security(state): define idempotent generation admission - #200
Draft
seonghobae wants to merge 5 commits into
Draft
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 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 current
#199@2ce6ddbb86b370928eebdae22ab17b0042663c56after ordinary non-force adoption.This successor defines the bounded PostgreSQL source-generation admission contract without enabling production PostgreSQL selection, repository wiring, snapshot publication, or claiming #80/#192 complete.
RED -> causal repair
Test-only exact
ce7b8ebed5d4e242e4404ee7c60e2e66d9643ba1required a real PostgreSQL 18.4wardnet_admit_reputation_source_generation(...)boundary. Hosted CI34232142028, rust job102080672291, acquired GitHub-hostedubuntu-24.04, passed checkout/toolchain/formatting, then failed inTestbecause migration0002_reputation_source_generation_admission.sqldid not exist. Required behavior is: first binding ->committed; byte-identical replay ->replay; divergent immutable evidence on an existing token -> deterministicreputation_source_generation_replay_conflict; historical token rebound at another ordinal -> the same replay conflict; another token at an occupied ordinal -> deterministicreputation_source_generation_ordinal_conflict; rejected attempts create no extra history row.Production repair
fe204d5a1fd96ae63c302718c48be55022cd166dadded only the admission migration over #199's forced-RLS immutable relation. The function isSECURITY INVOKER, binds its tenant argument to the transaction-localwardnet.tenant_id, keeps the table's unique token/ordinal constraints authoritative, treats only the complete immutable tuple as replay, maps divergent token/ordinal reuse to stable conflict classes, and revokes PUBLIC execution. It does not introduce a recent-token cache, mutable history, cross-service SQL, provider routing, or a second lifecycle truth.That production head exposed an integration-harness defect rather than a SQL failure: CI
34232816650, job102082941192, failed because two PostgreSQL tests executed in parallel inside one test process and both derived Docker container namewardnet-postgres-generation-<pid>. Repairb4d748fbd2128ac7f8b46c559343d41a19eb91bagives each in-process test container a monotonic per-process suffix while preserving ordinary parallel test execution; it does not serialize the suite or weaken CI.Non-force parent adoption and exact-current evidence
Parent #199 advanced after the first GREEN. Commit
63b2731d7173d24fc15cc1c340fb177727d33251is a normal two-parent merge commit (b4d748f...+ current #1992ce6dd...) titledchore(stack): adopt current #199 into #200; it preserves #200's generation-admission/harness delta while adopting the intervening Runtime Configuration ancestry instead of force-rewriting history. Comparison fromb4d748f...to current head shows only the parent Runtime Configuration delta outside #200's owned migration/tests.Current exact head is therefore
63b2731d7173d24fc15cc1c340fb177727d33251, base is#199@2ce6ddbb86b370928eebdae22ab17b0042663c56, and hosted CI34234982519is terminal SUCCESS on this exact head. Submitted reviews: 0. Inline review threads: 0. No self/model approval is supplied.Remaining issue acceptance and stack discipline
This slice proves durable historical binding plus exact idempotent admission only. #192 still requires producer lifecycle identity, admitted evidence snapshot, completeness/pagination proof and last-known-good publication pointer to move atomically in one transaction; concurrent competing transitions, injected failure/rollback, pooled-connection context hygiene, migration upgrade/rollback/restore and backup/restore remain subsequent RED/GREEN work. Draft #207 is the direct atomic-publication successor on this exact head and does not enable production PostgreSQL authority.
Keep dependency order
#140 -> #193 -> #194 -> #196 -> #198 -> #199 -> #200. Parent movement must continue by ordinary adoption/non-force restack and invalidates predecessor gate evidence. No force update, destructive rebase, self/model approval, routine bypass, gate weakening, mutable foreign dependency, predecessor-result transfer or no-op workflow churn.