Skip to content

chore(ci): partition archived runs by UTC day - #4166

Merged
schlessera merged 7 commits into
mainfrom
chore/4130-daily-run-archive
Nov 17, 2026
Merged

schlessera merged 7 commits into
mainfrom
chore/4130-daily-run-archive

Conversation

@schlessera

@schlessera schlessera commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #4130

What changed

New archived runs use YYYY-MM/run/DD.json based on UTC run.createdAt; other kinds stay monthly. Legacy monthly run blobs remain unchanged and readable. Both report commands share deterministic run/attempt joins across layouts, retaining newer/richer observations and refusing conflicting identities. The dated decision amendment, archive guide, inventory and workflow describe the transition.

Why this shape

Implements the maintainer's 2026-11-17 option B ruling. Natural UTC days give late arrivals a stable location. Numbered parts can reshuffle and compression obscures text diffs. No live archive dispatch or publication was performed.

Proof

Refresh after clean merge of current origin/main: the run fixture now returns TimingSnapshot explicitly; the deep-equality check compares the same arrays with operands reversed to satisfy the typed matcher. All behavioral assertions remain.

  • NODE_OPTIONS=--max-old-space-size=8192 bun run typecheck: passed.

  • Refreshed focused tests: 37 passed, 359 assertions.

  • Refreshed bun run check:pr --base origin/main: passed, including 1,214 affected invariant tests.

  • Failing first: daily-path expectations against the original writer failed (3 archive tests; expected 2026-07/run/12.json, got monthly run.json or missing daily path).

  • Placement mutation: replacing daily selection with monthly selection failed UTC_DAY_PARTITIONS, showing two monthly paths instead of four UTC day paths.

  • Boundary mutation: allowing MAX_FILE_BYTES + 1 failed the daily overflow assertion because the promise resolved instead of refusing. Both mutations restored.

  • bun run test tests/ci-archive.test.ts tests/ci-timings.test.ts tests/ci-evidence-report.test.ts: 37 pass, 0 fail, 359 assertions. Covers late arrivals, UTC offset/day/month boundaries, unchanged historical blob bytes, deterministic mixed-layout joins and replay, both report inputs, unknown versions, leakage refusal and real exact-lease concurrent writers. Exactly 95 MiB passes; one byte over refuses before any commit.

  • bun run check:pr --base origin/main: all checks passed, including 1,214 affected fast invariant tests.

  • Existing repository-wide citation drift is tracked by docs: reconcile accumulated citation drift before the next release #3626; archive source citations are valid.

{"version":1,"kind":"brain-check-pr-receipt","head":"0b336f9b906c74c8b1e957b25f301935b294a4cc","base":"origin/main","mode":"focused","startedAt":"2026-11-17T09:40:34.578Z","finishedAt":"2026-11-17T09:42:19.168Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":17774.813049},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":132.83902999999918},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":157.11149999999907},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":19.945106000002852},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":86487.320378}]}

Off-main qualification

Exact-head CI after the orchestrator refresh merge: https://github.com/schlessera/brain-kit/actions/runs/44082827503, head 0ea997b774f375888d82fad3d1a0981b42878897, completed success.

Exact-head CI after the orchestrator refresh merge: https://github.com/schlessera/brain-kit/actions/runs/44081657952, head ffe98524bac7062e080b03a8418c4d2fb8e92c74, completed success.

Exact-head CI after the orchestrator refresh merge: https://github.com/schlessera/brain-kit/actions/runs/44064721612, head 95724c9534139c8b5965f7eb594d32e62711877a, completed success.

Exact-head CI after the orchestrator refresh merge: https://github.com/schlessera/brain-kit/actions/runs/44060884007, head 843918cf1ed29ffa55b00ba3bb008442a6f5f186, completed success (the refresh merged main's #4160 proof-input change, so the earlier run on 0b336f9b9 no longer qualifies).

Exact-head draft CI: https://github.com/schlessera/brain-kit/actions/runs/44058030415, head 0b336f9b906c74c8b1e957b25f301935b294a4cc. It runs the selected offline invariants and repeats changed archive tests under load. At handback it is in progress; this is not a claim of completed hosted proof. Local offline tests compare daily/mixed-layout inputs against equivalent single-layout reports. Candidate confirmation belongs to the orchestrator.

Guard containment

A record in the wrong UTC partition or an incompatible run identity refuses that read/publication; it does not change unrelated archive data or proof/merge eligibility. Skipping a conflicting observation would silently misstate evidence, so reports refuse rather than label it clean. Size overflow refuses the whole proposed publication to avoid partial source receipts; the inspected ref stays intact. A subsequent valid batch can publish automatically. CLI errors and the workflow's retained result/log expose the cause. The boundary test proves a valid batch succeeds before an oversized batch refuses without another commit; existing leakage and concurrency tests prove unaffected records and competing writers survive. Unknown versions, leakage screening and exact-lease publication retain their existing behavior.

Checklist

  • Focused local behavioral and mutation proof passed; preflight receipt below.
  • Acceptance criteria are implemented and documented.
  • No core package changes; independent core review is not required.
  • Internal measurement layout only; no package changeset or CLI/MCP contract change.
  • No provider-facing history changes or personal data.
  • Release milestone is 0.45.0 on the PR and issue.

Collision check

bun scripts/collisions.ts --json --pr 4166 at head 0b336f9b906c74c8b1e957b25f301935b294a4cc: 12 closure-only reports, no direct path, textual or unknown collisions. Shared test/import closures overlap #3054, #3056, #3059, #3069, #3581, #3622, #4002, #4036, #4151, #4155, #4157, #4167. The graph was built for this head; these are dependency overlaps, not a lock.

Anything left open

Hosted candidate proof and landing belong to the orchestrator. No follow-up issues filed. Existing citation cleanup remains #3626.

@schlessera schlessera added this to the 0.45.0 milestone Nov 17, 2026
@schlessera schlessera added type: chore Tooling, CI, release plumbing, dependencies. area: ci CI workflows, the gates they run, release scripts, packaging. labels Nov 17, 2026
@schlessera
schlessera marked this pull request as ready for review November 17, 2026 12:31
@schlessera
schlessera merged commit 94f5580 into main Nov 17, 2026
61 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, the gates they run, release scripts, packaging. type: chore Tooling, CI, release plumbing, dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: partition archived run records by UTC day

1 participant