01 / 06 · Executive Summary
|
AIDA Arch Icon AIDA ENGINEERING AUDIT · NOV 2026
PRINCIPAL ARCHITECTURE & DELIVERY ANALYTICS AUDIT · DORA + GITCLEAR + LINEARB

High merge cadence.
Monolithic friction.

An empirical engineering audit of the AIDA (`v0.16.0`) codebase at pinned trunk commit 6a3f67671a9, synthesizing 343.4 days of Git history (4,190 commits, 2,421 merged PRs), tokei static source census (988,122 net code LoC), codegraph AST dependency topology (56,257 nodes / 268,598 edges), and a local, untracked snapshot of 3,824 review-verdict files (not reproducible from the pinned commit).

HEAD SHA: 6a3f67671a974703590efde5ae2a323f3f7471fa
AUDIT WINDOW: 2025-11-23 → 2026-11-01
FRAMEWORKS: DORA · GitClear · LinearB
Net Codebase Scale
988.1k
Large Tier 1.33M total lines
MR Velocity (60d Avg)
14.35/d
Repo Proxy 430.5 PRs/mo
PR Pickup Latency
Unmeasured
Design Claim dispatch on push
PRs Over 400 LoC
31.6%
Batch Inflation Illustrative target* <15%
<21d Rework Churn
27.7%
File Proxy Illustrative target* <8%
Commit Revert Ratio
0.10%
Repo Proxy 4 / 4,190 commits
01 / EXECUTIVE BENCHMARK MATRIX

Strengths vs. Structural Weaknesses

Engineering Dimension Source Tool AIDA Empirical Metric Industry Median Industry Elite Target Classification & Impact
Trunk PR Merge Frequency git log main 13.8 – 14.35 PRs/day (100.5/wk over 60d) 1.5 – 2.5 PRs/day* 4.0 – 6.0 PRs/day* High Merge Cadence Repo integration proxy (*illustrative 8-dev reference)
PR Pickup Time (Wait for Reviewer) review watch Unmeasured (design claim) ~13 hours* < 1 hour* Design Claim aida review watch dispatches a reviewer on push by design; no pickup-latency data was collected
Unreviewed PR Merge Rate review-verdicts Unmeasured per merged PR 15% – 30%* < 2%* Not Measured aida pr ship requires a recorded verdict, but the local verdict-file snapshot (3,824 files / 2,959 targets) is untracked and was not joined to merged PRs
Dedicated Rust Test Density tokei 27.9% (240,863 LoC / 641 files) 12% – 18%* > 25.0%* Architectural Strength Dedicated Rust test files + 72 Python suites (*heuristic)
Trunk Commit Revert Ratio (Repo Proxy) git log main 0.10% commit reverts (4 / 4,190) N/A (Deploy CFR: 15–30%*) Deploy CFR < 5%* Repo Proxy Only Commit revert ratio (actual deployment CFR & MTTR unknown)
Crate Monolith Concentration tokei / Cargo 78.3% in aida-cli-lib (675.6k LoC) 35% – 50%* < 25% per crate* Critical Weakness Penalizes incremental compile/link (*architectural heuristic)
Cross-File AST Hub Fan-In (models.rs) codegraph 1,003 caller files (69.7% of Rust) 15% – 25%* < 15% of files* Critical Weakness 10,402 cross-file edges; only 33 traits across 862.6k LoC
Oversized PR Rate (>400 LoC Diff) git shortstat 31.6% of PRs (median 225 LoC) ~26% of PRs* < 15% of PRs* Batch-Size Weakness 10.1% of PRs exceed 1,000 LoC; trailing 60 days 40.1% exceed 400 (SmartBear/Cisco 200–400 LoC guidance)
LinearB <21-Day Rework Churn (30d) git numstat 27.7% (351,760 LoC file-window proxy) 11% – 15%* < 8%* High Churn Proxy Co-occurs with 12 hub files touched 2–7x/day (file-level proxy)
Forward-Fix (BUG- / fix:) Commit Ratio git log main 31.6% (1,326 / 4,190 commits) 18% – 25%* < 15.0%* Dual Signal Combines healthy audit follow-up capture + post-merge bug fixes
METHODOLOGY, PRIMARY BENCHMARK SOURCES & MEASURED VS. PROXY / ASSUMED DISTINCTIONS
1. Pinned Repository Evidence & Collection Commands:
Evaluated against main at 6a3f67671a974703590efde5ae2a323f3f7471fa (window 2025-11-23 → 2026-11-01, 343.4 days): tokei --output json (static line census); sqlite3 .codegraph/codegraph.db (56,257 AST nodes / 268,598 edges); git rev-list --count 6a3f67671a9 (4,190 commits, full history). PR merges are first-parent commits whose subject ends in (#N), read from git log --first-parent 6a3f67671a9 --format='@%cs %s' --shortstat; PR size = insertions + deletions from that shortstat, with no files excluded. Windows filter on committer date (%cs ≥ start date); median is the midpoint average and p90 the inclusive decile. All history: 2,421 PRs. Since 2026-05-10 (175 d): 2,418 PRs, median 225, p90 1,008, mean 664.8, 31.6% >400, 10.1% >1,000. Since 2026-09-02 (60 d): 861 PRs, median 290, p90 1,485, 40.1% >400. Since 2026-10-02 (30 d): 387 PRs, median 325, p90 1,782, 44.7% >400. June 2026: 833 PRs, median 188, p90 625, 24.1% >400. Commit counts per window use the same committer-date filter on git log 6a3f67671a9 --format=%cs. Reverts = subjects matching ^revert (case-insensitive): 4 (7 subjects mention “revert” anywhere). Fix share = subjects containing BUG- (1,163) plus subjects starting with fix and not containing BUG- (163); subjects such as [AI:x] fix(...) are not matched, so this undercounts fixes. The 30-day churn and code-evolution figures come from git log --numstat --since="30 days ago" run on 2026-11-01 (795 commits). The .aida/review-verdicts/**/*.json snapshot (3,824 files across 2,959 targets) is local, untracked state (no files tracked at the pinned commit): verdict counts, review rounds, and findings per verdict cannot be reproduced from the commit and are not evidence of signatures.
2. Primary External Reference Sources & Caveats:
• DORA Four Keys: dora.dev/guides/dora-metrics/ (2023–2024 Accelerate State of DevOps production deployment & incident definitions).
• LinearB / GitClear-style benchmark figures: pickup time, cycle-time phases, <21d rework bands, unreviewed-merge rates, PR-size bucket distributions, and oversized-PR shares are not traced to a specific published report in this audit. Each is marked * and is an illustrative reference range only.
• Review size: SmartBear/Cisco Systems peer-review case study (Jason Cohen, Best Kept Secrets of Peer Code Review, 2006; 2,500 reviews) recommends reviewing no more than 200–400 LoC at a time.
• Proxies, Unknowns & Hypotheses: Actual production deployment frequency, deployment CFR, and incident MTTR are Unknown (no deployment/incident dataset is linked in the repo). The 27.7% <21d churn figure is a file-level commit-window proxy (files touched multiple times within 21d in git log --numstat), not line-by-line git blame survival. Figures marked * are illustrative: 8-developer squad scaling (~0.2–0.75 PRs/dev/day), architectural heuristics, or industry ranges without a cited report. PR pickup latency, CI settlement time, commit-to-merge time, and total cycle time are unmeasured in this audit; any values shown for them are labelled design claims or estimates. Target KPIs in the action plan are assumptions, not forecasts. Co-occurrence between >400-LoC batches, hub files, and churn is an architectural hypothesis rather than proved causation.
02 / SCALE & STRUCTURAL CLASSIFICATION (TOKEI + CODEGRAPH)

Codebase Scale, Monolith Skew & AST Coupling

Categorizing AIDA across industry repository scale tiers and inspecting crate boundaries, file-size tail risk, and codegraph fan-in/fan-out dependency hubs.

Industry Repository Scale Spectrum

AIDA reached 988,122 net code LoC (1,328,482 total lines) in 343.4 calendar days (+2,877 net LoC/day)

Large-Scale System Tier (500k–2M+ LoC)
TIER 1 · SMALL < 100k LoC
Microservices, single-purpose CLIs, libraries
TIER 2 · MEDIUM 100k – 500k LoC
Standard commercial SaaS applications
▲ AIDA POSITION (988,122 CODE LOC) 500k – 2M+ LoC (Large)
862,574 Rust LoC (1,440 files) + 125.5k multi-lang/docs
TIER 4 · ULTRA-SCALE 10M+ LoC
Enterprise multi-product monorepos
TOKEI LINE COMPOSITION: WHY 988.1K NET CODE LOC VS. 1.33M TOTAL PHYSICAL LINES?
1,328,482 Total Lines (wc -l) = 988,122 Net Code (74.4%) + 236,964 Comments/Docs (17.8%) + 103,396 Blanks (7.8%)
■ NET CODE LOC (74.4%) 988,122 LoC
Executable source statements (862,574 Rust + 125,548 multi-lang). Used by DORA/GitClear.
■ COMMENTS & DOCS (17.8%) 236,964 lines
/// Rustdoc, // inline notes, <!-- trace:... --> tags (62,213 in Rust) & Markdown prose.
■ BLANK LINES (7.8%) 103,396 lines
Vertical whitespace separating items and blocks (84,565 blank lines in Rust).
∑ TOTAL PHYSICAL LINES (100%) 1,328,482 lines
Raw file line count across repo (1,009,352 physical lines in 1,440 Rust files alone).

Workspace Crate & Language Distribution

78.3% of all Rust code is concentrated inside aida-cli-lib

⚠ Architectural Bottleneck: Crate Asymmetry
675,558 Rust LoC (1,115 files) sit inside aida-cli-lib alone, while aida-core holds 120,437 LoC (177 files). Furthermore, 213 Rust files (14.8%) exceed 1,000 LoC and 15 mega-files exceed 5,000 LoC, creating severe incremental compilation and context-window bottlenecks.

CodeGraph AST Coupling & Hotspot Explorer

56,257 AST Nodes · 268,598 Directed Edges · 488 Cargo.lock Packages

⚠ CodeGraph Topology Finding: Low Trait Abstraction
Across 862.6k Rust LoC, CodeGraph indexes 2,651 structs and 31,703 functions, but only 33 traits (165 implements edges). Because subsystems are not decoupled behind narrow traits, aida-core/src/models.rs is directly imported/called by 1,003 distinct files (10,402 cross-file edges).
03 / PULL REQUEST VELOCITY & GITCLEAR SIZING ANALYSIS

Trunk Merge Rate vs. Batch-Size Inflation

Evaluating AIDA's 2,421 PR/MR merges onto main against industry velocity tiers and illustrative industry reference ranges and the SmartBear/Cisco review-size guidance.

Monthly Commit & PR/MR Merge Trajectory onto main

4,190 Total Commits · 2,421 Merged PRs (#1–#3201) · Hover bars for exact telemetry

✓ High Trunk Merge Cadence
Since adopting PR-gated trunk integration on May 10, 2026 (175 days), AIDA has merged 13.8 PRs/day (96.7 PRs/week, 414.5 PRs/month), with 14.35 PRs/day over the trailing 60 days—roughly 3x the illustrative* Elite 8-engineer squad range and 7x the illustrative* median range (*reference ranges, not measured cohorts).

PR Diff Size vs. GitClear Review Ceiling

31.6% of PRs since 2026-05-10 exceed 400 LoC (40.1% in the trailing 60 days)

⚠ SmartBear/Cisco Review-Size Guidance (>400 LoC)
The SmartBear/Cisco Systems case study (Cohen, 2006; 2,500 reviews) recommends reviewing no more than 200–400 LoC at a time. Since 2026-05-10, AIDA's median PR is 225 LoC (mean 664.8 LoC, p90 1,008 LoC), with 10.1% of PRs exceeding 1,000 LoC. PRs have grown recently: over the trailing 60 days the median is 290 LoC and p90 1,485 LoC.

PR / MR Velocity & Diff Size Percentile Breakdown

Contrasting illustrative 8-developer human squad reference ranges (~0.2–0.75 PRs/dev/day) against measured AIDA repository windows (*industry rows are illustrative, not measured)

Cohort / Time Window PRs / Day PRs / Week PRs / Month Commits / Day Median PR LoC p90 PR LoC Share >400 LoC
Industry Median Squad (8 Swe)* 1.5 – 2.5 10 – 18 45 – 75 3.0 – 6.0 ~165 LoC ~650 LoC 26.0%
Industry Elite Squad (8 Swe)* 4.0 – 6.0 28 – 42 120 – 180 8.0 – 15.0 < 110 LoC < 380 LoC < 15.0%
AIDA 175-Day PR Era Average 13.8 / d 96.7 / wk 414.5 / mo 18.6 / d 225 LoC 1,008 LoC 31.6%
AIDA Trailing 60-Day Window 14.35 / d 100.5 / wk 430.5 / mo 24.5 / d 290 LoC 1,485 LoC 40.1%
AIDA Trailing 30-Day Window 12.9 / d 90.3 / wk 387.0 / mo 26.8 / d 325 LoC 1,782 LoC 44.7%
AIDA Peak Month (June 2026) 27.8 / d 194.4 / wk 833.0 / mo 30.6 / d 188 LoC 625 LoC 24.1%
04 / DORA STATE OF DEVOPS BENCHMARK MAPPING

DORA Deployment Metrics vs. Measured Repository Proxies

Per dora.dev/guides/dora-metrics/, DORA's Four Keys measure production deployments and incidents. Because no production deployment or incident log is linked in this repository, actual deployment metrics are marked Unknown and separated from measured Git trunk proxies.

DORA Four-Key Metrics Scorecard

Primary definitions: dora.dev/guides/dora-metrics/ · Production telemetry vs. repository proxies

DORA Metric (dora.dev) DORA Elite Standard (Prod) Actual Prod Metric Measured Repository Proxy (main) Status
1. Deployment / Integration Frequency On-demand (multiple deploys/day) Unknown (no prod deploy log) 12.9 – 14.35 PRs/day merged to main (24.5–26.8 commits/d over 60d / 30d; integration proxy) REPO PROXY
2. Change Lead Time < 1 day (commit to prod) Unknown (no prod release log) Unmeasured (commit-to-merge and CI timestamps were not collected for this audit) UNKNOWN
3a. Change Failure Rate (Hard Reverts) 0% – 5% of prod deployments Unknown (no incident log) 0.10% commit revert ratio (4 subjects matching ^revert / 4,190 commits; not deployment CFR) REPO PROXY
3b. Effective Defect Rework (fix:/BUG-) N/A (commit-intent proxy) Unknown (not prod CFR) 31.6% (1,326 / 4,190 commits: 1,163 BUG- + 163 starting with fix — audit follow-ups + fixes; matcher in methodology) HYBRID PROXY
4. Failed Deployment Recovery (MTTR) < 1 hour prod restoration Unknown (no incident dataset) Unmeasured (remediated via forward-fix BUG- slices & doctor --heal; no MTTR log) UNKNOWN

Trunk Commit Intent Breakdown (N = 4,190 Commits)

1,326 BUG-/fix commits combine proactive audit hardening with post-merge bug fixes

Fix / BUG- Follow-Up & Rework
1,326 (31.6%)
TASK- Engineering / Infra
1,258 (30.0%)
Feat / STORY- Capabilities
883 (21.1%)
Docs / Chore / Calibration
716 (17.1%)
Git Commit Reverts (Proxy)
4 (0.10%)
⚖ Disciplined Follow-Up Capture vs. Co-Occurring Rework
Filing follow-up BUG-XXXX tickets is a deliberate governance practice: reviewers, aida doctor, and security audits capture newly discovered edge cases as tracked, bounded slices rather than bloating in-flight PRs or leaving silent tech debt. While >400-LoC batches and shared hub files co-occur with the 27.7% <21-day file-touch churn proxy, causal attribution is an architectural hypothesis rather than proved causation (rapid iterative feature slicing on shared files also contributes).
05 / LINEARB-STYLE GIT ANALYTICS DEEP-DIVE

Cycle Time Phases, 21-Day Churn & Review Depth

Applying LinearB's Git Analytics framework across Cycle Time sub-stages (Coding, Pickup, Review, Deploy), 30-day Code Investment (1,270,201 LoC touched), and a local, untracked .aida/review-verdicts/ snapshot (3,824 JSON files; not reproducible from the pinned commit).

Anatomy of Cycle Time: AIDA vs. LinearB Tiers

Schematic: human tiers are *illustrative; AIDA phase durations are unmeasured estimates

◇ Design Claim: Automated Reviewer Pickup
Human teams commonly see PRs wait hours for a reviewer (*illustrative; no specific benchmark report is cited). AIDA's aida review watch is designed to dispatch a reviewer when a branch is pushed. This audit did not measure pickup latency, so no reduction percentage is claimed.

30-Day Code Evolution: New vs. Rework vs. Refactor

795 Commits · +951,435 Insertions / -318,766 Deletions (1,270,201 LoC Touched)

⚠ 27.7% <21-Day File-Touch Churn Proxy vs. 0.8% >21-Day Touch Share
In LinearB-style rework bands (*illustrative; no specific report is cited), >15% <21-day Rework is commonly flagged for attention (elite <8%*). Measured via git log --numstat file-touch windows over the last 30 days, lib.rs (216 touches), pr_cmd.rs (82), queue_cmd.rs (73), and cli.rs (72) are modified 2 to 7 times per day, placing 27.7% of touched lines in files modified again within <21 days (reflecting both rework and rapid iterative feature additions to shared hubs).

Illustrative Architecture & Batch-Size What-If Explorer

Illustrative linear scenario explorer anchored to current baselines — uses assumed heuristic weights with no empirical calibration or predictive/causal validity

Illustrative What-If (Assumed Weights)
1. Share of PRs Exceeding 400 LoC (Current: 31.6% → Assumed Target: 12%) 31.6%
2. Rust LoC Concentrated in aida-cli-lib (Current: 78.3% → Assumed Target: 15%) 78.3%
Methodology Disclaimer: Slider weights (10.5, 8.8, 11.2, 6.4, 11.5, 4.2) are illustrative heuristic assumptions anchored to repository baselines (31.6%, 78.3%, 27.7%, 31.6%, 73.5%; the 73.5% first-pass baseline comes from the untracked local verdict snapshot). They are not fitted regression parameters and do not establish causal or predictive outcomes. The shifted-capacity output is an assumption, not a forecast: it converts the illustrative BUG-/fix reduction into PRs at the 414.5 PRs/mo era cadence.
ILLUSTRATIVE <21D CHURN SCENARIO 27.7%
Baseline: 27.7% (Assumed linear weight)
ILLUSTRATIVE BUG-/FIX SHARE 31.6%
Baseline: 31.6% of main commits
ILLUSTRATIVE 1ST-PASS APPROVAL 73.5%
Baseline: 73.5% (local snapshot)
ILLUSTRATIVE SHIFTED PR CAPACITY +0 PRs/mo
Assumption, not a forecast (414.5 PRs/mo)
06 / ARCHITECTURAL RECOMMENDATIONS & EXECUTION ROADMAP

Four High-Impact Engineering Interventions

Concrete steps to preserve AIDA's high trunk integration cadence while reducing monolithic crate coupling, shrinking PR batch sizes below 400 LoC, and lowering post-merge rework.

ACTION 01 · WORKSPACE DECOMPOSITION

Split aida-cli-lib (675.6k LoC) into Bounded Domain Crates

78.3% of all Rust code (1,115 files) compiles inside a single library crate, and lib.rs was touched 216 times in the last 30 days (128,348 churn LoC).

  • Extract strict DAG crates: aida-orchestrator (drain/queue/leases), aida-forge (PR ship/review watch), aida-mailbox, aida-doctor, and aida-mcp-server.
  • Relocate the 240,863 LoC of dedicated Rust test files into domain-scoped integration targets so subcommand edits do not relink the entire workspace.
TARGET KPI: Reduce aida-cli-lib from 78.3% → <15% of Rust LoC; reduce incremental test link time (assumed benefit; not yet measured).
ACTION 02 · HUB & MEGA-FILE DECOUPLING

Shatter the 15 Mega-Files (>5k LoC) & Decouple models.rs

aida-core/src/models.rs has a cross-file fan-in of 1,003 files (69.7% of all Rust files), while handle_queue_command has a call fan-out of 790 outbound calls.

  • Partition models.rs (7,159 LoC) into narrow domain submodules (models::spec, models::queue, models::verdict, models::regen) and introduce narrow trait interfaces (expanding beyond the current 33 traits).
  • Enforce a CI file-size ratchet capping any single .rs file at 2,500 LoC (ratcheting to 1,500 LoC) and function call fan-out at <100 edges.
TARGET KPI: Eliminate all 15 files >5,000 LoC; cut models.rs direct file fan-in from 69.7% → <25%.
ACTION 03 · SMALL-BATCH PR RATCHET

Enforce a <400 Production-LoC Budget at Decomposition & Ship

31.6% of merged PRs since 2026-05-10 exceed the 400-LoC review threshold (40.1% in the trailing 60 days; 10.1% exceed 1,000 LoC), increasing reviewer context load and co-occurring with multi-round review cycles.

  • Separate Production Rust LoC from Test & Doc LoC in aida pr ship and aida review watch so test thoroughness is never penalized.
  • Cap net production code changes per PR at ≤300 LoC (advisor split gate at 400 production LoC or >8 production files) during /aida-decompose and queue pickup.
TARGET KPI: Shift PRs >400 LoC from 31.6% → <15% (illustrative target*); reduce median PR diff from 225 LoC → <180 LoC.
ACTION 04 · PRE-MERGE BLAST-RADIUS GATING

Wire CodeGraph Impact & Snapshot Isolation into Pre-Review Gates

cli_help_snapshot.txt alone generated 59,912 LoC of churn across 74 commits in 30 days. A hypothesis, not yet classified or measured, is that state-machine seams account for a large share of the 1,163 BUG- commits.

  • Shard monolithic golden help snapshots by subcommand so CLI flag additions do not conflict across concurrent worktrees.
  • Run automated codegraph impact checks on symbols with fan_in > 100 or fan_out > 100 prior to reviewer dispatch.
TARGET KPI: Reduce <21-day Rework Churn from 27.7% → <10% and BUG-/fix commit ratio from 31.6% → <15%.