Commit 90092ae
authored
* feat(impact): pure transport-agnostic walker engine (Tracer 1)
application/impact-engine.ts — single WITH RECURSIVE per (direction, backend),
JS-side merge + dedup + summary. Backends:
- calls (symbol-level, up=callers / down=callees)
- dependencies (file-level)
- imports (file-level, resolved_path only)
Plan §D2 backend split, §D6 cycle detection (path-string + instr), §D8 edge
tags. 27 unit tests cover: walks (up/down/both), depth caps, limit caps,
self-loop + 3-cycle, file-vs-symbol resolution, --via skipped_backends.
* feat(impact): cmd-impact.ts CLI verb wired into main + bootstrap (Tracer 2)
- src/cli/cmd-impact.ts — parser + runner mirroring cmd-show.ts shape
- main.ts dispatch, bootstrap.ts validateIndexModeArgs + printCliUsage
- 14 parser tests cover happy paths + 9 error cases (--depth/limit/direction/via validation)
Smoke: `bun src/index.ts impact src/db.ts --direction up --depth 1` lists
the real fan-in on this repo (every file in src/ that depends on db.ts).
`bun src/index.ts impact handleQuery --json --summary` returns the summary
shape ready for jq pipelines.
* feat(impact): MCP impact tool wired through tool-handlers (Tracer 3)
- impactArgsSchema + handleImpact in tool-handlers.ts (Zod + ToolResult shape)
- registerImpactTool in mcp-server.ts (one-line wrapper, like show/snippet)
- 5 MCP integration tests (tools/list, symbol target, file target, summary
trims matches but keeps summary.nodes count, Zod rejects float depth)
HTTP POST /tool/impact lights up automatically next tracer via the existing
http-server.ts dispatcher (one switch arm).
* feat(impact): HTTP POST /tool/impact dispatcher (Tracer 4)
- TOOL_NAMES gains 'impact' (auto-listed in /tools)
- dispatchTool switch arm with Zod validation (400 on bad body)
- 4 integration tests: happy path, missing target, non-int depth, bad direction enum
Both transports (MCP + HTTP) now expose impact via the same handleImpact
pure function.
* docs(impact): sync README + architecture + glossary + agent rule/skill + changeset (Tracer 5)
- README.md: new 'Impact analysis' code block + impact in MCP tools list
- docs/architecture.md: 'Impact wiring' section + impact-engine in application/ inventory
- docs/glossary.md: 'codemap impact / impact tool' entry under I (full envelope spec)
- docs/roadmap.md: drop the impact backlog item (it shipped)
- docs/research/fallow.md: Adjacent-shipped bullet referencing PR #49 (plan) + #50 (impl)
- .agents/rules/codemap.md + templates/agents/rules/codemap.md: new table row + 'Impact' paragraph + impact in MCP tools list (Rule 10 lockstep)
- .agents/skills/codemap/SKILL.md + templates/agents/skills/codemap/SKILL.md: impact tool description (Rule 10 lockstep)
- .changeset/codemap-impact.md: minor — full design rationale + decisions
- docs/plans/impact.md: deleted per docs-governance Rule 3 (canonical descriptions now live in architecture / glossary / README)
* chore(impact): slim self-authored comments per concise-comments rule
Re-read every comment authored in this PR; cut/slim ones a teammate could
re-derive in <30s. Targets:
- impact-engine.ts: drop trivial type doc, slim findImpact JSDoc, slim
termination heuristic from 6 lines → 2, drop redundant inline notes
- cmd-impact.ts + tool-handlers.ts: shorten the --summary trim explanation
No behaviour change; checks green (89 tests + lint + typecheck).
* chore(impact): apply CodeRabbit nitpicks 1+4
- impact-engine.ts:333 — one-line comment explaining empty-string file_path
fallback (external/dynamic call sites)
- impact-engine.test.ts:209 — strengthen exact-fit limit test from
not.toBe('limit') to toBe('exhausted')
Pushed back on nitpicks 2+3 (hallucinated — see PR comment) and 5 (style;
deterministic order is fine to lock).
1 parent c76f09a commit 90092ae
22 files changed
Lines changed: 1528 additions & 182 deletions
File tree
- .agents
- rules
- skills/codemap
- .changeset
- docs
- plans
- research
- src
- application
- cli
- templates/agents
- rules
- skills/codemap
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | | - | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
149 | 158 | | |
150 | 159 | | |
151 | 160 | | |
152 | | - | |
| 161 | + | |
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
| |||
0 commit comments