FE-870: Renderer golden coverage and agent-context tools#228
Conversation
…uash merge The FE-870 squash merge (#217, e4a63fd) reintroduced the exhausted renderer-golden-coverage--graph-render-migration.md scope card in its stale pre-build form (Cards 0-3 shown blocked/not-done), though Cards 0-3 shipped and PLAN records the scope card as retired. Re-delete it so HEAD matches bkp/ln/fe-870-renderer-golden-context-tools and PLAN's "scope card retired" state. No other canonical-doc drift from the restack.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR SummaryMedium Risk Overview Taxonomy drift is closed in code: Process fix: Reviewed by Cursor Bugbot for commit e50a407. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR updates the graph/context rendering surfaces to the newer “house style” (markdown tables + prose projection), embeds a full graph overview inside <specification> context output, and reconciles plan/doc state by re-retiring the previously resurrected graph-render-migration scope card.
Changes:
- Reworks graph rendering:
formatGraphOverviewnow emits legend + plane·band node tables + impact-normalized edge table; neighborhood rendering becomes prose-grouped with optional compaction. - Embeds the shared graph overview into
read_specification_contextoutput (order: Overview → Graph → Gaps → Sessions) and updates golden previews/tests accordingly. - Updates node-kind metadata readiness-band mapping (now pinned by tests) and refreshes SPEC/PLAN/docs to reflect the new canonical sources and retired card state.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/session/tests/context-seed.test.ts | Updates seed assertions to match graph overview markdown tables. |
| src/renderers/specification/specification-context.ts | Embeds a Graph section using the shared graph overview renderer and reorders blocks. |
| src/renderers/specification/tests/specification-context.test.ts | Updates invariants for new Graph block placement/content and removes old graph bullet expectations. |
| src/renderers/specification/previews/specification-context.md | Golden preview updated to include Graph overview tables before gaps/sessions. |
| src/renderers/README.md | Ledger text updated to reflect new graph overview/neighborhood contracts and remaining gaps (e.g., related mode leakage). |
| src/renderers/graph/node-neighborhood.ts | Replaces bracket/bullet dialect with prose sections and adds per-section compaction via maxExpandedEdges. |
| src/renderers/graph/graph-slice.ts | Replaces prior graph-slice variants with the new uncapped G-D overview: legend + node tables + edge table. |
| src/renderers/graph/tests/node-neighborhood.test.ts | Updates option naming/behavior and snapshot expectations for the new neighborhood format. |
| src/renderers/graph/tests/graph-slice.test.ts | Replaces old formatGraphSlice snapshot coverage with formatGraphOverview expectations + new fixture golden. |
| src/renderers/graph/previews/neighborhood-hub-REQ1.md | Updates neighborhood golden to the new prose-grouped format. |
| src/renderers/graph/previews/neighborhood-hub-REQ1-hops2.md | Updates hops=2 neighborhood golden, including ambient-relations footer. |
| src/renderers/graph/previews/neighborhood-hub-REQ1-compact.md | Adds new compacted-section neighborhood golden. |
| src/renderers/graph/previews/neighborhood-hub-REQ1-bounded.md | Removes old “maxEdges omission” golden (no longer applicable). |
| src/renderers/graph/previews/neighborhood-code-health-REQ1.md | Updates neighborhood golden for a real-port fixture to the new format. |
| src/renderers/graph/previews/neighborhood-brunch-self-REQ1.md | Updates brunch-self neighborhood golden to the new format. |
| src/renderers/graph/previews/neighborhood-brunch-self-MOD1-hops2.md | Updates brunch-self hops=2 golden and ambient codes line. |
| src/renderers/graph/previews/graph-slice-code-health-grouped-list.md | Deletes old formatGraphSlice grouped-list golden. |
| src/renderers/graph/previews/graph-slice-code-health-compact-summary.md | Deletes old formatGraphSlice compact-summary golden. |
| src/renderers/graph/previews/graph-slice-category-directions-full-debug.md | Deletes old formatGraphSlice debug golden. |
| src/renderers/graph/previews/graph-slice-brunch-self-grouped-list.md | Deletes old formatGraphSlice brunch-self golden. |
| src/renderers/graph/previews/graph-slice-alpha-grounding-compact-summary.md | Deletes old formatGraphSlice alpha golden. |
| src/renderers/graph/previews/graph-overview-kind-band-spread.md | Adds new golden for the uncapped, sectioned graph overview output. |
| src/graph/schema/nodes.ts | Updates NODE_KIND_METADATA readiness-band assignments (now the pinned source of truth). |
| src/graph/tests/queries.test.ts | Pins NODE_KIND_METADATA mapping to prevent future drift. |
| src/dev/tests/tier-2-harness.test.ts | Updates harness assertions to match the new graph overview output in provider contexts. |
| memory/SPEC.md | Updates spec text/examples to align with REQ* codes and new metadata source-of-truth notes. |
| memory/PLAN.md | Records renderer-golden coverage progress, retires the resurrected scope card, and adds graph-model-doc-retirement. |
| memory/cards/renderer-golden-coverage--graph-render-migration.md | Deletes the resurrected scope card (re-retired). |
| memory/cards/graph--edge-impact-remodel.md | Adds a new proposed card describing the edge-impact metadata remodel plan. |
| docs/design/GRAPH_MODEL.md | Adds “superseded snapshot” banners/notes pointing canonical tables to code/SPEC pending retirement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const header = `${heading} (LSN ${overview.lsn}): ${overview.nodes.length} nodes, ${overview.edges.length} edges`; | ||
| const nodesById = new Map(overview.nodes.map((node) => [node.id, node])); |
| for (const node of nodes) { | ||
| const key = `${node.plane}/${node.kind}`; | ||
| counts.set(key, (counts.get(key) ?? 0) + 1); | ||
| const band = primaryBand(node.kind); | ||
| const key = `${node.plane}\u0000${band}`; | ||
| nodeGroups.set(key, [...(nodeGroups.get(key) ?? []), node]); |
| const band = primaryBand(node.kind); | ||
| const key = `${node.plane}\u0000${band}`; | ||
| nodeGroups.set(key, [...(nodeGroups.get(key) ?? []), node]); |

Summary
renderer-golden-coverage--graph-render-migration.mdcard that was resurrected by the squash merge.Verification
npm run check