Skip to content

FE-735: Mode shell and fixture driver (M1)#144

Merged
lunelson merged 18 commits into
nextfrom
ln/fe-735-mode-shell-fixture-driver
Jun 2, 2026
Merged

FE-735: Mode shell and fixture driver (M1)#144
lunelson merged 18 commits into
nextfrom
ln/fe-735-mode-shell-fixture-driver

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

FE-735: Add print snapshot transport shell

FE-735: Add named JSON-RPC stdio skeleton

FE-735: Project elicitation exchanges from JSONL

FE-735: Project real Pi JSONL exchanges

FE-735: Scope session exchange RPC to current session

FE-735: Add RPC print snapshot parity smoke

FE-735: Add fixture capture bundle skeleton

FE-735: Seed deterministic fixture briefs

FE-735: Scope capture seam review fixes

FE-735: Stabilize current session capture

FE-735: Reconcile fixture brief format docs

FE-735: Use Pi session entry types for exchange projection

FE-735: Report Brunch-owned fixture metadata version

FE-735: Capture scripted brief runs

@lunelson lunelson changed the title FE-735: Add print snapshot transport shell FE-735: Mode shell and fixture driver (M1) May 27, 2026
@lunelson lunelson marked this pull request as ready for review May 27, 2026 16:31
@cursor
Copy link
Copy Markdown

cursor Bot commented May 27, 2026

PR Summary

Medium Risk
Headless boot and session reopen semantics changed for RPC/print/capture; impact is mitigated by broad tests and runbook checks, but wrong session selection would break replay fixtures.

Overview
M1 mode shell and first fixture driver land on the same Brunch host as the TUI: brunch --mode print renders a workspace snapshot and exits without an agent turn; brunch --mode rpc serves newline-delimited JSON-RPC with workspace.snapshot and session.elicitationExchanges (coordinator-selected session only, no raw file params).

New elicitation exchange projection derives prompt/response spans from Pi JSONL (assistant, tool results, structured prompts/responses). Fixture capture copies the selected session transcript plus Brunch-owned .meta.json (projection summary, deferred graph/coherence); a scripted-deterministic path seeds briefs #1#3 as JSON under .brunch-fixtures/ with committed scripted-001 replay bundles.

Workspace session coordinator now persists currentSessionFile, reopens the selected session on headless paths, and supports createNewSpec for per-brief captures. Planning/docs mark mode-shell-and-fixture-driver complete and advance active work to jsonl-session-viability; fixture strategy and SPEC clarify transport vs agent modes and JSON brief format. ./runbooks/verify-m1.sh plus unit/integration tests cover RPC, print/RPC parity, capture, and replay projection parity.

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

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 27, 2026

🤖 Augment PR Summary

Summary: This PR delivers M1 “mode shell + fixture driver” support by adding headless transport modes and the first deterministic fixture capture loop.

Changes:

  • Adds runBrunchCli() with --mode print (snapshot-only) and --mode rpc (newline JSON-RPC over stdio), while keeping TUI mode intact.
  • Introduces a product-shaped WorkspaceSnapshot projection and a human-readable print renderer.
  • Adds a minimal JSON-RPC adapter with named methods (workspace.snapshot, session.elicitationExchanges) scoped to the coordinator-selected session.
  • Implements elicitation-exchange projection over Pi JSONL transcripts and disk loader utilities.
  • Adds fixture brief library loading (JSON briefs) and a fixture capture path that writes .jsonl + .meta.json bundles.
  • Seeds three deterministic briefs and commits scripted capture bundles under .brunch-fixtures/.
  • Extends the workspace session coordinator to persist/reopen the selected session file via .brunch/state.json.
  • Adds a runbook (runbooks/verify-m1.sh) plus unit tests covering print/RPC parity and fixture replay/projection parity.

Technical notes: The RPC surface is intentionally thin (named method families over projections), and print mode is treated as a transport proof-of-life rather than an agent turn.

🤖 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. 2 suggestions posted.

Fix All in Augment

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

): Promise<WorkspaceSessionReadyState["session"]> {
await ensureWorkspaceDirs(cwd)
const files = await listSessionFiles(cwd)
const manager = currentSessionFile
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 27, 2026

Choose a reason for hiding this comment

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

currentSessionFile is read from .brunch/state.json, so a stale/tampered path here can throw (breaking print/RPC) and also cause bindSessionToSpec to rewrite an unexpected file. Consider guarding that it exists and is within .brunch/sessions/ (and falling back when invalid) before calling SessionManager.open().

Severity: medium

Fix This in Augment

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

}

function isPromptSideEntry(entry: SessionEntry): boolean {
if (isCustomTranscriptEntry(entry) && entry.customType.includes("prompt")) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 27, 2026

Choose a reason for hiding this comment

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

isPromptSideEntry() only treats custom(_message) entries as prompt-side when customType contains "prompt", so other model-visible injected custom_message entries (e.g. brunch/world_update/v1) would be omitted from promptEntryIds/ranges. If those injections are meant to be part of the prompt span between user turns, the current projection will silently drop them.

Severity: medium

Fix This in Augment

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

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 2 potential issues.

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 e32eb02. Configure here.


const role = roleOf(entry)
return role === "assistant" || role === "toolResult"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prompt-side classification uses fragile substring match

Medium Severity

isPromptSideEntry uses customType.includes("prompt") as a substring match, while isResponseSideEntry uses an explicit Set (STRUCTURED_RESPONSE_TYPES). This asymmetry means any future custom entry type containing "prompt" anywhere in its name (e.g. brunch.prompt_history, brunch.user_prompt_feedback) would silently be classified as prompt-side, potentially corrupting exchange projections. The response side is already guarded against this with an allowlist pattern.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e32eb02. Configure here.

Comment thread runbooks/verify-m1.sh
@lunelson lunelson self-assigned this Jun 2, 2026
@lunelson lunelson requested a review from kostandinang June 2, 2026 13:34
Base automatically changed from ln/fe-729-walking-skeleton to next June 2, 2026 17:28
@lunelson lunelson force-pushed the ln/fe-735-mode-shell-fixture-driver branch from e32eb02 to eca7505 Compare June 2, 2026 17:29
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Jun 2, 2026

Merge activity

  • Jun 2, 5:29 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@lunelson lunelson merged commit 38d2c2a into next Jun 2, 2026
6 checks passed
@lunelson lunelson deleted the ln/fe-735-mode-shell-fixture-driver branch June 2, 2026 17:30
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