Skip to content

FE-1575: Resume one Brunch workpiece and Petrinaut document across tabs - #9537

Open
lunelson wants to merge 29 commits into
ln/fe-1574-direct-voice-fluefrom
ln/fe-1575-resumable-workpiece-petrinaut
Open

FE-1575: Resume one Brunch workpiece and Petrinaut document across tabs#9537
lunelson wants to merge 29 commits into
ln/fe-1574-direct-voice-fluefrom
ln/fe-1575-resumable-workpiece-petrinaut

Conversation

@lunelson

@lunelson lunelson commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🌟 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 available to Start 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

  • The parent transport PR, #9528
  • Cold-reader semantic adjudication of fixture/workpiece honesty and correspondence
  • Product-manager execution of the local two-tab demo without an engineer

🔍 What does this change?

  • Adds a stable, explicitly test-authored crew-reservation fixture with distinct fixture, conversation, workpiece, and Petrinaut document identities.
  • Delivers prepared workpiece revision zero exactly once as a tagged, idempotent Flue system/dispatch signal and selects later genuine assistant workpiece revisions without rewriting history.
  • Admits only the canonical Petrinaut document read and addArc as mutation-side tools for this fixture (the docs reader and interactive-widget tools stay answerable), normalizes the narrow provider input exercised by the witness, and returns correlated client-tool results through the same Flue route.
  • Adds a runtime settled manifest that advances only when conversation, workpiece, mutation result, and document state form one observable coherent bundle; stale or partial state remains visible and cannot replace the prior settled bundle.
  • Adds a labelled fixture selector and status banner (shown only when Brunch is configured), owns the brunch-fixture search key on the index route so Petrinaut's URL writes keep the fixture selected, adds automatic local document persistence, same-fixture second-tab recovery, focused failure tests, user documentation, a Petrinaut changeset, and retained browser evidence.
🏗️ 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 addArc request → 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/:instanceId transport; 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 addArc carrier 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

  • The accepted witness used the production dev processes behind yarn dev:brunch, a fresh Playwright context, the mounted Flue route, a real configured provider credential, and ?brunch-fixture=crew-reservation-v1.
  • Canonical conversation: conv_01M1NV5WZETMYEGGMFXNYDSTRS.
  • Correlated mutation call: toolu_01BQukCZTAhJ64VNE7oC1CWG.
  • The provider emitted arc weight "1". normalizePetrinautAiToolInput (owned by petrinaut-core) coerces a finite numeric-string weight to a number before canonical validation wherever the addArc tool is defined, including validated-construction mode; it is one narrow coercion, and no broader nested-input repair is claimed.
  • The first browser witness is retained as immutable history but superseded for acceptance because its assistant workpiece mislabelled authorship and its correlation artifact omitted parsed canonical input. The r2 witness corrects both issues.
  • Cold-reader semantic adjudication and the product-manager demo remain human-reserved acceptance gates. No persona suite replaced them.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

  • Mission closure still requires the cold-reader adjudication and product-manager demo listed above.
  • The proof is local-only. Mission 8 stopped before remote deployment, so remote replacement durability is not claimed.
  • The corrected r2 witness supersedes the first retained witness for acceptance.
  • App-wide lint retains pre-existing warning-only findings; this PR introduces no lint errors.
  • Review round (six bot findings) addressed in 0164989: the index route now owns the brunch-fixture search key so URL writes no longer drop the fixture; the selector and fixture URL fall back to the ordinary demo when Brunch is unconfigured; the fixture's browser tool catalog keeps the always-mounted docs reader answerable; workpiece revisions are numbered by the history rather than by manifest count, so a model revision that settles first is never labelled revision zero; and an unchanged-document mutation result no longer claims the requested state already existed. The addArc weight normalization was found to apply to the shared tool definition rather than the fixture alone; the description above now says so instead of the code being narrowed.

Final review fixes (ce0ac400b3): the index route keys the stateful demo by validated fixture mode, so an in-place query transition atomically opens the fixture document/handle; and a selected coherent manifest now reports revalidating rather than preparing while canonical history reconnects, without claiming the workpiece is currently available. Focused route-identity, settlement-hook, and rendered-banner tests cover both cases.

🐾 Next steps

  • Mission 7: make every consequential element in the demo net resolve to exact conversation evidence or visibly refuse.
  • Mission 9: broaden this viable mutation seam into repeatable, traceable projection of one meaningful region.

🛡 What tests cover this?

  • Core workpiece parsing, provenance, hashing, and latest-eligible revision selection.
  • Prepared-signal idempotency and built-agent read/mutation/continuation integration.
  • SDCPN fixture-only tool advertisement and canonical schema derivation.
  • AI SDK transport projection, input normalization, deterministic submission keys, and client-tool history correlation.
  • Petrinaut mutation application, rejected inputs, duplicate/no-op handling, and exact document structure.
  • Website fixture preparation, bundle resolution, stale/partial-state refusal, settled-manifest advancement, history hydration, and second-tab identity continuity.
  • The affected Brunch, transport, plugin, Petrinaut, and website builds, type checks, and lint checks passed on 2026-09-04.

❓ How to test this?

  1. Run yarn dev:brunch.
  2. Open http://127.0.0.1:4915/?brunch-fixture=crew-reservation-v1.
  3. Confirm the fixture is visibly labelled test-authored/prepared and the target input arc is absent.
  4. Tell Brunch that final inspection uses the single dispatch crew and sign-off releases it.
  5. Wait for the coherent bundle to settle; confirm exactly one weight-1 input arc now connects Dispatch crew available to Start final inspection.
  6. Open the same URL in a second tab and confirm the fixture, conversation, workpiece, document, and settled-manifest identities match.
  7. Submit a non-mutating follow-up in Tab B and confirm Brunch replies in the same conversation without another prepared source or addArc call.

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

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
petrinaut Ready Ready Preview Sep 8, 2026 10:36am UTC
petrinaut-docs Ready Ready Preview Sep 8, 2026 10:36am UTC
2 Skipped Deployments
Project Deployment Actions Updated
hash Ignored Ignored Preview Sep 8, 2026 10:36am UTC
hashdotdesign-tokens Ignored Ignored Preview Sep 8, 2026 10:36am UTC

Request Review

@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/tests New or updated tests area/apps labels Sep 4, 2026
@lunelson lunelson changed the title Cut Mission 6 resumable fixture authority FE-1575: Resume one Brunch workpiece and Petrinaut document across tabs Sep 4, 2026
@lunelson
lunelson marked this pull request as ready for review September 4, 2026 13:30
Copilot AI balanced review requested due to automatic review settings September 4, 2026 13:30
@cursor

cursor Bot commented Sep 4, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
New cross-cutting contracts (workpiece provenance, settlement gates, client-tool rehydration) affect conversation continuity and mutation correlation; scope is mostly fixture-local but errors could stall turns or mis-label revisions if misconfigured.

Overview
Introduces a test-authored crew-reservation prepared fixture that ties canonical Flue history, Markdown runbook workpieces, and a live Petrinaut net through one browser demo (?brunch-fixture=crew-reservation-v1), with a Petrinaut patch so no-op document mutations return as not applied rather than “already satisfied.”

Workpiece and agent plumbing moves runbook-IR selection and hashing into shared @hashintel/brunch-agent/workpiece, adds app-level recoverRunbookWorkpiece, and registers fixture-scoped Petrinaut client tools alongside the docs reader. Runbook artifact recovery delegates to that selector; a hermetic built-agent integration proves idempotent prepared-signal delivery, workpiece provenance, and consecutive client-tool continuations.

AI SDK / Flue transport gains deterministic idempotencyKeys on user and client-tool sends, optional per-host client-tool catalogs and input normalization, and history projection that folds client-tool results back onto assistant messages (including deferred refresh before observation starts).

Local-storage demo adds preparation via tagged Flue dispatch, a settled manifest that advances only when workpiece, completed settlement, correlated successful addArc, and document state align (otherwise refuses and keeps the prior bundle), content-addressed coherent SDCPN snapshots, route brunch-fixture search preservation, fixture-only when Brunch is configured, status banner/selector, and hooks for second-tab recovery.

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

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

Stale Bugbot comment from a previous run.

Comment thread apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx Outdated
@lunelson
lunelson force-pushed the ln/fe-1575-resumable-workpiece-petrinaut branch from ec85958 to 23e19e6 Compare September 7, 2026 07:33
@lunelson
lunelson changed the base branch from ln/fe-1574-direct-voice-flue to graphite-base/9537 September 7, 2026 07:33
@lunelson
lunelson requested review from a team as code owners September 7, 2026 07:33
@github-actions github-actions Bot added type/eng > backend Owned by the @backend team area/tests > playwright New or updated Playwright tests type/legal Owned by the @legal team labels Sep 7, 2026
lunelson and others added 16 commits September 8, 2026 09:57
Add dispositions G1 to G22 to the decision log, revise the mini spec to its
third state with the settled-revision protocol, typed basis, verifiable
transition record, document reconciliation, readiness ownership, and probe
decision tables, and retain the follow-up review as design evidence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ared basis

Rewrite the Mission 7 draft at cut-level detail as the consolidated
construct-and-explain mission with a two-step authority, probe decision
tables, and a conversion map; recut Mission 9 as repeatable projection
breadth over the Mission 7 seam; re-express Missions 10 and 11 over settled
revisions, declared basis, and transition records with three-gate readiness
for the handoff; and record the provenance relations and tool admission
locks plus a lossless planning-content migration matrix in MISSION.next.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Point the Deferred section at the 2026-09-04 provenance replanning, carry the
fixture-authorship and fenced-block admissions into the close record, and note
in Status that no other section of the live authority changed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Record dispositions H0 to H12 in the decision log, fix revision identity to
the tool call id, make the transition record and elicited evidence relation
precise, replace every oracle gap in the Step A leaves with an exact
prospective test, artifact, or adjudication, classify probe outcomes as
eligible, rework, or terminal stop under the owner's no-narrowing rule, give
the two-step authority a lawful document shape, and add the pre-cut owner
checklist and the ask/sweep keep-remove-archive inventory.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…revision numbering

The index route now owns the brunch-fixture search key beside the shared
example contract, so a selection write no longer drops the prepared
fixture mid-session. The fixture selector and fixture URL fall back to
the ordinary demo while Brunch is unconfigured, the fixture's browser
tool catalog keeps the always-mounted docs reader answerable, workpiece
revisions are numbered by the history rather than by manifest count, and
an unchanged-document mutation result no longer claims the requested
state already existed.
const runbookIrFencePattern = /```runbook-ir\s*\n([\s\S]*?)```/gu;

export const latestRunbookIrBlock = (text: string): string | undefined => {
const matches = [...text.matchAll(runbookIrFencePattern)];

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

Stale Bugbot comment from a previous run.

@kostandinang kostandinang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This proves a useful end-to-end fixture path while keeping conversation, workpiece, and document identities explicit.

One boundary question: libs/@hashintel/brunch-agent/packages/core/src/workpiece.ts is described as substrate-neutral, but createPreparedWorkpieceDelivery and the preparedWorkpieceSignal* constants encode the Flue signal/delivery envelope and are consumed from plugin-sdcpn/src/flue.ts. Our current package boundary keeps Flue-native production resources behind ./flue. Is this an intentional new precedent? Could the delivery-specific pieces move under ./flue or remain fixture-local, leaving ./workpiece responsible only for workpiece parsing and selection?

@kostandinang kostandinang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Following a deeper pass, I found two issues that block the cross-tab coherence claim:

  1. crew-reservation-settled-manifest.ts includes the observer's settledAt and conversation offset in manifestId, while use-crew-reservation-settled-manifest.ts persists the snapshot and manifest separately without rejecting revision or offset regression. Two tabs can derive different identities for the same logical bundle, and a stale writer can replace a newer manifest. Please derive identity from canonical bundle data and make publication monotonic or atomic.

  2. In local-storage-demo-app.tsx, settlement reads the synchronized stored document while Petrinaut continues rendering the existing active handle until an explicit load/create replaces it. A tab can therefore show stale canvas state beside another tab's newer settled bundle. Please reconcile the active handle or visibly refuse the stale tab.

These need resolving before approval because they undermine the PR's central two-tab coherence proof.

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

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 1e5315f. Configure here.

resumableAssistant.parts.push(...parts);
// Live continuations start a new step. Keep that boundary after reopen
// so completedClientToolResults still selects only the latest step.
resumableAssistant.parts.push({ type: "step-start" }, ...parts);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Step-start strands pending client tools

High Severity

Inserting step-start when folding a waiting assistant reply while a client tool is still pending creates a trailing step with no tool. After reopen, lastAssistantMessageIsCompleteWithToolCalls only inspects that last step, so the completed browser result is never auto-submitted and the turn stalls.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1e5315f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

4 participants