Skip to content

fix(cycle): reroute stops only on the cycle's own publications; document nested Codex sandbox limit (#268) - #277

Merged
datacas merged 3 commits into
mainfrom
fix/268-codex-sandbox-socket
Oct 19, 2026
Merged

datacas merged 3 commits into
mainfrom
fix/268-codex-sandbox-socket

Conversation

@datacas

@datacas datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Closes #268

Work item: datacas/code-cycle-toolkit#268

Diagnosis

Symptom. In the #142 cycle (2026-10-17), the Codex implement stage returned BLOCKED with sandbox_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 with publication_changed.

Issue hypotheses. (1) The runtime's native TMPDIR or stage permission profile masks /tmp/codex-daemon-<uid>. (2) publication_changed fired 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 codex CLI is not in this stage's command table, so it was not rerun here):

Cause (cause_mismatch, within scope).

  • Socket: Codex's own Linux sandbox hides its app-server socket directory from the commands it runs. The runtime's profile and TMPDIR do 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 changed updated_at also 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 issues is 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.

  • Narrow the reconciliation snapshot to the authenticated account's publications, by identity and content digest. No new state or flag.
  • Document the nested-Codex limitation in the recovery guidance and 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

Unit Behaviour Files Tests Verification Rollback
WU-1 publication_changed fires only for pull requests, comments or reviews that the cycle's gh api user account created or edited. Other accounts, reactions and timestamps reroute. An unreadable account is evidence_unavailable. scripts/reroute.py, tests/test_reroute.py, docs/routing.md, CHANGELOG.md test_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, updated test_github_comment_review_and_issue_boundaries_are_read python3 -m unittest tests.test_reroute: exit 0, 9 tests independent (revert 2e65a1e)
WU-2 The recovery guidance names the nested-Codex limit (/tmp/codex-daemon-<uid>), tells the stage to report it once as sandbox_filesystem_access, and grants nothing. docs/routing.md documents the cause. scripts/environment_recovery.py, tests/test_environment_recovery.py, docs/routing.md, CHANGELOG.md test_guidance_names_the_nested_codex_limit_without_a_grant python3 -m unittest tests.test_environment_recovery tests.test_reroute: exit 0, 28 tests independent (revert 6a2f508)

Verification (agent-reported)

Level Command Exit Result
test python3 -m unittest tests.test_reroute 0 9 tests OK
test python3 -m unittest tests.test_environment_recovery tests.test_reroute tests.test_cycle 0 91 tests OK
test python3 -m unittest discover -s tests 0 1607 tests OK (175.99 s)
static python3 scripts/validate-package.py 0 VALID: 16 skills (7 cycle, 9 supporting), shared sections in sync, cross-agent manifests aligned
test python3 -m unittest tests.test_environment_recovery tests.test_reroute (final head) 0 28 tests OK

Environment. These ran on the host under the Claude implement stage's command hook. The tests use a fake gh and set their own Git identity (GIT_CONFIG_GLOBAL=/dev/null), so they do not rely on the global Git config or gh credentials. CI runs the same suite.

Not verified. No check ran with the installed Codex CLI (codex is 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 with codex sandbox --permission-profile code_cycle_publish_write -c 'permissions.code_cycle_publish_write.extends=":workspace"' -- /usr/bin/true run on the host (expected: exit 0) and the same command from inside a Codex session (expected: the error above).

Residual risk

  • A pull request's title and body carry no editor. Any edit to the cycle's own pull request, including one by a maintainer, still stops the reroute (conservative, documented and tested).
  • A cycle whose runtime is started from inside a Codex session would fail the runtime's own Codex probes for the same reason. This is documented, not changed.

…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).
@datacas

datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

Implementation stage: IMPLEMENTED, head 6a2f508739d58c0e14095cdf54c0bbe2b02ca185. Diagnosis cause_mismatch → implement.

  • WU-1 2e65a1e: a reroute stops on publication_changed only when the cycle's own account created or edited a pull request, comment or review (Q-001).
  • WU-2 6a2f508: the recovery guidance and docs/routing.md document that a Codex stage cannot start a nested Codex sandbox (/tmp/codex-daemon-<uid> is masked by Codex itself). No grant is enabled.

Local verification (agent-reported): python3 -m unittest discover -s tests exit 0 (1607 tests); python3 scripts/validate-package.py exit 0.

Checks of 6a2f508, read once under the parallel CI policy: 0 passed, 0 failed, 5 pending (Skills, manifests, and Bash installer, Windows test shard (windows-1) … (windows-4)).

Not verified: no check ran against the installed Codex CLI (codex is not in this stage's command table). The PR description gives the host command that confirms it.

run: stage=implement profile=deep_coder requested=anthropic/claude-opus-5-5 resolved=? effort=high schema:2

@datacas

datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261019-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Initial review — CHANGES_REQUESTED

Head reviewed: 6a2f508739d58c0e14095cdf54c0bbe2b02ca185 (base main, merge base 2fa8dfdc32d59efec3d964bd0bbb309446449e90). Work item #268.

Summary and scope

I reviewed the whole accumulated diff from the merge base to the head (325 lines, 6 files): scripts/reroute.py, scripts/environment_recovery.py, docs/routing.md, CHANGELOG.md, tests/test_reroute.py and tests/test_environment_recovery.py. I also read the caller (scripts/cycle.py, snapshot() → effect_snapshot/reconcile) and the decisions recorded on #268 (Q-001, Q-002).

WU-2, the nested-Codex guidance, is accurate, grants nothing (unix_sockets is absent and a test asserts it), and is consistent with Q-002. The core of WU-1 is sound. Attributing comments, reviews and the cycle's own PRs to gh api user matches Q-001. Body and state digests ignore reactions and updated_at. An unreadable login fails closed through snapshot() → None → evidence_unavailable. Comments are still read on every in-scope PR, whoever opened it.

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

scripts/reroute.py:30-34, scripts/reroute.py:101

_own_pulls drops every in-scope pull request that another account authored, so its state, headRefOid, title and body are no longer in the snapshot. Before this change, state and headRefOid were compared for every in-scope pull. Q-001 says that PRs created or edited by the cycle's own account stop the reroute. A PR's state, title and body carry no editor, which is the same reasoning the PR uses to stop conservatively on any edit to the cycle's own PR. The author of the PR does not change that reasoning.

Concrete case: change_request_id names a PR that a maintainer opened. The cycle runs under a different account. A publishing stage closes or reopens that PR, or edits its title or body with gh pr edit, and then fails with transport/timeout/quota. Both snapshots contain pulls=[]. reconcile returns ("reroute", "no_effects"), and the fallback runs against a PR the first attempt already changed. A merge or a head push would still be caught, but only through the remote ref fingerprint. Closing the PR and editing its text are not caught at all.

Evidence: from reading the code (_authored_by filter in _own_pulls). The diff's own test case "other account PR" → no_effects confirms that foreign pulls are excluded completely. I could not run a probe test: this stage may write only its comment, report and log files.

Suggested fix: keep number/state/headRefOid/text for every pull present in the before snapshot, or at least for the change_request_id pull, whoever authored it. Ignore only foreign pulls that appear between the two snapshots, which keeps the intended "another account opens a PR on the branch → reroute" behaviour. Add a case to test_only_the_cycle_accounts_publications_stop_a_reroute: a PR seeded with author=someone-else, and the change state="CLOSED" or a title edit → publication_changed.

Security triage

.code-cycle.yml declares no security_review.always_when. The default rule matched no changed path, file name or label (the PR has no labels). The audit ran on reviewer judgement: the change narrows the cycle's publication-boundary gate and edits guidance injected into every stage prompt, and both are security tooling. I did the equivalent of cc-security-review inline, scoped to that boundary:

  • No secret or token is read, logged or persisted. Only the login from gh api user is used, and snapshots stay out of telemetry.
  • The guidance enables no grant, so the Unix-socket grant stays person-only (feat(runtime): ask before granting sensitive sandbox access such as Docker #239, Q-002).
  • Logins are compared case-insensitively, which matches GitHub.
  • The one permissive gap is REV-001. No other vulnerability was found.

Commands executed

Command Exit Result
python3 scripts/validate-package.py 0 VALID: 16 skills (7 cycle, 9 supporting), shared sections in sync, cross-agent manifests aligned
python3 -m unittest tests.test_reroute tests.test_environment_recovery tests.test_cycle 0 Ran 91 tests … OK
python3 -m unittest discover -s tests 1 Ran 1607 tests, FAILED (failures=1, errors=62); see below

All 62 errors in the full suite are in test_validate_package (copy_package → shutil.copytree). Each one is Permission denied on dotfiles and .claude/* entries that this review stage's sandbox masks in the clone, such as .bashrc and .mcp.json. The single failure, test_executors.ReadOnlyVerificationTests.test_scratch_never_uses_a_temp_parent_inside_the_checkout ("no temporary directory outside the dispatch checkout"), depends on this stage's temp layout. Neither test module nor the code they exercise is in the diff. I attribute both to this stage's sandbox, not to the change. CI ran the full suite green on this head (see below).

Unverified

  • REV-001 was not reproduced at runtime, because this stage cannot write a probe file. The evidence comes from reading the code.
  • Codex write stages fail: /tmp/codex-daemon-<uid> masked in the stage sandbox, and reroute stops on publication_changed #268's second acceptance criterion, that a Codex write stage starts with the installed version, was not checked here: codex is not in this stage's command table. The PR relies on the session logs of both Codex attempts, which ran commands and published. That supports the diagnosis that only a nested Codex sandbox fails, but it is not a boundary check. The PR body gives the host-side command that would confirm it.

CI (policy: parallel)

All 6 checks on 6a2f508 completed with SUCCESS: Skills, manifests, and Bash installer, Windows test shard (windows-1..4), PowerShell installer.

Residual risks

  • A cycle that authenticates gh with a GitHub App installation token cannot read gh api user (HTTP 403). Every publishing reroute then stops with evidence_unavailable. This fails closed, but it is new.
  • As the PR documents, any edit to the cycle's own PR stops the reroute, including an edit by a maintainer.
  • The cycle account's comments outside the in-scope PRs and the issue are still not observed. This was already the case before the change.

Verdict

CHANGES_REQUESTED: REV-001 blocks approval.

@datacas

datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

[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

Resolution: RESOLVED. Work item #268; fix committed and pushed as ecf4f330fbdfd917c8d5f7e04d84e86e8db2261d on the existing PR branch and worktree. No findings remain open.

[REV-001] · medium · resolved · valid · blocks:yes — Edits by the cycle's account to a PR another account opened no longer stop a reroute

The finding was valid at the triage SHA above. Before changing production code, the new regression test reproduced 12 missed edit cases: reconciliation returned reroute/no_effects for changes that should stop publication recovery.

scripts/reroute.py now retains normalized state, head, title and body for every in-scope PR. Reconciliation compares every PR present before the attempt, regardless of its author; changes or disappearance stop with publication_changed. New PRs from another account remain ignored, while the account's own PRs, comments and reviews retain their existing protection. docs/routing.md and CHANGELOG.md describe this conservative attribution rule.

tests/test_reroute.py covers closing, reopening, merging, head changes, title edits and body edits on an existing foreign-authored PR, through both branch discovery and an explicit change-request ID. Unchanged and metadata-only cases still reroute; the existing new-foreign-PR test still passes. There were no native review threads to reply to or resolve.

Verification (agent-reported)

Commands ran through rtk proxy; check output was captured under the supplied dispatch TMPDIR.

Command Exit Observed result
python3 -m unittest tests.test_reroute.ReconciliationBoundaryTests.test_existing_foreign_pull_edits_stop_a_reroute (before fix) 1, expected 1 test, 12 failing subcases; reproduced REV-001
python3 -m unittest tests.test_reroute tests.test_environment_recovery tests.test_cycle 0 92 tests, OK
python3 -m unittest discover -s tests 0 1608 tests in 324.503 seconds, OK
python3 scripts/validate-package.py 0 VALID: 16 skills; shared sections and manifests aligned
git diff --check 0 No whitespace errors

Conclusion: verified; boundary: not_required for this comparison-only fix. Local verification used Linux and the project's existing Python dependencies. The affected Git fixtures set their own identities and disable global Git configuration; GitHub responses are mocked. Windows and hosted integration remain CI coverage. No BasedPyright command is configured in this stage's closed verification table.

Post-change review and security

The delegated cc-code-review and cc-security-review passes found no additional issues in the complete four-file fix delta. The selected delta base was 6a2f508739d58c0e14095cdf54c0bbe2b02ca185, verified as an ancestor of the new head; no accumulated-diff fallback was needed. The original supplied 325-line accumulated diff was also read in full for triage.

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 policy

Checks were read once after the successful push, on head ecf4f330fbdfd917c8d5f7e04d84e86e8db2261d: 0 passed, 0 failed, 5 pending.

Check State at observation
Skills, manifests, and Bash installer QUEUED
Windows test shard (windows-1) IN_PROGRESS
Windows test shard (windows-2) IN_PROGRESS
Windows test shard (windows-3) IN_PROGRESS
Windows test shard (windows-4) IN_PROGRESS

PowerShell installer was not registered yet; its workflow job depends on the Windows shards. It is not counted as passed. Remote CI was neither awaited nor retried; the cycle's CI gate owns its eventual result.

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.

@datacas

datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

[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

Rereview — APPROVED

Head reviewed: ecf4f330fbdfd917c8d5f7e04d84e86e8db2261d (base main, merge base 2fa8dfdc32d59efec3d964bd0bbb309446449e90). Previous reviewed head: 6a2f508739d58c0e14095cdf54c0bbe2b02ca185. Work item #268.

What changed since the previous review

ecf4f33 touches 4 files (+57/−13): scripts/reroute.py, tests/test_reroute.py, docs/routing.md and CHANGELOG.md. The snapshot now keeps number/state/headRefOid plus a title-and-body digest for every in-scope pull request (observed_pulls), alongside the cycle account's own pulls. reconcile stops with publication_changed when any pull present in the before snapshot changes or disappears, whoever authored it. A foreign pull request that only appears between the two snapshots is still ignored.

Scope of this rereview

I read the complete accumulated diff, 378 lines (6 files), in sections. I also read the current effect_snapshot/reconcile code and its only caller, scripts/cycle.py (snapshot() → reroute_gate()). Snapshots stay in memory and are never serialised, so the integer keys of observed_pulls compare consistently. A before snapshot without observed_pulls, such as a non-publishing one, falls back to {}.

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 reroute

Corrected and verified by execution. reconcile (scripts/reroute.py:122-124) now compares every pull from before["observed_pulls"] against after. Closing, reopening, merging, pushing a new head, retitling, editing the body, or removing a pre-existing foreign-authored pull all return ("stop", "publication_changed"). This holds for both branch discovery (gh pr list) and an explicit change_request_id (gh pr view). tests.test_reroute.ReconciliationBoundaryTests.test_existing_foreign_pull_edits_stop_a_reroute exercises those cases, plus an unchanged case and a metadata-only case that both reroute. It passed on this head. The test discriminates: on the previous head, the seeded author=someone-else left pulls=[] in both snapshots, so every case returned no_effects. The resolver reported the same result (12 failing subcases before the fix). The intended Q-001 behaviour is preserved: "other account PR", a new foreign PR on the branch, still returns no_effects.

New findings

None.

Security triage

.code-cycle.yml declares no security_review.always_when. The default rule matched no changed path, file name or label (the PR has no labels). As in the initial review, the audit ran on reviewer judgement, because the change touches the cycle's publication-boundary gate. The fix only makes the gate stricter for pre-existing pull requests. It adds no external call beyond the existing gh pr view/list fields, and it handles no credential (only login from gh api user is used). It enables no grant: the guidance still contains no unix_sockets, and a test asserts this. No vulnerability was found.

Verification

Command Exit Result
python3 -m unittest tests.test_reroute tests.test_environment_recovery tests.test_cycle 0 Ran 92 tests … OK
python3 -m unittest -v tests.test_reroute.ReconciliationBoundaryTests 0 7 tests OK, including test_existing_foreign_pull_edits_stop_a_reroute
python3 scripts/validate-package.py 0 VALID: 16 skills (7 cycle, 9 supporting), shared sections in sync, cross-agent manifests aligned
python3 -m unittest discover -s tests 1 Ran 1608 tests, FAILED (failures=1, errors=62)

The full-suite result matches the initial review's run in this stage's sandbox:

  • All 62 errors are in test_validate_package. copy_package → shutil.copytree hits Permission denied on dotfiles and .claude/* entries that this stage's sandbox masks in the clone.
  • The single failure is test_executors.ReadOnlyVerificationTests.test_scratch_never_uses_a_temp_parent_inside_the_checkout ("no temporary directory outside the dispatch checkout"), which depends on this stage's temp layout.

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 ecf4f330fbdfd917c8d5f7e04d84e86e8db2261d: 6 passed, 0 failed, 0 pending.

Check State
Skills, manifests, and Bash installer (required) SUCCESS
PowerShell installer (required) SUCCESS
Windows test shard (windows-1) SUCCESS
Windows test shard (windows-2) SUCCESS
Windows test shard (windows-3) SUCCESS
Windows test shard (windows-4) SUCCESS

Residual risks

  • Any edit to any pre-existing in-scope pull request now stops a reroute, including an unrelated maintainer edit, because GitHub records no editor identity. This is conservative and documented in docs/routing.md and CHANGELOG.md.
  • A cycle authenticated with a GitHub App installation token cannot read gh api user. Publishing reroutes then stop with evidence_unavailable, which fails closed.
  • Publications by the cycle account outside the in-scope pull requests and the issue are still not observed. This predates the change.

Verdict

APPROVED: REV-001 is resolved and verified, no new findings, and every required check passed on the reviewed head. Merging remains a manual decision.

@datacas

datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

[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:2

Rereview (verifying recovered attempt) — APPROVED

Head reviewed: ecf4f330fbdfd917c8d5f7e04d84e86e8db2261d (base main, merge base 2fa8dfdc32d59efec3d964bd0bbb309446449e90). Previous reviewed head: 6a2f508739d58c0e14095cdf54c0bbe2b02ca185. Work item #268.

This run independently checks the rereview that attempt attempt-d342ddc989c343f89b512cfedeb0c252 published (CCR-20261019-002, APPROVED, REV-001 resolved) on the same head. I did not reuse its result: I re-read the diff and reran the verification here.

What changed since the previous review

ecf4f33, compared with 6a2f508, touches 4 files (+57/−13): scripts/reroute.py, tests/test_reroute.py, docs/routing.md and CHANGELOG.md. effect_snapshot now records observed_pulls: number, state, headRefOid and a title/body digest for every in-scope PR. It also keeps the cycle account's own pulls. reconcile returns publication_changed when any PR from before["observed_pulls"] has changed or is missing in after. A foreign PR that only appears between the two snapshots is still ignored.

Scope

  • I read the complete accumulated diff in sections: 378 lines (count confirmed), 6 files.
  • I read the base-side scripts/reroute.py at 6a2f508 (git show) to confirm the regression the test guards against.
  • I read the only caller, scripts/cycle.py snapshot(). Any exception becomes None, which reconcile turns into evidence_unavailable, so the gate fails closed.
  • Repository conventions: AGENTS.md and .code-cycle.yml. The trusted author for recovered state is datacas. All four prior comments are by datacas, and the recovered ID history is REV-001 only, with no collision.

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 reroute

Corrected and verified by execution. At 6a2f508, _own_pulls dropped every pull that _authored_by did not match. A PR seeded with author=someone-else therefore produced pulls=[] in both snapshots, and any close, reopen or text edit returned no_effects. At ecf4f33, reconcile (scripts/reroute.py, the observed_pulls comparison) compares every pre-existing pull, whoever authored it.

tests.test_reroute.ReconciliationBoundaryTests.test_existing_foreign_pull_edits_stop_a_reroute passed on this head. It covers closed, reopened, merged, head pushed, retitled and body edited (each returns publication_changed), plus unchanged and metadata-only (each returns no_effects). It runs each case through branch discovery (gh pr list) and through explicit change_request_id="7" (gh pr view).

The test discriminates. _remote_ref_fingerprint is patched to a constant, so on the old code nothing else would catch these cases. Q-001 behaviour is preserved: in test_only_the_cycle_accounts_publications_stop_a_reroute, the case "other account PR", a new foreign PR on the branch, still returns no_effects.

New findings

None.

Security triage

.code-cycle.yml declares no security_review.always_when. The default rule matched no changed path, file name or label (the PR has no labels). As in the earlier reviews, I ran the audit on reviewer judgement because the change touches the cycle's publication-boundary gate. Findings:

  • The fix only makes the gate stricter for pre-existing PRs.
  • It adds no new external call; the gh pr view/list fields are unchanged since 6a2f508.
  • It uses only login from gh api user and handles no credential.
  • The recovery guidance enables no grant: unix_sockets is absent, and a test asserts it.

No vulnerability found.

Verification

Command Exit Result
python3 -m unittest -v tests.test_reroute.ReconciliationBoundaryTests 0 Ran 7 tests … OK, including test_existing_foreign_pull_edits_stop_a_reroute
python3 -m unittest tests.test_reroute tests.test_environment_recovery tests.test_cycle 0 Ran 92 tests … OK
python3 scripts/validate-package.py 0 VALID: 16 skills (7 cycle, 9 supporting), shared sections in sync, cross-agent manifests aligned
python3 -m unittest discover -s tests 1 Ran 1608 tests in 198.754s, FAILED (failures=1, errors=62)

The full-suite result is identical to the initial review and the recovered rereview in this stage's sandbox:

  • 62 errors, all in test_validate_package: copy_package → shutil.copytree → [Errno 13] Permission denied on dotfiles and .claude/* entries that this stage's sandbox masks in the clone, such as .bashrc, .mcp.json and .claude/settings.json.
  • 1 failure: test_executors.ReadOnlyVerificationTests.test_scratch_never_uses_a_temp_parent_inside_the_checkout ("no temporary directory outside the dispatch checkout"), which depends on this stage's temp layout.

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 ecf4f330fbdfd917c8d5f7e04d84e86e8db2261d: 6 passed, 0 failed, 0 pending. gh pr checks --required reports 2 required checks, both passed.

Check State
Skills, manifests, and Bash installer SUCCESS
PowerShell installer SUCCESS
Windows test shard (windows-1) SUCCESS
Windows test shard (windows-2) SUCCESS
Windows test shard (windows-3) SUCCESS
Windows test shard (windows-4) SUCCESS

Residual risks

  • Any edit to any pre-existing in-scope PR stops a reroute, including an unrelated maintainer edit, because GitHub records no editor. This is conservative and documented.
  • A cycle authenticated with a GitHub App installation token cannot read gh api user, so publishing reroutes stop with evidence_unavailable. This fails closed.
  • The cycle account's publications outside the in-scope PRs and the issue are still not observed. This predates the change.

Verdict

APPROVED. 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.

@datacas

datacas commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

Evidence for a manual merge decision: head ecf4f33

Cycle result: HUMAN_INTERVENTION. The stop is #276, not a finding: both round 1 rereview attempts ended their turn while the full suite was still running in the background (unreadable_result), so the runtime could not confirm the recovered result. The verifying rereview did publish APPROVED on ecf4f33 (above), with REV-001 resolved and no new findings.

Host results (ecf4f33)

  • python3 -m unittest discover -s tests: 1608 tests, OK (145 s).
  • python3 scripts/validate-package.py: VALID.
  • GitHub CI: 6/6 checks SUCCESS.

Review sandbox results: environment only, tracked in #274

  • python3 -m unittest discover -s tests: 1608 tests, FAILED (failures=1, errors=62). These are the same 62 test_validate_package errors and 1 test_executors failure reproduced on main de2e35b. They are not in this diff.
  • Targeted runs passed in the sandbox: tests.test_reroute tests.test_environment_recovery tests.test_cycle (92 OK), and ReconciliationBoundaryTests (7 OK), including test_existing_foreign_pull_edits_stop_a_reroute.

Scope against #268 and its decisions

  • Q-001: a reroute stops only on publications created or edited by the cycle's own account after the stage started. This includes edits to an existing PR opened by another account (REV-001).
  • Q-002: no Unix-socket grant is enabled. The Codex app-server socket failure is a nested Codex sandbox limit (/tmp/codex-daemon-<uid> is fixed by Codex 0.163.0 and masked by the outer sandbox). The fix documents it and reports it as sandbox_filesystem_access. A direct Codex writing stage starts and runs, as the issue_review stage cannot run git grep/ls-files/blame: the stage command table excludes it from GIT_REVIEW_READ #270 cycle showed.

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.

Codex write stages fail: /tmp/codex-daemon-<uid> masked in the stage sandbox, and reroute stops on publication_changed

1 participant