Skip to content

Stop the Go fixture stranding a read-only module cache, and pin review cleanup containment - #2973

Merged
jonathanKingston merged 2 commits into
mainfrom
claude/open-issues-priority-review-yooklc
Sep 22, 2026
Merged

jonathanKingston merged 2 commits into
mainfrom
claude/open-issues-priority-review-yooklc

Conversation

@jonathanKingston

@jonathanKingston jonathanKingston commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #2945.

Outcome

The production cleanup recovery landed earlier in #2947 and #2954. This change closes the two remaining regression gaps:

  • tie both Go sandbox fixtures' temporary-directory cleanup to t.after, so setup failures cannot strand a read-only module cache before the test body reaches its finally
  • pin removeTree containment with deterministic coverage for a read-only Go-shaped tree, outside permission preservation, symlink escape prevention, and the root-runner recovery path

Only test code changes. The reviewer implementation, permission policy, and benchmark specimens are unchanged.

Review

The complete diff was independently reviewed after rebasing onto current main. The cleanup repair remains confined to the owned tree: it uses lstat, traverses only directory entries reported as directories, and never follows the planted symlink. The test mock forces the first owned-root removal to fail with EACCES, so the recovery assertions execute even on a privileged runner.

Validation

  • focused remove-tree suite: 4/4 passed
  • focused Go preparation suites on pinned Node 24 in the real macOS environment: 7/7 passed
  • full local static gates passed; the full unit run reached 10,007/10,012 with five unrelated current-main macOS environment failures
  • rebased GitHub CI: precheck, check, and aggregate CI Passed all green
  • real secret-free Stage 0: exact head 1cad77304e5e; build, typecheck, lint, and tests clean; cleanup, artifact upload, and handoff succeeded
  • read-only findings run: explicit project-scoped Scaleway route, completed turn, no findings, and advisory review posted

The original PR-specific baseline failure mentioned in #2945 was separate from cleanup. It is not reproduced by this rebased head and is not being treated as a reason to modify a specimen PR.

#2945 reported review-ground cleanup failing with EACCES while unlinking a
Go module-cache fixture inside the review cell's own temporary directory.
The removal itself was hardened shortly afterwards in #2947 and #2954, but
the negative coverage that issue asks for was never added, so nothing holds
the containment properties in place.

Add the three cases the acceptance criteria name:

- a read-only, Go-shaped module cache is removed from the owned cell;
- permission repair never touches a path outside that cell;
- repair follows no symlink out of it — an outside sentinel keeps both its
  contents and its mode.

Also fix a silent gap in the existing race regression. It relied on a real
EACCES to drive its chmod interception, which root never sees: the mode bits
stop nothing, the first `rm` succeeds, and the interception the test exists
to exercise is skipped while the test still reports green. All four cases now
force the recovery path explicitly, so they assert the same thing whoever
runs them.

Mutation-checked: removing the EACCES recovery fails all four; the symlink
case fails once both containment guards (the `lstat` check and the `readdir`
directory filter) are removed — either alone still holds the line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KtZSwBeY9GbEPkM3Tkb8f3
Both fixtures in this file create their temporary directory, then run setup
— including `go mod tidy`, which populates a deliberately read-only module
cache — before entering the try whose finally removes it. Any failure in
that window (the zip helper, `go mod tidy`, or sandbox initialisation)
strands the directory with read-only contents still in it.

Observed locally: a full `pnpm run check` whose sandbox could not initialise
left /tmp/go-preparation-test-*/author-cache/example.test/dep@v1.0.0/dep.go
at mode 0444 under a 0555 parent — the same path shape #2945 reported the
review cell failing to unlink with EACCES. When this fixture runs inside a
review cell's own temporary directory, that stranded tree is what the cell's
cleanup then trips over.

Tie teardown to the directory's own lifetime with `t.after` instead of the
try, so it runs wherever setup fails. Sandbox state stays in the finally,
which is the only part that depends on the body having started.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KtZSwBeY9GbEPkM3Tkb8f3
@jonathanKingston
jonathanKingston force-pushed the claude/open-issues-priority-review-yooklc branch from b6f5340 to 1cad773 Compare September 22, 2026 19:41
github-actions Bot added a commit that referenced this pull request Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copse Reviewer

Executed in the ephemeral-runner backend (container).
Checks: build ✓, typecheck ✓, lint ✓, test ✓.
Verification: 0 attempted — 0 confirmed by reproducer, 0 refuted, 0 survived challenge, 0 undetermined.
Reviewers: qwen3.8-27b.
Head: 1cad77304e5e.

No findings.

Advisory, not a gate. copse-review 0.1.0 ·

@jonathanKingston
jonathanKingston marked this pull request as ready for review September 22, 2026 20:03
@jonathanKingston
jonathanKingston merged commit e4e9f72 into main Sep 22, 2026
29 of 41 checks passed
@jonathanKingston
jonathanKingston deleted the claude/open-issues-priority-review-yooklc branch September 22, 2026 20:18

This branch was successfully deployed

1 active deployment
github-pages 1cad7730 Deployed Sep 22, 2026 by github-actions[bot] via deploy #508
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.

Reviewer cleanup fails on read-only Go module fixtures

2 participants