FE-1575: Resume one Brunch workpiece and Petrinaut document across tabs - #9537
FE-1575: Resume one Brunch workpiece and Petrinaut document across tabs#9537lunelson wants to merge 13 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…nsport Prepare one honestly labelled crew-reservation fixture whose starting workpiece enters canonical Flue history exactly once as a tagged system dispatch signal with idempotent retry, scope the read/`addArc` client tools to that fixture, settle a runtime manifest only after conversation, workpiece, and document state are observable, and surface a visible refusal when the mounted Brunch route is absent. The fixture rides Mission 5's landed browser `ChatTransport`: the panel transport keeps the conversation tracker and accepts fixture-scoped client tool names as an option, the history hook keeps the live observation and additionally exposes the observed snapshot with its offset, and AI SDK user sends carry a deterministic idempotency key. The real two-tab witness remains blocked on the configured Anthropic credential; the blocker and handoff are recorded in the FE-1575 evidence note. No persona testing was run.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview Shared workpiece logic moves into The Petrinaut local-storage demo gains preparation via an idempotent tagged dispatch signal, a runtime settled manifest (refuses partial or uncorrelated mutations), content-addressed document snapshots, configurable brunch panel transport, and UI to select and status the fixture. Transport/history paths add idempotency keys and fixture-aware client-tool projection. Petrinaut / petrinaut-core patch reports duplicate AI mutations as no-ops ( Reviewed by Cursor Bugbot for commit ec85958. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ec85958. Configure here.
| useCrewReservationSettledManifestStorage(); | ||
| const crewReservationFixtureSelected = isCrewReservationFixtureSelected( | ||
| window.location.search, | ||
| ); |
There was a problem hiding this comment.
Fixture query param is dropped
High Severity
Fixture mode is gated on a raw brunch-fixture query that the index route’s validateSharedExampleSearch contract does not own. Any Petrinaut search write replaces the URL with contract keys only, so the param disappears and the session drops fixture tools and the stable conversation id.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit ec85958. Configure here.
| export const crewReservationFixtureClientToolNames = [ | ||
| getLatestNetDefinitionToolName, | ||
| "addArc", | ||
| ] as const satisfies readonly PetrinautAiToolName[]; |
There was a problem hiding this comment.
Fixture catalog omits docs reader
Medium Severity
The fixture replaces the browser client-tool catalog with only getLatestNetDefinition and addArc. The SDCPN plugin still mounts readPetrinautDoc as a client-awaiting tool, so a docs read cannot be executed or returned through the Flue route and the turn stalls.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ec85958. Configure here.
There was a problem hiding this comment.
🟡 Changes recommended
One critical settlement revision bug and three moderate correctness/configuration issues remain unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a prepared Brunch/Petrinaut fixture that preserves its canonical conversation, Markdown workpiece, document mutation, and settled state across browser tabs.
Changes:
- Adds fixture-scoped workpiece recovery, Petrinaut tools, and idempotent Flue transport.
- Persists coherent document snapshots and settled manifests for cross-tab recovery.
- Adds focused tests, documentation, changesets, and browser evidence.
File summaries
| File | Description |
|---|---|
yarn.lock |
Records the hashing dependency. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/apply-petrinaut-ai-mutation.ts |
Handles mutation outcomes and no-ops. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/apply-petrinaut-ai-mutation.test.ts |
Tests mutation outcomes. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel.tsx |
Uses the extracted mutation helper. |
libs/@hashintel/petrinaut/docs/ai-assistant.md |
Documents prepared fixtures and settlement. |
libs/@hashintel/petrinaut-core/src/ai.ts |
Normalizes provider arc weights. |
libs/@hashintel/petrinaut-core/src/ai.test.ts |
Tests weight normalization. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/test/ui-stream.test.ts |
Tests streamed input mapping. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/test/client-tool-history.test.ts |
Tests call/result history extraction. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/test/chat-transport.test.ts |
Tests deterministic admission keys. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/src/ui-stream.ts |
Maps streamed client-tool inputs. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/src/transcript.ts |
Maps hydrated client-tool inputs. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/src/index.ts |
Exports history APIs and adds idempotency. |
libs/@hashintel/brunch-agent/packages/transport-aisdk/src/client-tool-history.ts |
Extracts canonical client-tool history. |
libs/@hashintel/brunch-agent/packages/plugin-sdcpn/test/construction-tools.test.ts |
Tests fixture tool restrictions. |
libs/@hashintel/brunch-agent/packages/plugin-sdcpn/src/tools/petrinaut-construction.ts |
Defines fixture construction tools and normalization. |
libs/@hashintel/brunch-agent/packages/plugin-sdcpn/src/flue.ts |
Mounts fixture-specific instructions and tools. |
libs/@hashintel/brunch-agent/packages/core/vite.config.ts |
Builds the workpiece subpath. |
libs/@hashintel/brunch-agent/packages/core/test/workpiece.test.ts |
Tests workpiece delivery and selection. |
libs/@hashintel/brunch-agent/packages/core/src/workpiece.ts |
Implements canonical workpiece recovery. |
libs/@hashintel/brunch-agent/packages/core/package.json |
Exports the workpiece API. |
libs/@hashintel/brunch-agent/docs/mission-drafts/9-traceable-projection.md |
Updates Mission 9 prerequisites. |
libs/@hashintel/brunch-agent/docs/mission-drafts/7-capture-backed-review.md |
Updates Mission 7 prerequisites. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-resumable-workpiece-petrinaut.md |
Records implementation evidence. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/witness.md |
Records the superseded witness. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/tab-b-correlation.json |
Records resumed-tab correlation. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/SHA256SUMS |
Protects witness integrity. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/settled-manifest-tab-b.json |
Captures resumed settled state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/settled-manifest-before.json |
Captures initial settled state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/settled-manifest-after.json |
Captures mutated settled state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/route-evidence.json |
Records mounted-route evidence. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/prepared-workpiece.md |
Retains prepared revision zero. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/latest-workpiece.md |
Retains the revised workpiece. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/definition-tab-b.json |
Retains resumed document state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/definition-before.json |
Retains initial document state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/definition-after.json |
Retains mutated document state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/cold-reader-records.json |
Retains adjudication inputs. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/cold-reader-gate.md |
Defines the human gate. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04/call-result-correlation.json |
Records original tool correlation. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/witness.md |
Records the corrected witness. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/tab-b-correlation.json |
Records corrected resumed-tab correlation. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/SHA256SUMS |
Protects corrected witness integrity. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/settled-manifest-tab-b.json |
Captures corrected resumed state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/settled-manifest-before.json |
Captures corrected initial state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/settled-manifest-after.json |
Captures corrected mutated state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/run-metadata.json |
Records corrected run inputs. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/route-evidence.json |
Records corrected route evidence. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/prepared-workpiece.md |
Retains corrected prepared input. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/latest-workpiece.md |
Retains the model-produced revision. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/flue-snapshot-before.json |
Captures initial canonical history. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/definition-tab-b.json |
Retains corrected resumed document state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/definition-before.json |
Retains corrected initial document state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/definition-after.json |
Retains corrected mutated document state. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/cold-reader-records.json |
Retains corrected adjudication records. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/cold-reader-gate.md |
Defines corrected human review. |
libs/@hashintel/brunch-agent/docs/evidence/implementations/fe-1575-outer-browser-witness-2026-09-04-r2/call-result-correlation.json |
Records normalized tool correlation. |
apps/petrinaut-website/src/main/app/voice-interview/voice-preview.integration.test.ts |
Updates Voice idempotency expectations. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-prepare-crew-reservation-conversation.ts |
Prepares the fixture conversation. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-prepare-crew-reservation-conversation.test.ts |
Tests preparation failures. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-local-storage-sdcpns.ts |
Stores coherent document snapshots. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-flue-chat-history.ts |
Exposes canonical history snapshots. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-flue-chat-history.test.ts |
Tests canonical history projection. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-crew-reservation-settled-manifest.ts |
Maintains settled bundle state. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-crew-reservation-settled-manifest.test.ts |
Tests refusal and persistence behavior. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-crew-reservation-fixture-session.ts |
Coordinates fixture preparation and settlement. |
apps/petrinaut-website/src/main/app/local-storage-demo/resolve-crew-reservation-bundle.ts |
Resolves coherent workpiece/document revisions. |
apps/petrinaut-website/src/main/app/local-storage-demo/resolve-crew-reservation-bundle.test.ts |
Tests coherent bundle resolution. |
apps/petrinaut-website/src/main/app/local-storage-demo/prepared-fixture-banner.tsx |
Displays fixture and settlement status. |
apps/petrinaut-website/src/main/app/local-storage-demo/prepared-fixture-banner.test.tsx |
Tests fixture status rendering. |
apps/petrinaut-website/src/main/app/local-storage-demo/prepared-crew-reservation-fixture.ts |
Defines the prepared fixture. |
apps/petrinaut-website/src/main/app/local-storage-demo/prepared-crew-reservation-fixture.test.ts |
Tests fixture boundaries and structure. |
apps/petrinaut-website/src/main/app/local-storage-demo/prepare-crew-reservation-conversation.ts |
Creates or recovers revision zero. |
apps/petrinaut-website/src/main/app/local-storage-demo/prepare-crew-reservation-conversation.test.ts |
Tests idempotent preparation. |
apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx |
Integrates the fixture into the browser demo. |
apps/petrinaut-website/src/main/app/local-storage-demo/crew-reservation-history.ts |
Defines fixture history state. |
apps/petrinaut-website/src/main/app/local-storage-demo/brunch-panel-transport.ts |
Adds fixture-scoped transport options. |
apps/petrinaut-website/src/main/app/local-storage-demo/brunch-panel-transport.test.ts |
Tests fixture transport behavior. |
apps/petrinaut-website/package.json |
Adds browser SHA-256 support. |
apps/brunch-agent/test/workpiece.test.ts |
Tests hashed workpiece recovery. |
apps/brunch-agent/test/runbook-artifacts.test.ts |
Uses shared workpiece APIs. |
apps/brunch-agent/test/prepared-workpiece.integration.ts |
Exercises the built fixture workflow. |
apps/brunch-agent/test/prepared-workpiece.integration.test.ts |
Verifies the integration script. |
apps/brunch-agent/test/architecture/boundaries.test.ts |
Registers the architecture suite. |
apps/brunch-agent/test/architecture/boundaries.integration.ts |
Updates package-boundary expectations. |
apps/brunch-agent/src/evaluations/runbook/headless-petrinaut-client.ts |
Accepts an initial Petrinaut definition. |
apps/brunch-agent/src/evaluations/runbook/artifacts.ts |
Reuses canonical workpiece recovery. |
apps/brunch-agent/src/evaluations/persona/proof-artifacts.ts |
Uses the relocated recovery helper. |
apps/brunch-agent/src/conversation/workpiece.ts |
Adds Flue-specific workpiece hashing. |
apps/brunch-agent/src/conversation/client-tools.ts |
Registers fixture client tools. |
.changeset/resumable-petrinaut-workpiece.md |
Declares Petrinaut patch releases. |
Review details
- Files reviewed: 102/109 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| return { status: "settled", manifest: input.previous }; | ||
| } | ||
| const revision = (input.previous?.revision ?? -1) + 1; |
| settlementStatus={crewReservationSession.settlementStatus} | ||
| /> | ||
| )} | ||
| {!preparedFixtureIsCurrent && <PreparedFixtureSelector />} |
| const normalizedInput = normalizePetrinautAiToolInput( | ||
| toolName, | ||
| context.dataset.value, | ||
| ); | ||
| const parsed = canonicalTool.inputSchema.safeParse(normalizedInput); |
| if (isSDCPNEqual(definition, instance.definition.get())) { | ||
| return { | ||
| applied: false, | ||
| reason: `${summary.title} was a no-op because the document already had that state.`, |


🌟 What is the purpose of this PR?
Determine whether one canonical Brunch conversation can maintain a useful Markdown workpiece, make one meaningful change to the Petrinaut document open in the browser, and resume the same coherent conversation/workpiece/document bundle in another tab.
This joins the real browser panel to the mounted Flue conversation route introduced by the parent PR. The retained two-tab witness establishes single-fixture browser-backed viability: one honestly labelled prepared crew-reservation case gained exactly one weight-1 input arc from
Dispatch crew availabletoStart final inspection, then reopened and continued without duplicate preparation, mutation, or identity drift.This does not establish automatic full-net projection, capture-backed provenance, broad scenario coverage, behavioral execution, remote durability, or concurrent collaboration.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
addArcoperations for this fixture, normalizes the narrow provider input exercised by the witness, and returns correlated client-tool results through the same Flue route.🏗️ Agent notes
Mission contract
Imperative: Determine whether one canonical Brunch conversation can maintain a useful Markdown workpiece and drive a meaningful browser-side Petrinaut change without reviving a comprehensive typed domain IR. The visible advance is: Brunch edits the net being viewed from the conversation, and the work survives closing the tab.
Throughline: Stable prepared-fixture selector → distinct fixture/document/conversation identities → idempotent tagged revision-zero dispatch → canonical Flue history hydration → latest eligible Markdown workpiece recovery → one realistic confirming turn → fixture-scoped canonical document read and
addArcrequest → browser validation/execution → original call-id result through the same Flue route → coherent settled manifest → second-tab reopen and real follow-up in the same conversation.Proof: The corrected production-browser witness records one prepared source, one model-produced revision, one canonical weight-1 input arc, one unique correlated successful mutation result, matching settled identities/hashes in Tab B, and a completed non-mutating follow-up without duplicate preparation or mutation. Focused tests cover preparation idempotency, append-only workpiece selection, tool scoping, call/result correlation, no-op and rejected mutations, mismatch refusal, and content-addressed fallback to the prior coherent document. The proof is limited to this prepared local fixture.
Constraints: Flue remains the canonical conversation log; Markdown remains the semantic workpiece; Petrinaut owns schemas, validation, mutation, and document state; fixture, conversation, workpiece, and document identities stay distinct; the browser uses the parent PR's mounted
/agents/chat/:instanceIdtransport; construction tools remain unavailable to unrelated conversations; no second event log, comprehensive process ontology, graph database, workflow engine, explicit Save flow, or remote durability claim is introduced.Fog-line: The narrow shallow
addArccarrier succeeded, including provider string-to-number normalization, but broader nested provider schemas remain unproved. The witness found message id plus SHA-256 sufficient for this fixture's workpiece revision and found localStorage mirroring sufficient for this same-browser two-tab path; neither result proves broader revision storage, concurrent editing, or cross-store transactions.Stop or reorient: Stop if preparation hides authorship, identities collapse, traffic bypasses the mounted Flue route, transcript prose replaces the workpiece as construction input, parser acceptance substitutes for semantic correspondence, call ids or document targeting are lost, partial state advances the settled manifest, stale Tab B state is silently selected, fixture-only mutations leak to ordinary conversations, or the work widens into later provenance/projection/deployment missions.
Deferred: Mission 7 owns capture-backed visible why/provenance and broken-link refusal. Mission 9 owns repeatable automatic projection and broader nested provider-schema classes. Remote replacement durability remains with Mission 8. Concurrent editing, cross-store commit machinery, and promotion of this prepared fixture re-enter only under observed strain or a named later consumer.
Implementation record
yarn dev:brunch, a fresh Playwright context, the mounted Flue route, a real configured provider credential, and?brunch-fixture=crew-reservation-v1.conv_01M1NV5WZETMYEGGMFXNYDSTRS.toolu_01BQukCZTAhJ64VNE7oC1CWG."1"; only the fixture's canonical Petrinaut tool input is normalized to numeric1. No broader nested-input repair is claimed.r2witness corrects both issues.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
r2witness supersedes the first retained witness for acceptance.🐾 Next steps
🛡 What tests cover this?
❓ How to test this?
yarn dev:brunch.http://127.0.0.1:4915/?brunch-fixture=crew-reservation-v1.Dispatch crew availabletoStart final inspection.addArccall.📹 Demo
The corrected witness includes Tab A before/after and Tab B screenshots, canonical Flue snapshots, document definitions, settled manifests, correlation artifacts, workpieces, and checksums.