Skip to content

executor: a seat carrying the agent DID still answers the viewer gate - #2179

Merged
santoshkumarradha merged 4 commits into
app/v3from
c40/viewer-gate-did
Nov 2, 2026
Merged

santoshkumarradha merged 4 commits into
app/v3from
c40/viewer-gate-did

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

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.watched had the same gap and forwards it too, and a structural law test (TestEverySeatWrapperForwardsCheckWork) fails for any type in the executor package that embeds Seat without a CheckWork method.

Root cause

executor.CheckWork finds the gate by type assertion on CheckWork() error. environmentSeat embeds the Seat interface, which does not carry that method, so wrapping a gated seat hid the gate.

Validation

  • Red first: the new law failed on watched before its fix and passes after.
  • Red first: TestC1C6WorkAdmissionReusesTheViewerGate now 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.
  • With the pinned furrow engine present, TestC1C2AppViewerRefusesWorkBeforeSubmission and TestC1AppViewerAcceptsRealPendingConsent (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.
  • Gate: at 0c7384b with the pinned engine (CODEAF_FURROW): 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 Seat wrapper declared in another package is not covered; none exists today.

🤖 Generated with Claude Code

#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
santoshkumarradha marked this pull request as ready for review November 2, 2026 12:13
@santoshkumarradha
santoshkumarradha merged commit 80f4122 into app/v3 Nov 2, 2026
@santoshkumarradha
santoshkumarradha deleted the c40/viewer-gate-did branch November 2, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant