server: four identity checks still compare a Number ino, which can collide on Windows (#8750 follow-up)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
Research direction
Start with the four named sites in claude-tui-session.js, freshness/outbox.js, continuation-metadata-worker.js, and codex-native-resume.js; inspect their stat calls and identity comparisons. Then trace source.identity to confirm whether handlers/conversation-handlers.js needs a change. Add deterministic tests using colliding Number IDs and exact BigInt IDs; done means each affected comparison preserves exact identity and guards zero inodes, with macOS and Linux behavior unchanged.
Written by the indexing model from the issue text.
Description
Context
Follow-up from #8750 (config-dir-migration.js's sameDir), which now stats with { bigint: true }.
On Windows, Node's plain fs.stat returns ino as a JS Number. An NTFS file ID is 64 bits, with a sequence number in the high bits, so the Number loses everything below the top 53 bits. Two different files or directories created close together can then report the same ino. With { bigint: true }, dev and ino are exact BigInts. This repo already uses that form in byok-tool-executor.js, handler-utils.js, jsonl-reader.js and freshness-sources/claude-transcript-adapter.js. The 0n case still needs a guard, because some Windows filesystems report no inode.
Sites that still compare or key on a Number ino (from origin/main d45e17149)
| Site | Stat | What a false-equal ino does on Windows |
|---|---|---|
claude-tui-session.js ~1270/1279 (_sinkBaseIdentity from fstatSync(fd)), compared at ~1403 against lstatSync(base) (~1329) |
Number | The sink-base re-check ("was replaced with a different directory since it was validated") can read a recreated directory as the original. On Windows the uid/mode checks above it do not apply, so this dev/ino compare is the only replacement check there. |
freshness/outbox.js ~110/114 and ~126/127 |
Number | The rotation check (seen.ino !== known.ino) can miss a replaced file whose size is not smaller, so the cached tail of the old file is reused for duplicate detection. |
continuation-metadata-worker.js ~11/13 |
Number | The dev:ino:size:mtimeMs:ctimeMs key also needs the same size and both timestamps to collide, so the practical impact is negligible. Fix it for consistency. |
codex-native-resume.js ~34/36 (directoryBinding digest) |
Number | No impact today: bindNativeOwnership refuses on Windows (process.getuid is undefined there, and nativeMachineId() returns null). Fix it for consistency, so a future Windows path does not inherit the lossy key. |
handlers/conversation-handlers.js:368 keys on source.identity. Its provenance looks like the bigint jsonl-reader identity, but that is unconfirmed: confirm it.
Acceptance Criteria
- Each site above stats with
{ bigint: true }, guardsino === 0nwhere it compares identity, and compares or serializes the exact BigInt values.JSON.stringifycannot serialize a BigInt, so stringify it explicitly. - Each changed identity compare has a deterministic test that models the lossy Windows stat. The seam's fake stat must return
Number(id)withoutbigintand the exact BigInt with it, using two IDs that collide only as Numbers, e.g.(1n << 60n) + 1nand(1n << 60n) + 2n. The test must go red on the Number compare, as in #8750'sconfig-dir-migration.test.js. - No behavior change on macOS or Linux, where the IDs fit in a Number.
Note: claude-tui-session.js and codex-native-resume.js are provider session code, and freshness/ is under its own open work (#9312–#9325). Schedule each part with its area.
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 1
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 333
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blamechris/chroxy
-
from-review tech-debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blamechris/chroxy#9520 ·
Maintainers usually reply within 1 day
-
priority: low server
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
blamechris/chroxy#9340 ·
Maintainers usually reply within 1 day
-
documentation from-review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
blamechris/chroxy#9237 ·
Maintainers usually reply within 1 day
-
agent-control client: notify() docstring should say the outbound gate applies only in principal modeOpenenhancement from-review
Difficulty 1/5 Under an hour Newbie friendliness 80/100
blamechris/chroxy#9227 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blamechris/chroxy#9108 ·
Maintainers usually reply within 1 day
All issues in blamechris/chroxy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Use one constant for the 10,000-character input limitPossibly taken @NginxL claimed this today. Opengood first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aniru-dh21/snap-validate#51 ·
Maintainers usually reply within 1 day
-
Documentation pleaseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area/host bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days