Repository navigation
Dispatch a stage with the permission its role needs - #17
Conversation
Four canary runs had an implementer that could not implement. The fourth said why, now that the reason is shown: "GitHub access and issue resolution succeeded, but the required branch creation and README edit were blocked by the read-only workspace." `codex exec` is read-only unless told otherwise and nothing here had ever told it. The two CLIs default in opposite directions and nobody had declared either. Codex refuses to write; a dispatched Claude created a file with no flag at all, observed on a live probe. So neither default can be relied on, and the role decides: implement and resolve may write the tree they were given, everything else reads it. A reviewer that can edit the change it is judging is a reviewer nobody can trust afterwards. Codex gets `-s workspace-write` or `-s read-only`, stated either way rather than left to a default that may change. Claude gets `--permission-mode acceptEdits` when writing, which declares what is already happening rather than granting something new. No argument list built here asks for `danger-full-access` or any bypass flag, asserted over the commands rather than over the source text -- because the source mentions those names precisely to say they are not used, and the first version of that test failed on its own comment. For a reading Claude stage there is no honest flag and this does not invent one. `--permission-mode plan` refuses the edit but turns the task into planning it, which is not a review. Disallowing Edit, Write and NotebookEdit does not stop a write: the probe created the file anyway. A Claude reviewer is confined by the directory it is given, which is the isolation invariant this toolkit already states, and not by an argument.
Review summaryReviewed PR 17 at head The Codex path implements that model, but the accumulated change does not enforce it for every executor the cycle can select. That leaves one blocking review-integrity and authorization finding. Findings[REV-001] · high · open · blocks:yes — Claude and Orca review stages are not confined to read-only workspacesFiles:
I reproduced the current wiring with non-executing adapters: implement and review received the same workspace path, with This invalidates the new policy's stated premise that a reviewer must not be able to edit the change it judges. A Claude or Orca reviewer can modify the diff before reporting a verdict, making the review result and post-review tree untrustworthy. The existing tests only assert propagation of the boolean and absence of a Claude flag; they do not prove non-mutation. Do not dispatch a review or rereview to an executor that cannot enforce non-mutation in this runner. Either route those roles only to a read-only-capable executor, or provide a distinct immutable/sandboxed review workspace and verify its tree or head is unchanged after the stage. Cover the real enforcement boundary in tests and fail closed when it is unavailable. Security triage and auditSensitive change: the diff changes execution permissions and worktree access for autonomous agents. The security audit confirmed REV-001 as a review-integrity/authorization failure. It found no additional command-injection path: native commands are executed as argument lists without a shell, and the constructed commands do not request full-access or bypass flags. No secret, token, or persistence exposure was introduced by the reviewed diff. VerificationPreflight succeeded; this Python toolkit has no required service, migration, or runtime configuration for its unit-test workflow.
Live Codex/Claude execution was not run because it would require real credentials and a workspace that could be mutated. The deterministic command-construction and cycle-wiring reproduction above verifies the current implementation boundary, but not any future provider-side permission behavior. CIAll four current check runs are completed successfully, with no pending, failed, cancelled, or skipped checks:
Residual riskThe Codex role mapping is tested and preserves a sandboxed read-only review path. Until REV-001 is resolved, however, routing a review to Claude or Orca still permits the reviewer to alter its subject; green unit and CI checks do not establish independent review integrity. VerdictCHANGES_REQUESTED — resolve REV-001 before approval. |
Resolution summaryResolved the valid review-integrity finding on head [REV-001] · high · resolved · blocks:yes — Claude and Orca review stages are not confined to read-only workspacesThe finding was valid. Review and rereview are now routed by default to Codex with its explicit Regression coverage proves that configured Claude review dispatches never invoke the adapter, Codex read-only dispatches do proceed, and both default review profiles select Codex. Installed-cycle coverage now exercises the Codex review route. Verification passed:
The post-change code review found and corrected the readiness-telemetry detail above. The scoped security audit found no confirmed vulnerabilities or command-injection, secret-exposure, or authorization bypass regressions. CI is still running on the pushed commit: two Skills/manifests/Bash-installer jobs and two PowerShell-installer jobs are |
Re-review summaryRe-reviewed PR 17 at head Since the previous review ( The accumulated change is coherent and the previous blocking finding is genuinely closed. Four non-blocking findings remain, all consequences of the new boundary rather than defects in it. Previous findings[REV-001] · high · resolved · blocks:yes — Claude and Orca review stages are not confined to read-only workspacesFiles: Corrected and verified by execution, not from the diff. I re-ran the original reproduction against the current head:
New findings[REV-002] · medium · open · blocks:no — The dispatch guard fails open when
|
| role | profile | executor | gate |
|---|---|---|---|
security |
security |
claude | BLOCKED(read_only_enforcement) |
verify |
cheap_tool |
claude | BLOCKED(read_only_enforcement) |
run |
cheap_tool |
claude | BLOCKED(read_only_enforcement) |
bootstrap |
cheap_tool |
claude | BLOCKED(read_only_enforcement) |
coordinate |
coordinator |
codex | ok |
These are declared roles: router.profile_for handles each explicitly, PROFILE_COST prices them, telemetry.py lists them as valid, and test_router.py::test_the_security_audit_always_uses_the_security_profile still asserts a route that can no longer be dispatched. Nothing breaks today because run_cycle.py dispatches only implement, review, resolve and rereview — hence non-blocking — but the router now advertises routes the dispatcher will always refuse. Either point those profiles at a read-only-enforcing executor, or state which roles the boundary is deliberately not for. verify in particular is worth deciding on explicitly: a test run that writes build artefacts is not obviously a read-only stage.
[REV-004] · medium · open · blocks:no — Review lost every fallback, so any non-READY Codex ends the cycle
Files: scripts/router.py:160, tests/test_installed_cycle.py:163
reviewer and senior_reviewer previously had a Claude fallback; both are now single-target. I routed review under each availability value: UNKNOWN, INSTALLED, AUTHENTICATED and QUOTA_EXHAUSTED all return blocked=True with "no executor for this profile is ready". Only READY routes. implement and resolve keep their Claude fallback, so Codex is now a single point of failure for exactly one half of the cycle.
The diff records this, but only as a flipped assertion: test_the_fallback_runs_when_the_primary_is_exhausted changed from assertEqual(0, result.returncode) to assertEqual(1, ...) plus HUMAN_INTERVENTION. The implementation still falls back to Claude and succeeds; the cycle then halts at review because Codex is exhausted. That is the correct fail-closed direction, but it is a real availability change — a Codex quota exhaustion that used to complete a cycle now stops it — and neither the PR description, the CHANGELOG entry, nor docs/instrumentation.md says so. One sentence in the CHANGELOG stating the trade-off would close this.
[REV-005] · low · open · blocks:no — The Orca skill path is outside the boundary and nothing says so
Files: skills/cc-orca-orchestrator/SKILL.md:149, README.md:498
cc-orca-orchestrator instructs "Place every worker of the run in the same worktree, because they share one PR branch", with calibration reviewers as the only exception, and documents reviewer defaulting to claude. That path dispatches through orca orchestration worker-start, not through executors.dispatch, so the new guard never sees it: under Orca supervision the reviewer still shares the writable worktree the implementer just used — the condition REV-001 named.
The new prose is careful and does not over-claim: cc-orchestrator/SKILL.md and docs/instrumentation.md both scope the guarantee to profiles and adapters. So this is a gap in coverage, not a false statement, and it is pre-existing rather than introduced here. Worth one sentence in cc-orca-orchestrator saying the read-only dispatch boundary does not apply to its supervised workers, so a reader of both skills is not left to infer it. The same applies to the reviewer_a calibration profile in .code-cycle.yml, which names a Claude reviewer that the driver path would now refuse.
Security triage and audit
Sensitive change: the diff alters the execution permissions and workspace access of autonomous agents, which matches the toolkit's own authorization and permission triggers. The audit ran and found no confirmed vulnerability.
- No shell is used anywhere on the dispatch path:
_runcallssubprocess.run(argv, ...)with an argument list, and the task prompt is a single argv element, so no command-injection path exists. - Asserted over the commands actually built, not over the source text: no rendered argument list requests
danger-full-access,--dangerously-skip-permissions,--dangerously-bypass-approvals-and-sandboxorbypassPermissions, for either executor and for bothwritesvalues. - No secret, token, credential or persistence surface is introduced or widened by the diff.
- The authorization change itself is a tightening: the only new privilege is
-s workspace-writeonimplementandresolve, scoped to the directory the dispatch was given, and--permission-mode acceptEditson a writing Claude stage, which declares behaviour a live probe showed already happens by default.
REV-002 is reported above as a boundary-consistency defect rather than an exploitable vulnerability, because no production caller reaches the fail-open path.
Verification
Preflight succeeded; this toolkit needs no service, migration or runtime configuration for its test workflow.
python3 -m unittest discover -s tests—Ran 416 tests in 15.577s,OK.python3 scripts/validate-package.py—VALID: 12 skills (6 cycle, 6 supporting), shared sections in sync, cross-agent manifests aligned.git diff --check 45e341b...57bfe8d— clean.- REV-001 reproduction, re-run at the current head — results under that finding above.
- Role/profile/gate enumeration across all nine declared roles and all five availability values — results under REV-003 and REV-004.
- Rendered commands inspected for both executors and both permission values.
Not verified. No live codex exec or claude -p run was made, so the claim that -s read-only actually prevents a mutation is taken from the CLI's documented behaviour and the canary report, not observed here — that would need real credentials and a tree that could be mutated. Consequently enforces_read_only = True on CodexAdapter is an assertion about Codex, verified only at the level of the command this repository builds. The -c model_reasoning_effort=<effort> override is also unchanged by this diff and was not exercised against a real Codex parser.
CI
All four check runs on head 57bfe8d are completed and successful, with none pending, failed, cancelled or skipped. gh pr checks 17 reports Passed: 4, Failed: 0.
Skills, manifests, and Bash installer— success (two runs, push and pull_request triggers).PowerShell installer— success (two runs).
Residual risk
The read-only boundary is enforced where the driver dispatches and fails closed elsewhere, which is the right shape. What remains is scope rather than correctness: the guard is only as strong as Codex's sandbox, which this repository asserts but cannot demonstrate from a unit test (see Not verified); the Orca supervised path is outside it (REV-005); and the driver-level tests exercise the wiring through ScriptedAdapter, which sets enforces_read_only = True, so the real guard is proven in tests/test_executors.py and through the installed cycle rather than in test_run_cycle.py. Removing the review fallbacks trades availability for integrity (REV-004); that is a defensible choice, but it is currently recorded only in a test assertion.
parse_target accepts any non-empty effort token, including one containing a newline, which reaches codex -c model_reasoning_effort=<value> as a single argument. Whether Codex's TOML override parser would read a second key from it was not tested and is not something this diff changed; it is noted as residual risk, not as a finding.
Verdict
APPROVED — REV-001 is corrected and verified by execution, all four required checks pass on the reviewed head, and no open finding blocks approval. REV-002 through REV-005 are worth addressing but none of them holds up this change.
Final resolution updateNo new review feedback or line-level threads were added after the resolution commit [REV-001] · high · resolved · blocks:yes — Claude and Orca review stages are not confined to read-only workspacesThe valid finding remains resolved at the current HEAD. Review and rereview default to Codex with explicit Verification remains green:
CI is complete: both |
Re-review summaryRe-reviewed PR 17 at head No code changed since the previous re-review. The head SHA is identical, the branch matches One thing did change: the review record. A comment published at 08:12:20Z (#issuecomment-5773242636) states that "No new review feedback or line-level threads were added after the resolution commit Previous findings[REV-001] · high · resolved · blocks:yes — Claude and Orca review stages are not confined to read-only workspacesFiles: Still corrected, re-verified by execution at this head rather than carried over:
[REV-002] · medium · open · blocks:no — The dispatch guard fails open when
|
Resolution update[REV-001] · high · resolved · blocks:yes — Review stages were not guaranteed read-onlyResolved in the preceding branch update. Review dispatches now use an adapter with enforced read-only capability; unconfined adapters are rejected at the central boundary. [REV-002] · medium · resolved · blocks:yes — Omitted writes could bypass read-only enforcementResolved in 4882612. The central dispatcher now defaults an omitted writes permission to read-only and rejects adapters that cannot enforce that boundary. A regression test verifies that a direct dispatch without writes does not invoke Claude. [REV-003] · medium · open · blocks:no — Auxiliary non-writing roles need an explicit workspace policyKept as a follow-up. The role policy for security, verify, run, and bootstrap requires an explicit decision between strict read-only, workspace-write, or a disposable workspace before their default routing can be broadened safely. [REV-004] · low · resolved · blocks:no — Review availability trade-off was undocumentedDocumented in the instrumentation guide and orchestrator skill. Default review profiles intentionally have no fallback: a review blocks when Codex is unavailable instead of falling back to an adapter without a proven immutable workspace. This favors integrity over availability. [REV-005] · medium · open · blocks:no — Direct Orca adapter use lacks an explicit isolation contractKept as a follow-up. Production cycle dispatches traverse the central permission gate, but the direct Orca adapter API does not itself prove immutable or isolated workspace behavior. Any future direct reviewer fallback must supply that guarantee. Validation
All GitHub checks for the current PR head completed successfully. Finding recovery follow-upThe accumulated finding-recovery behavior was not changed in this PR. It should be handled separately by reconstructing findings from stable IDs across review comments rather than treating the latest comment as authoritative. Resolution status: PARTIALLY_RESOLVED. No blocking findings remain. |
Re-review summaryRe-reviewed PR 17 at head Since the previous review ( Two of the four open findings are closed and verified. REV-003 and REV-005 are unchanged and remain open by explicit decision. One new low finding comes out of the fix itself. A note on finding headers. The resolution comment at #issuecomment-5773462901 republished REV-002, REV-004 and REV-005 with different severities and Previous findings[REV-001] · high · resolved · blocks:yes — Claude and Orca review stages are not confined to read-only workspacesFiles: Still corrected, re-verified by execution at this head:
[REV-002] · medium · resolved · blocks:no — The dispatch guard fails open when
|
What the fourth canary said
The observability PR paid for itself on its first run. Same
BLOCKED, but now with the reason on screen:codex execis read-only unless told otherwise, and nothing inCodexAdapter.argvhad ever told it. Four canary runs had an implementer that could not implement, and the first two reported a cause — "GitHub authentication is invalid and the GitHub API is unreachable" — that I disproved by hand at the cost of three extra dispatches.The two CLIs default in opposite directions
Neither default was declared anywhere, and they disagree:
codex exec--help:-s read-only | workspace-write | danger-full-access; the canary's own reportclaude -pprobe-write.txtwith no flag at allSo neither can be relied on. The role decides:
implementandresolvemay write the tree they were given, everything else reads it. A reviewer that can edit the change it is judging is a reviewer nobody can trust afterwards.-s workspace-writeor-s read-only, stated either way rather than left to a default that may change.--permission-mode acceptEditswhen writing — declaring what already happens, not granting something new.danger-full-access,--dangerously-skip-permissions,--dangerously-bypass-approvals-and-sandboxorbypassPermissions.What it does not claim
A reading Claude stage gets no flag, because none of them confines it honestly. Both candidates were tried live, not reasoned about:
--permission-mode planrefuses the edit, and turns the task into planning it: "Plan mode is active — I can't create probe-plan.txt … Do you want to exit plan mode?" That is not a review.--disallowedTools Edit Write NotebookEditdoes not stop a write: the probe reported "Write succeeded" and the file was on disk.A Claude reviewer is confined by the directory it is given — the isolation invariant this toolkit already states for paired reviews — and not by an argument. Saying so beats shipping a flag that reads like a guarantee and is not one.
Tests
413 (was 404). At the adapter: a writing stage gets
workspace-write, a reading one saysread-onlyrather than relying on the default, asking for nothing asks for the smaller permission, Claude declares a writing stage, Claude claims no confinement it does not have, and the permission reachesargvfrom the dispatch call. At the driver: the implementer may write and the reviewer may not, across both the first round and the resolve/rereview round.One test caught a real imprecision in its own first version. It asserted
danger-full-accesswas absent fromscripts/executors.py— and failed, on the comment that says the flag is deliberately unused. It now asserts over the commands actually built, which is the claim worth making.Verification
python3 -m unittest discover -s tests—Ran 413 tests ... OK.python3 scripts/validate-package.py—VALID.After this
Canary 5, and for the first time the implementer can actually do the work. If it reaches
IMPLEMENTED, the review follows and the chain is finally closed end to end. Issue #15 stays open until then.