Skip to content

Commit f3e5908

Browse files
committed
Add config key graph parity fixture
1 parent cb1aca2 commit f3e5908

9 files changed

Lines changed: 168 additions & 23 deletions

File tree

docs/gap-analysis.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Intentionally deferred after Phase 7:
7272
- The remaining MCP work outside the completed daily-use slice, especially fuller Cypher parity.
7373
- Full Cypher parity beyond the broader day-to-day query subset now supporting node/edge reads, filtering, sorting, and counts.
7474
- Deeper usage/type-reference extraction parity and broader cross-language semantics beyond the current target daily-use slice.
75-
- Richer decorator/enrichment follow-ons, decorator-based route detection, `HANDLES`/`DATA_FLOWS` edge creation, and full config normalization surface. (Git-history coupling is now implemented; config-linking and route nodes are partially implemented.)
75+
- Richer decorator/enrichment follow-ons, broader route detection, and broader config normalization/linking surface. (Git-history coupling is now implemented; route nodes and config-linking both have strict shared graph-model fixture slices.)
7676
- Broader installer/self-update behavior beyond the current source-build-friendly Codex CLI / Claude Code support.
7777
- Idle-store and session-lifecycle extras beyond the current persistent-store + watcher runtime model.
7878

@@ -127,7 +127,7 @@ Deferred or optional future slices:
127127
- git-history coupling — now implemented (subprocess `git log`, `FILE_CHANGES_WITH` edges)
128128
- long-tail edges — now implemented: `THROWS`/`RAISES` (JS/TS/TSX throw statements), decorator-backed `HANDLES`, and route-linked `DATA_FLOWS`; remaining or out-of-scope gaps: `OVERRIDE` (Go-only), `WRITES`/`READS` (not proven original-overlap by the current C reference fixture)
129129
- route nodes — partially implemented (stub and concrete URL/path/topic `Route` nodes, verified decorator-backed `Route`/`HANDLES`, strict shared route-linked `DATA_FLOWS`, and strict shared `ASYNC_CALLS`; broader framework coverage still open)
130-
- config-linking — partially implemented (Strategy 1 key-symbol + Strategy 2 dependency-import; full config normalization surface not yet ported)
130+
- config-linking — partially implemented (Strategy 1 key-symbol + Strategy 2 dependency-import; the first strict shared key-symbol normalization fixture now proves raw-key preservation and `CONFIGURES` query visibility, while dependency-import closure remains open)
131131
- richer decorator/enrichment promotion
132132
- current entrypoint: [graph-model-parity-plan.md](/Users/skooch/projects/codebase-memory-zig/docs/plans/in-progress/graph-model-parity-plan.md)
133133
- Productization beyond the current contract:
@@ -428,10 +428,10 @@ The Zig store has the schema (tables + indexes + pragmas) and opens in-memory DB
428428
| `pass_parallel` | 1,427 | MISSING | Thread pool orchestration |
429429
| `pass_similarity` | 505 (minhash.c) | MISSING | MinHash near-clone detection |
430430
| `pass_gitdiff` | ~200 | MISSING | Git diff → changed files/hunks |
431-
| `pass_route_nodes` | 742 | PARTIAL (stub and concrete URL/path Route nodes, verified decorator-backed `Route`/`HANDLES`, and Zig route-linked `DATA_FLOWS`) | HTTP route node creation, first handler association slice, and first data-flow bridge |
431+
| `pass_route_nodes` | 742 | PARTIAL (stub and concrete URL/path/topic Route nodes, verified decorator-backed `Route`/`HANDLES`, strict shared route-linked `DATA_FLOWS`, and strict shared `ASYNC_CALLS`) | HTTP/async route node creation, first handler association slice, and first data-flow bridge |
432432
| `pass_tests` | 285 | WORKS for the shared Python `TESTS` / `TESTS_FILE` slice | Test file/function tagging now verified on the local parity fixture; broader language breadth stays follow-on work |
433433
| `pass_enrichment` | ~200 | MISSING (deferred) | Decorator tag enrichment |
434-
| `pass_configlink` | ~200 | PARTIAL (Strategy 1 key-symbol + Strategy 2 dependency-import) | Config-code linking |
434+
| `pass_configlink` | ~200 | PARTIAL (Strategy 1 key-symbol + Strategy 2 dependency-import; first strict shared key-symbol fixture is locked) | Config-code linking |
435435
| `pass_githistory` | 514 | WORKS | Change coupling from git log |
436436
| `pipeline_incremental` | ~400 | MISSING (deferred) | Incremental re-indexing |
437437

docs/plans/in-progress/graph-model-parity-plan.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ normalization surface.
88

99
## Current Phase
1010
Phase 3 route-linked data flow is complete for the first shared public fixture,
11-
and the first shared async route caller fixture is now locked:
11+
the first shared async route caller fixture is locked, and Phase 4 now has its
12+
first strict config-key fixture:
1213
decorator route extraction creates `Route` nodes and `HANDLES` edges,
1314
route-registration calls preserve enough call metadata to emit `HANDLES` when
1415
the handler reference resolves, and the shared Python route fixture now proves a
1516
strict C/Zig `DATA_FLOWS` row through a `GET` route. The async fixture proves a
1617
broker-specific `Route` and `ASYNC_CALLS` row for a local `celery.delay` topic.
18+
The config fixture proves raw key preservation, dash/camel normalization, the
19+
`maxConnections -> max-connections` `CONFIGURES` row, and no false link for a
20+
short one-token config key.
1721

1822
## Current Codebase State
1923
- Complete and verified: advanced trace modes, risk labels, include-tests
@@ -36,11 +40,15 @@ broker-specific `Route` and `ASYNC_CALLS` row for a local `celery.delay` topic.
3640
- Newly implemented for async route coverage: Zig accepts async broker topics,
3741
preserves broker names for route QNs/properties, and the `graph-model-async`
3842
fixture proves the shared `enqueue_users -> users.refresh` `ASYNC_CALLS` row.
43+
- Newly locked for config-link coverage: the `graph-model-config` fixture proves
44+
the first shared key-symbol normalization contract with a YAML
45+
`max-connections` key linked from a camelCase Python symbol while preserving
46+
the raw config key in query-visible output.
3947
- Still missing for graph-model parity: broader framework route coverage and
40-
the full config normalization/linking surface beyond the current key-symbol
41-
and dependency-import strategies.
42-
- Current full Zig-vs-C harness baseline after this route slice:
43-
`165` comparisons, `92` strict matches, `21` diagnostic-only comparisons,
48+
broader config-link coverage beyond the first strict key-symbol fixture,
49+
especially dependency-import mismatch closure.
50+
- Current full Zig-vs-C harness baseline after this config slice:
51+
`172` comparisons, `95` strict matches, `22` diagnostic-only comparisons,
4452
`10` mismatches, and `cli_progress: match`. The graph-model-related
4553
mismatches still include the existing `graph-enrichment-config-deps` and
4654
`graph-enrichment-http-calls` query rows.
@@ -67,7 +75,7 @@ broker-specific `Route` and `ASYNC_CALLS` row for a local `celery.delay` topic.
6775
- Modify: `testdata/interop/manifest.json`
6876
- Create: `testdata/interop/graph-model/routes/`
6977
- Create: `testdata/interop/graph-model/config/`
70-
- Create: `docs/plans/in-progress/graph-model-parity-progress.md` after approval
78+
- Modify: `docs/plans/in-progress/graph-model-parity-progress.md`
7179

7280
## Phases
7381

@@ -77,7 +85,7 @@ broker-specific `Route` and `ASYNC_CALLS` row for a local `celery.delay` topic.
7785
- [x] Define fixture-backed acceptance rules for first-slice `HTTP_CALLS` route callers and route-linked `DATA_FLOWS` in Zig.
7886
- [x] Define fixture-backed acceptance rules for strict shared C/Zig `DATA_FLOWS`.
7987
- [x] Define fixture-backed acceptance rules for strict shared C/Zig `ASYNC_CALLS`.
80-
- [ ] Define fixture-backed acceptance rules for config normalization/linking.
88+
- [x] Define fixture-backed acceptance rules for first-slice config normalization/linking.
8189
- [x] Add a minimal Python route fixture under `testdata/interop/graph-model/routes/`.
8290
- [ ] Add minimal JavaScript/TypeScript route fixtures once the shared C/Zig public behavior is established for those registrations.
8391
- **Status:** partially complete
@@ -104,10 +112,11 @@ broker-specific `Route` and `ASYNC_CALLS` row for a local `celery.delay` topic.
104112
- **Status:** complete for the first async route caller slice
105113

106114
### Phase 4: Finish Config-Link Normalization
107-
- [ ] Extend config-key extraction and matching only for original-overlap config patterns with fixture evidence.
108-
- [ ] Preserve raw config keys while adding the minimum normalized lookup metadata needed for stable links.
109-
- [ ] Add regression coverage for config-key normalization, dependency-import matching, deduplication, and query visibility.
110-
- **Status:** pending approval
115+
- [x] Add the first strict shared key-symbol fixture for dash/camel config normalization.
116+
- [x] Verify raw config keys remain query-visible while normalized matching creates stable links.
117+
- [ ] Extend config-key extraction and matching only for additional original-overlap config patterns with fixture evidence.
118+
- [ ] Add regression coverage for dependency-import matching, deduplication, and broader query visibility.
119+
- **Status:** in progress
111120

112121
### Phase 5: Verify and Reclassify
113122
- [x] Run `zig build`, `zig build test`, `bash scripts/run_interop_alignment.sh --zig-only`, and focused graph-model fixture queries.

docs/plans/in-progress/graph-model-parity-progress.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,24 @@
3939
- Added strict manifest assertions for `__route__celery__users.refresh` and `enqueue_users -> users.refresh` over `ASYNC_CALLS`.
4040
- Regenerated `graph-model-async` golden coverage.
4141

42+
### Phase 4: Finish Config-Link Normalization
43+
- **Status:** in progress for the first shared key-symbol slice
44+
- Actions:
45+
- Re-read the original C `pass_configlink` behavior and compared it with Zig's `runConfigLinkPass` and `normalizeConfigName`.
46+
- Probed a focused YAML/Python fixture against both implementations and confirmed the shared public rows before adding repo fixtures.
47+
- Added `testdata/interop/graph-model/config/` with `maxConnections`, `max_connections`, `max-connections`, and `short`.
48+
- Added strict manifest assertions that prove the raw `max-connections` config key, the normalized `maxConnections -> max-connections` `CONFIGURES` row, and no false `CONFIGURES` row for `short`.
49+
- Regenerated `graph-model-config` golden coverage.
50+
4251
### Verification
4352
- `zig build` -> passed
4453
- `zig build test` -> passed
45-
- `bash scripts/run_interop_alignment.sh --update-golden` -> passed, 21/21 golden snapshots updated
46-
- `bash scripts/run_interop_alignment.sh --zig-only` -> passed, 21/21 golden comparison
47-
- `bash scripts/run_interop_alignment.sh` -> passed with 21 fixtures, 165 comparisons, 92 strict matches, 21 diagnostic-only comparisons, 10 known mismatches, and `cli_progress: match`
54+
- `python3 -m json.tool testdata/interop/manifest.json >/dev/null` -> passed
55+
- `bash scripts/run_interop_alignment.sh --update-golden` -> passed, 22/22 golden snapshots updated
56+
- `bash scripts/run_interop_alignment.sh --zig-only` -> passed, 22/22 golden comparison
57+
- `bash scripts/run_interop_alignment.sh` -> passed with 22 fixtures, 172 comparisons, 95 strict matches, 22 diagnostic-only comparisons, 10 known mismatches, and `cli_progress: match`
58+
- `git diff --check` -> passed
59+
- `command -v zlint` -> blocked; `zlint` is not installed in this environment
4860

4961
## Errors
5062
| Timestamp | Error | Attempt | Resolution |

docs/port-comparison.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ It is intentionally not a wish list. It describes:
132132
| LSP hybrid type resolution | Present for Go/C/C++ in original | Not implemented | `Deferred` | No | The original README explicitly calls out LSP-style hybrid type resolution; Zig does not ship that layer. |
133133
| Test tagging pass | Yes | Yes for the verified shared Python fixture slice | `Near parity` | Yes | Zig now derives `TESTS` and `TESTS_FILE` from shared filename and call-edge rules on the parity fixture without reopening broader language-specific enrichment work. |
134134
| Git history coupling | Yes | Implemented | `Near parity` | Yes | Zig pass uses subprocess `git log` (no libgit2); creates `FILE_CHANGES_WITH` edges with `co_changes` and `coupling_score` properties. |
135-
| Config linking / config normalization | Yes | Partial | `Partial` | No | Zig now implements Strategy 1 (key-symbol) and Strategy 2 (dependency-import matching) but not the full config normalization surface. |
135+
| Config linking / config normalization | Yes | Partial | `Partial` | No | Zig now implements Strategy 1 (key-symbol) and Strategy 2 (dependency-import matching); the first strict shared key-symbol normalization fixture locks raw-key query visibility and `maxConnections -> max-connections`, but dependency-import mismatch closure and broader normalization coverage remain open. |
136136
| Route-node creation / cross-service graph | Yes | Partial | `Partial` | No | Zig now classifies call edges as `HTTP_CALLS`/`ASYNC_CALLS`, creates stub and concrete URL/path/topic `Route` nodes, emits verified decorator-backed `HANDLES`, and has strict shared route-linked `DATA_FLOWS` plus async topic fixtures. Broader framework coverage remains open. |
137137
| Infra scanning (`Docker`, `K8s`, Terraform, etc.) | Yes in the original codebase | Not ported | `Cut` | No | Zig intentionally excludes the infra-scan family from the current port target. |
138138
| OTLP traces | Stubbed | Not ported | `N/A` | No | Not a meaningful implemented-vs-implemented gap. |
@@ -146,7 +146,7 @@ This section compares what kinds of graph entities the two systems are built to
146146
| Core code graph (`Project`, `Folder`, `File`, `Module`, `Class`, `Function`, `Method`, `Interface`, `Enum`) | Yes | Yes | `Near parity` | Yes | These are the backbone of the shipped Zig graph. |
147147
| Core code edges (`CONTAINS_*`, `DEFINES`, `DEFINES_METHOD`, `CALLS`, `USAGE`) | Yes | Yes | `Near parity` | Yes | All are part of the current Zig daily-use contract. |
148148
| `SIMILAR_TO` | Yes | Yes | `Near parity` | Yes | Landed in Zig Phase 6. |
149-
| Shared `CONFIGURES` contract | Yes | Yes for the verified shared fixture slice | `Near parity` | Yes | The parity fixtures now compare the overlapping `CONFIGURES` row directly; broader config-link systems remain deferred elsewhere. |
149+
| Shared `CONFIGURES` contract | Yes | Yes for the verified shared fixture slices | `Near parity` | Yes | The parity fixtures now compare overlapping `CONFIGURES` rows directly, including the graph-model key-symbol normalization case; broader config-link systems remain deferred elsewhere. |
150150
| Internal serving architecture | Graph-centric serving path | Hybrid internal serving path: SQLite graph core, FTS5 lexical index, optional SCIP sidecar overlay, and query router | `Near parity` | Yes | This is an internal implementation improvement in the Zig port; it deliberately preserves the interoperable MCP surface rather than creating a new client contract. |
151151
| Route graph (`Route`, `HTTP_CALLS`, `ASYNC_CALLS`, `HANDLES`, route-linked data flows) | Yes | Partial | `Partial` | No | Zig now creates `HTTP_CALLS` and `ASYNC_CALLS` edges, concrete URL/path/topic `Route` nodes, verified decorator-backed `HANDLES`, strict shared route-linked `DATA_FLOWS`, and strict shared async topic caller rows. Broader framework coverage remains open. |
152152
| Resource / infra graph (`Resource`, K8s/Kustomize entities) | Yes | Not shipped | `Cut` | No | Intentionally outside the Zig scope. |
@@ -226,7 +226,7 @@ If someone asks “what still separates the Zig port from the original?”, the
226226
| No full Cypher parity | Some advanced graph query patterns remain C-only. |
227227
| Partial route / cross-service graph stack | Zig now emits verified decorator-backed `HANDLES`, strict shared route-linked `DATA_FLOWS`, and strict shared async topic caller rows, but broader framework coverage remains open. |
228228
| No LSP-assisted hybrid resolution | Some higher-fidelity call/type resolution paths remain original-only. |
229-
| No full config normalization | Git-history coupling is implemented, config linking has dependency-import matching, decorator-backed `HANDLES` is verified, strict shared route-linked `DATA_FLOWS` is covered, and the first async topic route fixture is covered. The remaining graph-model gap is broader framework route coverage and the full config normalization surface. |
229+
| No full config normalization | Git-history coupling is implemented, config linking has dependency-import matching and a strict shared key-symbol normalization fixture, decorator-backed `HANDLES` is verified, strict shared route-linked `DATA_FLOWS` is covered, and the first async topic route fixture is covered. The remaining graph-model gap is broader framework route coverage plus dependency-import and broader config-normalization closure. |
230230
| No UI subsystem | The original can run a graph visualization UI; the Zig port intentionally cannot. |
231231
| Much narrower installer ecosystem | The original configures 10 agents plus hooks/instructions; Zig currently configures 2 agents and only MCP entries. |
232232

docs/zig-port-plan.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ Current state: the broader daily-use MCP surface is now live, the runtime uses a
567567
- [x] Git history pass (change coupling)
568568
- [ ] Route node creation and handler/data-flow links (partial: stub and concrete URL/path/topic `Route` nodes, verified decorator-backed `HANDLES`, strict shared route-linked `DATA_FLOWS`, and strict shared `ASYNC_CALLS` are implemented; broader framework coverage remains open)
569569
- [x] Test tagging
570-
- [ ] Config-code linking (partial: key-symbol and dependency-import strategies are implemented)
570+
- [ ] Config-code linking (partial: key-symbol and dependency-import strategies are implemented; first strict shared key-symbol normalization fixture is locked)
571571
- [ ] Decorator enrichment
572-
Current state: M4 is no longer a blank backlog. Git-history coupling, test tagging, route stubs, concrete URL/path/topic route callers, decorator-backed `HANDLES`, strict shared route-linked `DATA_FLOWS`, strict shared `ASYNC_CALLS`, service-pattern call classification, partial config linking, and long-tail `THROWS` / `RAISES` edges are implemented. The active graph-model parity entrypoint is [graph-model-parity-plan.md](/Users/skooch/projects/codebase-memory-zig/docs/plans/in-progress/graph-model-parity-plan.md), which tracks the remaining broader route handler coverage and config-normalization work.
572+
Current state: M4 is no longer a blank backlog. Git-history coupling, test tagging, route stubs, concrete URL/path/topic route callers, decorator-backed `HANDLES`, strict shared route-linked `DATA_FLOWS`, strict shared `ASYNC_CALLS`, service-pattern call classification, partial config linking with a strict shared key-symbol normalization fixture, and long-tail `THROWS` / `RAISES` edges are implemented. The active graph-model parity entrypoint is [graph-model-parity-plan.md](/Users/skooch/projects/codebase-memory-zig/docs/plans/in-progress/graph-model-parity-plan.md), which tracks the remaining broader route handler coverage and dependency-import/config-normalization work.
573573

574574
## Completion Summary
575575

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"delete_project": [],
3+
"detect_changes_count": 0,
4+
"fixture_id": "graph-model-config",
5+
"get_architecture": [],
6+
"get_code_snippet": [],
7+
"get_graph_schema": [],
8+
"index_repository": {
9+
"edges_actual": 10,
10+
"edges_min": 2,
11+
"nodes_actual": 9,
12+
"nodes_min": 4
13+
},
14+
"index_status": [],
15+
"list_projects": [
16+
"config"
17+
],
18+
"manage_adr": [],
19+
"query_graph": [
20+
{
21+
"columns": [
22+
"n.name"
23+
],
24+
"rows": [
25+
[
26+
"max-connections"
27+
]
28+
]
29+
},
30+
{
31+
"columns": [
32+
"a.name",
33+
"b.name"
34+
],
35+
"rows": [
36+
[
37+
"maxConnections",
38+
"max-connections"
39+
]
40+
]
41+
},
42+
{
43+
"columns": [
44+
"a.name",
45+
"b.name"
46+
],
47+
"rows": []
48+
}
49+
],
50+
"search_code": [],
51+
"search_graph": [],
52+
"tools_list": [
53+
"delete_project",
54+
"detect_changes",
55+
"get_architecture",
56+
"get_code_snippet",
57+
"get_graph_schema",
58+
"index_repository",
59+
"index_status",
60+
"list_projects",
61+
"manage_adr",
62+
"query_graph",
63+
"search_code",
64+
"search_graph",
65+
"trace_call_path"
66+
],
67+
"trace_call_path": []
68+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def maxConnections():
2+
return 10
3+
4+
5+
def max_connections():
6+
return 20
7+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
max-connections: 100
2+
short: 1
3+

0 commit comments

Comments
 (0)