fix(fs): make expected ENOENT probes silent control flow - #92
robotlearning123 wants to merge 1 commit into
Conversation
fileExists, readFile, and directoryExists are used as existence probes on every scan; a missing path is expected control flow, not an error. Log ENOENT at trace level without the err object instead of emitting debug records carrying full stacks and absolute paths. Non-ENOENT errors keep the existing debug record.
|
Verification (cycle 20260928_040032, issue #82): premise reproduced on main — one fixture scan emitted 67 pino debug records each carrying full err.stack + absolute paths (fs.ts:15/:30 via context.ts:98 and project-type.ts). Two evidence corrections: pino writes to stdout (not stderr — the issue's stderr oracle passes vacuously today), and LOG_LEVEL is already honored (logger.ts:13) so the fix lives at the probe sites only. Fix at head 4dc9526 (src/utils/fs.ts + test/utils.test.ts only — no logger.ts, respecting sibling PR #89): ENOENT catches log logger.trace({path}) without err; non-ENOENT keeps debug+err. Session re-verified by execution in a fresh worktree: stack count 0 (was 67); scan report byte-identical before/after (level-20 records excluded); LOG_LEVEL=trace still shows probes (67 records, 0 stacks); test/utils.test.ts 28 pass / 0 fail; tsc clean. Independent review did NOT run (reviewer lane quota-blocked) — status: needs_work, review-gate only; zero code findings. One-command resume when the reviewer lane recovers: |
|
Reviewer lane recovered — grok review result: VERDICT SHIP. One minor: test/utils.test.ts:55 — the test stubs logger.debug but this branch's ENOENT probes log at trace, so its asserts never execute (debugRecords=0); reverting the directoryExists catch at src/utils/fs.ts:105 to debug would still pass that test. Checked-does-not-hold: no scope creep (diff is fs.ts + one test only), default-scan/Action path clean (0 stacks, 0 log lines on stdout), issue #82 oracle passes (exit 0, empty stderr), non-ENOENT errors correctly stay at debug, listDirectories ENOENT-at-debug has no callers, trace-level absolute paths unreachable under action.yml. |
What
Why
Test evidence
Scope