Skip to content

Commit a8cf25b

Browse files
feat(recipes): call-path and symbol-neighborhood trace recipes (#131)
* feat(recipes): add call-path and symbol-neighborhood trace recipes Ship cycle-safe call-path tracing and depth-bounded symbol neighborhood exploration with golden fixtures — recipe half of the MCP trace plan. * docs: link PR 131 in agent-surface delivery tracker * fix(recipes): address trace recipe review findings Prefer call paths over file imports for via=all; document via modes and neighborhood depth semantics; expand golden coverage; changeset patch bump.
1 parent f5374b8 commit a8cf25b

20 files changed

Lines changed: 766 additions & 15 deletions

.changeset/trace-recipes.md

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 `call-path` and `symbol-neighborhood` query recipes for cycle-safe call-graph tracing and bidirectional symbol exploration.

docs/plans/agent-surface-delivery.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
## Quick resume
1212

13-
| Next action | Detail |
14-
| -------------------- | ------------------------------------------------------------------------------------------ |
15-
| **Review / merge** | PR 3 stack — parse worker hardening (`feat/parse-worker-hardening`) when open |
16-
| **Start next** | **PR 4**trace recipes or **PR 5**`affected-tests-recipe` (parallel after PR 3 lands) |
17-
| **Do not start yet** | PR 6 (MCP trace tools) until PR 4 land; PR 9 (eval harness) until PR 8 |
13+
| Next action | Detail |
14+
| -------------------- | ----------------------------------------------------------------------------------- |
15+
| **Review / merge** | PR 4 — trace recipes ([#131](https://github.com/stainless-code/codemap/pull/131)) |
16+
| **Start next** | **PR 5**`affected-tests-recipe` or **PR 6**MCP trace tools (after PR 4 lands) |
17+
| **Do not start yet** | PR 6 until PR 4 lands; PR 9 (eval harness) until PR 8 |
1818

1919
Update the table below when a PR merges or a new branch opens.
2020

@@ -35,15 +35,15 @@ Merge each PR to `main` directly. No long-lived integration branch (`feat/agent-
3535

3636
Max **3 parallel tracks** at once.
3737

38-
| PR | Plans | Status | Blocked by | Parallel with |
39-
| ----- | ----------------------------------------------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------- | --------------------------------- |
40-
| **3** | [`index-lock-and-error-log`](./index-lock-and-error-log.md)[`parse-worker-hardening`](./parse-worker-hardening.md) (stack) | open | [#129](https://github.com/stainless-code/codemap/pull/129) merged; worker hardening in flight | 4, 5 |
41-
| **4** | Recipe half of [`mcp-trace-explore-tools`](./mcp-trace-explore-tools.md) (`call-path`, `symbol-neighborhood` SQL + tests) | planned | | 3, 5 |
42-
| **5** | [`affected-tests-recipe`](./affected-tests-recipe.md) | planned || 3, 4 |
43-
| **6** | MCP half of trace (`trace` / `explore` / `node` tools) + update instructions | planned | PR 1, PR 4 ||
44-
| **7** | [`field-qualified-search`](./field-qualified-search.md) | planned | PR 1 | 4, 5 if `mcp-server.ts` untouched |
45-
| **8** | [`agents-init-mcp-wiring`](./agents-init-mcp-wiring.md) | planned | PR 1 | 3–5 |
46-
| **9** | [`agent-eval-harness`](./agent-eval-harness.md) | planned | PR 1, PR 8, allowlist | **last P1** |
38+
| PR | Plans | Status | Blocked by | Parallel with |
39+
| ----- | ----------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
40+
| **3** | [`index-lock-and-error-log`](./index-lock-and-error-log.md)[`parse-worker-hardening`](./parse-worker-hardening.md) (stack) | merged | [#129](https://github.com/stainless-code/codemap/pull/129), [#130](https://github.com/stainless-code/codemap/pull/130) | 4, 5 |
41+
| **4** | Recipe half of [`mcp-trace-explore-tools`](./mcp-trace-explore-tools.md) (`call-path`, `symbol-neighborhood` SQL + tests) | open | [#131](https://github.com/stainless-code/codemap/pull/131) | 3, 5 |
42+
| **5** | [`affected-tests-recipe`](./affected-tests-recipe.md) | planned | | 3, 4 |
43+
| **6** | MCP half of trace (`trace` / `explore` / `node` tools) + update instructions | planned | PR 1, PR 4 ||
44+
| **7** | [`field-qualified-search`](./field-qualified-search.md) | planned | PR 1 | 4, 5 if `mcp-server.ts` untouched |
45+
| **8** | [`agents-init-mcp-wiring`](./agents-init-mcp-wiring.md) | planned | PR 1 | 3–5 |
46+
| **9** | [`agent-eval-harness`](./agent-eval-harness.md) | planned | PR 1, PR 8, allowlist | **last P1** |
4747

4848
**Parallelization constraints**
4949

docs/plans/mcp-trace-explore-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
### `call-path`
2525

26-
- Params: `from_name`, `to_name`, optional `max_depth`, `via` (`calls` | `dependencies` | `all`)
26+
- Params: `from`, `to`, optional `max_depth`, `via` (`calls` | `dependencies` | `all`)
2727
- SQL: recursive CTE on `calls` (+ optional `dependencies` UNION)
2828
- Output: ordered path rows `{file_path, caller_name, callee_name, line_start}`
2929

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"file_path": "src/consumer.ts",
4+
"caller_name": "run",
5+
"callee_name": "createClient",
6+
"line_start": 24,
7+
"hop": 1,
8+
"via": "calls"
9+
},
10+
{
11+
"file_path": "src/api/client.ts",
12+
"caller_name": "createClient",
13+
"callee_name": "setupTransport",
14+
"line_start": 21,
15+
"hop": 2,
16+
"via": "calls"
17+
},
18+
{
19+
"file_path": "src/api/client.ts",
20+
"caller_name": "setupTransport",
21+
"callee_name": "handshake",
22+
"line_start": 29,
23+
"hop": 3,
24+
"via": "calls"
25+
}
26+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"file_path": "src/consumer.ts",
4+
"caller_name": "src/consumer.ts",
5+
"callee_name": "src/api/client.ts",
6+
"line_start": 0,
7+
"hop": 1,
8+
"via": "dependencies"
9+
}
10+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"file_path": "src/api/client.ts",
4+
"caller_name": "createClient",
5+
"callee_name": "setupTransport",
6+
"line_start": 21,
7+
"hop": 1,
8+
"via": "calls"
9+
},
10+
{
11+
"file_path": "src/api/client.ts",
12+
"caller_name": "setupTransport",
13+
"callee_name": "handshake",
14+
"line_start": 29,
15+
"hop": 2,
16+
"via": "calls"
17+
}
18+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)