Repository navigation
release: promote DG-R R01 and R02 (legacy-day rebuild) to main - #532
Merged
Merged
Conversation
… (ADR-0074 A2.3) (#519) Appends one new quality report (a fail that retires a valid revision, or a pass that restores it) for the current live revision of one natural partition, then runs the existing A16 lifecycle seam. The report is filed under the same suite and profile as the assessment it supersedes, copies its bound evidence unchanged, carries metrics.supersedes_assessment_signature = the exact signature of the current leaf, and must pass current_partition_report before anything is written. Idempotent; refuses a superseded, writing or closed revision, foreign evidence, a different dataset or key. Two short transactions (report, then the seam); a crash between them converges on a repeat. Tests: unit (argument rules), real-PostgreSQL gate (retire/restore, supersession link, evidence copy, reads exclude the retired revision under every policy, bytes/manifests/reports untouched, refusals write nothing, a concurrent S13 publication waits for the writer, no lock held after, crash window), a CI job, mutation: 22 mutants, 0 survivors. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…seding-reassessment data: R01 - superseding reassessment writer for a live revision (ADR-0074 A2.3)
… days (ADR-0074 A2) (#520) Plan (read-only, with a digest), execute (one day at a time: retire with R01, import the archive day as revision 1 of dt=<day>/seg=000000.000 through S13/S14, verify) and verify, restore, as tools/rebuild_bybit_legacy_days.py over application/bybit_legacy_day_rebuild.py. - Importer variant: the invalid live revision of the exact key dt=<day> does not occupy the day; any other partition of the day still refuses; the key is fixed; the lock is the day's. - Refusals: open day (< 24 h), live slice, checkpoint binding, open gap, incumbent not valid (or invalid but not retired by this operation for the same archive), failed strict parsing, and conservation (every incumbent record exists in the archive file of its own day with equal fields, and that day is readable afterwards). Nothing changes for a refused day. - The digest binds what the operation depends on, not its progress: a crash between steps is recovered by running the same plan; anything changed makes it stale. - Runbook section 6. Real-PostgreSQL gate and CI job; 34 mutants, 0 survivors; the rebuild of a pilot-sized synthetic day (1,568,861 rows) measured. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… plan digest (#520) tests/test_canonical_v1.py inventories every canonical_bytes call site; the plan digest of the R02 rebuild (sorted-compact-ascii-v1, allow_nan False) is declared there like the other application codecs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…in the plan, refuse a duplicated trade id (#520 review) - The live publisher before the slices (#510) wrote partition-manifest-<HHMMSS>.json and coverage-manifest-<HHMMSS>.json in the dataset root, not beside the Parquet. The rebuild now looks beside the artifact and then in the root, and the catalog's manifest hash chooses the location, so a root file that a later day overwrote in the same second is never taken for this revision's. - The plan loads the incumbent's manifests with the S13 loader and compares the coverage hashes and ids with those its quality reports certified; the coverage and assertion ids are part of the plan's identity. A manifest that does not load or is not the certified one refuses the day in the plan, not at the retire. - A trade id that the incumbent holds twice with different content refuses the day instead of keeping the last row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the restore, bind the import to the approved archive hash (#520 review) - The records of the incumbent that belong to another day must stay served: a valid partition of that day must hold those very records, or that day must be in the same plan and not refused (a refused day contributes nothing; the refusal propagates). Decided in the plan, before the retire. The plan also binds the hash of every neighbouring archive file it read. - The restore takes the day's import lock and decides under it: it cannot slip in between the import's check and its publication, so the two cannot leave both partitions valid. - The rebuild import and the verification check the SHA-256 of the bytes they parse against the plan's: a file replaced after the plan is refused (SOURCE), a file replaced after the import fails the verification. `verify --plan` binds a standalone verification too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…digest (#520 review) `outside_held` (whether a valid partition of another day holds the incumbent's records of that day) turns true when the plan itself rebuilds that day, so it was progress inside the digest and a crash before the second day's verification made the original plan STALE. It is left out of the digest; its consequence for the plan is in the refusals, which stay bound, so a change from outside still changes the digest. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…oo (#520 review) `outside_held` is out of the digest because the plan's own progress changes it, but the digest then relied on the refusals to notice a dependency lost from outside, and `_resolve_dependencies` skipped the days already retired or rebuilt. A day retired by something else between the retire of the first day and its retry therefore left the digest unchanged and the retry completed. Every day that is not refused is now judged on each planning: the progress of the days of the plan is allowed, the loss of an external dependency is a refusal, so the digest changes (STALE) before any further change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
data: R02 - operator-run rebuild of selected closed legacy live days (ADR-0074 Amendment 2)
This was referenced Oct 25, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
release: promote DG-R R01 and R02 (legacy-day rebuild) from
implement/fidtomainPromotes the two post-version DG-R atoms merged on
implement/fidsince the last promotion (#529,87930b3). Code, tests, a runbook section and CI jobs only: no governance, schema, ADR or contract file changes, and nothing runs on the server by being merged.What is promoted
reassess_live_partition, the superseding quality reassessment of a live revision (ADR-0074 A2.3, ADR-0030 A16):fail -> invalid,pass -> valid, two short transactions, idempotent, refuses a superseded/writing/closed revision.tools/rebuild_bybit_legacy_days.pyoverapplication/bybit_legacy_day_rebuild.py(BTCUSDT only, at most 31 named days per plan):plan(read-only, digest),execute --plan --digest,verify,restore. Per day: retire the damageddt=<day>revision (R01), import the whole archive day asdt=<day>/seg=000000.000through S13/S14, verify against the archive and a strictDataGatewayread. Runbook:docs/engineering/BYBIT_ARCHIVE_IMPORT_RUNBOOK.mdsection 6. CI jobsquality-reassessment-postgresandlegacy-day-rebuild-postgres.Evidence
test_promote_main_v1), PostgreSQL 16 gates of the rebuild, R01 and the archive import, mutation checks with no survivor on the final logic.Not claimed
2026-10-20rebuild, the 31-date inventory and the real manifests of the legacy days are the operator's, from a reviewed plan.After the merge
A tag on the merge commit, then the server promotion by the operator (clean tree, fast-forward only), as in
docs/engineering/.🤖 Generated with Claude Code