fix(dispatch): pre-validate worktree containment before git materialises (#1154) - #1185
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
Walkthrough워크트리 생성 전에 기존 경로 구성요소를 검사합니다. 심볼릭 링크와 디렉터리가 아닌 구성요소를 거부합니다. run-id 및 repoSlug 심볼릭 링크 경로에 대한 dispatch 차단 테스트를 추가했습니다. Changes워크트리 경로 무결성
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
aef05d6 to
89b19c4
Compare
89b19c4 to
bde7b30
Compare
Summary
Pre-validate the retained-worktree destination BEFORE
git worktree addso a pre-existing symlink (or non-directory component) in the run-id path can never make git materialise the worktree outside the trusted relay base (#1154 item 2).createRetainedWorktreewalks the destination components from the canonical base and fails closed on a symlink / non-directory before git touches anything. The post-worktree addassertTrustedWorktreeunwind remains as a second line of defense.git worktree addnever runs against a symlinked destination and nothing is materialised at the symlink target.Scope split (direction: keep core, stay lightweight): the original draft also self-healed stranded worktrees inside dispatch (kill-window between
worktree addand the immutable run record). That is deliberately not in this PR — dispatch must not run recovery (AGENTS.md invariant), and cross-run worktree scanning is machinery the relay runtime is trimming. Stranded-litter recovery is tracked separately forrecover.js.Verification
node tests/skills-lint/scripts/vnext-test-ledger.js check✅node tests/skills-lint/scripts/vnext-runtime-inventory.js .✅Closes nothing yet: #1154 stays open for the recover.js-owned litter part.
Summary by CodeRabbit
버그 수정
테스트