NEC-113: Directory manifest ETag hashes the timestamp and disk figures, so it rarely matches (flaky 304 test) #203

Merged
nectenda-agent merged 3 commits from worktree-nec-113-directory-manifest-etag-hashes-the-times into main 2026-09-28 18:05:22 +01:00
Collaborator

Task: NEC-113 — https://projectron.nerchure.com/tasks/113

The shard's directory manifest ETag hashed the whole body, including generatedAt (a whole-second clock) and the capacity figures (which move with any disk write). So the identity service's conditional pull almost never got a 304, and directory-manifest.test.ts failed on CI whenever its two fetches straddled a second. That is FLAKE-8: tasks 425, 1536 and 1549, twice on main, where it blocked promotion. All three logged failures straddle a second boundary, and a forced boundary reproduces the 200 on the old code. The ETag now hashes the manifest minus generatedAt and capacity. A 304 carries the capacity figures in X-Shard-Capacity, and the identity service applies them when they are well formed, so its figures stay a minute fresh instead of freezing at the last directory change. New tests force the second boundary and a file-backed database's growth; both failed before the fix. Every rule was mutation-checked in both directions.

Spec: docs/changes/NEC-113-manifest-etag/spec.md

Changelog

NONE

Task: NEC-113 — https://projectron.nerchure.com/tasks/113 The shard's directory manifest ETag hashed the whole body, including generatedAt (a whole-second clock) and the capacity figures (which move with any disk write). So the identity service's conditional pull almost never got a 304, and directory-manifest.test.ts failed on CI whenever its two fetches straddled a second. That is FLAKE-8: tasks 425, 1536 and 1549, twice on main, where it blocked promotion. All three logged failures straddle a second boundary, and a forced boundary reproduces the 200 on the old code. The ETag now hashes the manifest minus generatedAt and capacity. A 304 carries the capacity figures in X-Shard-Capacity, and the identity service applies them when they are well formed, so its figures stay a minute fresh instead of freezing at the last directory change. New tests force the second boundary and a file-backed database's growth; both failed before the fix. Every rule was mutation-checked in both directions. Spec: `docs/changes/NEC-113-manifest-etag/spec.md` ## Changelog NONE
The directory manifest's ETag hashed the whole body, including generatedAt
(a whole-second clock) and the capacity figures (which move with any disk
write). The identity service's conditional pull almost never got a 304, and
directory-manifest.test.ts failed on CI whenever its two fetches straddled a
second (FLAKE-8: tasks 425, 1536, 1549, twice on main).

The ETag now hashes the manifest minus generatedAt and capacity, so a field
added later is hashed by default. A 304 carries the capacity figures in
X-Shard-Capacity, and the identity service applies them when they are well
formed, so its figures stay a minute fresh rather than freezing at the last
directory change.

Task: NEC-113
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N72wARCHDxUJ4P6GQezgro
Task: NEC-113
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N72wARCHDxUJ4P6GQezgro
Claim in the capacity tests only what they check, and survive live disk figures
All checks were successful
Release note / release-note (pull_request) Successful in 11s
CI / build (pull_request) Successful in 4m49s
CI / e2e (pull_request) Successful in 5m22s
CI / promote (pull_request) Has been skipped
CI / build (push) Successful in 5m2s
CI / e2e (push) Successful in 5m22s
CI / promote (push) Successful in 31s
1444056784
Review: the real-shard 304 test could not show capacity arriving, and the
server's 304-capacity test compared disk figures that are live wherever
packages/server/data exists. Checked with that directory present.

Task: NEC-113
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N72wARCHDxUJ4P6GQezgro
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nectenda/nectenda!203
No description provided.