Skip to content

docs(roadmap): re-analyze codebase readability program against current codebase#334

Merged
donbeave merged 1 commit into
mainfrom
roadmap/codebase-readability-reanalysis
May 13, 2026
Merged

docs(roadmap): re-analyze codebase readability program against current codebase#334
donbeave merged 1 commit into
mainfrom
roadmap/codebase-readability-reanalysis

Conversation

@donbeave

Copy link
Copy Markdown
Member

Summary

Re-analyzed the entire codebase readability roadmap against the current codebase (~91K lines production Rust, 116 files) after significant growth since the original analysis (~50K lines). Updated all 14 roadmap files with current metrics, corrected structural assumptions, and added a new Phase 1.5 DRY extraction phase grounded in measured duplication findings.

Key findings that drove the updates

Stale LOC counts everywhereapp/mod.rs more than doubled (1243L → 2767L, +123%), runtime/launch.rs grew 38% (5494L → 7575L), 13 files now exceed 1000 lines (was 4 at original analysis).

False structural claim — the claim "console/ has zero imports from runtime/ in production code" is false. Two production dependencies exist in console/manager/input/editor.rs: crate::runtime::register_agent_repo and crate::runtime::RepoError. The Cargo workspace split (Phase 3) needs these resolved first.

Pervasive TUI duplication — 120 Style::default() chains, 18 Block::default() constructions, 192 Span constructions, 4 identical header/body/footer layout triples across render files. Named style constants and a titled_block() helper would collapse 78+ boilerplate sites.

Auth provision copy-paste — 5 near-identical provision functions in instance/auth.rs (2607L), 3 identical model accessor methods, 12 duplicated match arms between launch.rs and config/roles.rs.

Docker command entropy — 40 runner.run("docker", ...) calls with no shared builder, 44 inline format!("{name}-dind") derivations across 5 files, identical DinD sidecar launch args copy-pasted between launch.rs and attach.rs.

Test infrastructure sprawl — 11 independent mock/fake struct definitions, FROM projectjackin/construct:trixie\n appears 100+ times, 41+ copy-pasted role-repo seeding blocks, a subtle trailing-newline difference between two fake_runner_with_running helpers.

What changed

  • codebase-readability.mdx (umbrella): Major rewrite with current metrics, new Phase 1.5 (DRY extraction), corrected structural claim, expanded Phase 2 table (4 → 13 files), updated execution order, and maintainability assessment
  • split-runtime-launch.mdx: Updated 5494L → 7575L, added duplication findings, added launch_dind.rs to proposed split
  • split-app-mod.mdx: Updated 1243L → 2767L, noted +123% growth, added new proposed sub-files and duplication findings
  • split-input-editor.mdx: Updated 3796L → 3955L, added paired render/editor.rs split (3231L), noted console/runtime boundary crossing
  • split-operator-env.mdx: Updated 2975L → 3573L, confirmed no cross-file duplication with auth/token_setup
  • module-contracts.mdx: Updated priority file list with current LOC, added 4 new entries that grew into the >1000L range
  • behavioral-spec-runtime-launch.mdx: Updated 5494L → 7575L, reinforced urgency
  • behavioral-spec-op-picker.mdx: Updated 1712L → 2331L, noted render.rs split
  • snapshot-tests-tui.mdx: Updated render file sizes, added new high-value targets (global mounts, per-tab editor bodies)
  • pub-crate-visibility.mdx: Updated to current numbers (22 modules, 383 pub fn vs 42 pub(crate) fn)
  • cargo-workspace-split.mdx: Corrected boundary claim, updated LOC from ~50K to ~91K, added prerequisites for fixing the 2 console→runtime deps
  • per-directory-readme.mdx: Added new target directories (config/, instance/, isolation/), corrected boundary note
  • developer-reference-setup.mdx: Fixed stale docs/superpowers/specs/ reference (directory no longer exists)
  • roadmap.mdx: Updated codebase health description to reference the re-analysis

What's deferred

  • Phase 1.5 DRY extraction implementation (the roadmap now describes what to extract and why; separate PRs will implement)
  • Phase 2 file splits (awaiting Phase 1 snapshot tests and Phase 1.5 extractions)
  • Phase 3 workspace split (trigger not yet met at ~91K LOC)

Verify locally

Checkout

Paste this first to bypass the tirith paste scanner for the rest of the session:

export TIRITH=0

Then paste the checkout block:

mkdir -p "$HOME/Projects/jackin-project/test"
cd "$HOME/Projects/jackin-project/test"

if [ ! -d jackin/.git ]; then
  git clone https://github.com/jackin-project/jackin.git
fi

cd jackin
mise trust
git fetch -f origin roadmap/codebase-readability-reanalysis:refs/remotes/origin/roadmap/codebase-readability-reanalysis
git checkout -B roadmap/codebase-readability-reanalysis refs/remotes/origin/roadmap/codebase-readability-reanalysis

Documentation

cd docs
bun install --frozen-lockfile
bun run dev

Astro serves at http://localhost:4321/. Pages to walk:

http://localhost:4321/reference/roadmap/codebase-readability/
UPDATED umbrella page. Check: current metrics table, Phase 1.5 section with extraction tables, corrected structural insight, Phase 2 expanded table with growth percentages.

http://localhost:4321/reference/roadmap/
UPDATED overview. Check: Codebase health section mentions re-analysis and current scope.

http://localhost:4321/reference/roadmap/split-runtime-launch/
UPDATED. Check: 7575L current size, duplication findings section, launch_dind.rs in proposed split.

http://localhost:4321/reference/roadmap/split-app-mod/
UPDATED. Check: 2767L (+123% growth), new proposed sub-files.

http://localhost:4321/reference/roadmap/module-contracts/
UPDATED. Check: new priority files table with growth metrics.

Migration notes

None — documentation-only changes.

@donbeave donbeave force-pushed the roadmap/codebase-readability-reanalysis branch 4 times, most recently from 21f22ad to 32968f8 Compare May 13, 2026 03:50
…t codebase

Deep audit of the entire codebase (~91K lines production Rust, 116 files)
found: stale LOC counts (app/mod.rs doubled to 2767L, launch.rs grew 38%
to 7575L), pervasive TUI/auth/Docker duplication (120 Style chains, 44
inline container name derivations, 11 mock structs), a false claim about
console/runtime boundary cleanliness (2 production dependencies exist),
and the need for a new Phase 1.5 DRY extraction phase.

Updates all 14 roadmap files with current metrics, new file split targets,
duplication findings, and corrected structural assumptions.

Also adds OpenCode (GLM) commit attribution trailer to AGENTS.md and COMMITS.md,
matching the GitHub App identity used by the anomalyco/opencode repository.

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
@donbeave donbeave force-pushed the roadmap/codebase-readability-reanalysis branch from 32968f8 to 385f2a6 Compare May 13, 2026 03:54
@donbeave donbeave merged commit 282e235 into main May 13, 2026
18 checks passed
@donbeave donbeave deleted the roadmap/codebase-readability-reanalysis branch May 13, 2026 03:56
donbeave added a commit that referenced this pull request May 18, 2026
…t codebase (#334)

Re-analyzed the codebase readability roadmap against the current codebase (~91K lines production Rust, 116 files) after 82% growth since the original analysis (~50K lines). Updated all 14 roadmap files with current metrics, corrected structural assumptions, and added a new Phase 1.5 DRY extraction phase grounded in measured duplication findings.

Key findings: stale LOC counts across all files (app/mod.rs +123%, launch.rs +38%), false console/runtime boundary claim (2 production deps exist), pervasive TUI duplication (120 Style chains, 192 Span constructions), auth provision copy-paste across 5 agent runtimes, Docker command entropy (40 invocations with no shared builder), and test infrastructure sprawl (11 independent mock structs).

Also adds the OpenCode (GLM) commit attribution trailer to AGENTS.md and COMMITS.md, matching the GitHub App identity from the anomalyco/opencode repository.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant