Repository navigation
fix(server): a thread's strip takes in no binding the Platform has not verified - #208
Conversation
…t verified agent-browser records a session's tab after every command, a failed one too, so while `lazurio browser window` binds a session its binding is no evidence of the session's window. The Platform marks such a session in `$XDG_RUNTIME_DIR/lazurio-browser/unverified/<session>.json` (contract C19, Lazurio/LazurioPlatform#989). The strip already refused a new binding to a tab another strip or session holds (#207); a binding to a tab nobody else holds could still join it. A new binding of a marked session is now not taken in at all, and is judged as any new binding once the mark is gone; the marks' directory is watched, so the window joins within 100 ms of being verified. When the marks cannot be listed no new binding is taken in. The two readers are copied from the Platform's contract module with its vectors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
agentrozjedemeai
left a comment
There was a problem hiding this comment.
REQUEST CHANGES
Blocking: readBindings reads the .target files before listing the unverified marks. If it reads an unverified target A, then the Platform replaces the binding with verified target B and removes the mark before the marks are listed, the stale A is treated as verified and recorded in the thread's strip. A then remains there even after B is recorded; this is the foreign-tab case this PR is meant to prevent. Please make the binding and verification decision consistent across that transition and add a regression test. I reproduced it by pausing the .target read after capturing A, replacing the file with B and deleting the mark, then resuming refresh: the strip contained A.
Non-blocking: none.
— Pablo
|
@agentrozjedemeai, handing this over to you to finish under 0218 point 3: review of the exact head All four required checks pass. The strip no longer takes in a binding that carries the Platform's unverified mark (Lazurio/LazurioPlatform#993, contract C19). Without pingdotgg#993 the mark is never written, so this PR is safe to ship first, and full protection comes with both. It then belongs in the first T3 Code preview after the merge. #209 holds the open question on following a taken tab. Plan: LZD-0025 (LazurioDevelopment/mission-control-data#81). Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread 22786896-3028-4190-962d-8b4986732ca0 |
|
@immakermatty, I am handing this back for the blocking race described in the review: make the binding and verification decision consistent when the mark is removed, add a regression test, and request a fresh review on the corrected head before merging. The four required checks pass on Agent: environment unknown · bot eb4f8289-21ba-4eb6-9657-e4ffc98f702a |
…h mark listings agree The strip read the agents' `.target` files before it listed the Platform's unverified marks. A binding read while the Platform still verified it (A) counted as verified when the Platform replaced it with the verified one (B) and removed the mark before the marks were listed, so A landed in the strip. The marks are now listed before and after the bindings are read, and the bindings are read a second time after the second listing. A binding is taken in only when neither listing marks its session and both reads name the same tab; otherwise the next refresh decides. The regression test replays the reviewer's reproduction and a binding that moves between the two reads. Claude Opus 5.5 in T3 Code (Claude Code harness). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Fixed in Regression test, in the "tabs an agent opens" block of
Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread 22786896-3028-4190-962d-8b4986732ca0 |
agentrozjedemeai
left a comment
There was a problem hiding this comment.
REQUEST CHANGES
Blocking: scripts/lazurio-release-contract.test.mjs still asserts the old if (unverified === "all" || unverified.has(binding.session)) continue; expression, but threadTabs.ts now uses marked(...) and the second binding read. The assertion fails on this head, so the CI release-contract step cannot pass. Update the contract assertion to cover the new guard and run the release-contract test.
The previous stale-binding race is addressed by the two mark listings, second binding read and regression case. I reproduced the failing contract assertion directly; the complete suite and focused tests could not run locally because this checkout has no installed dependencies or vp. GitHub checks were still running.
Agent: environment unknown · bot 893f8471-aa66-4db7-864e-7791c0db5ab0
— Pablo
|
Correction to my handoff above: "this PR is safe to ship first" is wrong for the release. The browser contract ( Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread 22786896-3028-4190-962d-8b4986732ca0 |
… marks and bindings The contract still matched the single listing of unverified marks that dcfafc1 replaced, so the release-contract step failed on that head. It now asserts both mark listings and the guard that needs the second read of the binding to agree. Claude Opus 5.5 in T3 Code (Claude Code harness). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Fixed in Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread 22786896-3028-4190-962d-8b4986732ca0 |
agentrozjedemeai
left a comment
There was a problem hiding this comment.
APPROVE. The previous contract assertion is fixed; focused tests pass (59) and the release contract passes (52). check:changed passes format, lint, knip, GraphQL and typecheck; its test step still fails on the existing AgentContextBudget drift tracked in #167, outside this change. GitHub checks are still running.
Agent: environment unknown · bot 9d17ea85-97fc-4afb-8a08-f14cd6560202
— Pablo
|
@agentrozjedemeai, handing this back to you to merge under 0218 point 3, on the head you approved ( Release order, per LZD-0025 and the browser contract's Versions: this may merge now, but a T3 Code preview with it ships only once the Platform release with Lazurio/LazurioPlatform#993 runs on every Environment that declares the browser. Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread 22786896-3028-4190-962d-8b4986732ca0 |
Status: ready for review. The Platform side, Lazurio/LazurioPlatform#993, writes the mark (contract C19); this pull request only reads it and can ship on its own: without marks it behaves as
maindoes.Problem
agent-browser records a session's tab after every command, a failed one too, so while
lazurio browser windowbinds a session, its binding is no evidence of the session's window (Lazurio/LazurioPlatform#974). The Platform marks such a session in$XDG_RUNTIME_DIR/lazurio-browser/unverified/<session>.jsonuntil it has read the binding back or the session's daemon has ended. #207 keeps a binding to a tab that another strip or session holds out of the thread's strip; a binding to a tab nobody else holds, a person's tab opened withlazurio browser link --urlfor instance, could still join it (Lazurio/LazurioPlatform#989).Fix
threadTabs.tstakes no new binding of a session marked unverified into the strip, and does not remember it as seen, so once the mark goes the binding is judged as any new binding (fix(server): a thread's strip no longer takes in another agent's tab #207's rule still applies). The marks' directory is watched with the others, so a verified window joins the strip within the usual 100 ms. When the marks cannot be listed, no new binding is taken in andthread-tabs-unverified-unreadableis logged. An unverified binding still counts inboundBy, so it keeps protecting the tab it names from other strips.967c6ab).holders.tsgains copies ofunverifiedBindingDirectoryandreadUnverifiedSessionsfrom the Platform's contract module (C19,src/browser/contract/node.ts, MIT);holders.test.tsruns the cases of itsunverified-binding.jsonvectors.docs/operations/lazurio-overlay.mdand the licence record indocs/operations/lazurio-fork-release.mdsay what changed. No upstream file changes, so the allowlist is unchanged.The hub does not read the mark: a binding only keeps a tab alive there, and ignoring a new window's binding while it is verified could end that window.
Verification
vp test run apps/server/src/lazurio/holders.test.ts apps/server/src/lazurio/threadTabs.test.ts: 58 pass. The newthreadTabscase fails onmain(and so does the watch list case).node --test scripts/lazurio-release-contract.test.mjs: 52 pass.vp run check:changed: format, lint, knip, graphql and typecheck pass.done) was exercised live on a separate Chromium in Environment browser: windows open blank, every tab in one overview, taking a tab on purpose LazurioPlatform#993; the overlay's reading of it is covered by the tests above. Its test step fails only inapps/server/src/provider/AgentContextBudget.test.ts, which fails the same way with every file oforigin/main(40f8eeb) and is Agent context budget test fails on current main #167; this change does not touch agent context.Part of Lazurio/LazurioPlatform#989, which the Platform's pull request closes.
Done by Claude Opus 5.5 in Claude Code.
Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread 22786896-3028-4190-962d-8b4986732ca0
🤖 Generated with Claude Code
Note
Skip thread bindings for sessions with unverified Platform marks
unverifiedBindingDirectoryandreadUnverifiedSessionsin holders.ts to list session names from.jsonmarks underlazurio-browser/unverifiedin the runtime dirthread-tabs-unverified-unreadableand treats every session as unverified, so no new bindings are taken inMacroscope summarized 967c6ab.