Repository navigation
fix(cycle): reroute stops only on the cycle's own publications; document nested Codex sandbox limit (#268) - #277
Conversation
…ns (#268) Reconciliation compared every comment and review payload on the change request and issue, so another account's comment, a reaction or a changed timestamp blocked the single fallback. It now compares only the pull requests, comments and reviews the authenticated code-host account created or edited, by identity and content digest. An unreadable account is unavailable evidence.
…#268) Codex's Linux sandbox overmounts /tmp/codex-daemon-<uid> read-only with mode 000 for the commands it runs, so a Codex stage cannot start a nested codex sandbox or codex exec. The runtime's profile and TMPDIR are not the cause. The guidance now tells the stage to report it once as sandbox_filesystem_access; no grant is enabled (#239).
|
Implementation stage: IMPLEMENTED, head
Local verification (agent-reported): Checks of Not verified: no check ran against the installed Codex CLI ( run: stage=implement profile=deep_coder requested=anthropic/claude-opus-5-5 resolved=? effort=high schema:2 |
[CCR-20261019-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2Initial review — CHANGES_REQUESTEDHead reviewed: Summary and scopeI reviewed the whole accumulated diff from the merge base to the head (325 lines, 6 files): WU-2, the nested-Codex guidance, is accurate, grants nothing ( One regression remains in the reroute gate itself. It is a safety boundary, so the gap goes in the permissive direction. Findings[REV-001] · medium · open · - · blocks:yes — Edits by the cycle's account to a PR another account opened no longer stop a reroute
Concrete case: Evidence: from reading the code ( Suggested fix: keep Security triage
Commands executed
All 62 errors in the full suite are in Unverified
CI (policy: parallel)All 6 checks on Residual risks
VerdictCHANGES_REQUESTED: REV-001 blocks approval. |
[CCR-20261019-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2[CCT-20261019-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:6a2f508739d58c0e14095cdf54c0bbe2b02ca185 · schema:2Resolution: RESOLVED. Work item #268; fix committed and pushed as [REV-001] · medium · resolved · valid · blocks:yes — Edits by the cycle's account to a PR another account opened no longer stop a rerouteThe finding was valid at the triage SHA above. Before changing production code, the new regression test reproduced 12 missed edit cases: reconciliation returned
Verification (agent-reported)Commands ran through
Conclusion: Post-change review and securityThe delegated The default deterministic security rule matched no changed path, filename or PR label. A judgment audit covered the publication boundary, attribution, failure handling and snapshot callers. The fix adds no external invocation, credential handling or permission grant. CI: parallel policyChecks were read once after the successful push, on head
Residual risk: unrelated edits to any existing in-scope PR also stop rerouting because GitHub exposes no editor identity in this evidence. Live provider mutation and the inherited installed-Codex sandbox smoke check were not exercised by this resolution. |
[CCR-20261019-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2[CCT-20261019-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:6a2f508739d58c0e14095cdf54c0bbe2b02ca185 · schema:2[CCR-20261019-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2Rereview — APPROVEDHead reviewed: What changed since the previous review
Scope of this rereviewI read the complete accumulated diff, 378 lines (6 files), in sections. I also read the current Previous findings[REV-001] · medium · resolved · valid · blocks:yes — Edits by the cycle's account to a PR another account opened no longer stop a rerouteCorrected and verified by execution. New findingsNone. Security triage
Verification
The full-suite result matches the initial review's run in this stage's sandbox:
Neither module, nor the code they exercise, is in the diff. The resolver ran the same suite green (1608 tests). CI ran it green on this head, including the Windows shards. Unverified
CI (policy: parallel)Read once on
Residual risks
VerdictAPPROVED: REV-001 is resolved and verified, no new findings, and every required check passed on the reviewed head. Merging remains a manual decision. |
[CCR-20261019-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2[CCT-20261019-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:6a2f508739d58c0e14095cdf54c0bbe2b02ca185 · schema:2[CCR-20261019-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2[CCR-20261019-003] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2Rereview (verifying recovered attempt) — APPROVEDHead reviewed: This run independently checks the rereview that attempt What changed since the previous review
Scope
Previous findings[REV-001] · medium · resolved · valid · blocks:yes — Edits by the cycle's account to a PR another account opened no longer stop a rerouteCorrected and verified by execution. At
The test discriminates. New findingsNone. Security triage
No vulnerability found. Verification
The full-suite result is identical to the initial review and the recovered rereview in this stage's sandbox:
Neither module, nor the code they exercise, is in the diff. CI ran the full suite green on this head, including the four Windows shards. Unverified
CI (policy: parallel)Read once on
Residual risks
VerdictAPPROVED. I independently verified the recovered attempt's claim: REV-001 is resolved. There are no new findings, and every required check passed on the reviewed head. Merging remains a manual decision. |
Evidence for a manual merge decision: head
|
Closes #268
Work item: datacas/code-cycle-toolkit#268
Diagnosis
Symptom. In the #142 cycle (2026-10-17), the Codex
implementstage returnedBLOCKEDwithsandbox_filesystem_access:error building bubblewrap command: app-server socket directory must be a user-owned directory with mode 0700. The reroute to the configured Claude fallback then stopped withpublication_changed.Issue hypotheses. (1) The runtime's native
TMPDIRor stage permission profile masks/tmp/codex-daemon-<uid>. (2)publication_changedfired even though the stage had published nothing.Reproduction (agent-reported, from the Codex session logs of the failed attempts and the issue's comments; the
codexCLI is not in this stage's command table, so it was not rerun here):~/.codex/sessions/2026/10/17/rollout-…-01a14ba0….jsonl): inside the Codex stage,/proc/self/mountinfoshowed/tmp/codex-daemon-1000 ro,nosuid,nodev,relatime - tmpfs tmpfs rw,mode=000,uid=1000,gid=1000, mounted twice (two nested layers). Listing it raisedPermissionError: [Errno 13].--no-daemonand a fresh mode-0700TMPDIRboth returned the same error. The failing command was a nestedcodex sandbox --permission-profile … -- /usr/bin/truethat the agent ran itself to verify Recommended host permissions for Claude/Codex and per-project generalized approvals #142.codex sandbox --permission-profile code_cycle_publish_write …failed the same way. That attempt also reported that, in Codex 0.163.0, the directory is fixed under/tmp, does not depend onTMPDIRorCODEX_HOME, and is masked deliberately.ls -ld /tmp/codex-daemon-1000shows700, owned by the user.gh issue view 142 --json commentsshows a comment bydatacas(the cycle's own account) at2026-10-17T20:52:04Z: "Implementation stage: BLOCKED by executor sandbox access before edits…". The Recommended host permissions for Claude/Codex and per-project generalized approvals #142 Codex stage posted it withgh issue comment 142 --body-file …during the stage.Cause (
cause_mismatch, within scope).TMPDIRdo not cause it. The stage itself started and ran: it executed commands and published a comment. Only a nested Codex sandbox cannot start inside a Codex stage. Changing a path or permission cannot fix this without widening the sandbox, and Q-002 rules widening out.publication_changed: in Recommended host permissions for Claude/Codex and per-project generalized approvals #142 the stop was correct, because the stage had published a comment with the cycle's account. The rule was still too broad compared with the Q-001 decision. It compared every payload of every comment and review, so another account's comment, a reaction or a changedupdated_atalso blocked the fallback.Invariant. A reroute is blocked only by effects the stage could have caused: pull requests, comments or reviews that the cycle's own account created or edited after the stage started (Q-001, consistent with #261).
Related items (basic search). The item's links: #141, #142, #239, #261, #266. #274 and #276 are also open on the same environment.
gh search issuesis not in this stage's command table, so the search was not widened. None of these duplicates or supersedes this item. #261 (publication invariants) stays separate; this change keeps to the reroute gate.Fix shape.
docs/routing.md, and enable no grant. The Unix-socket grant stays person-only (feat(runtime): ask before granting sensitive sandbox access such as Docker #239), and nothing in this fix needs Unix sockets.Work units
WU-1publication_changedfires only for pull requests, comments or reviews that the cycle'sgh api useraccount created or edited. Other accounts, reactions and timestamps reroute. An unreadable account isevidence_unavailable.scripts/reroute.py,tests/test_reroute.py,docs/routing.md,CHANGELOG.mdtest_only_the_cycle_accounts_publications_stop_a_reroute,test_reactions_and_metadata_on_own_comments_are_not_publications,test_unknown_publication_identity_is_not_clean_evidence, updatedtest_github_comment_review_and_issue_boundaries_are_readpython3 -m unittest tests.test_reroute: exit 0, 9 testsindependent(revert 2e65a1e)WU-2/tmp/codex-daemon-<uid>), tells the stage to report it once assandbox_filesystem_access, and grants nothing.docs/routing.mddocuments the cause.scripts/environment_recovery.py,tests/test_environment_recovery.py,docs/routing.md,CHANGELOG.mdtest_guidance_names_the_nested_codex_limit_without_a_grantpython3 -m unittest tests.test_environment_recovery tests.test_reroute: exit 0, 28 testsindependent(revert 6a2f508)Verification (agent-reported)
python3 -m unittest tests.test_reroutepython3 -m unittest tests.test_environment_recovery tests.test_reroute tests.test_cyclepython3 -m unittest discover -s testspython3 scripts/validate-package.pyVALID: 16 skills (7 cycle, 9 supporting), shared sections in sync, cross-agent manifests alignedpython3 -m unittest tests.test_environment_recovery tests.test_reroute(final head)Environment. These ran on the host under the Claude implement stage's command hook. The tests use a fake
ghand set their own Git identity (GIT_CONFIG_GLOBAL=/dev/null), so they do not rely on the global Git config orghcredentials. CI runs the same suite.Not verified. No check ran with the installed Codex CLI (
codexis denied in this stage). Nothing confirms, at the boundary, that a Codex write stage passes its runtime probe. The evidence is the session logs above: both Codex stages started and ran commands. A person can confirm withcodex sandbox --permission-profile code_cycle_publish_write -c 'permissions.code_cycle_publish_write.extends=":workspace"' -- /usr/bin/truerun on the host (expected: exit 0) and the same command from inside a Codex session (expected: the error above).Residual risk