Repository navigation
executor: a seat carrying the agent DID still answers the viewer gate - #2179
Merged
Merged
Conversation
#2027 wraps every conversation's seat in WithEnvironment to hand commands CODEAF_AGENT_DID. environmentSeat forwarded ForSetup, Settle and Drain but not CheckWork, and executor.CheckWork asks for that method by type assertion, so the ownership gate beneath stopped answering user admission: a chat that another computer continued still accepted remote submits, and answering a pending consent cleared the session's viewer fact. environmentSeat now forwards CheckWork to the seat beneath.
executor.watched had the same gap as environmentSeat: it embeds Seat and did not forward CheckWork, so a watched seat over a gated one would hide the ownership gate. TestEverySeatWrapperForwardsCheckWork reads the package's sources and fails for any struct that embeds Seat without a CheckWork method; it failed on watched, which now forwards it.
santoshkumarradha
marked this pull request as ready for review
November 2, 2026 12:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes for a person
A chat that another computer has continued is a viewer on this computer: it must refuse new work. Since #2027 every conversation's seat is wrapped to hand commands
CODEAF_AGENT_DID, and that wrapper did not pass the viewer check through. So a displaced chat in the app still accepted work sent through the remote doors (submit, composed submit), and answering a pending consent cleared the session's viewer fact.The environment wrapper now forwards the ownership check to the seat beneath, so a displaced chat refuses work again.
executor.watchedhad the same gap and forwards it too, and a structural law test (TestEverySeatWrapperForwardsCheckWork) fails for any type in the executor package that embedsSeatwithout aCheckWorkmethod.Root cause
executor.CheckWorkfinds the gate by type assertion onCheckWork() error.environmentSeatembeds theSeatinterface, which does not carry that method, so wrapping a gated seat hid the gate.Validation
watchedbefore its fix and passes after.TestC1C6WorkAdmissionReusesTheViewerGatenow also checks a seat that carries an environment over the gate (and its setup form). It failed before the fix (ownership refusal = <nil>) and passes after. This test does not need the engine.TestC1C2AppViewerRefusesWorkBeforeSubmissionandTestC1AppViewerAcceptsRealPendingConsent(cmd/codeaf) failed on app/v3 and pass with this change. Bisected to session: give every agent a stable DID its commands see as CODEAF_AGENT_DID #2027.BUILD_EXIT=0 VET_EXIT=0 FMT_EXIT=0 CHANGELOG_EXIT=0 LAWS_EXIT=2 PKG_EXIT=0 (./internal/executor) CMDRUN_EXIT=0 (^(TestC1AppViewerAcceptsRealPendingConsent|TestC1C2AppViewerRefusesWorkBeforeSubmission)$). LAWS_EXIT=2 comes from the known base reds only: TestSourceComments, which flags two factory pipeline_copy files; the taxonomy law; and the two NoRoad complexity laws.Limits
The law reads the executor package's own sources. A
Seatwrapper declared in another package is not covered; none exists today.🤖 Generated with Claude Code