Test the -x filesystem-boundary rejection branch (closes #17) #60

Open
clawbot wants to merge 1 commits from issue-17-x-boundary-tests into next
Collaborator

Adds tests for the -x (--one-file-system) descent rules in
subdirJob, which previously had no test executing the rejection
itself — only a case proving -x skips nothing when every path is on
one filesystem.

The tests call subdirJob directly with a fabricated operand device,
so no second real filesystem is needed (that would not be portable):

  • reject descent when the subdirectory is on a different device;
  • bypass the boundary check when the operand's own device is unknown
    (rootDevOK false);
  • warn and refuse descent when the entry's Info() fails;
  • cross the boundary by default (no -x).

The real subdirectory's device drives the boundary comparison; the
operand device is fabricated as that device plus one. The Info()
failure is produced by a small directory-entry stub whose Info()
returns a sentinel error (the repo linter forbids dynamic errors and
inline error handling, so the stub and its error are separate).

Tests only; scan.go is unchanged. make check green.

Model: opus-4-8

Adds tests for the `-x` (`--one-file-system`) descent rules in `subdirJob`, which previously had no test executing the rejection itself — only a case proving `-x` skips nothing when every path is on one filesystem. The tests call `subdirJob` directly with a fabricated operand device, so no second real filesystem is needed (that would not be portable): - reject descent when the subdirectory is on a different device; - bypass the boundary check when the operand's own device is unknown (`rootDevOK` false); - warn and refuse descent when the entry's `Info()` fails; - cross the boundary by default (no `-x`). The real subdirectory's device drives the boundary comparison; the operand device is fabricated as that device plus one. The `Info()` failure is produced by a small directory-entry stub whose `Info()` returns a sentinel error (the repo linter forbids dynamic errors and inline error handling, so the stub and its error are separate). Tests only; `scan.go` is unchanged. `make check` green. Model: opus-4-8
clawbot added 1 commit 2026-09-21 09:45:51 +02:00
The -x descent rules in subdirJob had no test executing the actual
rejection: the only case proved -x skips nothing when everything is on
one filesystem. Add tests that call subdirJob directly with a fabricated
operand device, so no second real filesystem is needed:

- reject descent when the subdirectory is on a different device;
- bypass the check when the operand's own device is unknown;
- warn and refuse descent when the entry's Info() fails;
- cross the boundary by default (no -x).

Tests only; scan.go is unchanged.

Model: opus-4-8
clawbot added the needs-review label 2026-09-21 09:45:57 +02:00
clawbot self-assigned this 2026-09-21 09:45:57 +02:00
Author
Collaborator

One finding.

TODO.md, new Completed Steps entry (top of the list): the entry runs five lines and narrates the four test cases ("reject across a boundary, bypass when the root device is unknown, stat-error warning, and default crossing"). The standing rule is at most three lines and no narration — what landed, date, issue link. Acceptable is a trimmed entry such as: what was tested, the date, and the issue URL, without the per-case list.

The tests themselves are correct and in scope: they exercise all four subdirJob branches from the definition of done, scan.go is untouched, and the gate is green.

Model: opus-4-8

One finding. `TODO.md`, new Completed Steps entry (top of the list): the entry runs five lines and narrates the four test cases ("reject across a boundary, bypass when the root device is unknown, stat-error warning, and default crossing"). The standing rule is at most three lines and no narration — what landed, date, issue link. Acceptable is a trimmed entry such as: what was tested, the date, and the issue URL, without the per-case list. The tests themselves are correct and in scope: they exercise all four `subdirJob` branches from the definition of done, `scan.go` is untouched, and the gate is green. Model: opus-4-8
clawbot added needs-rework and removed needs-review labels 2026-09-21 10:02:30 +02:00
Some required checks failed
check / check (push) Failing after 1s
This pull request has changes conflicting with the target branch.
  • TODO.md
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-17-x-boundary-tests:issue-17-x-boundary-tests
git checkout issue-17-x-boundary-tests
Sign in to join this conversation.