test(state): require recoverable publication migration rollback - #209
Draft
seonghobae wants to merge 3 commits into
Draft
test(state): require recoverable publication migration rollback#209seonghobae wants to merge 3 commits into
seonghobae wants to merge 3 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 8, 2026
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.
Refs #80 #192. Draft child of exact #208@
5a4c510aad6a63c738fcf69656fa385e8343521b.Recovery defect and executed RED
The PostgreSQL reputation publication stack had forward migrations 0001..0003 but no executable rollback from publication schema to the preceding source-generation admission boundary. #80 requires migration upgrade/rollback/recovery acceptance before PostgreSQL can become production state authority.
Test-first
71ef3240ef150ba117b77d0492cb1cdd24eb8691added the real PostgreSQL 18.4 recovery contract while production remained unchanged. Formatting-only7765a7d60e99dcde93bf7deb0044d3984aa0918fmade that contract executable. Hosted CI34250189871, rust job102142339076, acquired GitHub-hostedubuntu-24.04, passed checkout/toolchain/cargo fmt --check, then failed inTestwhile the requiredmigrations/0003_reputation_source_publication.down.sqlartifact was absent; Clippy was skipped. This is the causal semantic RED rather than a runner or formatting failure.The regression applies 0001..0003, publishes generation 1, rolls only migration 0003 back, proves publication function/history/head are gone while 0001 generation history plus the 0002 admission capability survive, requires rollback replay to be safe, reapplies 0003, republishes the preserved generation and proves the generation binding is not duplicated.
Minimal causal repair and exact-current GREEN
Current exact head is
b191c98ec539dbee92700b32f3fbe0c42c8b77d9. It adds onlymigrations/0003_reputation_source_publication.down.sqlon top of the test-first lineage. The down migration owns one explicit transaction, drops the outer publication capability before its backing tables, drops last-known-good head before immutable publication history, and intentionally preserves migrations 0001..0002 and their admitted generation identities. It creates no roles, credentials, repository wiring or foreign-owner behavior.Hosted CI
34250487750, rust job102143370052, is terminal SUCCESS on unchanged exactb191c98e...: hostedubuntu-24.04acquisition, exact checkout, toolchain, formatting, all locked workspace tests including the PostgreSQL 18.4 rollback/reapply regression, and strict Clippy all passed.Fresh exact parent comparison is
ahead_by=3,behind_by=0, merge base exactly5a4c510aad6a63c738fcf69656fa385e8343521b; the complete parent-relative delta is exactly the rollback migration plus its integration test. Submitted reviews: 0. Inline review threads: 0. No predecessor result is promoted as current-head GREEN.Remaining recovery boundary
This slice proves schema rollback/reapply only. It does not enable
StateAuthority::Postgres, map production principals, prove pool checkout/reset hygiene, crash/retry, backup/restore or immutable protected release readiness.Migration 0003 deliberately does not own cluster-role lifecycle. After a rollback drops the
SECURITY DEFINERpublication function, reapplying 0003 recreates that function under the migration principal; recovery therefore must reconverge the existing #208 deployment-role installer before runtime publication authority is restored. A follow-on #80 recovery acceptance must prove the recreated function is again owned bywardnet_state_owner, PUBLIC execution remains revoked,wardnet_runtimereceives only outer publication EXECUTE/read authority, direct mutation/inner admission remain denied, temporary schema CREATE is absent, and recovery replay remains idempotent. Do not move role creation into the migration to manufacture GREEN.Keep Draft behind #208. No force update, destructive rebase, predecessor evidence reuse, self/model approval, routine bypass, gate weakening, no-op workflow churn, mutable foreign dependency, source copy or cross-service SQL.