Preserve published Evidence Record IDs across v0.1.3 - #3
Merged
Merged
Conversation
AMBRA7592
marked this pull request as ready for review
August 3, 2026 05:09
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.
Summary
Adds the production coexistence layer required before the v0.1.3 correction can be frozen or promoted.
evidence_recordsas an active-only compatibility view for the currently deployed frontend during migration/events/supersessions.jsonindexStorage and activation
Migration 007 renames the physical table to
evidence_record_store, adds package-generation metadata and supersession mappings, and creates an active-onlyevidence_recordsview.The exporter now has two explicit modes:
--truncate --package-generation ... --activate-generationfor local/bootstrap databases--evidence-only --package-generation v0.1.3 --supersedes v0.1.2for additive production stagingAn additive export cannot activate itself. Generated SQL checks inserted record/trial/membership/rule-hash totals, source-versus-target corpus metadata, and the complete transition map before committing. Activation rechecks row count, one rule hash, canonical hashes, and a complete map while holding an exclusive generation-state lock. The forward predecessor-to-successor map also authorizes a checked reverse activation; CI proves forward activation, rollback, and reactivation.
Generation corpus/severity totals are import-attested metadata for the frozen generation, not mutable live aggregates. A missing active generation is an unavailable state and returns HTTP 503 rather than displaying a zero-count corpus.
HTTP contract
x-trialdiff-record-status: inactivefor hold-stage byte verification but remain absent from feeds, links, totals, and the discovery indexmax-age=0, must-revalidatepublic, max-age=31536000, immutableVerification
Local:
unittesttrialdiff/,records/, or any frozen event-class package directoryCI run #24 is green across Python 3.11, Python 3.12, and the PostgreSQL/frontend contract. The PostgreSQL 16 job proves two frozen generations, inactive staging, hold-state exact bytes and non-enumerability, no-active HTTP 503, forward activation, reverse rollback, reactivation, 190 retained rows, 95 complete fixture mappings, zero canonical mismatches, exact old/new HTTP bytes, offline verification, supersession metadata/index, bodyless 304, and unknown-ID 404 controls.
Scope boundary
This PR does not regenerate or freeze v0.1.3, touch Neon/Vercel/Zenodo, create a tag or release, or modify any frozen package or implementation-hashed TrialDiff source. Independent read-only audit passed at
570d7cb; its two non-blocking consistency notes were closed atca236d8, with CI run #24 green. The PR remains draft/HOLD pending owner merge authorization.