Tracking issue for upstream PR #1383 (branch feat/version-token-s1).
Part of the file-write safety series — plan: easonLiangWorldedtech/Zoo-Code#33, epic: #1375. Item: S1 / A1 — Version token.
Scope
- New
src/utils/versionToken.ts:
computeVersionToken(filePath): Promise<string> — one fs.stat(path, { bigint: true }); rejects with the underlying ENOENT for absent files.
versionTokenOfStat(stats: BigIntStats): string — pure, zero I/O; token format dev:ino:size:mtimeNs:ctimeNs, all five fields exact BigInt values rendered as decimal strings (no float anywhere).
- A1 infrastructure only: no production callers — behavior change is zero. S2 (observation registry) and S4 (guarded write) build on it.
Acceptance
- Same disk state → same token, deterministic across processes; any size/identity/mtime/ctime change → different token
- Regression test pins a size > Number.MAX_SAFE_INTEGER; sub-ms test asserts an exact 1_000 ns delta
- CI green (ubuntu unit-test gate), 100% codecov patch coverage
Status
- PR: OPEN, MERGEABLE — CI green (platform-unit-test ubuntu SUCCESS, codecov/patch SUCCESS)
- CodeRabbit finding (numeric stat precision) fixed via the
{ bigint: true } route (commit 2c1582bd9), inline comment replied
Tracking issue for upstream PR #1383 (branch
feat/version-token-s1).Part of the file-write safety series — plan: easonLiangWorldedtech/Zoo-Code#33, epic: #1375. Item: S1 / A1 — Version token.
Scope
src/utils/versionToken.ts:computeVersionToken(filePath): Promise<string>— onefs.stat(path, { bigint: true }); rejects with the underlying ENOENT for absent files.versionTokenOfStat(stats: BigIntStats): string— pure, zero I/O; token formatdev:ino:size:mtimeNs:ctimeNs, all five fields exactBigIntvalues rendered as decimal strings (no float anywhere).Acceptance
Status
{ bigint: true }route (commit2c1582bd9), inline comment replied