Skip to content

FE-539: Explicit phase outcomes and scope closure#33

Merged
lunelson merged 5 commits into
mainfrom
ln/fe-539-explicit-phase-outcomes-scope-closure
Apr 10, 2026
Merged

FE-539: Explicit phase outcomes and scope closure#33
lunelson merged 5 commits into
mainfrom
ln/fe-539-explicit-phase-outcomes-scope-closure

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

@lunelson lunelson commented Apr 8, 2026

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 8, 2026

FE-539 Explicit phase outcomes and scope closure

Replace pure is_resolution semantics with explicit phase outcomes and user-confirmed scope closure. Scope mode closes when framing sufficiency is reached, not just when the model feels done.

Acceptance

  • Scope mode proposes closure with a summary
  • User confirms
  • Explicit phase outcome persists
  • The project shows updated workflow state

FE-567 Phase-aware observer extraction

Teach the observer to bias extraction by interview mode: scope prefers framing and constraints, design prefers decisions and assumptions, and later modes surface requirements, criteria, and revisions.

Acceptance

  • Scope turns primarily yield framing and constraints
  • Design turns primarily yield decisions and assumptions
  • Observer results still stream in-band to the sidebar

Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 8, 2026

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

@lunelson lunelson changed the title docs: re-sequence phase 5 and 6 around scope closure and knowledge redesign FE-567: Explicit phase outcomes + scope closure Apr 9, 2026
@lunelson lunelson changed the title FE-567: Explicit phase outcomes + scope closure FE-539: Explicit phase outcomes + scope closure Apr 9, 2026
@lunelson lunelson marked this pull request as ready for review April 9, 2026 12:29
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 9, 2026

🤖 Augment PR Summary

Summary: This PR replaces implicit “resolution” semantics for scope with an explicit, persisted phase-outcome/readiness record and a user-confirmed closure flow.

Changes:

  • Adds a new phase_outcome table + migration to persist proposed/confirmed/superseded outcomes per project/phase.
  • Extends server DB utilities to create/confirm outcomes, reconcile/supersede them when the active path changes, and project a per-phase workflow state.
  • Updates GET /api/projects/:id to include projected workflow alongside turns.
  • Adds a new interviewer tool (propose_phase_closure) and shared Zod schemas for proposal output and data-phase-summary parts.
  • Updates POST /api/projects/:id/chat to accept typed data-confirmation user parts, confirm a proposed outcome, and emit a typed data-phase-summary when a proposal is created.
  • Updates the workspace controller/UI to show scope workflow status in the header, render a scope-closure confirmation card, and submit confirmations via typed chat parts.
  • Adds server and client tests covering proposal streaming, confirmation persistence, workflow projection, and supersession on upstream path changes.

Technical Notes: Workflow readiness is derived from the latest non-superseded outcome whose proposal turn remains on the active path; confirmations are carried through the same chat transport via typed data parts for durable replay/hydration.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/shared/chat.ts
observerResultPartSchema,
phaseSummaryPartSchema,
askQuestionToolPartSchema,
proposePhaseClosureToolPartSchema,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/shared/chat.ts:295 — assistantPartsSchema now accepts tool-propose_phase_closure, but BrunchAssistantPart (used for persisted assistant parts elsewhere) doesn’t include that variant, so the code relies on unsafe casts and downstream handling may silently ignore this new tool part.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread src/server/interview.ts
execute: async (input) => {
createPhaseOutcome(db, {
projectId,
phase: input.phase,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/server/interview.ts:111 — createProposePhaseClosureTool() receives the current phase but persists phase: input.phase, so a malformed/LLM-mistaken tool call could write a phase outcome for a different phase than the turn’s actual mode.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.


void sendMessage({
parts: [
{ type: 'text', text: 'Confirm scope closure' },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/client/workspace/workspace-controller.ts:113 — confirmPhaseClosure() hardcodes the text "Confirm scope closure" even though data-phase-summary includes a phase; if a non-scope closure is ever proposed (or the model emits the wrong phase), the UI/confirmation text will be misleading while still confirming the proposal by turnId.

Severity: medium

Other Locations
  • src/client/routes/InterviewWorkspace.tsx:64
  • src/client/routes/InterviewWorkspace.tsx:78

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

? { kind: 'persisted-turn', turn: lastTurn }
const latestPhaseSummary = findPhaseSummary(messages);
const phaseSummary =
latestPhaseSummary && (isLoading || workflow.phases[latestPhaseSummary.phase].status === 'proposed')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/client/workspace/workspace-controller-core.ts:284 — phaseSummary is shown only while isLoading or when workflow.phases[phase].status === 'proposed', which can briefly hide the confirmation card after streaming ends but before router.invalidate() refreshes workflow, causing a flicker/momentary prompt re-enable.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lunelson lunelson changed the title FE-539: Explicit phase outcomes + scope closure FE-539: Explicit phase outcomes and scope closure Apr 10, 2026
Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 10, 2026

Merge activity

  • Apr 10, 11:44 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 10, 11:47 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 10, 11:48 AM UTC: @lunelson merged this pull request with Graphite.

@lunelson lunelson changed the base branch from ln/fe-567-phase-aware-observer-extraction to graphite-base/33 April 10, 2026 11:45
@lunelson lunelson changed the base branch from graphite-base/33 to main April 10, 2026 11:46
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.

1 participant