Skip to content

Define workspace policy for auxiliary non-writing roles - #25

Merged
datacas merged 3 commits into
mainfrom
issue-20-auxiliary-workspace-policy
Sep 22, 2026
Merged

datacas merged 3 commits into
mainfrom
issue-20-auxiliary-workspace-policy

Conversation

@datacas

@datacas datacas commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • define explicit workspace contracts for every cycle role
  • keep security and bootstrap strictly read-only
  • run verify and run only in an isolated disposable workspace that may hold generated artifacts
  • filter routing to adapters that can satisfy the requested policy and fail closed at dispatch
  • document the policy and cover routing, isolation, telemetry, and regression behavior

Verification

Give security, bootstrap, verify, and run explicit workspace contracts, enforce compatible executor routing, and document disposable artifact isolation.
@datacas

datacas commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Initial review — cc-initial-review

Verdict: CHANGES_REQUESTED. Blocking findings: REV-001, REV-002.

The workspace-contract design is sound and the fail-closed direction is the right one: security finally routes to an adapter that can actually enforce read-only, DisposableWorkspace resolves symlinks before comparing paths (a symlinked disposable directory pointing into the source tree is correctly rejected), and the policy is consumed by the dispatch layer rather than leaked to adapters. Two problems stop approval: an undocumented side effect of the profile change breaks a configuration the toolkit itself ships as an example, and the disposable policy grants write permission to the one adapter this repository has repeatedly documented as unconfinable.

Reviewed scope: accumulated diff 8f9bfaf..1d072a1 (10 files, +273/−22): scripts/cycle.py, scripts/executors.py, scripts/router.py, scripts/telemetry.py, docs/role-workspace-policy.md, and the four test modules. Conventions applied: CONTRIBUTING.md (no AGENTS.md or CLAUDE.md in this repository); output language English, taken from those instructions.


Findings

[REV-001] · high · open · blocks:yes — Dropping claude-opus-5 from the default profiles makes a documented configuration unrecordable

scripts/router.py:164, scripts/telemetry.py:174-207, skills/cc-provider-bootstrap/SKILL.md:103

known_models() is a closed set built only from router.DEFAULT_PROFILES, never from a repository's own profiles block. This PR removes the last occurrence of claude-opus-5 from those defaults, so the set shrinks from five names to four. Any repository whose .code-cycle.yml still names that model routes fine, dispatches fine, and then dies when the stage row is written — after the stage has been paid for.

The configuration that breaks is the one this toolkit ships as its own example:

code_cycle:
  profiles:
    senior_reviewer:
      primary: "claude:anthropic/claude-opus-5 high"

Observed at runtime on this branch:

known_models: ['claude-haiku-4-5-20251001', 'claude-sonnet-5', 'gpt-5.6-luna', 'gpt-5.6-terra']
TelemetryError: 'model_requested' must name a model this toolkit knows, not 'claude-opus-5'.

The test diff shows the blast radius rather than the intent: tests/test_telemetry.py:236 and tests/test_cycle.py:352 were edited away from claude-opus-5 because the name stopped being valid, and tests/test_run_cycle.py:613 had to follow. The PR description, the new document, and CHANGELOG.md say nothing about a model change at all — the router comment frames it purely as a read-only enforcement decision.

Either keep claude-opus-5 reachable from the closed set, or update skills/cc-provider-bootstrap/SKILL.md and say in the changelog that configurations naming it must be migrated. Silently narrowing a validation set that a shipped example depends on is the "absent configuration silently disables the thing it configures" failure that _known_models()'s own docstring names.

[REV-002] · medium · open · blocks:yes — The disposable policy hands write permission to the adapter that cannot be confined

scripts/executors.py:298-312, scripts/cycle.py:155-158, docs/role-workspace-policy.md:3,10

For DISPOSABLE, supports_workspace_policy() checks only that a DisposableWorkspace was declared and that cwd equals its path. It never consults enforces_read_only, and cycle.py sets writes=True for the policy. The default profile for verify and run is cheap_tool, which is Claude-only with no fallback (router.py:153, router.py:285-287) — so the documented way to make these roles run resolves to Claude.

Observed on this branch:

outcome: DispatchOutcome.SUCCEEDED
argv: ['claude', '-p', 'run the test suite', '--model', 'claude-sonnet-5', '--effort', 'high',
       '--output-format', 'json', '--permission-mode', 'acceptEdits']
proc cwd: /tmp/disposable-verify

Only the process working directory separates that agent from the source tree, and executors.py:618-623 already states the consequence in its own words: there is no flag that confines a non-writing stage here, and "a reviewer is confined by the directory it is given, not by an argument." An absolute path out of the disposable directory is not blocked by anything in this change. Codex under the identical policy is genuinely sandboxed — -s workspace-write -C <disposable> — which is exactly the asymmetry the new document draws for read_only and then drops for disposable.

Meanwhile docs/role-workspace-policy.md:3 says the contract "is enforced by scripts/cycle.py and scripts/executors.py", and line 10 lists repository mutation as "Forbidden in the source workspace" for verify and run. For Claude that is advisory, not enforced.

Before this change those roles ran with writes=False and Claude was blocked outright, so this is a real widening of the least-privilege boundary issue #20 asked not to weaken. Resolve it in one of two directions — require an adapter that can confine the dispatch for disposable too, or keep the current design and have the document state plainly that for a non-enforcing adapter the isolation is the caller's responsibility and the source tree is not protected by the contract.

[REV-003] · low · open · blocks:no — A decision blocked by policy reports an availability reason that is untrue

scripts/router.py:339-342,358-366

When eligibility filtering removes every target, the decision still ends with "no executor for this profile is ready", although the executor may be READY and merely ineligible. Observed:

route("verify", ...) -> blocked
reasons: ('a step whose result is judged by execution, not by judgement',
          'claude cannot satisfy the workspace policy',
          'no executor for this profile is ready')

The fallback path has the same defect, and there it is more misleading because the decision is not blocked. A primary skipped by continue never updates primary_state, so the audit trail attributes a policy-driven fallback to availability:

target: codex  fallback: True
reasons: ('ordinary change uses the standard reviewer',
          'claude cannot satisfy the workspace policy',
          'primary executor claude is ready -> fell back to codex')

"primary executor claude is ready -> fell back to codex" is self-contradicting. route()'s own comment at router.py:350-353 is the standard being missed: "a routing decision is only auditable if its reasons are true."

[REV-004] · low · open · blocks:no — The security profile's relative cost was not revisited with its target

scripts/router.py:160,175

PROFILE_COST["security"] stays at 6.0, the figure calibrated when the profile was claude:anthropic/claude-opus-5 high. The profile now resolves to codex:openai/gpt-5.6-terra high — byte-for-byte the reviewer target, which the same table prices at 3.0. estimate_cost() now charges double for an identical dispatch.

[REV-005] · low · open · blocks:no — RoleContract.generated_artifacts is never read

scripts/cycle.py:58,67-68

The field is declared and set for verify and run, but no production path reads it; the only consumer is the assertion at tests/test_cycle.py:172. The "necessary generated artifacts versus unauthorized repository mutations" distinction that issue #20 asks for is carried entirely by the prose document and by writes=True. Either let the field decide something — it is the natural place to gate whether a policy may produce artifacts at all — or drop it so the contract does not advertise a knob that has no effect.

[REV-006] · low · open · blocks:no — The change is not reachable from the project's own documentation entry points

CHANGELOG.md, docs/role-workspace-policy.md

CHANGELOG.md has an open [Unreleased] section and every comparable merged change updates it — #24, #22, #17, #16, #14, #13 all touch the file. This PR changes dispatch behaviour for five roles and the default security model, and adds nothing.

docs/role-workspace-policy.md is likewise referenced from nowhere: README.md links docs/provider-contract.md and docs/instrumentation.md, and six skills point at docs/provider-contract.md, but no file mentions the new document. Since CONTRIBUTING.md is explicit that a wording change in these files is a behaviour change, a behaviour document nothing links to will not be found by the people it is written for.


Security triage and audit

Sensitive change — the audit ran. Triage matched on authorization, roles and policies, and excessive permissions: the diff defines and enforces the privilege boundary for every dispatched role. The PR carries no labels, so the file surface was the trigger.

cc-security-review ran as a delegated pass, degraded: its criteria were applied directly with this repository's own tooling rather than as a separately dispatched agent, and it published nothing of its own. It returned REV-002 as its only finding above informational, plus these observations:

  • DisposableWorkspace.source_path is caller-declared and never related to the repository actually under review (executors.py:104-118). A caller can declare a source path unrelated to the real tree and satisfy the contract while cwd sits inside the repository. This matches the existing OrcaReviewWorkspace self-declaration model, so it is consistent rather than new — recorded as residual risk, not a finding.
  • _paths_overlap() canonicalises through Path.resolve(), so symlink escape is closed. Verified: a disposable path symlinked to <source>/build is rejected.
  • No secret, injection, deserialisation, web, or network surface in this diff. The prompt reaches argv as a single non-shell argument.
  • WORKSPACE_WRITE returns True for every adapter unconditionally, but OrcaAdapter.dispatch still blocks without an orchestration context, so nothing was lost there.

Commands and flows executed

Command Result
python3 -m unittest discover -s tests -p 'test_*.py' OK — 451 tests, matching the PR description
python3 scripts/validate-package.py VALID — 12 skills, shared sections in sync, manifests aligned
Registry.compatible_executors(DISPOSABLE, writes=True, cwd=...) with no workspace frozenset() → route("verify", ...) blocks. Fail-closed confirmed; reason text is REV-003
ex.dispatch(...) with Claude + DisposableWorkspace SUCCEEDED with --permission-mode acceptEdits. Evidence for REV-002
Telemetry.record_stage(model_requested="claude-opus-5") TelemetryError. Evidence for REV-001
DisposableWorkspace(<symlink into source>, <source>) ExecutorError. Symlink escape closed
route("review", ..., eligible_executors={"codex"}) with a Claude primary used_fallback=True, reason "primary executor claude is ready -> fell back to codex". Evidence for REV-003

Runtime evidence is distinguished from inspection above: REV-001, REV-002 and REV-003 were each reproduced by execution on this branch. REV-004, REV-005 and REV-006 come from code and repository inspection only.

Not verified

  • No end-to-end run of a real verify or run stage against a live Codex or Claude binary; the adapter behaviour above was observed through the injected runner, so the argv and working directory are confirmed but the agents' actual filesystem behaviour is not.
  • The claim in REV-002 that Claude can write outside its working directory is taken from this repository's own recorded live probe (executors.py:621-623), not re-probed here.
  • bootstrap and coordinate were exercised only through routing, not dispatched.

CI

Both jobs of the single workflow (.github/workflows/validate.yml, "Validate package") passed on both runs of the head commit:

Check State
Skills, manifests, and Bash installer (Linux) pass — 23s, 51s
PowerShell installer (Windows) pass — 1m12s, 57s

No check is missing, pending, skipped or cancelled, and no repository policy suppresses a suite for this PR. Both jobs run validate-package.py and the full unittest discovery, so the green result covers the suite the PR description cites.

Residual risks

  • verify, run and bootstrap remain unroutable under the default profiles unless the caller supplies a workspace, because cheap_tool is Claude-only with no fallback. That is pre-existing rather than introduced here, but this PR is the one that makes it a documented contract, and the document does not mention it.
  • The workspace contract is entirely self-declared: nothing in the dispatch layer ties a declared source_path to the repository actually under review.
  • known_models() still derives from DEFAULT_PROFILES only, so every future profile edit silently changes which telemetry rows a configured repository can write. REV-001 is the current instance of a recurring hazard.

Verdict

CHANGES_REQUESTED — REV-001 and REV-002 block approval. Reviewed head: 1d072a15bbe278c8b52ca655a469a1ce87c61a80.

Preserve model compatibility, require confined disposable adapters, fix blocked routing telemetry, and document the role policy.
@datacas

datacas commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Review resolution — cc-resolve-comments

All six findings from the initial review are addressed in commit 9d0d8cf.

[REV-001] · high · resolved · blocks:yes — Dropping claude-opus-5 from the default profiles makes a documented configuration unrecordable

claude-opus-5 is retained as the security profile fallback, so the closed model registry remains compatible with existing configuration. The eligible-executor filter still prevents that unconstrained adapter from being selected for strict read-only security dispatches.

[REV-002] · medium · resolved · blocks:yes — The disposable policy hands write permission to the adapter that cannot be confined

Added enforces_workspace_boundary and require it for disposable. Codex is the eligible default auxiliary adapter; Claude and Orca are blocked for this policy unless they provide a proven boundary. Added a direct regression test proving Claude is not invoked.

[REV-003] · low · resolved · blocks:no — A decision blocked by policy reports an availability reason that is untrue

Routing now reports no executor for this profile satisfies the workspace policy when policy eligibility, rather than availability, is the blocking condition.

[REV-004] · low · resolved · blocks:no — The security profile's relative cost was not revisited with its target

The security profile cost now matches the Codex reviewer target (3.0), with a regression assertion.

[REV-005] · low · resolved · blocks:no — RoleContract.generated_artifacts is never read

Removed the unused field. The disposable workspace policy is the executable distinction that permits generated artifacts only outside the source workspace.

[REV-006] · low · resolved · blocks:no — The change is not reachable from the project's own documentation entry points

Linked docs/role-workspace-policy.md from README.md and added the behavior change to CHANGELOG.md. The document now also states that disposable dispatch requires a confining adapter.

Verification

  • python -m unittest discover -s tests -p 'test_*.py': 452 tests passed.\n- python -m compileall -q scripts tests: passed.\n- python scripts/validate-package.py: VALID.\n- GitHub checks: both Linux and PowerShell validation jobs passed on the updated head.\n- Post-change cc-code-review: no new P0/P1 findings.\n- Security review: no confirmed vulnerabilities; residual risk remains that source_path is caller-declared, consistent with the existing Orca workspace contract.\n\nNo review threads were open; the six findings above are recorded in this consolidated comment.

@datacas

datacas commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Re-review — cc-rereview

Verdict: APPROVED. No open finding blocks approval. Blocking findings: none.

Both blocking findings from the initial review are genuinely fixed and were reproduced as fixed by execution on this branch: claude-opus-5 is recordable again, and the disposable policy now refuses the adapter that cannot be confined. Of the four low findings claimed resolved, three are; REV-003 is only half fixed — the blocked branch tells the truth now, the fallback branch still does not. That plus three new low findings are recorded below. None of them blocks.

Reviewed scope: previous reviewed head 1d072a15bbe278c8b52ca655a469a1ce87c61a80, current head 9d0d8cfa358a4ecbadbde7bb417183e7c92dd27e. Accumulated diff 8f9bfaf..9d0d8cf (10 files, +320/−24); delta since the previous review, 12 files, +74/−29. Conventions applied: CONTRIBUTING.md (no AGENTS.md or CLAUDE.md in this repository); output language English, taken from those instructions. No review threads exist on this pull request, so the two consolidated comments are the whole record.


What changed since the previous review

  • router.py: security gained a claude:anthropic/claude-opus-5 high fallback behind the Codex primary; the blocked-because text distinguishes policy ineligibility from unavailability; PROFILE_COST["security"] dropped to 3.0.
  • executors.py: new Adapter.enforces_workspace_boundary, set only on CodexAdapter, and required by supports_workspace_policy for DISPOSABLE.
  • cycle.py: RoleContract.generated_artifacts removed.
  • README.md links docs/role-workspace-policy.md; CHANGELOG.md records the behaviour change; the document states that disposable needs a confining adapter.
  • Tests: a direct regression test that Claude is never invoked under disposable, a cost-parity assertion, and auxiliary_tool routing assertions. 453 tests.

Status of every previous finding

[REV-001] · high · resolved · blocks:yes — Dropping claude-opus-5 from the default profiles makes a documented configuration unrecordable

Corrected and verified by execution. The closed set is five names again and the exact call that failed on the previous head now succeeds:

known_models: ['claude-haiku-4-5-20251001', 'claude-opus-5', 'claude-sonnet-5', 'gpt-5.6-luna', 'gpt-5.6-terra']
Telemetry.record_stage(..., model_requested="claude-opus-5") -> row 1

The shipped example in skills/cc-provider-bootstrap/SKILL.md:103 records again, and CHANGELOG.md now names the compatibility fallback explicitly. tests/test_telemetry.py:236 and tests/test_cycle.py:352 were moved back onto claude-opus-5, so the regression is pinned rather than merely repaired. See REV-009 for the mechanism that was used to repair it.

[REV-002] · medium · resolved · blocks:yes — The disposable policy hands write permission to the adapter that cannot be confined

Corrected and verified by execution. enforces_workspace_boundary is now required for DISPOSABLE and is set only on CodexAdapter (executors.py:275,311,542). Observed on this head with a valid DisposableWorkspace and matching cwd — the case that previously succeeded:

compatible_executors(DISPOSABLE, writes=True, workspace=ws, cwd=dis) -> {'codex'}
claude  + disposable -> DispatchOutcome.BLOCKED  missing_capability='disposable_workspace'
codex   + disposable -> DispatchOutcome.SUCCEEDED
  argv: ['codex','exec','-m','gpt-5.6-luna','-c','model_reasoning_effort=medium','--json',
         '-s','workspace-write','-C','/tmp/disp-x7m83gg2','run tests']

The acceptEdits dispatch that was the evidence for this finding is no longer reachable: the eligibility filter removes Claude before routing and dispatch() refuses it again afterwards, so the two layers fail closed independently. tests/test_executors.py:916 asserts the adapter is not invoked at all rather than asserting on the returned outcome, which is the stronger form. docs/role-workspace-policy.md:17-25 now states the boundary requirement instead of implying isolation from the cwd alone.

[REV-003] · low · open · blocks:no — A decision blocked by policy reports an availability reason that is untrue

Still reproducible on the fallback path. The blocked branch is fixed and verified:

route("verify", ..., eligible_executors=frozenset()) -> blocked
reasons: ('a step whose result is judged by execution, not by judgement',
          'codex cannot satisfy the workspace policy',
          'no executor for this profile satisfies the workspace policy')

The fallback branch is not. primary_state is still read once before the loop (router.py:340), and a primary removed by the new continue at router.py:342-346 never updates it, so the decision still attributes a policy-driven fallback to availability. The default profiles now put Codex first, so the same self-contradiction appears mirrored:

route("security", ..., eligible_executors=frozenset({"claude"}))
target: claude:anthropic/claude-opus-5 high   used_fallback: True
reasons: ('a security audit always uses the security profile',
          'codex cannot satisfy the workspace policy',
          'primary executor codex is ready -> fell back to claude')

The reasons tuple contradicts itself two lines apart: Codex could not satisfy the policy, and the audit trail says it was ready and was routed around. This is the half of the finding the initial review called "more misleading because the decision is not blocked", and the resolution comment marked the whole finding resolved. route()'s own comment at router.py:353-356 is still the standard being missed. Fixing it is a one-line change: set primary_state from the skip branch, or describe the primary with the reason it was actually skipped.

[REV-004] · low · resolved · blocks:no — The security profile's relative cost was not revisited with its target

Corrected and verified by execution. PROFILE_COST["security"] == PROFILE_COST["reviewer"] == 3.0, pinned by tests/test_router.py:210. The profile's primary is byte-for-byte the reviewer target, so the two now price identically.

[REV-005] · low · resolved · blocks:no — RoleContract.generated_artifacts is never read

Obsolete — the scope was removed. The field is gone from cycle.py and from the assertion that was its only consumer; a repository-wide grep finds the string only in a test method name. The artifact distinction is now carried by WorkspacePolicy.DISPOSABLE itself, which is executable, which is what the finding asked for.

[REV-006] · low · resolved · blocks:no — The change is not reachable from the project's own documentation entry points

Corrected by inspection. CHANGELOG.md:10-14 records the behaviour change under [Unreleased] / Added, and README.md:23-25 links docs/role-workspace-policy.md. The document is now reachable from the entry point the finding named. See REV-007 for a documentation surface this change left behind.


New findings

[REV-007] · low · open · blocks:no — The shipped routing documentation names a profile no role resolves to and omits the one they all now use

skills/cc-orchestrator/SKILL.md:155-156, docs/Plan de instrumentación y routing.md:247,272-274

profile_for() moved verify, run, and bootstrap from cheap_tool to the new auxiliary_tool (router.py:289). cheap_tool is now referenced by no role: it survives in DEFAULT_PROFILES, PROFILE_COST, and the telemetry vocabulary, but nothing routes to it.

The skill that tells an operator which profiles exist was not updated:

Name a profile, never a model. `cheap_coder`, `deep_coder`, `reviewer`,
`senior_reviewer`, `security`, `coordinator`, `cheap_tool` resolve through
`code_cycle.profiles` in `.code-cycle.yml`;

auxiliary_tool is absent from that list, and cheap_tool is listed as routable. A repository following this skill would override cheap_tool in .code-cycle.yml to steer its verification stages and observe no effect — the "absent configuration silently disables the thing it configures" shape again. docs/Plan de instrumentación y routing.md:272-274 still maps cc-provider-bootstrap, cc-run, and cc-verify to cheap_tool for the same reason.

CONTRIBUTING.md is explicit that these skill files are copied into other people's repositories, where nothing about this one is available to them, and that a wording change in them is a behaviour change. Either document auxiliary_tool in both places, or say why cheap_tool is retained.

[REV-008] · low · open · blocks:no — The disposable block message names a cause that is not the one that fired

scripts/executors.py:1002-1004

When DISPOSABLE is refused, the detail is always:

a disposable policy needs a DisposableWorkspace whose path is the dispatch cwd
and does not overlap the source workspace

supports_workspace_policy refuses for two independent reasons: a malformed workspace contract, or an adapter without enforces_workspace_boundary. Only the first is described. Reproduced above with a fully valid contract — DisposableWorkspace('/tmp/disp-…', '/tmp/src-…'), cwd equal to its path, no overlap — and Claude as the target: the message tells the operator to fix a workspace that has nothing wrong with it, and says nothing about the adapter, which is the actual and unfixable-by-workspace cause. This is the same class as REV-003 at the dispatch layer rather than the routing layer, and tests/test_executors.py:916 asserts only on missing_capability, so the wrong text is not caught.

[REV-009] · low · open · blocks:no — claude-opus-5 is kept alive by a fallback that routing can never select

scripts/router.py:163-166, scripts/telemetry.py:174-207

REV-001 was fixed by adding fallback: claude:anthropic/claude-opus-5 high to the security profile. That target is unreachable by design: security carries WorkspacePolicy.READ_ONLY, cycle.py:176-183 computes the eligible set from compatible_executors(READ_ONLY, …), Claude never satisfies it, and dispatch() refuses it a second time. Confirmed: compatible_executors(READ_ONLY, writes=False, cwd=<src>) -> {'codex'}. The comment above it says as much — Claude "cannot enforce this boundary".

So the entry is not a fallback. It is a registration in the model registry, written in the profile table because known_models() has no other input, placed in the one profile whose policy guarantees it will never be chosen. Two consequences:

  • The root cause REV-001 identified is untouched. known_models() still derives only from DEFAULT_PROFILES, so the next profile edit that drops a model name breaks configured repositories the same way, after the stage has been paid for. The residual risk was recorded in the initial review and is now load-bearing.
  • route() defaults eligible_executors to None, so a caller that routes without the eligible set does get claude-opus-5 back for security (reproduced above). cycle.py is the only in-tree caller and always passes the set, and dispatch() fails closed regardless, so nothing is exploitable — but an unreachable entry in a table read as configuration will be read as an intended fallback by the next person to edit it.

A model registry that does not double as a routing table would resolve both. At minimum, a comment at router.py:163 saying the entry exists to keep the name recordable and is not selectable would stop it being maintained as if it were.


Security triage and audit

Sensitive change — the audit ran. Triage matched again on the same triggers as the initial review: authorization, roles and policies, and excessive permissions. The diff defines the privilege boundary for every dispatched role, and the delta since the previous review changes that boundary directly. The pull request carries no labels, so the file surface is the trigger.

cc-security-review ran as a delegated pass, degraded: its criteria were applied with this repository's own tooling rather than as a separately dispatched agent, and it published nothing of its own. It returned no confirmed vulnerability and no finding above informational. Observations:

  • The REV-002 widening is closed at two independent layers, verified separately: routing eligibility (compatible_executors) and dispatch (supports_workspace_policy). Removing either still fails closed.
  • enforces_workspace_boundary defaults to False on Adapter, so a future adapter is ineligible for disposable until it opts in. Correct default direction.
  • No regression in the Isolate direct Orca review dispatches #24 Orca isolation contract, checked because dispatch() now pops workspace from kw before calling the adapter. Orca reads its review workspace from OrcaDispatchContext.review_workspace, not from that keyword, so the path is untouched. Verified: an Orca read-only dispatch with a valid OrcaReviewWorkspace still produces --worktree path:<review workspace> and is still eligible under READ_ONLY.
  • WORKSPACE_WRITE still returns True for every adapter unconditionally, but OrcaAdapter.dispatch continues to block without an orchestration context. Unchanged from the initial review, nothing lost.
  • DisposableWorkspace.source_path remains caller-declared and is never related to the repository actually under review. Unchanged residual risk, consistent with the OrcaReviewWorkspace model.
  • No secret, injection, deserialisation, network, or web surface in the delta.

Verification evidence

Command or probe Result
python3 -m unittest discover -s tests -p 'test_*.py' OK — 453 tests
python3 scripts/validate-package.py VALID — 12 skills, shared sections in sync, manifests aligned
telemetry.known_models() five names including claude-opus-5. REV-001 resolved
Telemetry.record_stage(model_requested="claude-opus-5") row written. REV-001 resolved
Telemetry.record_stage(profile="auxiliary_tool", missing_capability="disposable_workspace") row written; new vocabulary accepted
Registry.compatible_executors(DISPOSABLE, workspace=ws, cwd=ws.path) {'codex'}. REV-002 resolved
dispatch(claude, DISPOSABLE, valid workspace) BLOCKED / disposable_workspace, adapter not invoked. REV-002 resolved, REV-008 evidence
dispatch(codex, DISPOSABLE, valid workspace) SUCCEEDED with -s workspace-write -C <disposable>
Registry.compatible_executors(DISPOSABLE) with no workspace frozenset(). Fail-closed confirmed
route("verify", …, eligible_executors=frozenset()) blocked, policy reason. REV-003 blocked branch resolved
route("security", …, eligible_executors={"claude"}) used_fallback=True, "primary executor codex is ready". REV-003 still open, REV-009 evidence
Registry.compatible_executors(READ_ONLY) with an OrcaDispatchContext {'codex','orca'}; Orca dispatch still emits --worktree. No #24 regression
PROFILE_COST["security"] == PROFILE_COST["reviewer"] 3.0 == 3.0. REV-004 resolved
grep -rn generated_artifacts only a test method name. REV-005 resolved

REV-001 through REV-005 were each re-checked by execution rather than from the diff. REV-006, REV-007 and REV-009's documentation half come from repository inspection.

Not verified

  • No end-to-end run of a real verify or run stage against a live Codex binary. The -s workspace-write -C <disposable> argv is confirmed through the injected runner, but Codex's actual filesystem confinement under that flag pair is taken from the flag's documented meaning, not probed here.
  • The claim that Claude cannot be confined is still this repository's own recorded live probe (executors.py:623-628), not re-probed.
  • run_cycle.py drives only implement, review, resolve, and rereview, so no production caller exercises DISPOSABLE today. The policy is contract-only until a caller creates a workspace, which matches what the document says but means the path has no end-to-end coverage outside the tests.
  • coordinate and bootstrap were exercised only through routing, not dispatched.

CI

Both jobs of the single workflow (.github/workflows/validate.yml, "Validate package") pass on head 9d0d8cf, across both runs:

Check State
Skills, manifests, and Bash installer (Linux) pass
PowerShell installer (Windows) pass

gh pr checks 25 reports 4 passed, 0 failed, none pending, skipped, or cancelled. No expected gate is missing and no repository policy suppresses a suite for this pull request. Both jobs run validate-package.py and the full unittest discovery, so the green result covers the suite the description cites.

Residual risk

  • known_models() deriving from DEFAULT_PROFILES remains the standing hazard. REV-009 describes the workaround now holding claude-opus-5 in place; the next profile edit can reintroduce REV-001 unchanged.
  • The workspace contract is still entirely self-declared. Nothing ties a declared source_path to the repository actually under review, for either DisposableWorkspace or OrcaReviewWorkspace.
  • verify, run, and bootstrap now resolve to auxiliary_tool, which is Codex-only with no fallback. Where they previously required Claude and no other, they now require Codex and no other. That is the right direction for enforceability and it is what the document describes, but it is still a single point of failure, and neither the document nor the changelog says these roles block outright without Codex.
  • cheap_tool remains defined, priced, and in the telemetry vocabulary while no role routes to it (REV-007).

Verdict

APPROVED. Reviewed head 9d0d8cfa358a4ecbadbde7bb417183e7c92dd27e equals the current head; all four required checks passed; both previously blocking findings are fixed and verified by execution. Four low findings are open — REV-003, REV-007, REV-008, REV-009 — and none blocks approval. REV-003 is recorded as open rather than resolved because the fallback branch it named is still reproducible; that correction to the resolution claim is the only substantive disagreement with the previous comment.

@datacas

datacas commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

PR #25 follow-up resolution

Commit: f23abf0

All findings from the latest rereview are addressed in the pushed commit. No blocking findings remain.

REV-001 — Resolved (blocks: yes)

The model registry still contains the required Claude Opus compatibility entry, and telemetry records remain valid for the resolved security profile.

REV-002 — Resolved (blocks: yes)

Disposable-workspace routing requires an adapter that enforces the workspace boundary. Codex is eligible; Claude and Orca are filtered out before dispatch.

REV-003 — Resolved (blocks: no)

Fallback routing now reports when the primary executor was skipped because it could not satisfy the workspace policy, instead of claiming that a ready primary merely fell back.

REV-004 — Resolved (blocks: no)

The security profile cost remains aligned with the reviewer cost at 3.0.

REV-005 — Resolved (blocks: no)

The unused generated_artifacts field was removed from the role contract.

REV-006 — Resolved (blocks: no)

The role-policy documentation is linked from the README and the change is recorded in the changelog.

REV-007 — Resolved (blocks: no)

The orchestrator skill and routing plan now document auxiliary_tool. They also explain that cheap_tool is retained only for compatibility with direct or custom callers.

REV-008 — Resolved (blocks: no)

Disposable dispatch errors now distinguish an invalid or missing DisposableWorkspace from a valid workspace whose adapter cannot enforce the disposable boundary. A Claude regression test covers the latter.

REV-009 — Resolved (blocks: no)

The Claude Opus security fallback is explicitly documented as a compatibility-only registry entry; the workspace-policy eligibility filter never selects it.

Verification

  • Focused tests: 24 passed.
  • Full suite: 454 passed.
  • python -m compileall -q scripts tests: passed.
  • python scripts/validate-package.py: passed.
  • git diff --check: passed.
  • GitHub CI: all 4 jobs passed.
  • Post-change code review: no new P0/P1 findings or regressions identified.
  • Post-change security review: no confirmed vulnerabilities identified.

Residual risks remain unchanged: DisposableWorkspace.source_path is caller-declared under the existing execution contract, and no live Codex/Claude adapter E2E was available. No approval or merge was performed.

@datacas

datacas commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Re-review — cc-rereview

Verdict: APPROVED. Blocking findings: none. Every finding raised across both previous reviews is now resolved, and each one was reproduced as fixed by execution on this head rather than read from the diff.

The four findings left open by the previous re-review — REV-003, REV-007, REV-008, REV-009 — are addressed in commit f23abf0, which was pushed without a resolution comment; this review is the record for it. No new finding was raised.

Reviewed scope: previous reviewed head 9d0d8cfa358a4ecbadbde7bb417183e7c92dd27e, current head f23abf0bea3109dd95c250b0c5fd2ffc9cd8e8d4. Accumulated diff 8f9bfaf..f23abf0 (12 files); delta since the previous review, 6 files, +62/−10. Conventions applied: CONTRIBUTING.md (no AGENTS.md or CLAUDE.md in this repository); output language English, taken from those instructions. No review threads exist on this pull request, so the three consolidated comments are the whole record.


What changed since the previous review

  • router.py:343,349-352,364-369: route() remembers when the primary was removed by the eligibility filter and describes the fallback with that reason instead of the primary's availability. A new comment at router.py:166-167 marks the security fallback as a compatibility-only registry entry.
  • executors.py:1002-1015: the DISPOSABLE block detail now distinguishes a malformed workspace contract from an adapter that cannot confine writes.
  • skills/cc-orchestrator/SKILL.md:155-160 and docs/Plan de instrumentación y routing.md:250-251,268-280: both now name auxiliary_tool as the profile the built-in auxiliary roles resolve to and state that cheap_tool is retained for compatibility only.
  • Tests: tests/test_router.py:229 pins the policy-skip fallback reason, and tests/test_executors.py:915,932 pin both DISPOSABLE detail branches. 454 tests.

Status of every previous finding

[REV-001] · high · resolved · blocks:yes — Dropping claude-opus-5 from the default profiles makes a documented configuration unrecordable

Corrected and verified by execution, re-checked on this head. The closed set still holds five names and the call that failed on 1d072a1 still succeeds:

known_models: ['claude-haiku-4-5-20251001', 'claude-opus-5', 'claude-sonnet-5', 'gpt-5.6-luna', 'gpt-5.6-terra']
Telemetry.record_stage(..., model_requested="claude-opus-5") -> row 1

The shipped example in skills/cc-provider-bootstrap/SKILL.md:103 records again, and the mechanism keeping it alive is now labelled in place — see REV-009.

[REV-002] · medium · resolved · blocks:yes — The disposable policy hands write permission to the adapter that cannot be confined

Corrected and verified by execution, re-checked on this head. The f23abf0 delta touches only the block message, not the eligibility rule, and the boundary still holds at both layers:

compatible_executors(DISPOSABLE, writes=True, workspace=ws, cwd=dis) -> {'codex'}
compatible_executors(READ_ONLY,  writes=False, cwd=src)              -> {'codex'}
codex + disposable -> SUCCEEDED
  argv: ['codex','exec','-m','gpt-5.6-luna','-c','model_reasoning_effort=medium','--json',
         '-s','workspace-write','-C','/tmp/disp-elfe2dzn','t']
claude + disposable -> BLOCKED, adapter never invoked

[REV-003] · low · resolved · blocks:no — A decision blocked by policy reports an availability reason that is untrue

Corrected and verified by execution. This is the finding the previous re-review reopened, because only the blocked branch had been fixed. Both branches are now honest, and the genuine availability fallback still reports availability — the regression that mattered when changing this code:

route("security", …, eligible_executors={"claude"})       # codex removed by policy
  -> 'primary executor codex cannot satisfy the workspace policy -> fell back to claude'

route("security", …, codex=installed, both eligible)      # codex removed by availability
  -> 'primary executor codex is installed -> fell back to claude'

route("verify", …, eligible_executors=frozenset())        # nothing eligible
  -> blocked, 'no executor for this profile satisfies the workspace policy'

router.py:349-352 records the skip reason only for index == 0, so a fallback reached past an ineligible secondary still reports the primary's real state. tests/test_router.py:229 pins the exact sentence. The standard route() sets for itself at router.py:360-363 — "a routing decision is only auditable if its reasons are true" — is met on every path now.

One cosmetic consequence, recorded as an observation rather than a finding because every sentence in it is true: the reasons tuple now carries the policy skip twice, once as codex cannot satisfy the workspace policy from the loop and once inside the fallback sentence.

[REV-004] · low · resolved · blocks:no — The security profile's relative cost was not revisited with its target

Corrected and verified by execution, re-checked: PROFILE_COST["security"] == PROFILE_COST["reviewer"] == 3.0, pinned by tests/test_router.py:210.

[REV-005] · low · resolved · blocks:no — RoleContract.generated_artifacts is never read

Obsolete — the scope was removed, re-checked: a grep across scripts/, skills/ and docs/ finds the identifier nowhere.

[REV-006] · low · resolved · blocks:no — The change is not reachable from the project's own documentation entry points

Corrected by inspection. README.md:23-25 links docs/role-workspace-policy.md and CHANGELOG.md:10-14 records the behaviour change. f23abf0 extends the same repair to the two surfaces REV-007 named.

[REV-007] · low · resolved · blocks:no — The shipped routing documentation names a profile no role resolves to and omits the one they all now use

Corrected by inspection. skills/cc-orchestrator/SKILL.md:155-160 now reads:

Name a profile, never a model. `cheap_coder`, `deep_coder`, `reviewer`,
`senior_reviewer`, `security`, `coordinator`, and `auxiliary_tool` resolve
through `code_cycle.profiles` in `.code-cycle.yml`; `cheap_tool` remains a
compatibility profile for direct/custom callers and is not selected by the
built-in auxiliary roles.

That is the stronger of the two options the finding offered: it documents auxiliary_tool and says why cheap_tool is retained, so a repository overriding cheap_tool now learns beforehand that the built-in roles will not read it. docs/Plan de instrumentación y routing.md carries the same correction in its own language: the profile table gains auxiliary_tool, the per-skill assignment table moves cc-provider-bootstrap, cc-run and cc-verify onto it, and a new paragraph states the compatibility role of cheap_tool. validate-package.py reports shared sections still in sync, so the edit did not desynchronise a duplicated block — the failure mode CONTRIBUTING.md warns about for these files.

[REV-008] · low · resolved · blocks:no — The disposable block message names a cause that is not the one that fired

Corrected and verified by execution. All three refusal paths now name the cause that actually fired:

valid workspace + claude  -> 'claude cannot confine writes to a disposable workspace'
no workspace     + codex  -> 'a disposable policy needs a DisposableWorkspace whose path is
                              the dispatch cwd and does not overlap the source workspace'
mismatched cwd   + codex  -> (same workspace message)

The first line is the case the finding reproduced, where the operator was previously told to fix a workspace that had nothing wrong with it. Both branches are pinned by assertions on result.detail at tests/test_executors.py:915,932, so the text is now covered rather than only the capability token. kw["workspace"] is still present at that point — the kw.pop("workspace", None) happens after this block — so the branch reads real state rather than a default.

[REV-009] · low · resolved · blocks:no — claude-opus-5 is kept alive by a fallback that routing can never select

Corrected by inspection, at the minimum bar the finding named. router.py:166-167:

"security":       {"primary": "codex:openai/gpt-5.6-terra high",
                   # Compatibility-only registry entry: the read-only
                   # eligibility filter deliberately never selects Claude.
                   "fallback": "claude:anthropic/claude-opus-5 high"},

The entry now states in place that it is a registry entry rather than a routing target, which is what stops it being maintained as if it were a real fallback. The structural cause is unchanged and stays in residual risk: known_models() still derives only from DEFAULT_PROFILES.


Current accumulated review

The accumulated change against 8f9bfaf is reviewed in full, not only the delta. Nothing in the three commits taken together contradicts the design the first review approved of: the workspace contract is declared once per role in cycle.py, consumed by the dispatch layer, and enforced twice — by the routing eligibility filter and again by dispatch() — so removing either layer still fails closed. f23abf0 changes only reason text, detail text, one in-code comment, and documentation; it adds no branch that can widen a permission, which is what re-reviewing it was mostly checking for.

Two observations from this pass, neither a finding:

  • executors.py:1002-1015 expresses the detail choice as a conditional nested inside a dict literal with an inverted condition (A if not valid else B). It is correct and both branches are pinned, but a plain if/else above the dict would read as what it is. Style only.
  • router.py:364-369 builds the fallback sentence with x = policy_reason or availability_reason followed by if policy_reason: x += …. Correct, and the appended clause cannot be attached to the availability branch, which is the only way it could have gone wrong.

Security triage and audit

Sensitive change — the audit ran. Triage matched on the same triggers as both previous passes: authorization, roles and policies, and excessive permissions. The pull request carries no labels, so the file surface is the trigger.

cc-security-review ran as a delegated pass, degraded: its criteria were applied with this repository's own tooling rather than as a separately dispatched agent, and it published nothing of its own. No confirmed vulnerability, no finding above informational. Specific to this delta:

  • The delta changes no predicate that decides a permission. supports_workspace_policy, enforces_workspace_boundary, enforces_read_only, compatible_executors and the cycle.py contract table are byte-identical to the previously reviewed head; re-verified by execution rather than by reading the diff.
  • The new router.py branch affects only the reasons tuple. It cannot select a target: primary_policy_reason is a string, and the continue that skips an ineligible target is unchanged.
  • No regression in the Isolate direct Orca review dispatches #24 Orca isolation contract, re-checked because executors.py changed again: an Orca read-only dispatch with a valid OrcaReviewWorkspace is still eligible and still emits --worktree path:<review workspace>.
  • The security fallback remains unreachable through cycle.py, which is the only in-tree route() caller and always supplies the eligible set, and dispatch() refuses Claude for read_only independently. The new comment documents that; it does not rely on it.
  • No secret, injection, deserialisation, network, or web surface in the delta.

Verification evidence

Command or probe Result
python3 -m unittest discover -s tests -p 'test_*.py' OK — 454 tests
python3 scripts/validate-package.py VALID — 12 skills, shared sections in sync, manifests aligned
telemetry.known_models() / record_stage(model_requested="claude-opus-5") five names, row written. REV-001
compatible_executors(DISPOSABLE, workspace=ws, cwd=ws.path) {'codex'}. REV-002
compatible_executors(READ_ONLY, writes=False, cwd=src) {'codex'}. REV-002
dispatch(codex, DISPOSABLE, valid workspace) SUCCEEDED with -s workspace-write -C <disposable>
dispatch(claude, DISPOSABLE, valid workspace) BLOCKED, adapter not invoked, adapter-specific detail. REV-002, REV-008
dispatch(codex, DISPOSABLE, no workspace) / (…, mismatched cwd) BLOCKED, workspace-specific detail. REV-008
route("security", …, eligible_executors={"claude"}) policy-skip fallback reason. REV-003
route("security", …, codex installed, both eligible) availability fallback reason preserved. REV-003 regression check
route("verify", …, eligible_executors=frozenset()) blocked, policy reason. REV-003
compatible_executors(READ_ONLY, context=OrcaDispatchContext(...)) {'codex','orca'}; dispatch still emits --worktree. No #24 regression
PROFILE_COST["security"] == PROFILE_COST["reviewer"] 3.0 == 3.0. REV-004
grep -rn generated_artifacts scripts skills docs no match. REV-005

REV-001 through REV-005, REV-008 and the Orca contract were each re-checked by execution on head f23abf0. REV-006, REV-007 and REV-009 are documentation and in-code comment changes, verified by inspection, which is the whole of what they asked for.

Not verified

  • No end-to-end run of a real verify or run stage against a live Codex binary. The -s workspace-write -C <disposable> argv is confirmed through the injected runner; Codex's actual filesystem confinement under that flag pair is taken from the flag's documented meaning.
  • The claim that Claude cannot be confined remains this repository's own recorded live probe (executors.py:623-628), not re-probed here.
  • run_cycle.py still drives only implement, review, resolve and rereview, so no production caller exercises DISPOSABLE. The policy stays contract-only until a caller creates a workspace — which matches the document, but means the path has no end-to-end coverage outside the tests.
  • coordinate and bootstrap were exercised only through routing, not dispatched.

CI

Both jobs of the single workflow (.github/workflows/validate.yml, "Validate package") pass on head f23abf0, across both runs. One PowerShell job was IN_PROGRESS when this review began and was re-checked to completion rather than reported as green early:

Check State
Skills, manifests, and Bash installer (Linux) pass — 25s, 30s
PowerShell installer (Windows) pass — 42s, and the second job completed during this review

gh pr checks 25 reports 4 passed, 0 failed, none pending, skipped or cancelled. No expected gate is missing and no repository policy suppresses a suite for this pull request. Both jobs run validate-package.py and the full unittest discovery, so the green result covers the suite the description cites — though the description still says 451 tests and the branch now has 454.

Residual risk

  • known_models() deriving from DEFAULT_PROFILES remains the standing hazard behind REV-001. It is now labelled at the point of use (REV-009) but not structurally separated, so a future profile edit can reintroduce the original failure: a configured repository routes and dispatches fine, then fails when the stage row is written, after the stage has been paid for.
  • The workspace contract is entirely self-declared. Nothing ties a declared source_path to the repository actually under review, for either DisposableWorkspace or OrcaReviewWorkspace.
  • dispatch() infers WORKSPACE_WRITE when no workspace_policy is passed and writes=True, and that policy accepts every adapter. A direct caller that bypasses cycle.py therefore gets no disposable confinement. This is unchanged from before this pull request and the role contract lives in cycle.py by design, but docs/role-workspace-policy.md:3-5 says the contract is enforced by both modules, which is true only for callers that pass the policy.
  • verify, run and bootstrap resolve to auxiliary_tool, which is Codex-only with no fallback: they block outright without Codex. That is the right direction for enforceability and is now documented in two places, but neither the document nor the changelog says these roles are unroutable without it.
  • cheap_tool stays defined, priced and in the telemetry vocabulary with no role routing to it. That is now a deliberate, documented compatibility decision rather than drift.

Verdict

APPROVED. Reviewed head f23abf0bea3109dd95c250b0c5fd2ffc9cd8e8d4 equals the current head; all four required checks passed; all nine findings across the three reviews are resolved and no open finding remains. No new finding was raised in this pass.

@datacas
datacas merged commit 8a802ae into main Sep 22, 2026
4 checks passed
@datacas
datacas deleted the issue-20-auxiliary-workspace-policy branch September 24, 2026 09:21
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