Repository navigation
fix(usage): keep usage-ledger file ids exact so Windows NTFS ids stop colliding - #7089
Conversation
… colliding UsageLogRevision carried dev and ino as JS Numbers. NTFS file ids put a sequence number in their high bits and routinely exceed 2^53, so two different ledger files could round to the same Number and pass every identity check: the history indexer, the ingest tail guard, the cooperative ledger scanner and ledger retention would all treat a replaced ledger as the recorded one. This is what made the stale-ledger build case fail on Windows CI (#7070). Read dev/ino through bigint fstat (exactFileIdentity) and carry them as exact decimal strings end to end, including the schema_meta source identity, following the Aside profile precedent in #3842. Indexes written by an older build stored rounded values and rebuild once on mismatch. The stale-ledger test goes back to perturbing ino, now exactly, and asserts the revision matches bigint stats.
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. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab9b3b180b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration into
|
Summary
Preserve usage-ledger device and inode identifiers as exact decimal strings captured with bigint
fstat. NTFS identifiers can exceed 2^53, where distinct files collide as JavaScript Numbers. History metadata matching, ingest guards, cooperative scans and retention now compare exact identities. Old rounded metadata safely causes one index rebuild; corrected metadata is reused.Merged current
dev(7640a942b, including #7107) without rebasing or force-pushing. #7107 addresses Windows test-process cleanup and does not supersede this precision fix. Added deterministic SQLite tests for the colliding IDs9007199254740992and9007199254740993in both device and inode fields, plus a live-index regression for rebuild-once and subsequent reuse. The existing identity matcher is exported for direct regression coverage. Updated the owning structure document without increasing its line count.Verification
bun install: pass.OCX_TEST_NO_QUEUE=1 bun scripts/test.ts --parallel=2 tests/usage/request-history-rebuild-worker.test.ts tests/usage/request-history-index.test.ts tests/usage/usage-ledger-retention.test.ts tests/usage/usage-ledger-scanner.test.ts: 62 pass, 0 fail.Numbercomparisons makes the new deterministic precision test fail (0 pass / 1 fail); restoring exact comparisons passes (24 pass / 0 fail for the index file). No test stubs or skipped coverage added.bun run typecheck,bun run structure:check,bun run privacy:scan,git diff --check: pass.OCX_TEST_NO_QUEUE=1 bun run test:changed --parallel=2: interrupted under the resource exception after about eight minutes (exit 130; 25,628 passing records, incomplete run). Captured failures included audio readiness timeouts, sibling-home sync, and provider-header CLI handling. This broad import-connected selection approaches the full suite and many other worktrees were running on the host. Full local suite is deferred; broader coverage remains with hosted CI.dev7640a942b:OCX_TEST_NO_QUEUE=1 bun scripts/test.ts --parallel=2 tests/cli/cli-access-audio-live.test.ts tests/cli/cli-headless-parity.test.ts tests/cli/sibling-home-client-sync.test.ts --test-name-pattern 'native open and non-readiness|provider edit --headers|a secondary ensure parent'gives the identical 1 pass / 4 fail / 4 errors (exit 1) on both. Audio has three timeout cases; sibling-home times out at 30 s. The provider-header case passes in isolation on both, so the broad-run failure was not reproduced. No unrelated product/test behavior was changed to hide these failures.lane=all,9fd3031d5): https://github.com/lidge-jun/opencodex/actions/runs/38698612476 — queued, including Windows; pending is not passing evidence.enforce-targetattempts (38506374347, 38506509545) were cancelled before the gate ran. The original body passesassessPrDescription(ok: true); the author has admin permission, and the old branch was five dev commits behind. No description or ancestry rejection was present. The dev merge and this description refresh trigger a fresh exact-head gate; its completed verdict is still required.Checklist
structure/dashboard-and-usage.md).Refs #7070, #3842, #7087