Skip to content

FE-1091: Renderer golden coverage and prompt assembly lock, Part 2#270

Open
lunelson wants to merge 24 commits into
nextfrom
ln/fe-1091-renderer-golden-coverage-b
Open

FE-1091: Renderer golden coverage and prompt assembly lock, Part 2#270
lunelson wants to merge 24 commits into
nextfrom
ln/fe-1091-renderer-golden-coverage-b

Conversation

@lunelson

@lunelson lunelson commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

  • Live elicitor prompt assembly. New focused 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.
  • Suspended legacy runtime + prompt resources. Old runtime/ compose/policy/state and superseded skills/lenses/methods/strategies prompt resources moved under _suspended/ with TOPOLOGY notes, removed from the live path.
  • Topology convention. Directory README.md orientation docs renamed to TOPOLOGY.md across src/**, matching the materialized layout; prompts/registry.ts moved under prompts/.
  • Test hygiene. Dropped brittle static sentinels and prose-policing checks; behavior is asserted through structured outputs, active tool policy, and dynamic Markdown/renderer goldens.
  • Build config. tsconfig/vite adjustments for the new layout.

lunelson and others added 18 commits June 29, 2026 11:25
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>

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

lunelson added 5 commits June 29, 2026 16:26
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
@lunelson lunelson changed the title Establish live elicitor topology. FE-1091: Renderer golden coverage and prompt assembly lock, Part 2 Jun 29, 2026
@lunelson lunelson marked this pull request as ready for review June 29, 2026 15:54
Copilot AI review requested due to automatic review settings June 29, 2026 15:54
@cursor

cursor Bot commented Jun 29, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are primarily documentation, skill text, lint ignore patterns, and markdown-link CI steps; no application runtime logic appears in this diff slice.

Overview
Part 2 of FE-1091 continues the agents / prompt assembly closure; this diff is mostly convention, workflow, and repo hygiene that locks the remodel in place.

Topology convention. AGENTS.md and the ln-* skills (ln-build, ln-plan, ln-spec, ln-sync, ln-scope, ln-refactor, ln-review) now treat src/**/TOPOLOGY.md as the canonical co-located topology artifact (ownership, SPEC decision citations, dependency direction, migration notes). References to directory README.md for that role are retargeted; architecture docs point RPC/Pi seams at src/rpc/TOPOLOGY.md and src/.pi/TOPOLOGY.md.

Verification. AGENTS.md documents npm run check:markdown-links (remark-validate-links on AGENTS.md and src) as part of npm run verify and npm run check (alongside skills and data-model checks). fix also runs markdown-link validation after lint/format.

Tooling. Oxlint ignores src/**/_suspended/**, matching suspended legacy runtime/prompt material called out in the frontier description.

Docs / state. Root HANDOFF.md is removed after reconciliation. docs/README.md moves testing guides under docs/praxis/; README.md gets table formatting and the seeded-RPC link update. Some root README.md prose still names src/**/README.md for topology—worth aligning in a follow-up if TOPOLOGY.md is now authoritative everywhere.

Reviewed by Cursor Bugbot for commit 0ba6a84. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dd56d24. Configure here.

Signed-off-by: Lu Nelson <ln@hash.ai>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mdTOPOLOGY.md across src/**, 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.mddb/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.mdTOPOLOGY.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.

Comment on lines +73 to +77
const prompt = composeLiveElicitorPrompt({
sessionState: state,
spec: resolvedPromptContext.spec,
workspace: resolvedPromptContext.workspace,
context,
...(resolvedPromptContext.context ? { context: resolvedPromptContext.context } : {}),
Comment on lines 81 to 94
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 [];
}
Comment on lines +28 to +37
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));
}
Comment on lines +9 to +17
## Available tools:

${toolsList}

In addition to the tools above, you may have access to other custom tools depending on the project.

## Guidelines:

${guidelines}
Copilot AI review requested due to automatic review settings June 29, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 219 out of 273 changed files in this pull request and generated 4 comments.

Comment on lines +87 to 94
if (state.operationalMode === 'elicit' && state.agentRole === 'elicitor') {
return activeToolNamesForLiveElicitor({
registeredToolNames: pi.getAllTools().map((tool) => tool.name),
devAllowedToolNames,
});
}
return [];
}
Comment on lines +32 to +36
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.
Comment thread src/graph/schema/nodes.ts
}

const GHERKIN_THEN_FIELD = 'then';
const GHERKIN_THEN_FIELD = ['th', 'en'].join('') as 'then';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants