Skip to content

Commit a085ec6

Browse files
feat(substrate): type_heritage table and recipe rewire (#142)
* docs(plans): add type-heritage-substrate plan for lifting recipe limits Documents the substrate path to replace signature parsing in type-ancestors and type-descendants; links from roadmap and agent-surface related plans. * docs(delivery): mark #141 merged; track type-heritage-substrate as in flight * feat(substrate): type_heritage table and recipe rewire Add AST-backed type_heritage extraction, import-aware resolve pass, and rewire type-ancestors/type-descendants to JOIN substrate rows. Schema bump 34→35; heritage-qualified fixture; goldens refreshed.
1 parent bd5a1fa commit a085ec6

41 files changed

Lines changed: 1149 additions & 517 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@stainless-code/codemap": patch
3+
---
4+
5+
Add `type_heritage` substrate and rewire `type-ancestors` / `type-descendants` recipes to JOIN indexed heritage edges instead of parsing `symbols.signature`.

docs/architecture.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,25 @@ Edges are deduped per (caller_scope, callee, call vs constructor) per file: if `
269269
| is_optional | INTEGER | 1 if `?` modifier present |
270270
| is_readonly | INTEGER | 1 if `readonly` modifier present |
271271

272+
### `type_heritage` — Class/interface extends and implements edges (`STRICT`)
273+
274+
| Column | Type | Description |
275+
| ------------------- | ---------- | -------------------------------------------------------------------------------------- |
276+
| id | INTEGER PK | Auto-increment row id |
277+
| child_file_path | TEXT FK | File defining the child type |
278+
| child_name | TEXT | Child class or interface name |
279+
| child_kind | TEXT | `class` or `interface` |
280+
| child_line_start | INTEGER | Child definition line |
281+
| relation | TEXT | `extends` or `implements` |
282+
| base_simple_name | TEXT | Unqualified base name used for graph walks |
283+
| base_qualified_name | TEXT | Qualified base when present (e.g. `pkg.Type`); nullable |
284+
| base_file_path | TEXT | Resolved definition file (null until resolve pass) |
285+
| base_symbol_id | INTEGER FK | Resolved `symbols.id` (null when unresolved) |
286+
| resolution_kind | TEXT | `same-file`, `imported`, `qualified-unresolved`, or `unresolved` |
287+
| type_args | TEXT | Comma-separated generic args when present (display only; walks use `base_simple_name`) |
288+
289+
Populated at parse time from oxc AST; `heritage-resolver` fills `base_file_path` / `base_symbol_id` after bindings on full rebuild (scoped on incremental). Powers `type-ancestors` and `type-descendants` recipes.
290+
272291
### `imports` — Import statements (`STRICT`)
273292

274293
| Column | Type | Description |

docs/plans/agent-surface-and-ops.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ Details: [agents.md](../agents.md). Merge history: [agent-surface-delivery.md](.
4040

4141
## Related existing plans
4242

43-
| Plan | Relationship |
44-
| ------------------------------------------------------------- | ------------------------------------------------------------------------------ |
45-
| [c9-plugin-layer](./c9-plugin-layer.md) | Prerequisite for [framework-route-extraction](./framework-route-extraction.md) |
46-
| [github-marketplace-action](./github-marketplace-action.md) | May add `affected` mode (shipped CLI/MCP `affected` + `affected-tests` recipe) |
47-
| [perf-triangulation-rollout](./perf-triangulation-rollout.md) | Parse-worker hardening shipped #130; Phase 3 deferrals remain in rollout plan |
43+
| Plan | Relationship |
44+
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
45+
| [c9-plugin-layer](./c9-plugin-layer.md) | Prerequisite for [framework-route-extraction](./framework-route-extraction.md) |
46+
| [github-marketplace-action](./github-marketplace-action.md) | May add `affected` mode (shipped CLI/MCP `affected` + `affected-tests` recipe) |
47+
| [perf-triangulation-rollout](./perf-triangulation-rollout.md) | Parse-worker hardening shipped #130; Phase 3 deferrals remain in rollout plan |
48+
| [type-heritage-substrate](./type-heritage-substrate.md) | Lifts [#141](https://github.com/stainless-code/codemap/pull/141) recipe limits via `type_heritage` substrate |
4849

4950
---
5051

docs/plans/agent-surface-delivery.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
| Next action | Detail |
1414
| ------------------- | --------------------------------------------------------------------------------------------------------------- |
1515
| **Open** | Live MCP agent-eval arms + optional external nightly — [agent-eval-harness.md](./agent-eval-harness.md) |
16-
| **In flight** | [#141](https://github.com/stainless-code/codemap/pull/141)`type-ancestors` / `type-descendants` recipes (P2) |
17-
| **Recently merged** | [#139](https://github.com/stainless-code/codemap/pull/139) — agent-eval probe harness (PR 9) |
16+
| **In flight** | [#142](https://github.com/stainless-code/codemap/pull/142)`type_heritage` substrate |
17+
| **Recently merged** | [#141](https://github.com/stainless-code/codemap/pull/141)`type-ancestors` / `type-descendants` recipes (P2) |
18+
| | [#139](https://github.com/stainless-code/codemap/pull/139) — agent-eval probe harness (PR 9) |
1819
| | [#138](https://github.com/stainless-code/codemap/pull/138) — field-qualified search (PR 7) |
1920
| | Wave 1–2 (#126#137) — see merged rows below; plan tombstones removed per docs-governance |
2021

@@ -57,13 +58,13 @@ Max **3 parallel tracks** at once.
5758

5859
Do not rush with P0/P1. **2–4 separate PRs** after P1 completes.
5960

60-
| Item | Plan | Gate |
61-
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
62-
| Type hierarchy | `type-ancestors` / `type-descendants` recipes (plan deleted — shipped) | open [#141](https://github.com/stainless-code/codemap/pull/141) |
63-
| Framework routes | [`framework-route-extraction`](./framework-route-extraction.md) | Blocked on [`c9-plugin-layer`](./c9-plugin-layer.md) (XL) |
64-
| Call substrate | [`callback-dispatch-synthesis`](./callback-dispatch-synthesis.md), [`unresolved-calls-staging`](./unresolved-calls-staging.md) | One at a time (schema + parser) |
65-
| FTS default | [`fts-default-on-evaluation`](./fts-default-on-evaluation.md) | Measurement-only; solo PR anytime |
66-
| Cross-project root | [`cross-project-mcp-root`](./cross-project-mcp-root.md) | On demand |
61+
| Item | Plan | Gate |
62+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- |
63+
| Type hierarchy | `type-ancestors` / `type-descendants` recipes (plan deleted — shipped) | merged [#141](https://github.com/stainless-code/codemap/pull/141) |
64+
| Framework routes | [`framework-route-extraction`](./framework-route-extraction.md) | Blocked on [`c9-plugin-layer`](./c9-plugin-layer.md) (XL) |
65+
| Call substrate | [`callback-dispatch-synthesis`](./callback-dispatch-synthesis.md), [`unresolved-calls-staging`](./unresolved-calls-staging.md) | One at a time (schema + parser) |
66+
| FTS default | [`fts-default-on-evaluation`](./fts-default-on-evaluation.md) | Measurement-only; solo PR anytime |
67+
| Cross-project root | [`cross-project-mcp-root`](./cross-project-mcp-root.md) | On demand |
6768

6869
---
6970

0 commit comments

Comments
 (0)