Skip to content

FE-XXX: Projection coverage orientation and scoping#206

Merged
lunelson merged 1 commit into
nextfrom
ln/fe-xxx-projection-coverage
Jun 11, 2026
Merged

FE-XXX: Projection coverage orientation and scoping#206
lunelson merged 1 commit into
nextfrom
ln/fe-xxx-projection-coverage

Conversation

@lunelson

@lunelson lunelson commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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.

@lunelson lunelson marked this pull request as ready for review June 11, 2026 14:31
Copilot AI review requested due to automatic review settings June 11, 2026 14:31
@cursor

cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
The rewritten migration drops and recreates elicitation_gaps without preserving legacy rows, which is risky for any environment that relied on the old in-place migration path.

Overview
Closes projection-shape-coverage in planning/docs and points the context-pipeline spine at renderer-golden-coverage, including a new scope card that sequences ledger work, workspace/session/exchange renderer goldens, and an honest preview path.

Migration 0004 no longer migrates legacy gap rows through elicitation_gaps_new and typology-name CASE mapping; it drops elicitation_gaps / backlog tables and recreates elicitation_gaps with the D75-L shape (refers_to, self-referential FK). Treat as a breaking reset for existing DBs, not an in-place data upgrade.

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; workspace/workspace-context is documented as deleted/inlined with consumers on session source shapes.

read_workspace_context contract: tool details are flat DTOs (markdownFiles, specs/sessions) without the old { mode, data } wrapper—tests and .pi/agents/README.md align with that.

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

lunelson commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

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

`id`,
`spec_id`,
`refers_to`,
`question`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 405b892. Configure here.

@lunelson lunelson force-pushed the ln/fe-847-turn-boundary-closure branch from 08a9387 to f9f774c Compare June 11, 2026 14:33
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from 405b892 to 408d000 Compare June 11, 2026 14:33

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 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-context and switch workspace context rendering/tools to consume session/workspace-context read 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.

Comment on lines +1 to +6
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
Comment thread src/app/brunch-tui.ts
Comment on lines 129 to 133
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);
@lunelson lunelson force-pushed the ln/fe-847-turn-boundary-closure branch from f9f774c to 0bb1094 Compare June 11, 2026 14:36
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from 408d000 to 0442270 Compare June 11, 2026 14:36
`id`,
`spec_id`,
`refers_to`,
`question`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0442270. Configure here.

@lunelson lunelson force-pushed the ln/fe-847-turn-boundary-closure branch from 0bb1094 to 220c3fa Compare June 11, 2026 14:38
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from 0442270 to 05f84da Compare June 11, 2026 14:38
Comment thread drizzle/0004_gaps_node_kind_reference.sql
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from 05f84da to f1a4bfb Compare June 11, 2026 14:40
@lunelson lunelson force-pushed the ln/fe-847-turn-boundary-closure branch from 220c3fa to 50204ab Compare June 11, 2026 14:40
Comment thread drizzle/0004_gaps_node_kind_reference.sql
@lunelson lunelson force-pushed the ln/fe-847-turn-boundary-closure branch from 50204ab to 4e2e2a0 Compare June 11, 2026 14:42
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from f1a4bfb to 9b81016 Compare June 11, 2026 14:42

@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.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

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

Comment thread drizzle/0004_gaps_node_kind_reference.sql
@lunelson lunelson changed the title orientation and scoping FE-XXX: Projection coverage orientation and scoping Jun 11, 2026
@lunelson lunelson force-pushed the ln/fe-847-turn-boundary-closure branch from 4e2e2a0 to 5939152 Compare June 11, 2026 14:51
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from 9b81016 to 47c4941 Compare June 11, 2026 14:51
Base automatically changed from ln/fe-847-turn-boundary-closure to next June 11, 2026 14:52
Copilot AI review requested due to automatic review settings June 11, 2026 14:55
@lunelson lunelson force-pushed the ln/fe-xxx-projection-coverage branch from 47c4941 to 894a11c Compare June 11, 2026 14:55
@lunelson lunelson merged commit ea4e6eb into next Jun 11, 2026
5 of 7 checks passed
@lunelson lunelson deleted the ln/fe-xxx-projection-coverage branch June 11, 2026 14:56

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 28 out of 28 changed files in this pull request and generated 2 comments.

Comment thread src/app/brunch-tui.ts
Comment on lines 129 to 133
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);
Comment on lines +1 to +7
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` (
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