Skip to content

Allow Claude in read-only roles via isolated worktrees - #74

Merged
datacas merged 7 commits into
mainfrom
issue-72-isolated-review-harness
Sep 24, 2026
Merged

datacas merged 7 commits into
mainfrom
issue-72-isolated-review-harness

Conversation

@datacas

@datacas datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Implements #72.

Changes

  • Run Claude read-only stages in a detached disposable worktree at the reviewed HEAD, then verify the implementer branch, HEAD, and working-tree fingerprint.
  • Warn and discard review-worktree edits; record read-only mode as enforced or isolated_verified.
  • Add Claude read-only tool restrictions and update routing/workspace documentation.

Verification

  • python3 scripts/validate-package.py — passed.
  • python3 -m unittest discover -s tests -v — passed (637 tests).

Run line: profile=cheap_coder requested_model=openai/gpt-6-luna effort=high resolved_model=?

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

Summary

CHANGES_REQUESTED for PR #74 at 732cf0473673a5d082edc5789a6427f64d399a73 against main (b9dbc5494f5a9992581ef491003be71ac39a176f). The change adds a detached worktree for Claude read-only stages, CLI tool restrictions, read-only telemetry, tests, and routing/workspace documentation. The scope matches work item #72, but the harness does not establish the promised non-mutation guarantee.

Repository convention: CONTRIBUTING.md and the toolkit review skills were applied; this repository has no AGENTS.md or CLAUDE.md.

Findings

[REV-001] · high · open · - · blocks:yes — Remote review branch can move without a contract violation

Path: scripts/executors.py:782.

The post-dispatch check compares only the implementer checkout's local HEAD, symbolic branch name, and status. The detached worktree still has the repository's remote and can push from its own HEAD. In a temporary local Git repository with a bare remote, a scripted reviewer committed in the disposable worktree and pushed HEAD:refs/heads/review. Dispatch returned succeeded with read_only_mode=isolated_verified; the implementer HEAD stayed unchanged while the remote branch moved. This violates the work item's hard branch protection contract and can leave unreviewed code on the change request. Constrain branch-writing credentials or operations for the reviewer and verify the actual change-request head before and after the stage; the local checkout check alone is insufficient.

[REV-002] · high · open · - · blocks:yes — Status fingerprint misses edits to an already dirty source file

Path: scripts/executors.py:736.

git status --porcelain records a file's status and path, not its bytes, and this harness does not require the implementer checkout to be clean before dispatch. In a temporary Git repository, I modified a tracked file before review, changed its content again from the scripted reviewer, and observed the same status and identical recorded fingerprints before and after. Dispatch returned succeeded although the implementer file changed. Reject a dirty checkout at preflight, or fingerprint actual contents of all mutable files whose changes must be detected.

[REV-003] · medium · open · - · blocks:yes — Failed isolation is recorded as verified isolation

Path: scripts/executors.py:1331 (persisted by scripts/telemetry.py:770).

The dispatch wrapper stamps every read-only result from a non-enforcing adapter as isolated_verified, including one that never created or verified a worktree. With an existing non-Git directory as cwd, dispatch returned blocked / review_workspace_isolation but its artifact reported read_only_mode=isolated_verified. This makes the new telemetry field factually wrong for failed dispatches and undermines the requested comparison of enforced and isolated reviews. Record the mode only after that boundary was established and verified; leave it absent for a blocked preparation.

Security triage and audit

Security audit required. The repository has no configured security_review.always_when rule and PR #74 has no labels; the default sensitive-area triage applies to executor permission and workspace-policy changes in scripts/executors.py and scripts/router.py. Reviewer judgment independently triggered the audit for the same trust boundary. The audit confirmed REV-001 and REV-002 as branch/workspace integrity failures and found no separate credential or injection finding in the changed code. A real Claude CLI run and GitHub permission enforcement were not exercised.

Verification and CI

  • python3 -m unittest tests.test_executors.PermissionTests -v — 12 passed.
  • python3 scripts/validate-package.py — passed.
  • python3 -m unittest discover -s tests -v — 637 passed.
  • Three targeted temporary-repository reproductions observed the outcomes in REV-001, REV-002, and REV-003. They used a scripted runner; no live Claude invocation was made.
  • Current PR head matches the reviewed local HEAD. GitHub's Validate package run for the PR head passed both defined jobs: Skills, manifests, and Bash installer and PowerShell installer. gh pr checks 74 also shows the duplicate push-triggered jobs as passing; no pending, failed, cancelled, or skipped check was reported.

Residual risk: the read-only boundary remains dependent on the reviewer's behavior and credentials until the remote-branch and dirty-tree gaps are closed. Blocking findings: REV-001, REV-002, REV-003.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

Triage record for the findings on PR #74. Repository convention: CONTRIBUTING.md and the toolkit review workflow were applied; there is no AGENTS.md or CLAUDE.md. All findings below were classified against the recorded triage commit, before edits.

[REV-001] · high · open · valid · blocks:yes — Remote review branch can move without a contract violation

A valid branch integrity gap: the detached worktree retains the remote and may push. The existing check observes only the implementer checkout. The linked work item explicitly requires that the reviewer cannot write to the branch.

[REV-002] · high · open · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

A valid workspace integrity gap: status fingerprints encode paths and status codes, not file bytes, and dirty checkouts are accepted. A reviewer can change an already dirty tracked file without changing that fingerprint.

[REV-003] · medium · open · valid · blocks:yes — Failed isolation is recorded as verified isolation

A valid telemetry gap: the wrapper labels any non-enforcing read-only dispatch as isolated_verified, including isolation setup failures. The mode must only be recorded after isolation is established and verified.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

Summary

CHANGES_REQUESTED for PR #74 at dfae17471879a23cd33a44815c57579064e1eadd, against main at b9dbc5494f5a9992581ef491003be71ac39a176f.

Since the previous review at 732cf0473673a5d082edc5789a6427f64d399a73, three commits changed the harness to use an independent clone, reject dirty implementer checkouts, inspect configured remote refs before and after a review, and improve clone cleanup on Windows. The tests and docs were updated. The dirty-checkout and failed-isolation telemetry findings are corrected and verified. Two blocking gaps remain: a remote branch can be changed and restored between snapshots, and a failed cleanup can leave the review clone on disk while the dispatch still reports success and isolated_verified.

Repository convention applied: CONTRIBUTING.md and docs/provider-contract.md; this repository has no AGENTS.md or CLAUDE.md. Both prior contract comments were authored by trusted reviewer datacas; no untrusted contract comments were present. Issue #72 is the linked work item.

Findings

[REV-001] · high · open · valid · blocks:yes — Remote review branch can move without a contract violation

Path: scripts/executors.py:821.

The independent clone removes its configured remotes, and the harness compares snapshots of the implementer's configured remote refs only before and after dispatch. A temporary reproduction force-pushed a new commit to the configured remote's main, restored the original SHA before the runner returned, and then observed outcome=succeeded, read_only_mode=isolated_verified, and equal before/after ref fingerprints. The reviewer can therefore write to the branch during the stage without the harness detecting it. Removing a remote alias does not deny writes when the reviewer process can invoke Git with a URL or use inherited GitHub credentials. The linked work item requires the reviewer to be unable to write to the branch; enforce that boundary or detect any branch update even if it is later restored.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

Path: scripts/executors.py:768.

Corrected and verified. The harness now refuses to start an isolated review when the implementer checkout has any tracked or untracked changes. python3 -m unittest tests.test_executors.PermissionTests -v passed, including test_claude_review_rejects_a_dirty_implementer_checkout.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

Path: scripts/executors.py:794.

Corrected and verified. Isolation setup failures now return a blocked result before adding the read_only_mode artifact. python3 -m unittest tests.test_executors.PermissionTests -v passed, including test_failed_isolation_does_not_claim_verified_mode.

[REV-004] · medium · open · - · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Path: scripts/executors.py:843.

If removing the clone raises, the fallback retries with ignore_errors=True, records a warning, and continues to return the dispatch result with read_only_mode=isolated_verified. A temporary reproduction simulated a locked cleanup path after the reviewer wrote a file: dispatch returned succeeded, the warning was present, and the clone containing the written file still existed. This does not meet the disposable-workspace contract and can leave repository contents and reviewer-created files under the temporary directory. Treat unsuccessful cleanup as a failed or contract-violating dispatch and do not report verified isolation while the workspace remains.

Security triage and audit

Security audit required. .code-cycle.yml has no security_review.always_when rule and PR #74 has no labels; the default sensitive-area triage applies because the change modifies executor isolation and remote-write handling. The cc-security-review pass could not be loaded from outside the repository sandbox, so its equivalent trust-boundary review ran in degraded/manual mode. It confirmed REV-001 and REV-004 and found no separate credential disclosure or injection issue. No live Claude invocation or GitHub permission enforcement was exercised.

Verification and CI

  • python3 -m unittest tests.test_executors.PermissionTests -v — 17 passed.
  • python3 scripts/validate-package.py — passed.
  • python3 -m unittest discover -s tests -v — 642 passed.
  • The targeted branch-write reproduction in REV-001 demonstrated that a push followed by restoration is missed by the before/after snapshots.
  • The targeted cleanup-failure reproduction in REV-004 demonstrated that failed removal can leave the clone while returning success and isolated_verified.
  • GitHub checks are all passing: Skills, manifests, and Bash installer (two runs) and PowerShell installer (two runs). gh pr checks 74 reported no pending, failed, cancelled, or skipped checks.

Residual risk: until REV-001 and REV-004 are closed, the harness cannot claim a complete non-mutation and disposable-workspace guarantee for a non-enforcing reviewer. The current project verdict is CHANGES_REQUESTED. Blocking findings: REV-001, REV-004.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

Triage record for the open findings on PR #74. Both findings are judged against the triage commit above, before any edit. Repository convention: CONTRIBUTING.md and the toolkit review workflow; there is no AGENTS.md or CLAUDE.md. Earlier contract comments are all by trusted author datacas.

[REV-001] · high · open · valid · blocks:yes — Remote review branch can move without a contract violation

This finding keeps the disposition valid that CCT-20260924-001 assigned. At the triage commit, the Claude reviewer still inherits the user's gh/Git credentials: the process environment is passed through, and read-only publishers get --allowedTools Bash(gh:*). So it can write to the branch, and a push that is later restored escapes the before/after ref snapshots. Detection alone can't close this gap. The reviewer has to lose write credentials.

[REV-004] · medium · open · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Valid at the triage commit. At scripts/executors.py:838-853, a failed rmtree falls back to ignore_errors=True and only adds a warning. The result keeps its outcome and read_only_mode=isolated_verified, even when the clone still exists.

Claude read-only stages now run with a temporary HOME, an empty gh
configuration, a neutral global Git configuration, no system Git
configuration, no SSH agent, and no token-like variables, so the
reviewer cannot push or call GitHub as the user (REV-001). Because it
cannot publish, Claude is no longer eligible for read-only stages that
publish; a direct dispatch is BLOCKED with harness_publication until
harness-side publication lands (#79).

A review clone or temporary home that cannot be removed now fails the
stage and drops read_only_mode instead of reporting verified isolation
(REV-004).
@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

Resolution summary

RESOLVED at 8ee2afe80e1f8b68cd1d41d49e9a281af8438044, up from dfae17471879a23cd33a44815c57579064e1eadd. Triage was recorded against dfae174 before any edit, in the triage comment. Repository convention: CONTRIBUTING.md; there is no AGENTS.md or CLAUDE.md.

Findings

[REV-001] · high · resolved · valid · blocks:yes — Remote review branch can move without a contract violation

Paths: scripts/executors.py (_credential_free_environment, _isolated_review_dispatch, ClaudeAdapter.supports_non_writing / read_only_refusal), scripts/telemetry.py, docs.

The fix is to take the credentials away, not to detect their use. The owner chose this direction. A Claude read-only stage now runs with:

  • a temporary HOME/USERPROFILE, with only Claude's own login linked in;
  • an empty GH_CONFIG_DIR and GH_PROMPT_DISABLED=1;
  • a neutral GIT_CONFIG_GLOBAL plus GIT_CONFIG_NOSYSTEM=1, so no credential helper is configured;
  • no SSH agent, and a GIT_SSH_COMMAND with no identity and BatchMode=yes;
  • GIT_TERMINAL_PROMPT=0;
  • no GH_TOKEN/GITHUB_TOKEN, GIT_CONFIG_* injection, or other token-, password- or secret-named variables. Claude's own model-provider credentials are the only exception.

A credential-free reviewer can't publish either, so Claude is no longer eligible for read-only stages that publish (review, rereview). A direct dispatch returns BLOCKED / harness_publication before the agent runs. Claude still serves security, bootstrap, coordinate, and local-only runs. Harness-side publication, which would let Claude review again, is tracked in #79. The before/after ref snapshots remain as a secondary check.

Verification:

  • New tests: test_claude_review_runs_without_github_or_git_credentials, test_claude_is_not_offered_for_a_publishing_read_only_stage, test_a_publishing_claude_review_is_blocked_before_it_runs, and test_a_refused_credential_free_publisher_is_recordable. All of them fail on dfae174 and pass now.
  • A live check with the real environment builder: git push --dry-run https://github.com/datacas/code-cycle-toolkit.git … fails with could not read Username … terminal prompts disabled; gh auth status reports no logged-in host; read-only git ls-remote still works; the temporary home is removed and the real Claude config is untouched.
  • A live Haiku run under a temporary HOME with the linked Claude config authenticated and answered on Linux.

Residual risk: this removes the credentials the process is handed; it is not an OS sandbox. A token kept in a readable file elsewhere on disk, such as a plaintext gh hosts file or an unencrypted SSH key, can still be reached by absolute path. The temporary-HOME login was verified only on Linux: macOS keychain and Windows symlink behaviour are unverified, and a failed symlink blocks the stage rather than running it.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

Unchanged since the rereview at dfae174: resolved and verified there.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

Unchanged since the rereview at dfae174: resolved and verified there.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Path: scripts/executors.py (_remove_workspace, tail of _isolated_review_dispatch).

The clone and the temporary home are now removed through _remove_workspace. If either is still on disk afterwards, the stage drops read_only_mode and names the leftover path in the detail. A success becomes FAILED, and a result that already failed keeps its outcome, so model drift stays a contract_violation. Removal no longer runs chmod through a symlink, so the linked Claude configuration is never altered.

Verification: test_a_review_clone_that_cannot_be_removed_fails_without_verified_mode fails on dfae174 and passes now.

Post-change workflow

  • cc-code-review (delegated) found two issues, both fixed. P1: telemetry rejected the new harness_publication token, so a blocked row could not be recorded; a regression test now covers it. P2: a cleanup failure hid a model-drift contract_violation.
  • Security triage: the default sensitive-area rule applies (executor isolation and credentials; no security_review.always_when configured, no labels). cc-security-review (delegated) confirmed no vulnerability. It raised one medium potential risk, now mitigated: non-GitHub tokens, such as Bitbucket or issue-provider tokens, passed through the environment. They are now dropped by name pattern, with a test.
  • python3 -m unittest discover -s tests — 647 passed.
  • python3 scripts/validate-package.py — VALID.
  • CI on 8ee2afe: Skills, manifests, and Bash installer and PowerShell installer passed on both the push and pull_request runs. Nothing is pending, failed, cancelled, or skipped.

No finding is blocking after this resolution. Approval belongs to the rereview.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

[CCR-20260924-003] · unknown · unknown/unknown→? · unknown · schema:1

Summary

CHANGES_REQUESTED for PR #74 at 8ee2afe80e1f8b68cd1d41d49e9a281af8438044, against main at b9dbc5494f5a9992581ef491003be71ac39a176f.

Since the previous rereview at dfae17471879a23cd33a44815c57579064e1eadd, commit 8ee2afe strips common GitHub/Git credentials from the reviewer environment, moves Git and GitHub configuration to temporary locations, blocks Claude for read-only stages that must publish, and treats an undeleted review clone as a failed dispatch. The cleanup change closes REV-004. The credential change reduces the inherited-credential risk, but REV-001 remains reproducible because the reviewer still runs as the same OS user and can read credential files outside its temporary home.

Repository convention applied: CONTRIBUTING.md and docs/provider-contract.md; this repository has no AGENTS.md or CLAUDE.md. All contract comments were authored by trusted reviewer datacas. The latest trusted triage comment marked REV-001 resolved against dfae174; current execution evidence reproduces the problem, so its status is open again. Its disposition remains valid.

Findings

[REV-001] · high · open · valid · blocks:yes — Remote review branch can move without a contract violation

Path: scripts/executors.py:799.

The new environment removes credentials passed through environment variables and redirects the ordinary GitHub and Git configuration paths. It does not isolate the reviewer from files readable by the same OS user; the helper's docstring explicitly leaves those files accessible. Bash remains available, and a configured CLAUDE_CONFIG_DIR is preserved. A temporary reproduction gave the runner a different HOME and no GH_TOKEN, while leaving a dummy GitHub credential file in the original home. The runner could read that file by path and, independently, force-pushed a commit to a configured local bare remote's main and restored the original SHA. Dispatch reported succeeded with read_only_mode=isolated_verified and equal before/after fingerprints. This confirms that the reviewer can still access a credential stored outside its temporary home, and that branch mutation followed by restoration evades the check. The current change closes the inherited-environment case, but not the work item's hard branch-write boundary; use an OS isolation boundary or otherwise make all remote-write credentials inaccessible to the reviewer process.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

Path: scripts/executors.py:870.

Corrected and verified in the prior rereview. The harness rejects a dirty implementer checkout before dispatch. The current run of python3 -m unittest tests.test_executors.PermissionTests -v passed, including test_claude_review_rejects_a_dirty_implementer_checkout.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

Path: scripts/executors.py:900.

Corrected and verified in the prior rereview. Isolation setup failures return a blocked result without read_only_mode=isolated_verified. The current targeted test run passed, including test_failed_isolation_does_not_claim_verified_mode.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Path: scripts/executors.py:980.

Corrected and verified. Cleanup now checks whether either temporary directory remains, removes the verified-mode artifact, and reports a failed dispatch when cleanup does not complete. python3 -m unittest tests.test_executors.PermissionTests -v passed, including test_a_review_clone_that_cannot_be_removed_fails_without_verified_mode.

Security triage and audit

Security audit required. .code-cycle.yml has no security_review.always_when rule and PR #74 has no labels; executor isolation and remote-write handling trigger the default sensitive-area review. The cc-pr-review and cc-security-review delegated passes were unavailable from this sandbox, so equivalent full-diff and trust-boundary reviews ran in degraded/manual mode. They confirmed REV-001 and found no separate credential disclosure or injection issue. The credential-file reproduction used a dummy credential; no real credential was inspected. No live Claude invocation or GitHub push was made.

Verification and CI

  • python3 -m unittest tests.test_executors.PermissionTests -v — 21 passed.
  • python3 scripts/validate-package.py — passed.
  • python3 -m unittest discover -s tests -v — 647 passed.
  • The REV-001 reproduction confirmed that an on-disk credential remains readable despite the sanitized environment, and that a remote push followed by restoration is not detected.
  • The prior REV-004 cleanup-failure reproduction is covered by the new passing test_a_review_clone_that_cannot_be_removed_fails_without_verified_mode.
  • GitHub checks are all passing: Skills, manifests, and Bash installer (two runs) and PowerShell installer (two runs). gh pr checks 74 reported no pending, failed, cancelled, or skipped checks.

Residual risk: a Claude reviewer can still access credentials stored in files readable by its OS user, so the branch-write guarantee is not enforced. The current project verdict is CHANGES_REQUESTED. Blocking finding: REV-001.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20260924-003] · unknown · unknown/unknown→? · unknown · triaged:8ee2afe80e1f8b68cd1d41d49e9a281af8438044 · schema:1

Triage record for PR #74 after rereview CCR-20260924-003, judged against the triage commit above before any edit. Repository convention: CONTRIBUTING.md; there is no AGENTS.md or CLAUDE.md. All contract comments are by trusted author datacas.

[REV-001] · high · open · valid · blocks:yes — Remote review branch can move without a contract violation

This finding keeps the disposition valid that CCT-20260924-001 assigned. The rereview is correct at 8ee2afe. The reviewer still runs as the same OS user with the whole filesystem visible, and on this machine the gh token sits in plaintext in the user's gh hosts file. A local bare remote is also still writable. Stripping the environment can't close the boundary. It needs OS-level isolation.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

No action. Resolved and verified in earlier rereviews.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

No action. Resolved and verified in earlier rereviews.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

No action. CCR-20260924-003 verified it resolved at 8ee2afe.

The maintainer accepts the remote-write risk for Claude reviewers, so
Claude keeps its full tooling and normal gh/git access. This reverts the
credential stripping and the harness_publication refusal from 8ee2afe
and drops the read-only --disallowedTools restriction. The stage is
told, and shown why, not to write, runs in a disposable clone, and the
before/after checks still turn a detected change into a
contract_violation. Such stages now record read_only_mode=detected
instead of isolated_verified. The docs explain that the Codex sandbox
enforces read-only, while with Claude a remote write can be detected
but not prevented or undone (REV-001).

A review clone that cannot be removed fails the stage without a
read_only_mode; a failure the run already reported keeps its outcome
(REV-004).
@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

[CCR-20260924-003] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

[CCT-20260924-003] · unknown · unknown/unknown→? · unknown · triaged:8ee2afe80e1f8b68cd1d41d49e9a281af8438044 · schema:1

Resolution summary

RESOLVED at 6c35d8b0fa27d595916a716c8d9e39aa18fd203c, up from 8ee2afe80e1f8b68cd1d41d49e9a281af8438044. Triage was recorded against 8ee2afe before any edit, in CCT-20260924-003. Repository convention: CONTRIBUTING.md; there is no AGENTS.md or CLAUDE.md.

Findings

[REV-001] · high · not_applicable · valid · blocks:yes — Remote review branch can move without a contract violation

Decision by the maintainer: the risk is accepted, documented, and detected where it can be observed. The disposition stays valid, because the gap was real when it was reported. The status is not_applicable because the maintainer deliberately did not adopt the hard write boundary for Claude.

What changed in 6c35d8b:

  • The credential stripping and the harness_publication refusal from 8ee2afe are reverted, and the read-only --disallowedTools Edit Write NotebookEdit restriction is removed. Claude keeps its full tooling and its normal gh/git access, stays eligible for review/rereview, and publishes its own comment.
  • The protection that remains:
    • the disposable clone;
    • a prompt that tells the reviewer not to modify files, commit or push, and explains why: a push, merge or edit to the change request can't be undone and invalidates the review;
    • the before/after comparison of HEAD, working tree and configured remote refs. A detected change is still a contract_violation.
  • Claude read-only rows now record read_only_mode=detected instead of isolated_verified, so the record shows read-only is watched, not enforced (scripts/executors.py, scripts/telemetry.py).
  • docs/routing.md, docs/role-workspace-policy.md, docs/instrumentation.md and the README.md spell out the difference. With Codex, read-only is enforced by the sandbox. With Claude it is only detected: a remote write (push, merge, change-request edit) cannot be prevented or undone, and a push that is later restored before the stage ends goes unseen. Anyone who needs a full guarantee should review with Codex or use read-only credentials.

Evidence anchor: 6c35d8b. The tests test_claude_claims_no_confinement_it_does_not_have, test_claude_publishing_stage_keeps_its_github_tooling, the detected assertions, and the existing detection tests all pass. #79 (harness-side publication) no longer applies under this decision and is left for the maintainer to close.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

Unchanged: the clean-checkout precondition is kept. test_claude_review_rejects_a_dirty_implementer_checkout passes.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

Unchanged: a setup failure still returns BLOCKED without a read_only_mode. test_failed_isolation_does_not_claim_verified_mode passes.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Re-applied on top of the reverted base, without the credential home. _remove_workspace reports anything left on disk. The stage then drops read_only_mode and names the path. A success becomes FAILED, and a result that already failed, such as one showing model drift, keeps its outcome. test_a_review_clone_that_cannot_be_removed_fails_without_a_read_only_mode fails against dfae174's executors.py (FAILED != SUCCEEDED) and passes at 6c35d8b.

Post-change workflow

  • Code review of the accumulated diff against dfae174: no P0/P1 issue. The new prompt sentence was reworded for clarity.
  • Security triage: the default sensitive-area rule applies (executor permissions; no security_review.always_when, no labels). The audit found no new vulnerability. The one remaining exposure is the accepted remote-write risk recorded under REV-001; the change adds no credentials, input handling or other injection surface.
  • python3 -m unittest discover -s tests — 643 passed.
  • python3 scripts/validate-package.py — VALID.
  • CI on 6c35d8b: Skills, manifests, and Bash installer and PowerShell installer passed on both the push and pull_request runs. Nothing is pending, failed, cancelled, or skipped.

Residual risk, accepted by the maintainer: a Claude reviewer can write to the remote with its normal credentials. The harness detects a lasting local or remote-ref change but can't prevent or undo it, and misses a change that is restored before the stage ends. No blocking finding remains open. Approval belongs to the rereview.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

[CCR-20260924-003] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-003] · unknown · unknown/unknown→? · unknown · triaged:8ee2afe80e1f8b68cd1d41d49e9a281af8438044 · schema:1

[CCR-20260924-004] · unknown · unknown/unknown→? · unknown · schema:1

Summary

CHANGES_REQUESTED for PR #74 at head 6c35d8b against main at b9dbc54. Since the prior reviewed head 8ee2afe, the new commit removes credential scrubbing and Claude tool restrictions, changes the recorded mode to detected, adds configured-remote ref checks, and retains failure on a review clone that cannot be removed.

Repository convention: CONTRIBUTING.md and the toolkit review workflow were applied; this repository has no project AGENTS.md or CLAUDE.md. The PR is open, not a draft, has no labels, and describes #72, which remains open.

Findings

[REV-001] · high · open · valid · blocks:yes — Remote review branch can move without a contract violation

Path: scripts/executors.py:812-819, 827-853.

The latest code now detects a push to a configured remote and returns CONTRACT_VIOLATION, but detection happens after the remote ref has already moved and the code cannot undo it. The targeted test test_claude_review_detects_a_remote_branch_push confirms that the remote contains the reviewer's new branch after dispatch fails. Issue #72 still requires a hard harness under which reviewer writes cannot reach the branch; the new documentation acknowledges a weaker, detection-only guarantee. The prior comment marked this finding not_applicable; this rereview reopens it because the linked issue's hard branch-protection acceptance criterion remains in force. The finding's disposition remains valid.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

Path: scripts/executors.py:781-787.

Corrected and verified by execution: the harness now blocks preparation when the implementer checkout is dirty. The targeted PermissionTests pass, including the dirty-checkout rejection case, so the earlier reproduction cannot run against a dirty source tree.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

Corrected and verified by execution: the current failed-isolation test passes and confirms that a failed preparation does not report a verified read-only mode.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Corrected and verified by execution: test_a_review_clone_that_cannot_be_removed_fails_without_a_read_only_mode passes. The stage fails and does not claim a read-only mode when cleanup leaves a clone.

[REV-005] · medium · open · - · blocks:yes — Cleanup follows a reviewer-created symlink and changes an external file

Path: scripts/executors.py:743-747.

The cleanup callback unconditionally calls chmod(path, 0o700). A reviewer can create a non-writable directory containing a symlink to a file outside the disposable clone. When recursive cleanup fails to unlink the symlink, this callback follows it and changes the target's permissions. I reproduced this with a temporary clone: cleanup left the clone behind and changed the external target from mode 0600 to 0700. Avoid following symlinks in the cleanup callback and add a regression test for a symlink inside a non-writable directory.

Security triage and audit

Security audit was required because the change alters executor permissions, credential availability, remote writes, and filesystem cleanup. The audit covered those changed trust boundaries. REV-001 and REV-005 are the confirmed issues; no other new vulnerability was confirmed. This was an execution-backed code audit using scripted runners, not a live Claude invocation.

Verification

  • PYTHONPATH=tests python3 -m unittest test_executors.PermissionTests -v — passed.
  • python3 scripts/validate-package.py — passed: 13 skills, shared sections, and cross-agent manifests validated.
  • python3 -m unittest discover -s tests — 643 tests passed.
  • git diff --check b9dbc54..origin/pr-74 — passed with no whitespace errors.
  • A contained cleanup reproduction confirmed REV-005.
  • No live Claude invocation was made.

Current CI

GitHub's Validate package checks passed at the current head: Skills, manifests, and Bash installer (2 runs) and PowerShell installer (2 runs). No pending or failed checks were reported.

Residual risk and verdict

Claude keeps normal GitHub and Git access. Configured remote changes are detected after dispatch, not prevented or rolled back; an already-published mutation can invalidate the review before the cycle stops. Scripted tests cannot establish the behavior of a live Claude process. CHANGES_REQUESTED because REV-001 and REV-005 remain open and blocking.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20260924-004] · unknown · unknown/unknown→? · unknown · triaged:6c35d8b0fa27d595916a716c8d9e39aa18fd203c · schema:1

Triage record for PR #74 after rereview CCR-20260924-004, judged against the triage commit above before any edit. Repository convention: CONTRIBUTING.md; there is no AGENTS.md or CLAUDE.md. All contract comments are by trusted author datacas.

[REV-001] · high · not_applicable · valid · blocks:yes — Remote review branch can move without a contract violation

This finding keeps the disposition valid that CCT-20260924-001 assigned. The rereview is right that the code only detects the write, and that issue #72 still lists hard branch protection as an acceptance criterion. The maintainer has decided to accept that risk for Claude reviewers, and this run amends #72's acceptance criterion to match the decision. The finding is therefore not applicable to the updated requirement.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

No action. Resolved and verified.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

No action. Resolved and verified.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

No action. Resolved and verified.

[REV-005] · medium · open · valid · blocks:yes — Cleanup follows a reviewer-created symlink and changes an external file

Valid at the triage commit. _remove_read_only_path calls os.chmod(path, 0o700) unconditionally, and chmod follows symlinks. So a reviewer-created link whose unlink fails, for example inside a non-writable directory, changes the permissions of its target outside the clone.

The cleanup callback chmodded every path it failed to remove, and
chmod follows links, so a reviewer-created symlink inside a
non-writable directory changed the permissions of a file outside the
clone. Links are no longer chmodded. The callback makes the parent
directory writable instead, and only a parent inside the workspace
being removed. Regression test included (REV-005).
@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

[CCR-20260924-003] · unknown · unknown/unknown→? · unknown · schema:1

[CCR-20260924-004] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

[CCT-20260924-003] · unknown · unknown/unknown→? · unknown · triaged:8ee2afe80e1f8b68cd1d41d49e9a281af8438044 · schema:1

[CCT-20260924-004] · unknown · unknown/unknown→? · unknown · triaged:6c35d8b0fa27d595916a716c8d9e39aa18fd203c · schema:1

Resolution summary

RESOLVED at 3e53b8825a84abdf17c2ec46b7d0b2e8a3e451e0, up from 6c35d8b0fa27d595916a716c8d9e39aa18fd203c. Triage was recorded against 6c35d8b before any edit, in CCT-20260924-004. Repository convention: CONTRIBUTING.md; there is no AGENTS.md or CLAUDE.md.

Findings

[REV-001] · high · not_applicable · valid · blocks:yes — Remote review branch can move without a contract violation

CCR-20260924-004 reopened this finding because issue #72 still required hard branch protection. The maintainer's decision is now written into that requirement: #72 was amended with a Decision (2026-09-24) section, and its criteria now say:

  • Claude read-only stages keep full tooling and ordinary gh/git access;
  • a move of the implementer's tree, the branch, or a configured remote ref is detected, not prevented or undone, and is a contract_violation;
  • the stage records read_only_mode = detected;
  • a full guarantee requires Codex (enforced) or read-only credentials.

The code at 3e53b88 meets the amended criteria, and the PR docs state the same limits. The disposition stays valid; the status is not_applicable against the amended requirement. Evidence anchor: 3e53b88.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

No change. Resolved and verified.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

No change. Resolved and verified.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

No change. Resolved and verified in CCR-20260924-004.

[REV-005] · medium · resolved · valid · blocks:yes — Cleanup follows a reviewer-created symlink and changes an external file

Path: scripts/executors.py (_remove_read_only_path, _remove_workspace). Fix commit: 3e53b88.

The cleanup callback no longer calls chmod on a link. To make removal possible, it makes the failing entry's parent writable instead, and only when that parent lies inside the workspace being removed. So neither a link target nor the directory containing the clone is ever touched.

Verification:

  • test_cleanup_never_follows_a_reviewer_symlink_out_of_the_clone reproduces the rereview's scenario: a symlink to an external 0600 file inside a 0500 directory in the clone. Against 6c35d8b it fails (384 != 448: the target became 0700). At 3e53b88 it passes: the target stays 0600 with its content intact, the clone is removed, and the stage succeeds.
  • A direct probe confirmed that a failure on the clone root chmods only the root, never its parent.

Post-change workflow

  • Code review of the change: found one P1 in the first draft of this fix, now fixed. It would have chmodded the clone root's parent (for example a user-owned TMPDIR) when removing the root itself failed; the parent chmod is now scoped to the workspace.
  • Security triage: the default sensitive-area rule applies (filesystem cleanup of agent-controlled content; no security_review.always_when, no labels). The audit confirmed no remaining path that modifies anything outside the workspace. On Windows, a junction is not reported by islink before Python 3.12, and there chmod only toggles the read-only attribute. That was not exercised.
  • python3 -m unittest discover -s tests — 644 passed.
  • python3 scripts/validate-package.py — VALID.
  • CI on 3e53b88: Skills, manifests, and Bash installer and PowerShell installer passed on both the push and pull_request runs. Nothing is pending, failed, cancelled, or skipped.

Residual risk, accepted by the maintainer and recorded in #72: a Claude reviewer can write to the remote with its normal credentials. The write is detected when observable, but it is neither prevented nor undone. No blocking finding remains open. Approval belongs to the rereview.

@datacas

datacas commented Sep 24, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20260924-001] · senior_reviewer · openai/gpt-6-sol→? · max · schema:1

[CCT-20260924-001] · cheap_coder · openai/gpt-6-luna→? · high · triaged:732cf0473673a5d082edc5789a6427f64d399a73 · schema:1

[CCR-20260924-002] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-002] · unknown · unknown/unknown→? · unknown · triaged:dfae17471879a23cd33a44815c57579064e1eadd · schema:1

[CCR-20260924-003] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-003] · unknown · unknown/unknown→? · unknown · triaged:8ee2afe80e1f8b68cd1d41d49e9a281af8438044 · schema:1

[CCR-20260924-004] · unknown · unknown/unknown→? · unknown · schema:1

[CCT-20260924-004] · unknown · unknown/unknown→? · unknown · triaged:6c35d8b0fa27d595916a716c8d9e39aa18fd203c · schema:1

[CCR-20260924-005] · unknown · unknown/unknown→? · unknown · schema:1

Summary

APPROVED for PR #74 at head 3e53b88 against main at b9dbc54. Since the previous reviewed head 6c35d8b, the cleanup callback was changed to avoid chmod through reviewer-created symlinks, and a regression test was added.

Repository convention: CONTRIBUTING.md and the toolkit review workflow were applied; this repository has no project AGENTS.md or CLAUDE.md. PR #74 is open, not a draft, and describes issue #72, which remains open and now states the detection-only policy for Claude remote writes.

Findings

[REV-001] · high · not_applicable · valid · blocks:yes — Remote review branch can move without a contract violation

Obsolete because the relevant requirement changed. Issue #72 now explicitly accepts detection rather than prevention of Claude remote writes, and says those writes cannot be undone. The disposition valid is preserved. This status does not mean remote writes are prevented; the documented residual risk remains.

[REV-002] · high · resolved · valid · blocks:yes — Status fingerprint misses edits to an already dirty source file

Corrected and verified by execution: dirty implementer checkouts are rejected before dispatch. The targeted permission tests pass, including the dirty-checkout rejection case.

[REV-003] · medium · resolved · valid · blocks:yes — Failed isolation is recorded as verified isolation

Corrected and verified by execution: the failed-isolation test passes and confirms failed preparation does not report a read-only mode.

[REV-004] · medium · resolved · valid · blocks:yes — Cleanup failure leaves the review clone while reporting verified isolation

Corrected and verified by execution: test_a_review_clone_that_cannot_be_removed_fails_without_a_read_only_mode passes. The stage fails and does not claim a read-only mode when cleanup leaves a clone.

[REV-005] · medium · resolved · valid · blocks:yes — Cleanup follows a reviewer-created symlink and changes an external file

Corrected and verified by execution: the cleanup callback skips chmod on symlink paths and makes a parent writable only when it is within the workspace being removed. test_cleanup_never_follows_a_reviewer_symlink_out_of_the_clone passes: the external file remains mode 0600, its contents remain unchanged, and the clone is removed. The finding's disposition valid is preserved.

Security triage and audit

Security review was run because the change affects filesystem cleanup at the reviewer trust boundary. The symlink-following permission change from the previous head is corrected and covered by the regression test. No new confirmed security issue was found in this delta. The audit used the scripted executor and local filesystem tests; no live Claude invocation was made.

Verification

  • PYTHONPATH=tests python3 -m unittest test_executors.PermissionTests -v — all 19 targeted permission tests passed, including the symlink cleanup case.
  • python3 scripts/validate-package.py — passed: 13 skills, shared sections, and cross-agent manifests validated.
  • python3 -m unittest discover -s tests — 644 tests passed.
  • git diff --check b9dbc54..origin/pr-74 — passed with no whitespace errors.
  • No live Claude invocation was made.

Current CI

GitHub's Validate package checks passed at the current head: Skills, manifests, and Bash installer (2 runs) and PowerShell installer (2 runs). No pending or failed checks were reported.

Residual risk and verdict

Claude retains normal GitHub and Git access. Remote writes are detected when observable but cannot be prevented or undone; issue #72 directs users who need a hard guarantee to Codex or read-only credentials. The current head has no open blocking findings. APPROVED.

datacas added a commit that referenced this pull request Sep 26, 2026
…003)

Real comments republish earlier run lines and one run can span several
comments, so reading each comment as one run skipped every resolution
summary and returned {} on PR #74. comment_runs now attributes each
comment to the run lines it introduces first and folds a comment with no
new line into the current run. PR #74's live history yields
{"REV-001": 2}.
datacas added a commit that referenced this pull request Sep 26, 2026
)

* feat(cycle): stop findings that survive a claimed fix (#83)

A resolver that pushes a commit which does not fix a finding changes the
head, so the no-progress guard never fires and the iteration budget is
spent on one finding, as REV-001 was on PR #74.

- review_contract.claimed_fix_survivals: the single, pure definition. A
  claim is a resolution run publishing an ID as resolved/not_applicable;
  a survival is the next review run reopening it. Status, not disposition;
  last header per run; each (claim, next review) pair counts once.
- run_cycle: tracks survivals from the in-cycle structured results. The
  first survival names the IDs in the next resolve prompt with a
  reproduce-and-rediagnose directive; the second stops with
  HUMAN_INTERVENTION before another resolve. Also applies the skills'
  no-progress guard (same head, same open set).
- Telemetry schema 7: repeated_findings (observed pre-routing signal on
  resolve/rereview rows) and stop_reason on the cycle row; cc-stats
  reports both.
- Both orchestrators state the ladder, cc-resolve-comments handles
  contested findings, and the validator checks the ladder prose.

Closes #83

* fix(cycle): read malformed statuses as unknown and keep the final survival count

REV-001: _finding_statuses checked vocabulary membership before the type,
so a JSON list or object status raised TypeError and bypassed the cycle's
stop and close telemetry. It now makes the finding list unreadable.

REV-002: a survival found by the last permitted rereview had no later
dispatch to carry repeated_findings, so cc-stats counted the cycle as
having none. The closing cycle row now keeps the last evaluated value,
and the value stays unknown (omitted) until the ladder is first
evaluated instead of starting at zero.

* fix(review-contract): count survivals from real comment history (REV-003)

Real comments republish earlier run lines and one run can span several
comments, so reading each comment as one run skipped every resolution
summary and returned {} on PR #74. comment_runs now attributes each
comment to the run lines it introduces first and folds a comment with no
new line into the current run. PR #74's live history yields
{"REV-001": 2}.
@datacas
datacas deleted the issue-72-isolated-review-harness branch October 6, 2026 07:53
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