Repository navigation
fix(check): refuse paths outside the project, and name the missing paths it skips - #490
Conversation
…ths it skips check reported success with zero findings for a path outside the project or one that does not exist, so a check that never looked read as a clean codebase. A path outside the project is now refused with INVALID_INPUT and exit 1. A missing path is still skipped with exit 0, since raw git diff output names deleted files, but the skipped paths are named in a notice.
|
@claude /review |
|
Claude finished @theCodeDrift's task in 2m 54s —— View job Review mode: incremental — read 0 prior review thread(s) before reviewing.
SummaryThe containment check is done the right way — One asymmetry worth knowing about, not blocking:
Everything else checked out:
No inline comments posted — nothing met the bar for a blocking or actionable finding. |
…s not read as outside Only cwd was resolved to its real path. On macOS process.cwd() already returns the real form, so a path typed through /tmp still read as outside the project. The path's nearest existing ancestor is now resolved as well, which keeps a missing path comparable and judges an in-project symlink by where it sits.
Fixed in e1dfdb7 rather than deferred: the reverse case (cwd already in its real form, path typed through the symlink) is the more common one on macOS, since — AI Coding Agent |
taskless checkreportedsuccess: truewith zero findings, and exited 0, for a path outside the project or one that does not exist. A check that never looked read exactly like a clean codebase.checksuccess: true, exit 0INVALID_INPUT, exit 1success: true, exit 0INVALID_INPUT, exit 1../elsewhere/bug.ts)success: true, exit 0INVALID_INPUT, exit 1/no/such/file.ts)success: true, exit 0INVALID_INPUT, exit 1success: true, silentsuccess: true, exit 0, notice names the pathChoices
cirecipe pipes rawgit diff --name-onlyoutput intocheck, which names deleted files, so a missing path is an ordinary input. It is now named in a notice (stderr in text,noticesunder--json), so "nothing scanned" reads differently from "clean"./tmpand/varare symlinks into/private/, so without this a hook handing over absolute paths in the other spelling would now hard-fail. Mutation-checked: removing the fallback turns the test red.INVALID_INPUTcode, no new one.Recipes
check→ v8: path rules, theINVALID_INPUTrow in Errors, and that an empty result alongside a skip notice means nothing was scanned.ci→ v5: "silently filters" becomes "skips, naming them in a notice", and run from the repository root.hooksunchanged: every hook it describes passes paths inside the repository.Tests
10 new cases in
check.test.ts(each table row, mixed inside/outside, text mode, real-path spelling); the two existing missing-path tests now also assert the notice. Full CLI suite: 2183 passed.Fixes #475