docs(review-checklist): rule 26 — a derived default must be one its consumer accepts - #1755
Merged
Merged
Conversation
…onsumer accepts Adds a section + rule 26 at the end of the file, per the doc's numbering norm (append to the tail; rule numbers ascend in document order and are cited by number elsewhere, so nothing above is renumbered). The rule is earned by #1754/TASK-052, where four instances of one family all surfaced from running the consumer rather than inspecting the derived shape: the predicate was ADAPTERS_WITH_DEFAULT_MCP ("consumes mcp[]"), which is not the set that can enforce a sandbox. Two of the four were fatal-and-silent — codex's throw and pi's assertNoSandboxDeclared would each have made every daemon-derived seat of that adapter unspawnable while the stored record looked correct. No version bump: docs only.
lilyshen0722
force-pushed
the
kai/checklist-consumer-accepts
branch
from
September 19, 2026 15:09
5c367a1 to
ad3aa8d
Compare
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.
Adds one rule to the incident-derived reviewer checklist: a default you derive for a consumer must be one that consumer accepts, and the check is to run the derived value through the consumer's own guard rather than assert its shape.
Why this rule, and why this incident
Earned by #1754 / TASK-052, where four instances of one family surfaced in a single PR and every one of them was found by running the consumer rather than inspecting the serializer. The predicate that chose the sandbox half of a derived seat environment was
ADAPTERS_WITH_DEFAULT_MCP— the set that consumesmcp[]— where the question was which adapters can enforce a sandbox.Two of the four failed in the fatal-and-silent direction: a declaration the consumer must refuse. The daemon writes the record, the spawn throws, and the stored row looks correct the whole time — so every derived seat of that adapter is unspawnable while the board says it is installed:
cli/src/lib/adapters/pi.js:149assertNoSandboxDeclared(called at:231, from fix(cli): pi seats — seat token out of the shell env; unenforceable sandbox fails closed #1727) refusestrust: 'public'— so every daemon-derived pi seat would have been written a record it cannot start on. Two fixtures were pinning that shape green.codex's absent-mode throw would have stopped every derived codex seat.claude's two consumers read one declaration independently and disagreed at runtime.The assertion that closes the class is not
expect(derived).not.toHaveProperty('sandbox')— that passes on exactly the state that breaks the seat — it is running the derived value through the consumer's own guard: the spec this adapter receives is one this adapter accepts. Reverting the guard reds exactly the two paired tests.Facts in the rule are checked against the tree, not recalled:
ADAPTERS_WITH_DEFAULT_MCPis atcli/src/lib/default-environment.js:25(gating the mcp half at:41/:60) andassertNoSandboxDeclaredis atcli/src/lib/adapters/pi.js:149. The quoted comment is in #1754's diff and is labelled as such in the text, so a reader greppingmainis not sent hunting for it.Placement
Appended, per the file's own norm: rule numbers ascend in document order and are cited by number elsewhere (
ADR-028rule 23,ADR-019rule 9,REVIEW.md§7), so a rule added mid-file renumbers everything below it. New section at the end, first item numbered 26 ⇒ renders as 26. Nothing above this diff changed.Verification
docs/only, nocli/srcchange: the "Source changed ⇒ version bumped" check passes with no version bump.grepon this base (ac544d5c); the rule names its incident as the doc requires.docs/.Gate: factual accuracy against the tree (Vera's standing rule for a doc/runbook PR).