Skip to content

Allow any executor in read-only roles through an isolated, verified review harness #72

Closed

Description

@datacas

Problem

Today an executor is eligible for a read-only role (review, rereview, security, bootstrap, coordinate) only if it enforces read-only at OS level (enforces_read_only, supports_non_writing). Codex can, through -s read-only. The Claude CLI can't: --permission-mode plan turns a review into planning, and a live probe showed that disallowing Edit/Write/NotebookEdit does not prevent a write. So:

  • Claude can never review, whatever the repository declares;
  • the review profiles have no fallback;
  • a repository can't choose "Codex implements, Claude reviews".

That is too restrictive. The toolkit should allow any executor in any role, and make the guarantee come from the harness instead of from the executor.

Expected

A hard harness that makes a non-enforcing executor safe for read-only roles by construction:

  1. Isolated review workspace. A read-only stage on an executor that can't enforce read-only runs in its own disposable workspace: a detached git worktree at the exact head SHA under review, outside the implementer's tree. This generalises the existing OrcaReviewWorkspace contract, which already requires a separate path that doesn't overlap the implementer's workspace, to native adapters. Whatever the agent writes locally there can't reach the implementer's tree.
  2. Non-mutation verified, not assumed. Record the head SHA and a clean-tree fingerprint (git status --porcelain, plus the HEAD of the implementer's tree) before the stage. Compare them after:
    • if the implementer's tree, the branch, or a configured remote ref moved, the stage is a contract_violation and the cycle stops. The move is detected, not prevented or undone;
    • writes inside the disposable review workspace are reported as a warning, then discarded with the workspace.
  3. No tool restriction. (Amended, see Decision.) Claude read-only stages keep their full tooling and ordinary gh/git access, with no acceptEdits. A live probe showed --disallowedTools does not prevent a write anyway.
  4. Explicit prompt contract. The stage prompt states that the stage must not modify files, commit, or push, and explains why. It says that changes in its workspace are discarded and that any change to the branch fails the stage.
  5. Recorded. Each dispatch row states how read-only was obtained: read_only_mode = enforced (Codex sandbox) or detected (harness: watched, not enforced). A later analysis can then compare them.

With that in place:

  • Claude becomes eligible for review, rereview, security, bootstrap, and coordinate;
  • review profiles may declare Claude as primary or fallback;
  • the default profiles can gain a Claude fallback for review. That is a separate decision for the defaults: this issue is about capability.

Documentation

Remove the statements that Claude cannot review: docs/routing.md (workspace policy, profiles table note), docs/role-workspace-policy.md, docs/instrumentation.md (What a stage may touch), and the README "Ways to use it" notes. In their place, explain clearly:

  • what enforced versus detected guarantees;
  • that a Claude reviewer's local edits are thrown away, and that a remote write by it (push, merge, change-request edit) is detected when observable but cannot be prevented or undone. Anyone who needs a full guarantee should review with Codex or use read-only credentials;
  • that publication stays behavioural, as for every executor.

Acceptance

  • A read-only stage routed to Claude runs in a disposable worktree at the reviewed SHA, never in the implementer's tree.
  • A scripted Claude that edits a file in its review workspace: the stage succeeds with a warning, the file isn't in the branch, and the workspace is removed.
  • A scripted executor that moves the implementer's tree, the branch, or a configured remote ref during a read-only stage: contract_violation, and the cycle stops.
  • A Claude read-only stage records read_only_mode = detected, and a review clone that can't be removed fails the stage.
  • Codex read-only stages keep -s read-only in place and record read_only_mode = enforced.
  • disposable roles (verify, run) keep their current contract.
  • A test asserts that no argument list contains danger-full-access or a bypass flag (existing guarantee).

Decision (2026-09-24)

The maintainer accepts the remote-write risk for Claude reviewers. Hard branch protection for a non-enforcing executor would need OS isolation or read-only credentials, and the maintainer chose not to take either of those, or any other capability, away from the agent. Read-only for Claude is therefore detected, not enforced, and recorded as read_only_mode = detected. Anyone who needs the hard guarantee reviews with Codex (enforced) or gives the reviewer read-only credentials. The criteria above were amended accordingly; see PR #74 (REV-001).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions