FE-1091: Renderer golden coverage and prompt assembly lock, Part 2#270
FE-1091: Renderer golden coverage and prompt assembly lock, Part 2#270lunelson wants to merge 24 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Drop file-topology and prose-policing checks in agents and Pi tests, keep dynamic Markdown golden coverage, and assert behavior through structured outputs and active tool policy instead.
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
PR SummaryLow Risk Overview Topology convention. Verification. Tooling. Oxlint ignores Docs / state. Root Reviewed by Cursor Bugbot for commit 0ba6a84. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dd56d24. Configure here.
| gaps: world.gaps, | ||
| agentBody, | ||
| }); | ||
| }).prompt; |
There was a problem hiding this comment.
Execute mode breaks agent start
Medium Severity
The before_agent_start hook always calls composeLiveElicitorPrompt, which throws when runtime state is execute/executor. Any transcript-backed execute mode (tests, resumed sessions, or a future mode switch) can error on the next agent turn instead of using an executor prompt path or skipping the live elicitor assembly.
Reviewed by Cursor Bugbot for commit dd56d24. Configure here.
Signed-off-by: Lu Nelson <ln@hash.ai>
There was a problem hiding this comment.
Pull request overview
This PR continues FE-1091 by (a) locking the remaining renderer/prompt-assembly surfaces into snapshot (“golden”) coverage, and (b) completing the src/agents/ topology remodel (including the _suspended/ quarantine and TOPOLOGY.md convention). It also introduces a new “live elicitor” prompt assembly path (src/agents/runtime/elicitor/) and routes SPEC-mode prompting through it.
Changes:
- Added live SPEC-mode elicitor prompt assembly (context + active-tool policy) with golden snapshots; moved/isolated legacy runtime/skill taxonomy under
_suspended/and excluded it from build/lint/test discovery. - Renamed/standardized orientation docs from
README.md→TOPOLOGY.mdacrosssrc/**, updating references accordingly. - Simplified/updated tests to prefer file snapshots over brittle substring sentinels; adjusted RPC/runtime projections to drop strategy/lens from public posture.
Reviewed changes
Copilot reviewed 219 out of 273 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Moves defineConfig to vitest/config and excludes _suspended from Vitest discovery. |
| tsconfig.json | Excludes src/**/_suspended/** from TS program roots. |
| tsconfig.build.json | Excludes tests + _suspended from build config. |
| .oxlintrc.json | Ignores _suspended subtree in linting. |
| src/README.md | Updates top-level src/ topology notes to reflect new agents/runtime structure. |
| src/app/TOPOLOGY.md | Adds app-layer topology documentation. |
| src/app/pi-settings.ts | Adds getThemeSetting to audited getters list. |
| src/app/brunch-tui.ts | Updates session runtime factory wiring for new runtime-state/tool/prompt assumptions. |
| src/app/tests/pi-session-options.test.ts | Updates tests to match new thinking-level handling. |
| src/workspace/TOPOLOGY.md | Introduces workspace layer topology documentation. |
| src/scripts/TOPOLOGY.md | Introduces scripts layer topology documentation. |
| src/web/TOPOLOGY.md | Updates web topology references (rpc/TOPOLOGY.md, graph/TOPOLOGY.md). |
| src/session/schema/TOPOLOGY.md | Adds session/schema topology documentation and dependency rules. |
| src/session/workspace-overview-context.ts | Updates import path for workspace context renderer under new contexts layout. |
| src/session/specification-overview-context.ts | Updates import path for specification context renderer under new contexts layout. |
| src/graph/index.ts | Updates canonical reference to src/graph/TOPOLOGY.md. |
| src/graph/seed-fixtures.ts | Updates docs reference from db/README.md → db/TOPOLOGY.md. |
| src/graph/schema/nodes.ts | Adjusts Gherkin “then” field constant usage (and downstream tests). |
| src/graph/schema/tests/generate-ontology-ref.test.ts | Updates assertion to match new Gherkin “then” field constant string form. |
| src/graph/tests/mutate-graph-edge-schema.test.ts | Updates tests to use computed “then” field key. |
| src/graph/tests/command-executor.test.ts | Updates tests to use computed “then” field key. |
| src/rpc/TOPOLOGY.md | Updates references to graph/TOPOLOGY.md. |
| src/rpc/methods/session.ts | Removes strategy/lens fields from runtime state schema branch (elicit/elicitor). |
| src/rpc/tests/handlers.test.ts | Updates handler test fixtures to match runtime projection changes. |
| src/probes/faux-provider.ts | Refactors provider config construction into clearer base/stream variants. |
| src/projections/graph/overview.ts | Updates “Used by” reference to new contexts path. |
| src/projections/graph/commit-result.ts | Updates “Used by” reference to new contexts path. |
| src/projections/graph/reconciliation-needs.ts | Updates “Future users” reference to new contexts path. |
| src/projections/tests/topology-boundaries.test.ts | Tightens boundary test to forbid any _suspended imports from session projections. |
| src/projections/session/tests/runtime-state.test.ts | Updates tests to ensure legacy strategy ids parse but are not projected as public posture. |
| src/projections/session/tests/readiness-estimate.test.ts | Removes brittle “not imported by legality paths” sentinel. |
| src/dev/tests/faux-harness.test.ts | Updates harness prompt assertions to match live elicitor control block. |
| src/agents/TOPOLOGY.md | Adds canonical agents/ topology and boundary rules. |
| src/agents/shared/TOPOLOGY.md | Documents formatting-helper ownership. |
| src/agents/subagents/TOPOLOGY.md | Renames/readjusts subagents topology doc. |
| src/agents/prompts/TOPOLOGY.md | Updates prompts topology to reflect new registry location and ownership. |
| src/agents/prompts/registry.ts | Moves body registry into prompts/ and removes prompt-resource registry helpers. |
| src/agents/prompts/executor.md | Rewrites executor prompt body (now contains unresolved template placeholders). |
| src/agents/prompts/tests/registry.test.ts | Adds minimal registry contract test for prompt bodies. |
| src/agents/skills/TOPOLOGY.md | Adds skills topology and quarantine boundary notes. |
| src/agents/skills/capture/TOPOLOGY.md | Adds capture skill topology doc. |
| src/agents/skills/capture/SKILL.md | Adds capture skill stub (Agent Skills format). |
| src/agents/skills/elicitation/SKILL.md | Adds elicitation skill stub (Agent Skills format). |
| src/agents/skills/projection/SKILL.md | Adds projection skill stub (Agent Skills format). |
| src/agents/skills/review/SKILL.md | Adds review skill stub (Agent Skills format). |
| src/agents/skills/synthesis/SKILL.md | Adds synthesis skill stub (Agent Skills format). |
| src/agents/skills/projection/references/technical-design.md | Renames/retitles and reformats design projection reference. |
| src/agents/skills/capture/slice-*.md | Updates references/links to new heuristics/ontology locations. |
| src/agents/skills/capture/references/readiness-bands.md | Adds readiness-bands reference content. |
| src/agents/skills/_suspended/** | Adds/updates suspended taxonomy topology + resource bodies under new quarantine path. |
| src/agents/runtime/TOPOLOGY.md | Adds runtime topology doc describing live elicitor vs suspended controls. |
| src/agents/runtime/shared/TOPOLOGY.md | Adds runtime shared helpers topology doc. |
| src/agents/runtime/elicitor/TOPOLOGY.md | Adds live elicitor runtime topology doc. |
| src/agents/runtime/elicitor/context.ts | Implements plain live elicitor context rendering. |
| src/agents/runtime/elicitor/active-tools.ts | Implements fixed allowed-tool policy for live elicitor. |
| src/agents/runtime/elicitor/compose-live-prompt.ts | Implements live elicitor prompt assembly with snapshot coverage. |
| src/agents/runtime/elicitor/tests/* | Adds tests for live prompt assembly + tool allowlist. |
| src/agents/runtime/elicitor/snapshots/live-elicitor-prompt.md | Adds golden snapshot for composed live elicitor prompt. |
| src/agents/runtime/_suspended/** | Relocates legacy runtime policy/compose/state/prompt-skill plumbing under quarantine. |
| src/agents/contexts/data-model/** | Moves “model-state” renderers under contexts/data-model/ and updates imports/tests/snapshots. |
| src/agents/contexts/exchanges/** | Adds exchange renderer topology + snapshot-based tests for markdown formatting. |
| src/agents/contexts/seeds/** | Updates seed composition to use new renderer paths and adds/updates snapshots. |
| src/agents/contexts/about/*.md | Adds new “about” docs (one appears truncated). |
| src/agents/contexts/_suspended/TOPOLOGY.md | Adds quarantine topology doc for legacy context controls. |
| src/.pi/TOPOLOGY.md | Renames .pi/README.md → TOPOLOGY.md and updates prompting notes. |
| src/.pi/extensions/TOPOLOGY.md | Renames extensions README → TOPOLOGY and documents new prompting dependency. |
| src/.pi/extensions/subagents/agents.ts | Defines subagent markdown parsing/loading; enforces empty skills lists. |
| src/.pi/extensions/subagents/prompt-assembly.ts | Removes prompt-resource manifest rendering from background prompt assembly. |
| src/.pi/extensions/subagents/tests/agents.test.ts | Adds a focused test for bundled subagent loading. |
| src/.pi/extensions/agent-runtime/runtime/index.ts | Changes active-tool policy wiring to live-elicitor allowlist and adds blocked tool enforcement. |
| src/.pi/extensions/agent-runtime/system-prompts/index.ts | Routes prompting through live elicitor composer (currently unguarded for execute mode). |
| src/.pi/extensions/commands/index.ts | Removes readiness-based caution annotations from lens/strategy pickers. |
| src/.pi/extensions/chrome/index.ts | Updates chrome status line to show role instead of strategy/lens. |
| src/.pi/extensions/chrome/TOPOLOGY.md | Updates chrome topology notes for D98 semantics. |
| src/.pi/extensions/brunch-data/** | Updates imports to new agents/contexts/data-model/ locations. |
| src/.pi/extensions/dev-mode/*/TOPOLOGY.md | Adds new dev-mode extension topology docs. |
| src/.pi/extensions/tests/* | Updates tests to match new runtime/tool/prompt behavior. |
| src/.pi/components/tests/workspace-dialog.test.ts | Removes brittle file/manifest sentinels from UI component test. |
| docs/praxis/ln-skills.md | Updates co-located topology doc convention to src/**/TOPOLOGY.md. |
| docs/design/STRUCTURED_EXCHANGE_COLLAPSE.md | Updates topology doc reference for exchange schemas. |
| docs/design/ONTOLOGY_REVIEW_PROTOCOL.md | Updates reference to suspended commit-graph skill path. |
| docs/architecture/pi-web-comparative.md | Updates references to rpc/TOPOLOGY.md and .pi/TOPOLOGY.md. |
| .agents/skills/ln-*/SKILL.md | Updates skill docs to reference TOPOLOGY.md convention. |
| .agents/skills/ln-plan/references/earned.md | Updates “materialize” language to topology files. |
Comments suppressed due to low confidence (1)
src/agents/contexts/about/brunch-concept.md:22
- The last line is an incomplete sentence (file ends after "require active"). This reads like an accidental truncation and leaves the doc in a broken state.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const prompt = composeLiveElicitorPrompt({ | ||
| sessionState: state, | ||
| spec: resolvedPromptContext.spec, | ||
| workspace: resolvedPromptContext.workspace, | ||
| context, | ||
| ...(resolvedPromptContext.context ? { context: resolvedPromptContext.context } : {}), |
| export function activeToolNamesForBrunchAgentState( | ||
| pi: ExtensionAPI, | ||
| state: ResolvedBrunchAgentState, | ||
| gaps?: readonly ElicitationGap[], | ||
| _gaps?: readonly ElicitationGap[], | ||
| devAllowedToolNames?: readonly string[], | ||
| ): string[] { | ||
| return activeToolNamesForPosture({ | ||
| registeredToolNames: pi.getAllTools().map((tool) => tool.name), | ||
| state, | ||
| gaps: gaps ?? conservativeUncoveredFloorGaps(), | ||
| devAllowedToolNames, | ||
| }); | ||
| if (state.operationalMode === 'elicit' && state.agentRole === 'elicitor') { | ||
| return activeToolNamesForLiveElicitor({ | ||
| registeredToolNames: pi.getAllTools().map((tool) => tool.name), | ||
| devAllowedToolNames, | ||
| }); | ||
| } | ||
| return []; | ||
| } |
| export function activeToolNamesForLiveElicitor({ | ||
| registeredToolNames, | ||
| devAllowedToolNames = [], | ||
| }: LiveElicitorToolPolicyInput): string[] { | ||
| const allowed = new Set<string>(LIVE_ELICITOR_ALLOWED_TOOL_NAMES); | ||
| for (const toolName of devAllowedToolNames) { | ||
| allowed.add(toolName); | ||
| } | ||
| return registeredToolNames.filter((toolName) => allowed.has(toolName)); | ||
| } |
| ## Available tools: | ||
|
|
||
| ${toolsList} | ||
|
|
||
| In addition to the tools above, you may have access to other custom tools depending on the project. | ||
|
|
||
| ## Guidelines: | ||
|
|
||
| ${guidelines} |
| if (state.operationalMode === 'elicit' && state.agentRole === 'elicitor') { | ||
| return activeToolNamesForLiveElicitor({ | ||
| registeredToolNames: pi.getAllTools().map((tool) => tool.name), | ||
| devAllowedToolNames, | ||
| }); | ||
| } | ||
| return []; | ||
| } |
| const allowed = new Set<string>(LIVE_ELICITOR_ALLOWED_TOOL_NAMES); | ||
| for (const toolName of devAllowedToolNames) { | ||
| allowed.add(toolName); | ||
| } | ||
| return registeredToolNames.filter((toolName) => allowed.has(toolName)); |
|
|
||
| ## Migration Note | ||
|
|
||
| D98-L suspends strategy/lens/method as runtime axes. Useful conduct moves into activity homes only when it is live guidance; historical or compatibility prompt resources remain under `_suspended/` and are not availability by filesystem presence. |
| } | ||
|
|
||
| const GHERKIN_THEN_FIELD = 'then'; | ||
| const GHERKIN_THEN_FIELD = ['th', 'en'].join('') as 'then'; |



Part 2 of FE-1091 (Part 1: #267). Locks the remaining RENDER-stage prompt assembly into golden, reviewable state and finishes the
src/agents/topology remodel.What changed
src/agents/runtime/elicitor/(context.ts,active-tools.ts,compose-live-prompt.ts) with a golden snapshot. Pi prompting now routes through this live assembly path instead of incidental string composition.runtime/compose/policy/state and superseded skills/lenses/methods/strategies prompt resources moved under_suspended/with TOPOLOGY notes, removed from the live path.README.mdorientation docs renamed toTOPOLOGY.mdacrosssrc/**, matching the materialized layout;prompts/registry.tsmoved underprompts/.