Skip to content

docs(m8): bind lane boundaries to the CLI's own stderr summary - #211

Merged
sushiHex merged 2 commits into
mainfrom
fix/210-lane-output-contract
Oct 15, 2026
Merged

sushiHex merged 2 commits into
mainfrom
fix/210-lane-output-contract

Conversation

@sushiHex

@sushiHex sushiHex commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Refs #210
Refs #186

Problem

The bounded g11 session stopped at its first S4 lane. The g11 procedure (M8-maintenance-g11-continuation.md line 40) requires "empty stderr at every boundary". But codex_lane.main (codex_lane.py:860-865) always prints one {"evidence_digest": ..., "faults": [...]} summary line to stderr after it publishes evidence, on success too. That rule rejects every clean lane. Only the outer transport exit was retained, so the live S4 exit and qualification stay unknown.

Change

This adds a new document, M8-maintenance-lane-output.md, plus its README row and manifest entry. No frozen procedure and no CLI byte changes.

  • Class audit. Every g11 boundary was audited from source at C. Exactly five write the lane summary:

    • S4 under maintain;
    • H7 active, S6b denial and S6c wrong plan;
    • ER R1 explicit refresh.

    The rest are CLEAN or UNKNOWN and keep the empty-stderr rule:

    • S6a: stays frozen; its lane output already goes to /dev/null.
    • C10 run: UNKNOWN. Its only implicit stderr writer is asyncio's default exception logging, which fires only after a walker drive has already failed.
  • L0 helpers, each a Python fence run by the host's stock interpreter, as every existing checker is:

    • lane_capture (operator, outside maintain) records stdout, stderr and returncode in exclusively created files. It checks identities on the retained descriptors before it publishes the status, and its own success is separate from the command's status.
    • lane_expectation (service) requires that the recomputed evidence digest equals the frozen check_evidence digest. For schema-5 explicit refresh it does a closed-field consistency check instead.
    • lane_boundary (operator) requires the stderr bytes to equal the summary rebuilt from that evidence, the exit to be 1 exactly when there are faults, and stdout to be empty or the declared verdict.
  • L1-L3: complete replacement blocks for S4, the three H7 controls and ER R1.

  • L4: a Python workstation transport that keeps ssh's returncode, stdout and stderr in three separate files and accepts only exit 0, empty stderr and the exact declared stdout.

Tests (tests/test_m8_lane_output.py, credential-free, no vendor or host)

  • Real CLI in a subprocess. codex_lane.main runs in a subprocess (tests/lane_cli_double.py) with only custody and launch substituted. Publication, the summary, the verdict and the exit are its own. The evidence comes from the production lane code with a scripted peer.

  • Accepting paths. That output flows through the actual L0 capture, the frozen check_evidence bytes, the expectation and the boundary. The six accepting cases are initial, active, denial, wrong plan, and measured and unmeasured refresh.

  • Refusing paths. Sixteen damages are each applied to the clean, refusal and refresh cases:

    • stderr: an extra line, a prefix, no LF, CRLF, or empty;
    • stdout: extra bytes;
    • status: a flipped exit, a bool exit, duplicate keys, a missing status, or an extra file;
    • expectation: another digest, other faults, or an extra key;
    • kind: the wrong declared kind, or an unknown kind.

    Reordered refusal faults and a mismatched refresh verdict also refuse.

  • Expectation and capture. The expectation binds the checked digest, and the closed schema-5 record refuses damage. Capture failure is kept separate from the command's status. The capture refuses before dispatch. Identity loss refuses before the status is published (POSIX only, since Windows cannot rename an open file).

  • Guard removal. Removing the stderr guard, the exit guard or the capture identity guard is caught by an assertion failure.

  • Composed shell blocks. L1, L2 and L3 execute with the real lane CLI and a fake maintain. An injected sudo warning stops S4, and an accepted S6b control stops the remaining H7 controls.

  • Transport and reproduction. L4 is tested over fake ssh exits 0, 255 and 1, stderr noise and stdout mismatches. The frozen g11 predicate rejects a clean real CLI run, which reproduces Reconcile operator procedure output checks with real lane CLI summaries #210.

Local evidence (Windows, Python 3.14)

  • tests/test_m8_lane_output.py at cb86a88: 92 passed, 7 skipped (the POSIX-only rename tests).
  • With test_m8_ci_scope, test_mutation_inventories, the g11 continuation tests and the operator-command tests: 529 passed, 7 skipped.
  • Ruff is clean.
  • The full uv run verify was not run locally. Hosted CI on the exact head is the gate.

Review

The design was reviewed before implementation by Codex (gpt-6.1-sol, high).

Adopted:

  • S6a stays frozen.
  • Capture writes the status only after its identity checks.
  • Every read opens nonblocking.
  • Waiting stays unbounded, and that is documented.
  • The transport trailer is dropped in favour of exact output.
  • The refresh verdict is re-emitted.
  • The transport is covered by joined tests.

Rejected, with the reason: a semantic schema-5 refresh checker. It would be new verification authority outside #210, and the frozen ER R2 already defines what the verdict means. The doc labels the refresh binding as consistency-only.

The implementation at ddf1e33 then got one focused Codex pass (gpt-6.1-sol, high).

Introduced defects, both fixed in cb86a88:

  • L2 did not compose. It left the rest of g11 C5 to be copied verbatim, and those lines hardcode g11 paths. L2 is now one complete C5 replacement, with the GEN, GEN_PRIOR and W_PRIOR literals declared. Its test runs the whole block, including the active-refresh selection, the derived no-chatgpt policy and the stale binding check. It covers both verdict variants, and its S6b denial record is produced under the derived policy.
  • No size bound had an input where it binds. New tests accept the stderr (8192) and status (64) bounds at exactly the limit and refuse them one byte past it.

Nits, all adopted:

  • Each helper's arity check now returns failure, so a call inside a command substitution cannot proceed.
  • Only lane_capture's own zero exit establishes a complete capture. A status file alone does not.
  • The doc names both RunHost exception-handler reports.
  • A maintain refusal can surface as a traceback.
  • The AGENT_HANDOFF wording now says explicit refresh gets a consistency check, not the frozen checker.

Design choice, kept and recorded: the double substitutes run_startup with a record the production lane produced. It therefore proves the CLI's publication, summary, verdict and exit, not that CLI arguments produce that record.

Not established

  • This is no host, vendor or qualification evidence.
  • It authorizes no resume of the stopped g11 session, and its occupied q11 paths are never reused.
  • A later live continuation needs a separately reviewed procedure, chosen from measured preserved state, and its own authority.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S7VMTaJ9XePzc8fjmBBFfs

sushiHex and others added 2 commits October 15, 2026 15:00
g11's blanket empty-stderr rule rejects every clean lane: codex_lane.main
always prints its {evidence_digest, faults} summary to stderr after it
publishes evidence. The additive lane output contract replaces that rule
at the five audited boundaries:
- S4;
- H7 active, S6b and S6c;
- ER R1.

At each, the captured stderr must equal the summary rebuilt from checked
evidence, the exit must be 1 exactly when there are faults, and stdout must
be only the declared verdict. Command status, capture success and ssh
transport status are recorded separately.

Credential-free tests drive the real CLI in a subprocess through the actual
blocks, on accepting and refusing paths.

Frozen procedures and the CLI are unchanged. This adds no host action and
no continuation authority.

Refs #210
Refs #186

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7VMTaJ9XePzc8fjmBBFfs
Review of ddf1e33 found two introduced defects:
- L2 left the rest of g11 C5 to be copied verbatim. Those lines hardcode g11
  paths, so a g12 composition would read evidence and policies that do not
  exist.
- No size bound had a test input where it binds.

L2 is now one complete C5 replacement, with the GEN, GEN_PRIOR and W_PRIOR
literals declared. Its test runs the whole block, including the
active-refresh selection, the derived no-chatgpt policy and the stale
binding check. It covers the measured and unmeasured variants, and its
S6b denial record is produced under that derived policy.

New tests accept the stderr and status bounds at exactly the limit and
refuse them one byte past it.

Also:
- Each helper's arity check now returns failure, so a call inside a
  command substitution cannot proceed.
- The doc states that only lane_capture's own zero exit establishes a
  complete capture.
- The doc names both RunHost exception-handler reports, and that a
  maintain refusal can surface as a traceback.

Refs #210

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7VMTaJ9XePzc8fjmBBFfs
@sushiHex
sushiHex marked this pull request as ready for review October 15, 2026 22:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T22:52:52.788169Z cb86a88 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sushiHex
sushiHex merged commit 4a84dfc into main Oct 15, 2026
21 checks passed
@sushiHex
sushiHex deleted the fix/210-lane-output-contract branch October 16, 2026 23:33
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