Repository navigation
Conversation
The changed-prefix regression rewrote its fixture at the same size within milliseconds of creating it. Linux stamps mtime/ctime from a coarse clock, so both writes can share every stat field the target guard compares, and the classifier parsed the rewritten header without seeing a change. Age the fixture's timestamps before the mutation so the rewrite is observable on any filesystem while the test still requires a changed-input refusal. Fixes morluto#8685 Co-Authored-By: Claude Opus 5.5 <[email protected]>
[Low impact] This test-only change appears safe to merge. SummaryMakes same-size fixture rewrites visible by setting the initial file timestamps to a fixed past date.
Reviews (1) · Last reviewed commit: "test(ines): make same-size prefix change..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
TL;DR: I ran the one changed test file on Node 22.23.4, 24.22.1 and 26.12.1. All 37 tests passed on each version. On this head, the
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/filesystem/inesArtifact.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
The changed-prefix regression rewrote its fixture at the same size within milliseconds of creating it. Linux stamps mtime/ctime from a coarse clock, so both writes can share every stat field the target guard compares, and the classifier parsed the rewritten header without seeing a change. Age the fixture's timestamps before the mutation so the rewrite is observable on any filesystem while the test still requires a changed-input refusal. Fixes #8685 Supersedes #8689 Co-Authored-By: gensokyo-dev <[email protected]>
The changed-prefix regression rewrote its fixture at the same size within milliseconds of creating it. Linux stamps mtime/ctime from a coarse clock, so both writes can share every stat field the target guard compares, and the classifier parsed the rewritten header without seeing a change. Age the fixture's timestamps before the mutation so the rewrite is observable on any filesystem while the test still requires a changed-input refusal. Fixes #8685 Supersedes #8689 Co-Authored-By: gensokyo-dev <[email protected]>
Summary
Fixes #8685.
rejects changed iNES prefixes at the target entry pointfailed in Linux CI because its same-size fixture rewrite can be invisible to file metadata. This makes the rewrite observable on any filesystem without weakening the assertion.Problem and expected behavior
The test writes the iNES fixture, then rewrites it at the same size (
counts,signaturecases) on the first intercepted read, milliseconds later. The target guard (assertStableRegularFileIdentity) detects change by comparingdev,ino,size,mode,mtimeandctime. Linux stamps file times from a coarse clock, so both writes can share every compared field. The classifier then parses the rewritten header without a change signal, matching the CI failure:truncated iNES payload: header declares 4186128 bytes; file has 40976(0x10 + 255 × 16384 + 8192, i.e. thecountsmutation). macOS APFS records fine-grained times, which explains the local pass.No metadata-based guard can detect a same-size rewrite within one timestamp tick, so this is a test synchronization defect, not a production guard bug.
Change and scope
After writing the fixture, the test sets its access and modified times to a fixed past instant (
2000-01-01T00:00:00Z). The mutation's write then always produces a differentmtime. Assertions are unchanged: the target route still requires a reason containingchanged, and the inventory route still requiresintegrity.Not included: changes to production identity checks. Other same-size rewrites in this file (
overwrittenheader admission) zero the header and fail content validation regardless of timestamps, so they don't depend on this.Contribution scope: not applicable (test-only fix within existing boundaries).
Contract and boundary impact
src/filesystem/RegularFile.tsunchanged.Expected effects:
(Test-only change; none of the above apply to product behavior.)
Evidence and regression coverage
tests/boundary/filesystem/inesArtifact.test.ts,rejects changed iNES prefixes at the %s entry point.countsheader size. Not reproduced at runtime on Linux.Validation performed
npm run test:focused -- tests/boundary/filesystem/inesArtifact.test.ts(macOS arm64, Node 24.22.1): 37 passed.npm run check:fast: typecheck and lint successful.Compatibility, safety, and release
Author readiness
Human owner: @hafeez97
Before merge
type(scope): outcome.🤖 Generated with Claude Code