Skip to main content

CODITECT Standard: Architecture Decision Records (ADRs)

Standard ID: CODITECT-STANDARD-ADR Version: 1.0.0 Status: Active Created: 2025-12-22 Author: AZ1.AI INC Architecture Team Compliance: Mandatory for all ADRs


1. Purpose

This standard defines the requirements for creating, naming, maintaining, and organizing Architecture Decision Records (ADRs) within the CODITECT ecosystem.


2. Scope

This standard applies to:

  • All ADRs in internal/architecture/adrs/
  • All submodule ADRs
  • Any documentation describing architectural decisions

3. ADR Definition

An Architecture Decision Record (ADR) is a document that captures an important architectural decision along with its context and consequences. ADRs:

  • Record the "why" behind decisions, not just the "what"
  • Serve as historical reference for future maintainers
  • Are immutable once accepted (changes require new ADRs)
  • Enable traceable decision-making

4. When to Create an ADR

4.1 Create ADR For

CategoryExamples
Framework PatternsAsync/sync, state management, message passing
Technology ChoicesFrameworks, libraries, protocols, databases
API DesignREST vs GraphQL, versioning, authentication
Data ArchitectureSchema design, storage strategies, migrations
ScalabilityCaching, sharding, load balancing
SecurityAuthentication methods, encryption, access control
IntegrationExternal APIs, inter-service communication
Multi-tenancyTenant isolation, data partitioning

4.2 Do NOT Create ADR For

  • Implementation details (code-level decisions)
  • Temporary workarounds
  • Bug fixes (unless revealing architectural issues)
  • Configuration choices
  • Cosmetic or formatting changes

5. Naming Convention

5.1 File Naming Format

ADR-{SERIES}-{title-in-kebab-case}.md

Examples:

  • ADR-001-async-task-executor-refactoring.md
  • ADR-CXQ-007-codebase-indexing-expansion.md
  • ADR-030-lms-phase-1.md

5.2 Numbering Series

SeriesRangePurposeExample
Core001-099Core platform architectureADR-001, ADR-002
Master100-199Platform-wide systemsADR-100
CXCX-*Context extractionADR-CX-CONTEXT-EXTRACTION
CXQCXQ-*Context queryADR-CXQ-007
LMSLMS-*Learning management systemADR-LMS-PHASE-1
TOKENTOKEN-*Token accountingADR-TOKEN-ACCOUNTING
WORKFLOWWORKFLOW-*Workflow executionADR-WORKFLOW-EXECUTOR

5.3 Title Formatting

ElementRuleExample
Casekebab-case for filenamesasync-task-executor
LengthMax 50 charactersKeep concise
ContentDescribe decision, not problemhybrid-deployment not deployment-issue

6. ADR Structure

6.1 Required Sections

Every ADR MUST contain:

  1. Title - Clear, descriptive title
  2. Metadata - Status, date, author, related documents
  3. Context - Why this decision is needed
  4. Decision - What was decided
  5. Consequences - Positive and negative impacts

6.2 Optional Sections

  • Decision Drivers - Requirements that influenced decision
  • Considered Options - Alternatives with pros/cons
  • Implementation Details - How to implement
  • Validation Criteria - How to verify compliance
  • Glossary - Definitions for acronyms and technical terms (see Section 6.4)
  • Links - Related documents, references

6.3 Glossary Requirements

Principle: "Define acronyms on first use; avoid acronyms unless widely known." (Reference: CODITECT-STANDARD-README-MD.md, CODITECT-STANDARD-AMBIGUITY-HANDLING.md)

6.3.1 When Glossary is REQUIRED

A Glossary section is REQUIRED when the ADR contains:

  • 3 or more acronyms (even if defined inline)
  • Domain-specific technical terms not in common developer vocabulary
  • CODITECT-specific terminology (e.g., MoE, RLS, PILOT plan)
  • Ambiguous terms with multiple industry interpretations

6.3.2 Glossary Format

## Glossary

| Term | Definition |
|------|------------|
| **ADR** | Architecture Decision Record - document capturing architectural decisions |
| **RLS** | Row-Level Security - PostgreSQL feature for automatic tenant data isolation |
| **MoE** | Mixture of Experts - multi-model evaluation pattern |
| **ACID** | Atomicity, Consistency, Isolation, Durability - database transaction properties |

6.3.3 Inline Definition Rule

First occurrence of any acronym MUST include inline definition:

✅ CORRECT: "Row-Level Security (RLS) ensures tenant isolation..."
❌ WRONG: "RLS ensures tenant isolation..."

6.3.4 Well-Known Acronyms

The following are considered "widely known" and do NOT require inline definition (but should still appear in Glossary if present):

  • API, REST, JSON, YAML, SQL, HTTP, HTTPS, HTML, CSS, URL, UUID
  • CI/CD, Git, PR (Pull Request), CLI, SDK, IDE
  • AWS, GCP, Azure (cloud providers)

6.3.5 Ambiguous Terms

For terms with multiple industry interpretations, use CODITECT-STANDARD-AMBIGUITY-HANDLING.md protocol:

| Term | CODITECT Definition | Industry Alternatives |
|------|---------------------|----------------------|
| **Tenant** | Organization in multi-tenant SaaS | Could also mean: user, workspace, project |

6.4 Template Reference

Use template: CODITECT-CORE-STANDARDS/TEMPLATES/ADR-TEMPLATE.md


7. Status Values

StatusMeaningCan Transition To
PROPOSEDUnder reviewACCEPTED, REJECTED
ACCEPTEDApproved, implementingDEPRECATED, SUPERSEDED
APPROVEDSynonym for ACCEPTEDDEPRECATED, SUPERSEDED
REJECTEDNot accepted(terminal)
DEPRECATEDNo longer recommendedSUPERSEDED
SUPERSEDEDReplaced by new ADR(terminal)

7.1 Status Transitions

PROPOSED ─┬─► ACCEPTED ─┬─► DEPRECATED ─► SUPERSEDED
│ │
└─► REJECTED └─► SUPERSEDED

7.2 Supersession Rules

When superseding an ADR:

  1. Add header to old ADR: **Superseded by:** [ADR-XXX](link)
  2. Change status to SUPERSEDED
  3. Reference old ADR in new ADR's context

8. Immutability

8.1 Core Principle

ADRs are immutable once accepted. The historical record must be preserved.

8.2 Allowed Changes to Accepted ADRs

AllowedNot Allowed
Fix typosChange decision
Update linksModify rationale
Add clarificationsRemove content
Update statusAlter consequences

8.3 Changing a Decision

To change an accepted decision:

  1. Create new ADR with updated decision
  2. Mark old ADR as SUPERSEDED
  3. Reference relationship in both ADRs

9. Quality Requirements

9.1 Content Quality

RequirementValidation
Clear contextExplains why decision needed
Explicit decisionStates what was decided
Complete optionsDocuments alternatives considered
Honest consequencesLists positive AND negative impacts
Implementation guidanceProvides actionable steps

9.2 Formatting Quality

RequirementValidation
YAML frontmatterPresent with required fields
Consistent headersMarkdown heading hierarchy
Valid linksAll cross-references work
Code blocksProperly fenced with language

10. Cross-Referencing

10.1 ADR Cross-References

ADRs should reference:

  • Related ADRs (dependencies, extensions)
  • Implementation documents
  • Affected components
  • External standards or research

10.2 Index Maintenance

When adding new ADR:

  1. Add entry to internal/architecture/adrs/README.md
  2. Update category count in statistics
  3. Verify cross-references from related ADRs

11. Review Process

11.1 Before Proposing

  • Decision is architectural (not implementation)
  • Alternatives have been considered
  • Impact is significant
  • Context is well-understood

11.2 Before Accepting

  • All alternatives documented
  • Consequences clearly stated
  • Implementation plan provided
  • Stakeholders have reviewed
  • Template compliance verified

11.3 After Accepting

  • README index updated
  • Cross-references added
  • Old ADRs superseded if needed
  • Team notified

12. Storage Location

RepositoryLocationPurpose
coditect-coreinternal/architecture/adrs/Core framework ADRs
Submodulesinternal/architecture/adrs/ or docs/adrs/Submodule-specific ADRs

13. Compliance

13.1 Mandatory Requirements

All ADRs MUST:

  • Follow naming convention (Section 5)
  • Include required sections (Section 6.1)
  • Use valid status values (Section 7)
  • Maintain immutability (Section 8)
  • Be indexed in README (Section 10.2)

13.2 Validation

ADRs are validated by:

  • Manual review during PR
  • Automated linting (future)
  • Periodic conformance audits

DocumentPurpose
ADR-TEMPLATE.mdADR template
internal/architecture/adrs/README.mdADR index
CODITECT-STANDARD-DOCUMENTATION.mdGeneral documentation standard

Last Updated: 2025-12-22 Review Schedule: Quarterly Owner: Architecture Team, AZ1.AI INC