Architectural Coherence Drift Index (ACDI)

GMI-SWD-002Software DeliveryIntegration-RequiredPattern O-2: Model Drift / Currency

Definition

Rate at which AI-generated code diverges from the codebase's established architectural conventions, measuring coherence erosion that coverage and complexity metrics cannot see.

The Measurement Gap

Measurement Gap and Decision

The Gap: Standard quality metrics cannot detect architectural coherence erosion from AI-generated code. Code coverage is unchanged because divergent patterns are tested. Cyclomatic complexity may be lower because the AI chose simpler patterns that happen to violate team conventions. DORA metrics show improved throughput. Static analysis passes because linters enforce syntax, not architectural intent. Technical debt tools might flag duplication but will not detect a correct-but-inconsistent abstraction choice.

The architectural decisions that make a codebase coherent -- consistent error handling, uniform abstraction levels, agreed-upon patterns for cross-cutting concerns -- are invisible to every standard quality metric. They exist as tribal knowledge, ADRs that new tools never read, and convention enforcement that depends on reviewer attention. When AI generates 30-50% of new lines without access to your architectural conventions, coherence erodes at the rate of AI contribution.

The Decision:

ACDI tells you whether AI-generated code deviates from established architectural patterns -- error handling, abstraction levels, framework idioms, naming conventions, and structural consistency. It quantifies something experienced developers sense intuitively but have no way to track systematically. When ACDI exceeds threshold, the intervention is automated convention enforcement or AI tool configuration changes, not blanket AI restriction.

Formula

Formula:

ACDI = (1/N) x SUM(Convention_score_human_i - Convention_score_AI_i)

Where:

  • Convention_score_human_i = conformance score (0 to 1) for paired human code block i, scored against the architecture checklist
  • Convention_score_AI_i = conformance score (0 to 1) for paired AI code block i, scored against the same checklist
  • N = number of paired samples (human block and AI block solving comparable problems)

Worked Example:

A Node.js microservices team scores 5 paired code blocks against 5 architectural conventions (Result type errors, repository pattern, constructor DI, event-driven communication, structured logging with correlation IDs). Each block scored 0-1 per convention, composited:

Pair 1: Human = 0.90, AI = 0.60 (AI used thrown exceptions instead of Result type)
Pair 2: Human = 0.85, AI = 0.75 (AI used DI but wrong container pattern)
Pair 3: Human = 0.95, AI = 0.40 (AI called DB directly, no repository, no correlation ID)
Pair 4: Human = 0.80, AI = 0.80 (AI matched conventions)
Pair 5: Human = 0.90, AI = 0.55 (AI used synchronous calls instead of event-driven)

ACDI = (1/5) x [0.30 + 0.10 + 0.55 + 0.00 + 0.35] = 0.26

Proposed formula, pending validation pilots.

At a Glance

Unit
Index
Trend Direction
Lower; less drift
Reporting Frequency
Quarterly
Category
AI-Generated Code Quality
Dependency Selection Quality Score (DSQS) →

Assess Your Organization

The AI-GPS Assessment evaluates your AI governance maturity and recommends KPIs like this one for your implementation roadmap.

Take the Free AI-GPS Assessment