docs: align roadmap and backlog with architecture audit#503
docs: align roadmap and backlog with architecture audit#503carlos-alm merged 10 commits intomainfrom
Conversation
Add Phase 4 (Resolution Accuracy) addressing the audit's top priorities: dead role sub-categories, receiver type tracking, interface/trait implementation edges, precision/recall benchmarks, package.json exports resolution, and monorepo workspace support. Reorder phases: TypeScript Migration (now Phase 5) before Native Acceleration (now Phase 6), per audit recommendation. Remove Web UI from Phase 12. Add kill list (5.9), confidence annotations (7.10), shell completion (7.11), and dual-engine architectural note. Backlog: mark ID 45 done, promote IDs 73/74/80 to roadmap, add Tier 1j with 10 audit-identified items (IDs 87-96).
|
Claude finished @carlos-alm's task —— View job PR Review: docs: align roadmap and backlog with architecture auditTodo List:
Root Cause AnalysisProblem Being Solved: Aligning the project roadmap and backlog with findings from an architecture audit (v3.1.4, dated 2026-03-16) to ensure documentation reflects current strategic priorities and identified gaps. Why This Approach: The changes systematically incorporate audit findings by: (1) reordering phases to prioritize Resolution Accuracy before Native Acceleration, (2) adding Phase 4 with 6 sub-sections addressing accuracy gaps, (3) removing Web UI from advanced features, (4) promoting backlog items to roadmap based on audit recommendations, and (5) adding audit-identified items to the backlog. Risk Assessment: This is a documentation-only change with no code modification risk. The main risk is documentation consistency - anchor links, cross-references, and phase numbering need to be correct. Phase 1: Configuration Change Detection ✅No configuration changes detected - this PR only modifies documentation files. Phase 2: Test Integrity ✅No test changes - documentation-only PR with no risk to test integrity. Phase 3: Code Quality ✅Documentation-specific quality checks: ✅ Phase numbering consistency: Updated from 11 to 12 phases correctly throughout Minor concerns:
Phase 4: Backlog ComplianceZero-dep: ✓ — No new runtime dependencies, pure documentation changes Foundation-aligned: ✓ — Changes align with FOUNDATION.md principles:
Problem-fit: 5 — Directly addresses core problem:
Breaking: No — Documentation changes are non-breaking Tier: 1 (zero-dep ✓ + foundation-aligned ✓) Phase 5: Documentation Specific ChecksContent accuracy concerns:
Positive aspects:
Critical ConcernsNone - this is a well-structured documentation update. Minor Recommendations
Final Recommendation
The PR successfully addresses the stated goal of aligning roadmap priorities with architectural audit findings, with clear benefits for development planning and stakeholder communication. |
The dual-engine strategy is settled — no need for a hedging note.
Greptile SummaryThis PR aligns the project roadmap and backlog with the v3.1.4 architecture audit, and ships two complementary code changes that enable old native binaries (pre-type-map support) to fall back gracefully to the JS edge builder. Documentation changes:
Code changes (old-native-binary compatibility):
Issue found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[parseFilesAuto or parseFileAuto] --> B[patchNativeResult]
B --> C{typeMap empty AND calls exist?}
C -- No --> G[Return patched, no flag set]
C -- Yes --> D[wasmExtractSymbols]
D --> E{extracted.symbols.typeMap truthy?}
E -- empty array or Map = still TRUE --> H[Set typeMap to empty Map\n_typeMapBackfilled = true BUG]
E -- non-empty Map or array --> F[Set typeMap to Map\n_typeMapBackfilled = true OK]
E -- null or undefined --> G
F --> I[build-edges.js]
H --> I
G --> I
I --> J{any symbol has _typeMapBackfilled?}
J -- Yes --> K[buildCallEdgesJS for ALL files]
J -- No --> L[buildCallEdgesNative faster and more accurate]
Last reviewed commit: "fix: reconcile Phase..." |
| ### Tier 1j — Audit-identified gaps (from Architecture Audit v3.1.4) | ||
|
|
||
| Items identified by the [architectural audit](../../docs/architecture/ARCHITECTURE_AUDIT_v3.1.4_2026-03-16.md) that don't fit existing tiers. All are zero-dep and foundation-aligned. | ||
|
|
||
| | ID | Title | Description | Category | Benefit | Zero-dep | Foundation-aligned | Problem-fit (1-5) | Breaking | Depends on | | ||
| |----|-------|-------------|----------|---------|----------|-------------------|-------------------|----------|------------| | ||
| | 87 | Confidence annotations on query output | Every query output should include resolution statistics: `{ resolved: N, unresolved_method_calls: M, confidence: 0.XX }`. When `fn-impact` shows a blast radius of 5 functions, it should note how many method-dispatch calls may be missing. CLI displays as a footer line; MCP tools include in JSON. Makes the tool honest about its known blind spots instead of presenting precise-looking numbers without qualification. | Embeddability | Agents and users can assess how much to trust a result — a blast radius of 5 with 82% confidence is actionable, while 5 with 40% confidence means "run more analysis". Directly prevents the "missed blast radius" problem by making the gap visible | ✓ | ✓ | 5 | No | — | | ||
| | 88 | SCIP/LSP integration for top languages | Use compiler-grade symbol indices from TypeScript (tsc/tsserver), Python (Pyright), Go (gopls), and Rust (rust-analyzer) for import resolution and call graph construction. These tools export SCIP or LSP-compatible symbol tables that give 100% precision on resolved symbols — at near-zero implementation cost compared to building custom type inference. Current heuristic resolution becomes the fallback for languages without SCIP support. | Resolution | The single highest-value accuracy improvement available. Compiler-backed resolution eliminates the entire class of method-dispatch, overload, and type-narrowing resolution failures for the 4 most popular typed languages. Transforms codegraph from "~75% accurate heuristic" to "~99% accurate for TS/Py/Go/Rust, ~75% for the rest" | ✓ | ✓ | 5 | No | — | | ||
| | 89 | Call resolution precision/recall benchmark suite | Hand-annotated fixture projects per language with `expected-edges.json` manifests declaring the correct call edges. Benchmark runner compares codegraph's resolved edges against expected, reports precision (correct / total resolved) and recall (correct / total expected). CI gate fails if metrics drop below baseline. Without this, there's no way to know if a change improves or degrades call graph quality. CodeScene publishes precision metrics; Sourcegraph SCIP indexers have per-language benchmarks; codegraph has none. | Testing | The only way to measure whether resolution changes actually improve accuracy — without it, "improvements" might silently break other resolution paths. Also provides regression protection as new languages and resolution modes are added | ✓ | ✓ | 5 | No | — | | ||
| | 90 | `package.json` `exports` field resolution | Modern Node.js standard since v12. Import resolution currently uses brute-force filesystem probing (tries 10+ extensions via `fs.existsSync()`). It doesn't read `package.json` `exports` field, meaning conditional exports, subpath patterns, and package self-references are invisible. Support subpath patterns, conditional exports (`"import"`, `"require"`, `"default"`), and fall back to filesystem probing only when `exports` is absent. | Resolution | Fixes resolution failures for any project using modern Node.js package conventions — which is most projects published since 2020. Currently produces low-confidence heuristic matches for imports that should resolve deterministically | ✓ | ✓ | 4 | No | — | | ||
| | 91 | Monorepo workspace resolution | `pnpm-workspace.yaml`, npm workspaces (`package.json` `workspaces`), and `lerna.json` are not recognized. Internal package imports (`@myorg/utils`) fall through to global resolution with low confidence. Detect workspace root, enumerate workspace packages, resolve internal imports to actual source files with high confidence (0.95). | Resolution | Fixes resolution for the most common monorepo patterns — affects every monorepo user. Internal package imports currently produce wrong or missing edges | ✓ | ✓ | 4 | No | — | | ||
| | 92 | Auto-generate MCP tool schemas from types | The `tool-registry.js` (801 LOC) contains hand-maintained JSON schemas for 40+ tools. With TypeScript (Phase 5), these can be derived from types via `zod` or `typebox`. Schema drift between the implementation and MCP schema is inevitable with hand-maintenance. | Embeddability | Eliminates an entire class of MCP bugs (schema says one thing, implementation does another). Reduces maintenance burden for adding new MCP tools | ✗ | ✓ | 3 | No | Phase 5 (TypeScript) | | ||
| | 93 | Shell completion for CLI | Commander supports shell completion but it's not implemented. `codegraph completion bash\|zsh\|fish` outputs the appropriate script. Basic UX gap for a CLI tool with 40+ commands. | Developer Experience | Tab completion makes the CLI discoverable — users find commands without reading docs. Reduces friction for new users and agents exploring available commands | ✓ | ✓ | 2 | No | — | | ||
| | 94 | VS Code extension | Replace the planned Web UI (removed from roadmap Phase 12) with a VS Code extension providing: webview-based graph visualization (reusing the existing `viewer.js` HTML), go-to-definition via graph edges, inline impact annotations on hover, integration with the MCP server for queries, and a sidebar panel for triage/audit results. VS Code is the right UI target for developer tools in 2026. | Visualization | Developers get graph intelligence directly in their editor — no context switching to a browser or terminal. Impact annotations on hover surface blast radius without running commands | ✗ | ✓ | 3 | No | — | | ||
| | 95 | SARIF output for cycle detection | Add SARIF output format so cycle detection integrates with GitHub Code Scanning, showing issues inline in PRs. Currently planned for Phase 11 but could be delivered as early as Phase 7 since it's a pure output format addition. | CI | GitHub Code Scanning integration surfaces cycle violations directly in PR review — no separate CI step or comment bot needed | ✓ | ✓ | 3 | No | — | | ||
| | 96 | Fix README runtime dependency count | README claims "Only 3 runtime dependencies" but there are 5 — it omits `graphology` and `graphology-communities-louvain` which are in `package.json` `dependencies` (not optional). Correct to 5. | Documentation | Accuracy — users and contributors should be able to trust the README | ✓ | ✓ | 1 | No | — | |
There was a problem hiding this comment.
Tier 1j items duplicated in ROADMAP without "PROMOTED" annotation
Five items newly added to Tier 1j are simultaneously added to the ROADMAP, but unlike IDs 73, 74, and 80 (which were pre-existing backlog items correctly struck-through and annotated with **PROMOTED**), the new overlapping entries have no cross-reference:
| Backlog ID | Backlog Title | ROADMAP section |
|---|---|---|
| 87 | Confidence annotations on query output | Phase 7.10 |
| 89 | Call resolution precision/recall benchmark suite | Phase 4.4 |
| 90 | package.json exports field resolution |
Phase 4.5 |
| 91 | Monorepo workspace resolution | Phase 4.6 |
| 93 | Shell completion for CLI | Phase 7.11 |
Without the same strikethrough + **PROMOTED** treatment applied to 73/74/80, readers have no way to know these items are already committed roadmap phases. The PR test plan explicitly calls out "verify cross-references between ROADMAP and BACKLOG are consistent" — this is the exact gap. Each of these rows should receive the same annotation pattern, e.g.:
| 87 | ~~Confidence annotations on query output~~ | ... | **PROMOTED** — Moved to ROADMAP Phase 7.10 |
There was a problem hiding this comment.
Fixed — added PROMOTED annotations with strikethrough titles and roadmap phase cross-references to backlog IDs 87, 89, 90, 91, and 93, matching the pattern used for IDs 73/74/80.
docs/roadmap/BACKLOG.md
Outdated
| ### Tier 1j — Audit-identified gaps (from Architecture Audit v3.1.4) | ||
|
|
||
| Items identified by the [architectural audit](../../docs/architecture/ARCHITECTURE_AUDIT_v3.1.4_2026-03-16.md) that don't fit existing tiers. All are zero-dep and foundation-aligned. |
There was a problem hiding this comment.
Tier 1j header incorrectly claims all items are zero-dep
The section header states: "All are zero-dep and foundation-aligned."
However, two entries in the table explicitly carry ✗ in the Zero-dep column:
- ID 92 (Auto-generate MCP tool schemas from types) —
✗zero-dep (requireszodortypebox) - ID 94 (VS Code extension) —
✗zero-dep (requires VS Code extension APIs and bundler tooling)
The header should be corrected to reflect that the items are mostly zero-dep, or the qualifier should be removed entirely to avoid misleading prioritization reviewers who rely on the tier descriptions to pre-filter candidates.
| ### Tier 1j — Audit-identified gaps (from Architecture Audit v3.1.4) | |
| Items identified by the [architectural audit](../../docs/architecture/ARCHITECTURE_AUDIT_v3.1.4_2026-03-16.md) that don't fit existing tiers. All are zero-dep and foundation-aligned. | |
| Items identified by the [architectural audit](../../docs/architecture/ARCHITECTURE_AUDIT_v3.1.4_2026-03-16.md) that don't fit existing tiers. Most are zero-dep and foundation-aligned (see individual rows for exceptions). |
There was a problem hiding this comment.
Fixed — changed the Tier 1j header from "All are zero-dep and foundation-aligned" to "Most are zero-dep and foundation-aligned (see individual rows for exceptions)" to account for IDs 92 and 94.
| ### 4.6 -- Monorepo Workspace Resolution | ||
|
|
||
| With analysis data loss fixed, optimize the 1-file rebuild path end-to-end. Current native 1-file rebuild is 265ms — dominated by parse (51ms), structure (13ms), roles (27ms), edges (13ms), insert (12ms), and finalize (12ms). | ||
| `pnpm-workspace.yaml`, npm workspaces (`package.json` `workspaces`), and `lerna.json` are not recognized. Internal package imports (`@myorg/utils`) fall through to global resolution with low confidence. | ||
|
|
||
| - **Skip unchanged phases:** Structure and roles are graph-wide computations. On a 1-file change, only the changed file's nodes/edges need updating — skip full reclassification unless the file's degree changed significantly | ||
| - **Incremental edge rebuild:** Only rebuild edges involving the changed file's symbols, not the full edge set | ||
| - **Benchmark target:** Sub-100ms native 1-file rebuilds (from current 265ms) | ||
| - Detect workspace root and enumerate workspace packages | ||
| - Resolve internal package imports to actual source files within the monorepo | ||
| - Assign high confidence (0.95) to workspace-resolved imports | ||
|
|
||
| **Affected files:** `src/domain/graph/builder/stages/build-structure.js`, `src/domain/graph/builder/stages/build-edges.js`, `src/domain/graph/builder/pipeline.js` | ||
| **Affected files:** `src/domain/graph/resolve.js`, `src/infrastructure/config.js` |
There was a problem hiding this comment.
Phase 4.6 overlaps substantially with the existing Phase 12.2
Phase 4.6 (Monorepo Workspace Resolution) describes:
Detect workspace root and enumerate workspace packages. Resolve internal package imports to actual source files within the monorepo.
Phase 12.2 (Cross-Repository Support / Monorepo, which predates this PR) describes:
Detect workspace root (
package.jsonworkspaces,pnpm-workspace.yaml,lerna.json). Resolve internal package imports (e.g.,@myorg/utils) to actual source files.
Both target the same workspace detection and internal import resolution mechanics. The distinction currently implied (4.6 = import-resolution accuracy, 12.2 = full cross-package graph support with a package column and --workspace flag) is not clearly stated in either section. A reader or implementer could reasonably implement 4.6 and then find the 12.2 scope already covered, or vice versa.
It's worth adding a note to 4.6 scoping it explicitly as the resolution layer only and deferring the full monorepo graph (package node type, cross-package edges, build --workspace) to 12.2 to avoid duplicating work.
There was a problem hiding this comment.
Fixed — added a scope note to Phase 4.6: "This phase covers the resolution layer only — detecting workspace packages and resolving internal imports to source files. Full monorepo graph support (package node type, cross-package edges, build --workspace flag) is deferred to Phase 12.2." Also added the same scoping note to backlog ID 91's PROMOTED annotation.
Document the rationale, trade-offs, and trajectory for maintaining both Rust native and JS/WASM engines. Covers performance requirements for large codebases, portability for VS Code extensions and CI, parity convergence plan, and alternatives considered.
Native binary v3.1.0 predates the type-map feature added in #501. When the native parser doesn't return typeMap, backfill it by re-extracting from WASM, convert to Map format, and fall back to the JS edge builder (which handles typeMap) instead of the native edge builder (which the old binary ignores). This restores engine parity for the build-parity test until a new native binary ships. Impact: 4 functions changed, 3 affected
- Add PROMOTED annotations to backlog IDs 87, 89, 90, 91, 93 that were simultaneously added to both backlog and roadmap without cross-references - Fix Tier 1j header to note exceptions (IDs 92, 94 are not zero-dep) - Add scope note to Phase 4.6 clarifying it covers resolution layer only, deferring full monorepo graph support to Phase 12.2
| for (const { filePath, relPath } of needsTypeMap) { | ||
| try { | ||
| const code = fs.readFileSync(filePath, 'utf-8'); | ||
| const extracted = wasmExtractSymbols(parsers, filePath, code); |
There was a problem hiding this comment.
Synchronous
fs.readFileSync blocks event loop in async context
parseFilesAuto is an async function that already uses await createParsers() just above this loop. Re-reading files synchronously inside the sequential for…of loop will block the Node.js event loop once per file. On a large codebase with an old native binary where many files need the WASM typeMap backfill, this adds a noticeable serial I/O stall.
The reads can be issued in parallel using fs.promises.readFile and Promise.all, and the WASM extraction can then be batched:
if (needsTypeMap.length > 0) {
const parsers = await createParsers();
await Promise.all(
needsTypeMap.map(async ({ filePath, relPath }) => {
try {
const code = await fs.promises.readFile(filePath, 'utf-8');
const extracted = wasmExtractSymbols(parsers, filePath, code);
if (extracted?.symbols?.typeMap) {
const symbols = result.get(relPath);
symbols.typeMap =
extracted.symbols.typeMap instanceof Map
? extracted.symbols.typeMap
: new Map(extracted.symbols.typeMap.map((e) => [e.name, e.typeName]));
symbols._typeMapBackfilled = true;
}
} catch {
/* skip — typeMap is a best-effort backfill */
}
}),
);
}Note: wasmExtractSymbols is synchronous (WASM), so the CPU work still serialises, but the I/O waiting does not.
There was a problem hiding this comment.
Fixed — replaced the synchronous \ loop with \ inside , so I/O reads are issued in parallel and don't block the event loop. The WASM extraction () is still synchronous by nature, but the file reads no longer serialize.
Impact: 1 functions changed, 0 affected
|
Addressed the Phase 5.9 / 6.6 contradiction flagged in the Greptile summary: Phase 6.6 now explicitly scopes native acceleration to cognitive and cyclomatic metrics only, with a note that Halstead and MI are governed by the Phase 5.9 Kill List (MI removed entirely, Halstead scoped to imperative code). Native acceleration should only target the metrics that survive the Kill List. |
…ignment # Conflicts: # src/domain/parser.js Impact: 15 functions changed, 15 affected
Items 71, 73, 74, 80, 83, 87, 89, 90, 91, 93 had strikethrough only on titles but not on description and benefit columns, inconsistent with all other done/promoted items in the table.
Summary
package.jsonexports resolution, monorepo workspace resolutionSource
Changes derived from architectural audit (v3.1.4).
Test plan