mirror of
https://github.com/affaan-m/ECC.git
synced 2026-08-28 18:59:47 +02:00
hasMarkerBlock previously swallowed every read/open error and returned false, so an unreadable AGENTS.md (EACCES, EMFILE, EISDIR, ...) made detectLegacyCodexSync report a clean Codex home instead of an indeterminate inspection result. The fallback path could then skip legacy cleanup and exit 0 with legacy artifacts still in place. Restrict the catch to ENOENT (a missing file legitimately means no marker block) and rethrow everything else. detectLegacyCodexSync already propagates from hasMarkerBlock, so callers now see the actual inspection error instead of a misleading 'no marker'. Regression test in tests/lib/codex-legacy-sync.test.js makes a detectLegacyCodexSync call against an unreadable AGENTS.md and asserts that it throws something other than ENOENT, plus a sanity check that a missing AGENTS.md still reads as no-marker.