Repository navigation
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on c4345e2c7ae1ccf37ae94f494e84630671310d9a, 57.6s: approve (0 critical, 0 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| try: | ||
| fd = os.open(path, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW) | ||
| except NotADirectoryError as exc: | ||
| raise WorktreeError(f"local state directory is not a directory or is a symbolic link: {path}") from exc |
There was a problem hiding this comment.
suggestion: A symlinked state directory never reaches the WorktreeError branch
On Linux, os.open(path, O_DIRECTORY | O_NOFOLLOW) on a symbolic link fails with ELOOP, not ENOTDIR. So the except NotADirectoryError branch only handles a regular file named .loopzero. When .loopzero is a symlink, the user gets a raw OSError: [Errno 40] Too many levels of symbolic links. main still turns this into exit 1, so the behavior is safe. The regression test asserts "symbolic link" in err, and that only passes because the errno text happens to contain those words.
The same gap shows up in read_local_state, where O_NOFOLLOW on a symlinked artifact also raises ELOOP. Callers handle it differently:
_load_reportlets it propagate as a generic OSError.task_textlets it propagate the same way._load_reviewreports it as "not runner-produced".sandbox._previousswallows it silently.
Smallest fix: in _local_state_directory, catch OSError with errno in (ELOOP, ENOTDIR) and raise the existing WorktreeError. In read_local_state, map ELOOP to the 'not regular or is a symbolic link' WorktreeError. Then every caller gets the intended diagnostic, and the test checks the message the code actually produces.
|
Parked at approved head |
Confine local task state to the worktree
Context and goal
Closes #1027
Acceptance
Notes
Reject tracked state before using it as evidence. Check the state directory and direct child at the point of use. Use a directory descriptor for reads, writes and chmod so path replacement cannot redirect them.
This replaces #1306. It carries the reviewed local-state change, preserves the receipt diagnostics from #1294, and keeps the state-refusal cases in one regression test.
Validation
Recorded for
c4345e2c7ae1uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0The previous full-suite rerun passed, including the earlier intermittent readiness case. The conflict resolution passed the size budget and 16 focused cases.
Base
Base: bafb356
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review