demo_agent: an app update keeps the session's lane; restore-lane repairs a moved one (beta.19 P1, goatai#1885) #143
All Vouch review confidence checks passed
Residual risk 0.42 = Change Risk (0.57) × (1 − Review Confidence (0.26)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 49% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #143"
general
weight: 0.35
chatgpt-codex-connector[bot]
Claude-PC: P1 for beta.19. An app update with MT5 open moved a customer terminal into the owner demo lane. This PR makes
install-buildkeep the session's lane and addsrestore-laneto repair terminals that an older update already moved. The desktop half is algogoat/goatai#2222. Coordination is on goatai#1885 (Claude-Mac agreed in comment 5975155476).Root cause (proven on Terminal 3, 2026-10-04 00:25Z)
The desktop's
suite.updatePlanprobes the terminal. With MT5 open, the probe throws and the plan takes the demo path (demoResumeLogin).suite.applyUpdatethen runs the bundleddemo_agent.py install-build --require-running --linked-login --bundle-version --agent-guide-path.DemoAgent._adopt_installed_binaryrebindssession.jsonto the new receipt, and it also wroteauthority_kind = 'demo_direct'on every session:That line is the owner's way to enroll a terminal ("its commands refuse to drive Studio until install-build has converted the selected session"). The desktop update reuses
install-build, so it enrolled every terminal it updated with MT5 open. T3's evidence:demo-agent/backups/session-ea5a19fb….json, written just before the rewrite:authority_kind: native_human_control. The currentsession.jsonreadsdemo_direct.actions.jsonl:before_close,binary_replaced,local_identity_verified(00:25:45), relaunchverified, thenbundle_identity_verified.demo_installed_at.studio close-terminal(Desktopsuite.closeTerminal) refused instudio_research_authority.authority():Demo mutation requires the broker-verified agent tool.Fix
install-buildrebindsinstallation_sha256and keepsauthority_kind:- A customer session stays
native_human_control.- An owner session stays
demo_direct.- A legacy session keeps no kind.
--enter-demo-lanewritesdemo_direct. That flag is the owner explicitly enrolling one of GOAT's own demo terminals. It refuses together with the app's--bundle-version/--agent-guide-path, so an app update can never change a lane. The desktop never passes it.demo_directalready used, instead of closing MT5 again. Enrollment still takes the full path.local_identity_verifiedrows now logauthority_kindandprevious_authority_kind.demo_directterminals behave exactly as before. Build verification, the DLL-carrying relaunch, the readback, "pairing needed" and the receipt write are all unchanged.Behaviour change for the owner: enrolling a new GOAT demo terminal now needs
install-build ... --enter-demo-lane. DEMO-AGENT-TOOLS.md says so. Terminals already ondemo_direct(Banker, T2) need nothing.Repair for terminals an older update moved:
restore-lane--applyrewrites onlysession.json'sauthority_kindand keeps the currentinstallation_sha256. Thedemo_directbytes are saved todemo-agent/backups/and the change is logged asrestore_lane. MT5, the EA, the receipt andstudio.sqliteare untouched.Every proof below must hold, or
restore-lanerefuses:demo_directand bound to the current receipt.demo-agent/backups/holds this tool's own backup of this exact session onnative_human_control, and its content matches its name.native_human_controlauthority.research-authority.json.actions.jsonlhas aninstall_buildidentity row and only update steps:install_build,launch_terminal,readback_refresh,recover_orphan,restore_lane.So an owner terminal that has run demo research always refuses. I scanned this PC read-only: Banker has 17 kinds of owner operations in its log and T2 has 14, so both would refuse. T3 has none.
Not run on T3. I ran only the review against T3's real files, with this branch's code and a G: build Python. It returned
ready_to_restore, with evidencebackups/session-ea5a19fb….json. Every file in T3's state was hashed before and after (session, receipt,studio.sqlite,demo-agent/*) and all were byte-identical.--applywas not run.Tests
New
controller/test_demo_update_keeps_lane.py(8 tests, fixtures only, no MT5):| Test | Proves |
|---|---|
| customer update with MT5 open | The exact desktop args install, verify and relaunch. The session stays
native_human_control, rebound to the new receipt. Then the realdispatch()CLI choke point plusclose_terminal()(Desktopsuite.closeTerminal) close MT5 (Claude-Mac's required test). || same-bytes customer update | Metadata-only update: verified in place,
process.closenever called, lane kept. || owner
demo_directupdate | Staysdemo_direct;ready_for_batchafter readback; rawstudio close-terminalstill refuses as before (regression test). || explicit enrollment |
--enter-demo-lanewith bundle metadata refuses before any close; alone it enrolls. || restore-lane end to end | Replays the beta.18 flip. close-terminal refuses (the T3 bug), the review writes nothing,
--applyrestores, close-terminal works, and a second run returnsalready_customer_lane. || restore-lane refusals | Owner demo work in the log; missing or tampered backup; STOP; typed continuation; active batch; store without the customer authority. |
| restore-lane CLI | Review by default,
--applywrites. |Mutation check: with the old always-enroll behaviour patched back in, both customer-update tests fail (
'demo_direct' != 'native_human_control').Fixtures that used
_adopt_installed_binaryas an implicit enrollment now passenter_demo_lane=True:test_demo_agent,test_demo_reservation_release,test_studio_t2_r3_fixes. Two desktop-shaped install tests now start from an ownerdemo_directsession, because they assertready_for_batch.Run locally (PowerShell, bundled Python 3.13.15, worktree controller first on
sys.path, module sources verified): the 15 demo, guide, setup, authority, rebind and self-repair modules pass (259 tests, including the 8 new ones andRecoveryGuidanceTests/test_studio_customer_skillsfor the guide). The full discovery run is still in progress locally, and the "Controller Windows tests" CI on this PR runs the full suite.Docs
DEMO-AGENT-TOOLS.md: the lane rule,--enter-demo-lane, and therestore-lanecontract.AGENT-START-HERE.md: one sentence. Updating keepsnative_human_control. If a customer terminal readsdemo_directafter an older update, the agent tells the user that GOAT support can restore it. The agent still never switches togoat demo.Not verified
install-buildon a customer terminal. That needs a beta.19 candidate on T3 afterrestore-lane --apply.🤖 Generated with Claude Code