From 668159726fa0ceef73bf736947d702dd854ccfae Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 19:46:33 -0700 Subject: [PATCH 1/6] fix: include role-based entry points in `flow --list` `listEntryPointsData()` only queried framework-prefixed names (route:%, event:%, command:%) but the docstring and builder both recognize role='entry' nodes. Add `OR n.role = 'entry'` to the SQL WHERE clause and fall back to type 'exported' for non-prefixed role-based entries. Impact: 1 functions changed, 3 affected --- src/flow.js | 7 +++++-- tests/integration/flow.test.js | 32 ++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/flow.js b/src/flow.js index ab59fe4..23224bf 100644 --- a/src/flow.js +++ b/src/flow.js @@ -45,7 +45,10 @@ export function listEntryPointsData(dbPath, opts = {}) { .prepare( `SELECT n.name, n.kind, n.file, n.line, n.role FROM nodes n - WHERE (${prefixConditions}) + WHERE ( + (${prefixConditions}) + OR n.role = 'entry' + ) AND n.kind NOT IN ('file', 'directory') ORDER BY n.name`, ) @@ -59,7 +62,7 @@ export function listEntryPointsData(dbPath, opts = {}) { file: r.file, line: r.line, role: r.role, - type: entryPointType(r.name), + type: entryPointType(r.name) || (r.role === 'entry' ? 'exported' : null), })); const byType = {}; diff --git a/tests/integration/flow.test.js b/tests/integration/flow.test.js index 1257fe3..0ff8e5f 100644 --- a/tests/integration/flow.test.js +++ b/tests/integration/flow.test.js @@ -79,6 +79,10 @@ beforeAll(() => { // Orphan (no prefix, no callers) insertNode(db, 'orphanFn', 'function', 'orphan.js', 1); + // Non-prefixed entry point (simulates an exported function with no callers) + insertNode(db, 'init.js', 'file', 'init.js', 0); + insertNode(db, 'exportedInit', 'function', 'init.js', 1); + // Import edges insertEdge(db, fRoutes, fAuth, 'imports'); insertEdge(db, fRoutes, fUsers, 'imports'); @@ -102,6 +106,10 @@ beforeAll(() => { // Classify roles (so we can test the fix) classifyNodeRoles(db); + // Manually mark exportedInit as 'entry' (simulates a real exported function + // with fan_in=0 that the builder would classify as entry) + db.prepare("UPDATE nodes SET role = 'entry' WHERE name = 'exportedInit'").run(); + db.close(); }); @@ -212,22 +220,38 @@ describe('flowData', () => { // ─── listEntryPointsData ────────────────────────────────────────────── describe('listEntryPointsData', () => { - test('finds all 3 framework entries, excludes orphanFn', () => { + test('finds all 3 framework entries plus role-based entry, excludes orphanFn', () => { const data = listEntryPointsData(dbPath); - expect(data.count).toBe(3); + expect(data.count).toBe(4); const names = data.entries.map((e) => e.name).sort(); - expect(names).toEqual(['command:build', 'event:connection', 'route:GET /users']); + expect(names).toEqual([ + 'command:build', + 'event:connection', + 'exportedInit', + 'route:GET /users', + ]); expect(names).not.toContain('orphanFn'); }); - test('groups by type correctly', () => { + test('groups by type correctly, including exported for role-based entries', () => { const data = listEntryPointsData(dbPath); expect(data.byType.route).toHaveLength(1); expect(data.byType.command).toHaveLength(1); expect(data.byType.event).toHaveLength(1); + expect(data.byType.exported).toHaveLength(1); expect(data.byType.route[0].name).toBe('route:GET /users'); expect(data.byType.command[0].name).toBe('command:build'); expect(data.byType.event[0].name).toBe('event:connection'); + expect(data.byType.exported[0].name).toBe('exportedInit'); + }); + + test('role-based entry points get type "exported"', () => { + const data = listEntryPointsData(dbPath); + const entry = data.entries.find((e) => e.name === 'exportedInit'); + expect(entry).toBeDefined(); + expect(entry.type).toBe('exported'); + expect(entry.role).toBe('entry'); + expect(entry.kind).toBe('function'); }); test('each entry includes type, kind, file, line', () => { From b753cb04ba0220b02e2f66d88c8da7f6e8be884c Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:23:00 -0700 Subject: [PATCH 2/6] docs: mark resolved bugs and suggestions in dogfood reports with version info Add resolution tracking to 8 dogfood reports (v2.2.3-dev through v3.0.0). Marks 20+ bugs, issues, and suggestions as resolved with the version that fixed them, and updates issue/PR status from open to closed/merged. --- .../DOGFOOD_REPORT_v2.2.3-dev.44e8146.md | 16 +++++---- generated/dogfood/DOGFOOD_REPORT_v2.3.0.md | 22 +++++++----- .../DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md | 8 +++-- generated/dogfood/DOGFOOD_REPORT_v2.4.0.md | 4 ++- generated/dogfood/DOGFOOD_REPORT_v2.5.0.md | 12 ++++--- .../DOGFOOD_REPORT_v2.5.35-dev.26434e2.md | 36 ++++++++++++------- .../DOGFOOD_REPORT_v2.6.32-dev.4f08082.md | 26 ++++++++------ generated/dogfood/DOGFOOD_REPORT_v3.0.0.md | 4 ++- 8 files changed, 82 insertions(+), 46 deletions(-) diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.2.3-dev.44e8146.md b/generated/dogfood/DOGFOOD_REPORT_v2.2.3-dev.44e8146.md index 02d478f..8363a90 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.2.3-dev.44e8146.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.2.3-dev.44e8146.md @@ -282,18 +282,20 @@ All exports verified present and correct type: ## 9. Suggestions for Improvement -### 9.1 Add `--json` flag to `search` command +### 9.1 Add `--json` flag to `search` command — RESOLVED in v2.4.0 The `search` command lacks `--json` output. Every other query command supports it, so this inconsistency is surprising for programmatic users. -### 9.2 Vitest should exclude worktree directories +### 9.2 Vitest should exclude worktree directories — RESOLVED in v2.4.0 `npm test` picks up test files from `.claude/worktrees/`, causing failures in worktree copies that lack WASM grammars. The vitest config should exclude `.claude/**` from test discovery. -### 9.3 `search --file` should support glob patterns +### 9.3 `search --file` should support glob patterns — RESOLVED in v2.4.0 `search --file "src/*.js"` returned 0 results while `search --file "builder"` worked. The `--file` flag is substring-only, but glob patterns would be more intuitive and consistent with other tools. -### 9.4 Consider adding `--exclude-worktrees` or similar to `registry prune` +### 9.4 Consider adding `--exclude-worktrees` or similar to `registry prune` — RESOLVED in v2.4.0 / v2.5.1 `registry prune --ttl 0` removes all entries including the main project, which can be surprising. A flag to preserve specific entries would help. +> `--exclude` flag added in v2.4.0; `--dry-run` flag added in v2.5.1. + --- ## 10. Testing Plan @@ -367,6 +369,6 @@ Positives: | Type | Number | Title | Status | |------|--------|-------|--------| -| Issue | [#77](https://github.com/optave/codegraph/issues/77) | bug: cycles, export, embed crash without graph.db | Open — fix in PR #79 | -| Issue | [#78](https://github.com/optave/codegraph/issues/78) | bug: package.json not in exports map | Open — fix in PR #79 | -| PR | [#79](https://github.com/optave/codegraph/pull/79) | fix(cli): graceful error for cycles, export, embed when no graph.db exists | Open | +| Issue | [#77](https://github.com/optave/codegraph/issues/77) | bug: cycles, export, embed crash without graph.db | Closed — fixed in v2.3.0 | +| Issue | [#78](https://github.com/optave/codegraph/issues/78) | bug: package.json not in exports map | Closed — fixed in v2.3.0 | +| PR | [#79](https://github.com/optave/codegraph/pull/79) | fix(cli): graceful error for cycles, export, embed when no graph.db exists | Merged | diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.3.0.md b/generated/dogfood/DOGFOOD_REPORT_v2.3.0.md index 1afa750..74ed71f 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.3.0.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.3.0.md @@ -314,7 +314,7 @@ MCP initializes via JSON-RPC, responds to `tools/list`, correct tool schemas. - **Root cause:** `buildStructure()` unconditionally clears ALL `contains` edges and directory nodes (`DELETE FROM edges WHERE kind = 'contains'`), then only rebuilds for files in `fileSymbols` — which during incremental builds only contains changed files. - **Fix applied:** Before calling `buildStructure`, load all existing file nodes from the DB into `fileSymbols` and `lineCountMap` so the complete file set is available for structure rebuild. 37 lines added to `builder.js`. All 491 tests pass. -### Enhancement: `search` command missing `--json` flag (Low) +### Enhancement: `search` command missing `--json` flag (Low) — RESOLVED in v2.4.0 - **Issue:** [#90](https://github.com/optave/codegraph/issues/90) - **PR:** N/A — enhancement, not a bug fix - **Description:** All other query commands support `-j/--json` but `search` does not. Running `search -j` returns "unknown option '-j'". @@ -323,20 +323,26 @@ MCP initializes via JSON-RPC, responds to `tools/list`, correct tool schemas. ## 9. Suggestions for Improvement -### 9.1 Add `--json` to `search` command +### 9.1 Add `--json` to `search` command — RESOLVED in v2.4.0 Every other query command supports JSON output. `search` is the only holdout, which breaks automation workflows. -### 9.2 Document `excludeTests` config nesting +### 9.2 Document `excludeTests` config nesting — RESOLVED in v2.5.0 The CHANGELOG and CLI help say "excludeTests config option" but don't mention it must be nested under `query`. A top-level `{ "excludeTests": true }` silently does nothing. Either: - Document as `query.excludeTests` in the README/CHANGELOG - Or accept it at both top-level and nested -### 9.3 Warn on engine mismatch during incremental builds +> v2.5.0 added `excludeTests` as a top-level config shorthand via `build.excludeTests`. + +### 9.3 Warn on engine mismatch during incremental builds — RESOLVED in v2.6.0 Store the engine used for the last full build in DB metadata. When an incremental build uses a different engine, warn the user and suggest `--no-incremental`. -### 9.4 Add `--no-incremental` recommendation after version upgrades +> v2.5.0 added build metadata tracking; v2.6.0 added drift detection warnings. + +### 9.4 Add `--no-incremental` recommendation after version upgrades — RESOLVED in v2.6.0 When `codegraph info` detects the installed version differs from the version that built the graph, suggest a full rebuild. +> v2.6.0 drift detection warns when counts diverge >20% and suggests `--no-incremental`. + --- ## 10. Testing Plan @@ -409,6 +415,6 @@ Deductions: | Type | Number | Title | Status | |------|--------|-------|--------| -| Issue | [#89](https://github.com/optave/codegraph/issues/89) | bug: mixed-engine incremental build corrupts structure/contains edges | open | -| Issue | [#90](https://github.com/optave/codegraph/issues/90) | enhancement: add --json flag to search command | open | -| PR | [#91](https://github.com/optave/codegraph/pull/91) | fix(builder): preserve structure data during incremental builds | open | +| Issue | [#89](https://github.com/optave/codegraph/issues/89) | bug: mixed-engine incremental build corrupts structure/contains edges | Closed — fixed in v2.4.0 | +| Issue | [#90](https://github.com/optave/codegraph/issues/90) | enhancement: add --json flag to search command | Closed — resolved in v2.4.0 | +| PR | [#91](https://github.com/optave/codegraph/pull/91) | fix(builder): preserve structure data during incremental builds | Merged | diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md b/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md index 7d61f60..a922e41 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md @@ -347,15 +347,19 @@ The `roles --role dead` crash observed earlier was caused by querying a stale DB ## 10. Suggestions for Improvement -### 10.1 Add --db flag to embed and search +### 10.1 Add --db flag to embed and search — RESOLVED in v2.5.0 The `embed` and `search` commands lack a `--db ` option, unlike most other query commands. This makes them harder to use from external directories. Users must `cd` into the repo or use `npx --prefix`. +> `embed` gained `-d, --db ` in v2.5.0. + ### 10.2 Warn on concurrent DB access The shared graph.db can cause FK constraint failures when concurrent sessions build/embed simultaneously. Consider adding advisory file locking or a warning when another process holds the DB. -### 10.3 Update notification for dev versions +### 10.3 Update notification for dev versions — RESOLVED in v2.5.0 The update notification feature (`update-check.js`) should suppress notifications for dev/prerelease versions to avoid false positives. +> v2.5.0 moved dev builds to GitHub pre-releases instead of npm, sidestepping the notification issue. + ### 10.4 Consistent file counts across builds File counts fluctuated slightly (99-106) across builds due to concurrent repo modifications. While not a bug, logging which files were added/removed between builds would help diagnose discrepancies. diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.4.0.md b/generated/dogfood/DOGFOOD_REPORT_v2.4.0.md index 0ccc153..2dfe491 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.4.0.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.4.0.md @@ -342,9 +342,11 @@ Appended `// test comment` to `src/logger.js`: ### 9.3 ~~Incremental rebuild needs reverse-dep edge cascade~~ — DONE ~~The most impactful fix would be making incremental rebuilds re-resolve edges for files that import changed files.~~ Implemented at `builder.js:444` — reverse-dependency cascade detects files that import changed files and re-resolves their outgoing edges, fixing Bug #4. -### 9.4 Update notification testing — Open (low priority) +### 9.4 Update notification testing — RESOLVED in v2.5.0 The update notification feature was not observable during testing. Consider adding a `--check-update` flag for manual testing, or document when the notification appears. +> v2.5.0 moved dev builds to GitHub pre-releases, resolving false-positive notification issues. The notification works correctly on stable npm releases. + --- ## 10. Testing Plan diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.5.0.md b/generated/dogfood/DOGFOOD_REPORT_v2.5.0.md index 0b19582..2a9ff26 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.5.0.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.5.0.md @@ -316,18 +316,22 @@ The initial dogfood run flagged `branch-compare` as a missing-implementation bug ## 10. Suggestions for Improvement -### 10.1 Guard against missing module imports in index.js +### 10.1 Guard against missing module imports in index.js — RESOLVED in v2.5.1 Add a CI check or test that validates all re-exports in `index.js` resolve to existing files. A simple `node --input-type=module -e "import('./src/index.js')"` in CI would catch missing modules before release. (The branch-compare issue was a lost stash, not a missing implementation, but the guard is still valuable.) +> v2.5.1 added `index-exports` unit test that validates all re-exports in index.js resolve without `ERR_MODULE_NOT_FOUND`. + ### 10.2 ~~Native complexity performance~~ (resolved) ~~Native complexity computation appeared slower than WASM.~~ This was caused by running benchmarks with a stale v2.4.0 native binary. With the correct v2.5.0 binary, native complexity is 47x faster (5.1ms vs 240.7ms) since Rust computes all metrics during parsing and the complexity phase is just DB inserts. ### 10.3 Add a `--full` flag documentation hint to structure The structure command shows "N files omitted. Use --full to show all files" but `--full` is not listed in `--help`. Consider adding it to the help text. -### 10.4 Registry prune UX +### 10.4 Registry prune UX — RESOLVED in v2.5.1 `registry prune --ttl 0` removes ALL entries including actively-used repos. Consider adding a `--dry-run` flag or confirmation prompt for aggressive TTL values. +> v2.5.1 added `--dry-run` flag to `registry prune` — preview what would be removed without deleting entries. + --- ## 11. Testing Plan @@ -390,5 +394,5 @@ All 28 commands work correctly in both cold-start and post-build scenarios. Edge | Type | Number | Title | Status | |------|--------|-------|--------| -| Issue | [#166](https://github.com/optave/codegraph/issues/166) | bug: branch-compare command and programmatic API crash — missing branch-compare.js | resolved (recovered from stash) | -| PR | (pending push) | fix: recover branch-compare implementation from lost stash | open | +| Issue | [#166](https://github.com/optave/codegraph/issues/166) | bug: branch-compare command and programmatic API crash — missing branch-compare.js | Closed — fixed in v2.5.1 | +| PR | [v2.5.1](https://github.com/optave/codegraph/releases/tag/v2.5.1) | fix: recover branch-compare implementation from lost stash | Merged | diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md b/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md index 4b37dd8..cbf45b1 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md @@ -286,27 +286,33 @@ This dev build includes all v2.6.0 features. ## 8. Bugs Found -### BUG 1: EISDIR warning during incremental rebuild (Medium) +### BUG 1: EISDIR warning during incremental rebuild (Medium) — RESOLVED in v2.6.0 - **Issue:** [#235](https://github.com/optave/codegraph/issues/235) -- **PR:** Open — not fixed in this session +- **PR:** [#241](https://github.com/optave/codegraph/pull/241) - **Symptoms:** `[codegraph WARN] Skipping src: EISDIR: illegal operation on a directory, read` during incremental rebuild after modifying a single source file - **Root cause:** The `src` directory node leaks into the re-parse file set during reverse-dep computation - **Impact:** Cosmetic warning; the directory is skipped and build completes. One fewer file is parsed than expected. -### BUG 2: Incremental rebuild edge count mismatch (High) +> Fixed in v2.6.0: filter directory nodes from reverse-deps query to prevent EISDIR on incremental rebuilds. + +### BUG 2: Incremental rebuild edge count mismatch (High) — RESOLVED in v2.6.0 - **Issue:** [#236](https://github.com/optave/codegraph/issues/236) -- **PR:** Open — needs investigation +- **PR:** [#241](https://github.com/optave/codegraph/pull/241) - **Symptoms:** After a 1-file incremental rebuild, `stats` reports a different edge count than a full rebuild of the same codebase. Full build: 1671 edges. Incremental: varies (676 in one test, 2660 in another) - **Root cause:** The incremental path re-parses only changed files + reverse-deps. Edge cleanup/insertion may not preserve edges from unchanged files correctly. - **Impact:** Queries after incremental rebuilds may return incomplete results. -### BUG 3: Dev build native binary tarball install fails via npm (Medium) +> Fixed in v2.6.0: load unchanged barrel files into reexportMap, add drift detection, barrel-project fixture and incremental-parity test. + +### BUG 3: Dev build native binary tarball install fails via npm (Medium) — RESOLVED in v2.6.0 - **Issue:** [#237](https://github.com/optave/codegraph/issues/237) -- **PR:** Open — needs investigation +- **PR:** [#241](https://github.com/optave/codegraph/pull/241) - **Symptoms:** `npm install ` fails with `TypeError: Invalid Version:` in npm's arborist - **Root cause:** npm's semver parser may not handle the `2.5.35-dev.26434e2` version format during deduplication - **Impact:** Dev build users must manually extract the native binary tarball +> Fixed in v2.6.0: `--strip` flag in `sync-native-versions.js` removes platform optionalDependencies in dev builds. + ### MINOR: Native addon version string is `0.1.0` - Not filed as issue — cosmetic. The Rust addon's internal version string hasn't been updated to match the package version. `codegraph info` shows `Native version: 0.1.0`. @@ -314,18 +320,24 @@ This dev build includes all v2.6.0 features. ## 9. Suggestions for Improvement -### 9.1 Incremental rebuild verification +### 9.1 Incremental rebuild verification — RESOLVED in v2.6.0 Add an assertion or warning in the build process that compares the post-incremental edge/node count against the previous full-build count. If they diverge significantly, suggest `--no-incremental`. +> v2.6.0 added node/edge count drift detection after incremental builds — warns when counts drift >20% and suggests `--no-incremental`. Threshold is configurable via `build.driftThreshold`. + ### 9.2 Embedding benchmark should declare `@huggingface/transformers` as a devDependency The embedding benchmark script fails because `@huggingface/transformers` is an optional dep that doesn't auto-install. Consider making it a devDependency so benchmark scripts work out of the box. -### 9.3 `complexity` should warn when data is missing +### 9.3 `complexity` should warn when data is missing — RESOLVED in v2.6.0 When `complexity` returns "No complexity data found" but a graph exists, it should suggest `build --no-incremental` to populate the data, rather than implying no graph exists. -### 9.4 Dev build install documentation +> v2.6.0 improved the missing-data message — now suggests `--no-incremental` rebuild instead of implying no graph exists. + +### 9.4 Dev build install documentation — RESOLVED in v2.6.0 The SKILL.md documents the manual tarball installation, but a note in the README or release notes about the `npm install ` failure would help users. +> v2.6.0 fixed the underlying `npm install` failure with `--strip` flag in `sync-native-versions.js`, making manual extraction unnecessary. + --- ## 10. Testing Plan @@ -392,9 +404,9 @@ The incremental edge count bug (#236) is the most impactful finding and should b | Type | Number | Title | Status | |------|--------|-------|--------| -| Issue | [#235](https://github.com/optave/codegraph/issues/235) | bug: EISDIR warning during incremental rebuild | open | -| Issue | [#236](https://github.com/optave/codegraph/issues/236) | bug: incremental rebuild produces different edge count than full rebuild | open | -| Issue | [#237](https://github.com/optave/codegraph/issues/237) | bug: dev build native binary tarball cannot be installed via npm | open | +| Issue | [#235](https://github.com/optave/codegraph/issues/235) | bug: EISDIR warning during incremental rebuild | Closed — fixed in v2.6.0 | +| Issue | [#236](https://github.com/optave/codegraph/issues/236) | bug: incremental rebuild produces different edge count than full rebuild | Closed — fixed in v2.6.0 | +| Issue | [#237](https://github.com/optave/codegraph/issues/237) | bug: dev build native binary tarball cannot be installed via npm | Closed — fixed in v2.6.0 | ## 13. Performance Benchmarks diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md b/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md index 79a29ff..d1e091f 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md @@ -281,32 +281,36 @@ Changes since v2.6.0 (12 non-doc commits): ## 9. Bugs Found -### BUG 1: Forward-slash paths on Windows cause empty build (Medium) +### BUG 1: Forward-slash paths on Windows cause empty build (Medium) — RESOLVED in v3.0.0 - **Issue:** [#287](https://github.com/optave/codegraph/issues/287) - **Symptoms:** `codegraph build H:/path/to/repo` finds 0 files and creates graph.db in CWD instead of target repo. Backslash paths work correctly. - **Root cause:** Native engine doesn't normalize forward-slash POSIX-style paths on Windows. -- **PR:** Not yet fixed — needs investigation in native engine path handling. +- **PR:** [#293](https://github.com/optave/codegraph/pull/293) — fix: resolve three build bugs in builder.js (#287, #288, #289) -### BUG 2: `--cfg` flag skipped on incremental no-op (Medium) +### BUG 2: `--cfg` flag skipped on incremental no-op (Medium) — RESOLVED in v3.0.0 - **Issue:** [#288](https://github.com/optave/codegraph/issues/288) - **Symptoms:** Running `build . --cfg` when no files changed produces no CFG data. All `cfg` queries return 0 blocks/edges. Requires `--no-incremental` to build CFG for the first time. - **Root cause:** Incremental build short-circuits before CFG computation when no file changes detected. -- **PR:** Not yet fixed. +- **PR:** [#293](https://github.com/optave/codegraph/pull/293) — fix: resolve three build bugs in builder.js (#287, #288, #289) -### BUG 3: Incremental divergence warning false positive (Low) +### BUG 3: Incremental divergence warning false positive (Low) — RESOLVED in v3.0.0 - **Issue:** [#289](https://github.com/optave/codegraph/issues/289) - **Symptoms:** On every incremental rebuild (even 1 file change), warning shows "edges: 1936→792 [59.1%]" — comparing full previous count with per-batch count, not DB totals. - **Root cause:** Divergence check compares previous build's total with current batch's count. -- **PR:** Not yet fixed. +- **PR:** [#293](https://github.com/optave/codegraph/pull/293) — fix: resolve three build bugs in builder.js (#287, #288, #289) ## 10. Suggestions for Improvement -### 10.1 Add `hotspots` as a CLI command +### 10.1 Add `hotspots` as a CLI command — SUPERSEDED in v3.0.0 Currently `hotspots` is only available as an MCP tool but not as a CLI command. The dogfood skill references it as a command to test, and users would expect it alongside `roles`, `triage`, etc. -### 10.2 Auto-detect version changes for full rebuild +> v3.0.0 consolidated `hotspots` into `triage --level` — the standalone command was intentionally removed. + +### 10.2 Auto-detect version changes for full rebuild — RESOLVED in v3.0.0 When the build metadata version doesn't match the current CLI version, suggest or automatically trigger a full rebuild. The `info` command already shows this warning but `build` doesn't act on it. +> v3.0.0 added `auto-promote full rebuild` feature (#294) — when build metadata version mismatches, automatically promotes to a full rebuild. + ### 10.3 Extend native engine with parameter/property/constant support The native engine doesn't extract parameter, property, or constant nodes. While core function/method/class parity is perfect, these extended types are useful for the `children` command and containment analysis. @@ -364,6 +368,6 @@ The three bugs found are all usability issues (not data corruption or crashes): | Type | Number | Title | Status | |------|--------|-------|--------| -| Issue | [#287](https://github.com/optave/codegraph/issues/287) | bug(build): forward-slash paths on Windows cause 0 files parsed | open | -| Issue | [#288](https://github.com/optave/codegraph/issues/288) | bug(build): --cfg flag skipped on incremental no-op | open | -| Issue | [#289](https://github.com/optave/codegraph/issues/289) | bug(build): incremental divergence warning compares per-batch edges vs total | open | +| Issue | [#287](https://github.com/optave/codegraph/issues/287) | bug(build): forward-slash paths on Windows cause 0 files parsed | Closed — fixed in v3.0.0 (#293) | +| Issue | [#288](https://github.com/optave/codegraph/issues/288) | bug(build): --cfg flag skipped on incremental no-op | Closed — fixed in v3.0.0 (#293) | +| Issue | [#289](https://github.com/optave/codegraph/issues/289) | bug(build): incremental divergence warning compares per-batch edges vs total | Closed — fixed in v3.0.0 (#293) | diff --git a/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md b/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md index 509c361..8b7fe94 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md +++ b/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md @@ -257,9 +257,11 @@ All 4 benchmark scripts crash if WASM grammars aren't built. They should either: - Fall back to native-only benchmarking - Or print a helpful error message instead of crashing -### 9.4 `flow --list` should work after build +### 9.4 `flow --list` should work after build — RESOLVED post-v3.0.0 `flow --list` returns "No entry points found" after a standard build. Entry point classification happens during build (50 entry points detected in roles), but `flow --list` doesn't find them. These may need to be stored explicitly. +> Fixed in commit `6681597` — `flow --list` now includes role-based entry points from the roles classification. + --- ## 10. Testing Plan From bab0be973c17c7fe34a29e2cc68c1100baf28e89 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:37:29 -0700 Subject: [PATCH 3/6] docs: mark native engine parity fixes and benchmark resilience as resolved Update v2.6.32-dev and v3.0.0 dogfood reports with resolutions for: - #305 native engine version string (post-v3.0.0) - #306 native AST node kind parity (post-v3.0.0) - #309 native/WASM engine parity gap (post-v3.0.0) - #311 benchmark scripts handle missing WASM grammars (post-v3.0.0) --- .../DOGFOOD_REPORT_v2.6.32-dev.4f08082.md | 4 +++- generated/dogfood/DOGFOOD_REPORT_v3.0.0.md | 24 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md b/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md index d1e091f..974ba53 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.6.32-dev.4f08082.md @@ -311,9 +311,11 @@ When the build metadata version doesn't match the current CLI version, suggest o > v3.0.0 added `auto-promote full rebuild` feature (#294) — when build metadata version mismatches, automatically promotes to a full rebuild. -### 10.3 Extend native engine with parameter/property/constant support +### 10.3 Extend native engine with parameter/property/constant support — RESOLVED post-v3.0.0 The native engine doesn't extract parameter, property, or constant nodes. While core function/method/class parity is perfect, these extended types are useful for the `children` command and containment analysis. +> Fixed in commits `52d6dcc` (#309) and `6101b5e` (#314) — native engine parity gap closed for extended node types and AST node kinds. + ## 11. Testing Plan ### General Testing Plan (Any Release) diff --git a/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md b/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md index 8b7fe94..03d0825 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md +++ b/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md @@ -226,20 +226,24 @@ Build: `npx codegraph build --no-incremental --verbose` ## 8. Bugs Found -### BUG 1: Native engine reports version 2.6.0 (Low) +### BUG 1: Native engine reports version 2.6.0 (Low) — RESOLVED post-v3.0.0 - **Issue:** [#305](https://github.com/optave/codegraph/issues/305) -- **PR:** Open — cosmetic, requires Cargo.toml version bump + native binary rebuild +- **PR:** [#310](https://github.com/optave/codegraph/pull/310) - **Symptoms:** `codegraph info` shows "Native version: 2.6.0" when package is v3.0.0. Build metadata shows version mismatch warning. - **Root cause:** `Cargo.toml` version not bumped to 3.0.0 before release build. - **Impact:** Cosmetic, but may trigger unnecessary full rebuilds due to version mismatch detection in `buildGraph()`. -### BUG 2: Native engine only stores 'call' AST nodes (Medium) +> Fixed in commit `8b96f7c` — Cargo.toml version bumped to 3.0.0, CI now includes Cargo.toml in publish version bump commit (#315). + +### BUG 2: Native engine only stores 'call' AST nodes (Medium) — RESOLVED post-v3.0.0 - **Issue:** [#306](https://github.com/optave/codegraph/issues/306) -- **PR:** Open — requires extending Rust extractors or documenting limitation +- **PR:** [#314](https://github.com/optave/codegraph/pull/314) - **Symptoms:** `ast --kind new/string/regex/throw/await` all return "No AST nodes found" when graph built with native engine. - **Root cause:** Native Rust engine extracts only `call_expression` nodes. It doesn't preserve the parse tree, so the JavaScript-side AST walk in `ast.js` cannot extract the 5 additional node kinds. WASM engine works correctly. - **Impact:** Users relying on native engine (default) get incomplete AST query results. 24716 nodes stored vs 40612 with WASM for the same codebase. +> Fixed in commit `6101b5e` — native engine now extracts all 6 AST node kinds (call, new, throw, await, string, regex). + --- ## 9. Suggestions for Improvement @@ -249,14 +253,18 @@ Currently these are opt-in flags. Users discovering the `cfg` and `dataflow` com - Making them default (with `--no-cfg`/`--no-dataflow` to opt out) - Or showing a more prominent hint in the `cfg`/`dataflow` commands -### 9.2 Document AST node kind limitations per engine +### 9.2 Document AST node kind limitations per engine — RESOLVED post-v3.0.0 The `ast` command help should note that non-call kinds require the WASM engine, or the native engine should be extended for parity. -### 9.3 Benchmark scripts should handle missing WASM grammars +> Fixed in commit `6101b5e` (#314) — native engine now extracts all 6 AST node kinds, eliminating the parity gap entirely. + +### 9.3 Benchmark scripts should handle missing WASM grammars — RESOLVED post-v3.0.0 All 4 benchmark scripts crash if WASM grammars aren't built. They should either: - Fall back to native-only benchmarking - Or print a helpful error message instead of crashing +> Fixed in commit `189cefb` (#311) — all 4 benchmark scripts now handle missing WASM grammars gracefully. + ### 9.4 `flow --list` should work after build — RESOLVED post-v3.0.0 `flow --list` returns "No entry points found" after a standard build. Entry point classification happens during build (50 entry points detected in roles), but `flow --list` doesn't find them. These may need to be stored explicitly. @@ -334,5 +342,5 @@ Justification: Solid feature delivery with comprehensive CLI and MCP coverage. T | Type | Number | Title | Status | |------|--------|-------|--------| -| Issue | [#305](https://github.com/optave/codegraph/issues/305) | bug: native engine reports version 2.6.0 in codegraph v3.0.0 | open | -| Issue | [#306](https://github.com/optave/codegraph/issues/306) | bug: native engine only stores 'call' AST nodes, missing 5 other kinds | open | +| Issue | [#305](https://github.com/optave/codegraph/issues/305) | bug: native engine reports version 2.6.0 in codegraph v3.0.0 | Closed — fixed post-v3.0.0 (#310) | +| Issue | [#306](https://github.com/optave/codegraph/issues/306) | bug: native engine only stores 'call' AST nodes, missing 5 other kinds | Closed — fixed post-v3.0.0 (#314) | From 58681d025a3621358b8dd45b844e73ce992babd5 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:38:47 -0700 Subject: [PATCH 4/6] docs: mark concurrent DB access warning as resolved in v2.3.1-dev report --- generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md b/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md index a922e41..bfc2611 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.3.1-dev.1aeea34.md @@ -352,9 +352,11 @@ The `embed` and `search` commands lack a `--db ` option, unlike most other > `embed` gained `-d, --db ` in v2.5.0. -### 10.2 Warn on concurrent DB access +### 10.2 Warn on concurrent DB access — RESOLVED in v2.6.0 The shared graph.db can cause FK constraint failures when concurrent sessions build/embed simultaneously. Consider adding advisory file locking or a warning when another process holds the DB. +> Fixed: `src/db.js` now implements advisory lock files at `.codegraph/graph.db.lock` (stores PID) with `acquireAdvisoryLock()`/`releaseAdvisoryLock()` on every `openDb()`/`closeDb()` call, warning when another live process holds the lock. + ### 10.3 Update notification for dev versions — RESOLVED in v2.5.0 The update notification feature (`update-check.js`) should suppress notifications for dev/prerelease versions to avoid false positives. From c32a3f82529162848d1dd3936b49bad386944d32 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:39:16 -0700 Subject: [PATCH 5/6] docs: mark default --cfg/--dataflow as resolved in v3.0.0 report (#312) --- generated/dogfood/DOGFOOD_REPORT_v3.0.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md b/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md index 03d0825..762d206 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md +++ b/generated/dogfood/DOGFOOD_REPORT_v3.0.0.md @@ -248,11 +248,13 @@ Build: `npx codegraph build --no-incremental --verbose` ## 9. Suggestions for Improvement -### 9.1 Default `--cfg` and `--dataflow` on full rebuilds +### 9.1 Default `--cfg` and `--dataflow` on full rebuilds — RESOLVED post-v3.0.0 Currently these are opt-in flags. Users discovering the `cfg` and `dataflow` commands will get empty results unless they know to rebuild with flags. Consider either: - Making them default (with `--no-cfg`/`--no-dataflow` to opt out) - Or showing a more prominent hint in the `cfg`/`dataflow` commands +> Fixed in #312 — `--cfg` and `--dataflow` are now enabled by default on full rebuilds. + ### 9.2 Document AST node kind limitations per engine — RESOLVED post-v3.0.0 The `ast` command help should note that non-call kinds require the WASM engine, or the native engine should be extended for parity. From 5c9646c2c46766f8e9b5251bdd43701873b637a5 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:41:25 -0700 Subject: [PATCH 6/6] docs: mark HF transformers devDep suggestion as superseded in v2.5.35-dev report --- generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md b/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md index cbf45b1..8da2a93 100644 --- a/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md +++ b/generated/dogfood/DOGFOOD_REPORT_v2.5.35-dev.26434e2.md @@ -325,9 +325,11 @@ Add an assertion or warning in the build process that compares the post-incremen > v2.6.0 added node/edge count drift detection after incremental builds — warns when counts drift >20% and suggests `--no-incremental`. Threshold is configurable via `build.driftThreshold`. -### 9.2 Embedding benchmark should declare `@huggingface/transformers` as a devDependency +### 9.2 Embedding benchmark should declare `@huggingface/transformers` as a devDependency — SUPERSEDED in v2.5.0 The embedding benchmark script fails because `@huggingface/transformers` is an optional dep that doesn't auto-install. Consider making it a devDependency so benchmark scripts work out of the box. +> Superseded: v2.5.0 added an interactive install prompt in `embedder.js` when the package is missing, and the optional-dep design is intentional to avoid bloating installs for contributors who don't need ML models. + ### 9.3 `complexity` should warn when data is missing — RESOLVED in v2.6.0 When `complexity` returns "No complexity data found" but a graph exists, it should suggest `build --no-incremental` to populate the data, rather than implying no graph exists.