FE-XXX: Projection coverage orientation and scoping#206
Conversation
PR SummaryMedium Risk Overview Migration SPEC / PLAN reframe readiness around gap-derived capability-readiness (not grades): pinned goal/strategy/lens stay visible when role/mode-legal while negotiation withholds gated methods/tools;
Reviewed by Cursor Bugbot for commit 894a11c. Bugbot is set up for automated code reviews on this repo. Configure here. |
| `id`, | ||
| `spec_id`, | ||
| `refers_to`, | ||
| `question`, |
There was a problem hiding this comment.
Migration drops existing gap rows
Medium Severity
The rewritten 0004 migration drops elicitation_gaps and recreates it empty, with no INSERT … SELECT from the prior table. Workspaces already at 0003 (or any DB with populated gap rows) lose all elicitation gap state on migrate; existing specs are not re-seeded, so capability-readiness and gap-driven behavior can silently diverge from pre-upgrade data.
Reviewed by Cursor Bugbot for commit 405b892. Configure here.
08a9387 to
f9f774c
Compare
405b892 to
408d000
Compare
There was a problem hiding this comment.
Pull request overview
This PR continues the “orientation and scoping” effort by tightening the context pipeline boundaries (PULL vs PROJECT), removing a no-op workspace-context projection wrapper, and adding/relocating projection invariants so downstream renderers can lock against stable shapes. It also updates agent prompt/authority behavior so readiness negotiation no longer crashes prompt composition and refreshes planning docs/cards for the next renderer-golden frontier.
Changes:
- Inline/delete
projections/workspace/workspace-contextand switch workspace context rendering/tools to consumesession/workspace-contextread shapes directly. - Add/adjust projection invariant tests (workspace-state, transcript-context) and extend topology boundary checks (graph neighborhood stays a direct PULL read).
- Update agent prompt composition policy to keep role/mode-legal pinned axes visible during readiness negotiation; adjust related tests/docs.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/session/README.md | Adds a session PULL read-shape ledger clarifying ownership/consumers. |
| src/renderers/workspace/workspace-state.test.ts | Updates renderer test to use the projected DTO type directly. |
| src/renderers/workspace/workspace-context.ts | Renders workspace context from direct session read shapes (no wrapper projection). |
| src/projections/workspace/workspace-state.test.ts | New invariant tests locking workspace-state projection shape. |
| src/projections/workspace/workspace-context.ts | Deletes the no-op {mode,data} wrapper projection. |
| src/projections/topology-boundaries.test.ts | Adds guard to prevent importing deprecated graph neighborhood projection stub. |
| src/projections/session/transcript-context.test.ts | New invariant test for transcript-context projection behavior. |
| src/projections/session/runtime-state.test.ts | Fixes import paths and updates test naming/structure. |
| src/projections/README.md | Updates projection ledger dispositions and closes remaining ●/◐ rows. |
| src/projections/graph/neighborhood.ts | Marks as deprecated topology stub and clarifies direct-read intent. |
| src/graph/README.md | Updates graph docs to reflect direct-read neighborhood consumption. |
| src/dev/tier-2-harness.test.ts | Updates expected read_workspace_context tool details shape. |
| src/db/connection.test.ts | Adjusts legacy DB test to reflect backlog-era drift handling expectations. |
| src/app/brunch-tui.ts | Changes sidecar advertisement behavior (now only if callback provided). |
| src/.pi/skills/strategies/freestyle.md | Updates wording to capability-readiness terminology. |
| src/.pi/skills/methods/read-context.md | Updates runtime handles wording (soft readiness estimate). |
| src/.pi/extensions/runtime/index.ts | Makes gaps optional and falls back to conservative gaps when absent. |
| src/.pi/extensions/runtime/authority-matrix.test.ts | Adds coverage for conservative-gap fallback behavior. |
| src/.pi/extensions/context/get-cwd.ts | Removes workspace-context projection wrapper from details payload. |
| src/.pi/agents/state.ts | Keeps pinned axes visible when readiness negotiates (no throw on readiness-thin). |
| src/.pi/agents/state.test.ts | Updates tests to reflect pinned-axis retention + gated method filtering. |
| src/.pi/agents/README.md | Documents pinned-axis visibility semantics during negotiation. |
| src/.pi/agents/compose.test.ts | Updates prompt composition tests for readiness-thin pinned selections. |
| src/.pi/tests/context-tools.test.ts | Updates context tool assertions for new details payload shape. |
| memory/SPEC.md | Updates spec narrative to reflect readiness/pinning semantics and coverage status. |
| memory/PLAN.md | Marks projection-shape coverage complete; adds renderer-golden chain pointer. |
| memory/cards/renderer-golden-coverage--render-stage-chain.md | New chain card for the next renderer-golden frontier. |
| drizzle/0004_gaps_node_kind_reference.sql | Rewrites migration (currently destructive; see review comments). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| DROP TABLE IF EXISTS `elicitation_gaps_new`; | ||
| --> statement-breakpoint | ||
| DROP TABLE IF EXISTS `elicitation_gaps`; | ||
| --> statement-breakpoint | ||
| DROP TABLE IF EXISTS `elicitation_backlog`; | ||
| --> statement-breakpoint |
| const webSidecarUrl = webSidecar ? `${webSidecar.url}${routePath}` : null; | ||
| if (webSidecarUrl) { | ||
| (options.advertiseWebSidecar ?? advertiseWebSidecar)(webSidecarUrl); | ||
| options.advertiseWebSidecar?.(webSidecarUrl); | ||
| if (shouldAutoOpenWebSidecar(options.autoOpen, dev)) { | ||
| await (options.openBrowser ?? openBrowser)(webSidecarUrl); |
f9f774c to
0bb1094
Compare
408d000 to
0442270
Compare
| `id`, | ||
| `spec_id`, | ||
| `refers_to`, | ||
| `question`, |
There was a problem hiding this comment.
Migration drops existing gap rows
High Severity
Replacing 0004 with DROP TABLE plus a fresh CREATE TABLE for elicitation_gaps removes every row that existed under the 0003 name-column schema. There is no INSERT/SELECT or other backfill, and createSpec only seeds new specs, so existing workspaces lose capability-readiness and elicitation state after migrate.
Reviewed by Cursor Bugbot for commit 0442270. Configure here.
0bb1094 to
220c3fa
Compare
0442270 to
05f84da
Compare
05f84da to
f1a4bfb
Compare
220c3fa to
50204ab
Compare
50204ab to
4e2e2a0
Compare
f1a4bfb to
9b81016
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9b81016. Configure here.
4e2e2a0 to
5939152
Compare
9b81016 to
47c4941
Compare
47c4941 to
894a11c
Compare
| const webSidecarUrl = webSidecar ? `${webSidecar.url}${routePath}` : null; | ||
| if (webSidecarUrl) { | ||
| (options.advertiseWebSidecar ?? advertiseWebSidecar)(webSidecarUrl); | ||
| options.advertiseWebSidecar?.(webSidecarUrl); | ||
| if (shouldAutoOpenWebSidecar(options.autoOpen, dev)) { | ||
| await (options.openBrowser ?? openBrowser)(webSidecarUrl); |
| DROP TABLE IF EXISTS `elicitation_gaps_new`; | ||
| --> statement-breakpoint | ||
| DROP TABLE IF EXISTS `elicitation_gaps`; | ||
| --> statement-breakpoint | ||
| DROP TABLE IF EXISTS `elicitation_backlog`; | ||
| --> statement-breakpoint | ||
| CREATE TABLE `elicitation_gaps` ( |



Stack Context
This branch sits between FE-847 closure and the FE-852 prompt/driver branch, normalizing the projection surfaces FE-852 consumes.
What?
Threads selected-spec gap/readiness state through prompt, affordance, workspace, and renderer projections; removes stale workspace-context shape; and stages the renderer-golden coverage card.
Why?
Prompt goldens and elicitation-driver selection need one canonical projection path for capability-readiness and context state before their outputs are locked.