test(audit-git-checkouts): a failed directory walk should be covered on root runners #79
Loading…
Reference in a new issue
No description provided.
Delete branch "test/audit-partial-walk-shim"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a test that makes
findlist a changed directory and then fail, through a shell shim. It covers the rule that a partial walk leaves a worktree's activity "unknown". The existing chmod-based test skips under root, so the rule could go untested on root CI runners. The new test fails if the driver ignores find's exit status or trusts a partial listing.The two tests' titles now name their triggers, so a failure line says which one broke.
Deferred from #77 review round 4.
🤖 Generated with Claude Code
Review
01M3A0NCM41MPS3JNGXE95FN2H— headf2f5df04c24e49c0621538a93387795ba193c671Review — j4k-oss/agent-skills @
5ac4dc1658Scope: diff against base tree
d1e95321d499Status: dispatched — coverage complete (3/3 slots terminal)
Facts: current review-wide projection
Computed under:
Findings (2)
low — New test's name and comment describe the sibling test's scenario, and neither records why both exist
01M3A0TQ8NZ38TCZ6A58AWRA3Eskills/audit-git-checkouts/scripts/audit-checkouts.test.mjs(snippet)low —
shimcomment restates the semicolon the next line visibly appends, omits the parse-error stake, and sits away from its callers01M3A0W1RJ2EQW0BXMM4VGY6R7skills/audit-git-checkouts/scripts/audit-checkouts.test.mjs(snippet)Other claims
Coverage
Coverage pass: 01M3A0NCPG5RM676A5P4TWHRPK
Accounting: complete
Slot health: healthy
@ -1418,6 +1418,17 @@ test("a changed directory is timed by the newest file inside it", (context) => {assert.equal(result.activityReview.error, null);});test("a failed walk of a changed directory leaves the timestamp unknown", (context) => {low — New test title "a failed walk of a changed directory" is indistinguishable from the adjacent "cannot be fully walked" test
lens
writing-quality· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M39S1J1M20P84XJZHERAZT0Sof review01M39RWAPBY3G42P5SVC41F8DHFixed in
1b5d6c2. Both titles now name their trigger: "a changed directory whose file listing command fails leaves the timestamp unknown" (thefindshim) and "a changed directory that is only partly readable leaves the timestamp unknown" (the chmod test, skipped under root).@ -1241,3 +1243,3 @@workingTree: { isClean: false, files: { staged: [], unstaged: ["sample.txt"], untracked: [] } },}));const classify = (days = "14", defaultBranch = "main", failStat = false) => {const classify = (days = "14", defaultBranch = "main", shim = "") => {low — The new
shimparameter hides a required trailing;, and nothing in its name or a comment states itlens
writing-quality· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M39V6DGKARYXWG13TK8XHS9Sof review01M39TYTY9JHTFE7AMZB0Y3KTWFixed in
cfdfe19. The template now adds the separator after a shim (${shim ?${shim};: ""}), so callers pass a bare statement and cannot drop it. A one-line comment states the shape.@ -1422,0 +1424,4 @@mkdirSync(join(fixture.worktreePath, "sample.txt"));writeFileSync(join(fixture.worktreePath, "sample.txt", "inner.txt"), "new work\n");utimesSync(join(fixture.worktreePath, "sample.txt"), 1000000000, 1000000000);const result = fixture.classify("14", "main", "find() { return 1; };");low — New directory-walk test shims find to emit nothing, leaving the documented partial-walk rule unprotected on root runners
lens
test-trimming· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M39V60BVNW8V9F4QZA3BKVVJof review01M39TYTY9JHTFE7AMZB0Y3KTWFixed in
cfdfe19. The shim is nowfind() { command find "$@"; return 1; }, andinner.txthas mtime 1003000000. Checked both mutants: trusting a non-empty partial listing now fails the test, and so does ignoring find's exit status.@ -1254,3 +1256,1 @@const annotationCommand = failStat? 'source "$1"; stat_epoch() { return 1; }; annotate_activity_review "$2" "$5" "$3" 1002592000 "$4"': 'source "$1"; annotate_activity_review "$2" "$5" "$3" 1002592000 "$4"';// `shim` is one shell statement, such as a function override; the template supplies its separator.medium — The
shimcomment constrains statement count when the real contract is "no trailing separator", so following it literally yields a bash syntax errorlens
writing-quality· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M3A03S29DQ966X198YWW81PDof review01M39ZYJK9W5XZ01YRX0XFC7CXFixed in
f2f5df0. Reproduced the;;syntax error. The comment now reads "Passshimwithout a trailing;; the template adds one."@ -1254,3 +1256,1 @@const annotationCommand = failStat? 'source "$1"; stat_epoch() { return 1; }; annotate_activity_review "$2" "$5" "$3" 1002592000 "$4"': 'source "$1"; annotate_activity_review "$2" "$5" "$3" 1002592000 "$4"';// Pass `shim` without a trailing `;`; the template adds one.low —
shimcomment restates the semicolon the next line visibly appends, omits the parse-error stake, and sits away from its callerslens
writing-quality· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M3A0W1RJ2EQW0BXMM4VGY6R7of review01M3A0NCM41MPS3JNGXE95FN2H@ -1419,3 +1420,3 @@});test("a changed directory that cannot be fully walked leaves the timestamp unknown", { skip: process.getuid?.() === 0 && "root reads directories regardless of mode" }, (context) => {test("a changed directory whose file listing command fails leaves the timestamp unknown", (context) => {low — New test's name and comment describe the sibling test's scenario, and neither records why both exist
lens
writing-quality· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M3A0TQ8NZ38TCZ6A58AWRA3Eof review01M3A0NCM41MPS3JNGXE95FN2HRound-4 outcomes for review
01M3A0NCM41MPS3JNGXE95FN2H(headf2f5df0). This PR is in round 4, where only clear, severe bugs get a new push. Both findings are real but touch only test names and comments, so they are acknowledged and deferred to a follow-up PR. Both fixes go inskills/audit-git-checkouts/scripts/audit-checkouts.test.mjs:// Exercises the non-zero exit alone; the unreadable-directory test below cannot run as root.shimcomment restates visible code. Move the caveat to theclassifysignature and state the consequence: "A shim ending in a semicolon yields;;and a bash parse error, not a test failure."