security(state): persist tenant-scoped generation bindings - #199
Draft
seonghobae wants to merge 6 commits into
Draft
security(state): persist tenant-scoped generation bindings#199seonghobae wants to merge 6 commits into
seonghobae wants to merge 6 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
seonghobae
added a commit
that referenced
this pull request
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 current
#198@53d17b89f31eb297980e24aea806b9737f4fe87cafter ordinary non-force adoption.This is the first bounded durable PostgreSQL schema/RLS slice for reputation source-generation history. It does not enable
StateAuthority::Postgres, remove the existing fail-closed backend-availability guard, publish snapshots, add pooling, or claim #80/#192 complete.Exact test-only RED head
18b9228c32acc607a94d4638093a0d21d0ac2c22changed onlytests/postgres_generation_rls.rs. Hosted CI34225504005, job102058512687, passed checkout/toolchain/format and failed because the required migration did not yet exist. The hostile integration contract requires PostgreSQL 18.4 execution, a non-owner/non-BYPASSRLSruntime role, default-deny tenant RLS, transaction-local tenant context, tenant-scoped historical generation-token uniqueness, tenant-scoped ordinal uniqueness, and no context leakage after transaction end.Causal schema GREEN
edc957710afdc3b3529dbfb8d0e19f5f9482a076added the smallest production migration plus CHANGELOG. Exact-head hosted CI34226651321was terminal SUCCESS: forced RLS, missing/cross-tenant denial, tenant-scoped token and ordinal uniqueness, permitted cross-tenant reuse of the same external source identity, isolated reads, and transaction-local context cleanup all executed against PostgreSQL 18.4. Production startup remains fail closed; no repository adapter is enabled.Fresh review then found a DDD/single-writer violation: this child had also created
docs/product-technical-gap-baseline.md, while #130 is the live sole writer for that ledger. Repaire0e0cbb75ce5f2f39f501bf4d145755965b983earemoved the competing path instead of closing or duplicating the documentation authority. Fresh changed-file inventory is onlyCHANGELOG.md,migrations/0001_reputation_source_generation.sql, andtests/postgres_generation_rls.rs; #130 receives the exact PostgreSQL evidence separately.Bounded immutability head
b23c34f6656f6c4abd0b59875894d47bd86379e6added executable mutation acceptance without changing production SQL: the deliberately over-privileged test runtime role receives SQL UPDATE/DELETE grants, while absence of UPDATE/DELETE RLS policies must expose zero mutable rows. The test asserts attempted provenance UPDATE and generation DELETE each affect zero rows and that the original provenance remains byte-for-byte present. Hosted CI34230257863was terminal SUCCESS on that head.Non-force parent adoption and exact-current evidence
Parent #198 subsequently advanced. Current
2ce6ddbb86b370928eebdae22ab17b0042663c56is a normal two-parent merge commit (b23c34f...+ current #19853d17b...) titledchore(stack): adopt current #198 into #199; it preserves #199's durable generation-history/RLS slice while adopting intervening Runtime Configuration ancestry instead of rewriting history.Exact-current CI
34234948897and Fuzz34234948958are terminal SUCCESS on2ce6ddbb86b370928eebdae22ab17b0042663c56. The earlier same-head CI34234926867failure is superseded by the later terminal-success run and is not used as current non-passing evidence. Submitted reviews remain 0; no self/model approval is supplied.The relation binds
(tenant_id, source_id, source_generation)and(tenant_id, source_id, source_generation_ordinal)uniquely, rejects blank/invalid identities, carries immutable completion/provenance identity, and appliesENABLE ROW LEVEL SECURITYplusFORCE ROW LEVEL SECURITY. No recent-token cache, cross-service SQL, foreign-owner source, mutable dependency, snapshot/publication pointer, or fake in-memory persistence.PostgreSQL 18.4 is the integration target for this slice. RLS semantics remain fail closed: normal access is policy-gated, no applicable policy is default deny, table owners normally bypass unless
FORCE ROW LEVEL SECURITY, and superuser/BYPASSRLSis outside the runtime-role model.Keep Draft behind
#140 -> #193 -> #194 -> #196 -> #198; after any parent movement, non-force adopt current ancestry and reacquire every exact-head gate. This exact-head evidence proves the bounded slice only on its current ancestry; it does not authorize the still-disabled production PostgreSQL repository adapter. No self/model approval, routine bypass, force update, destructive rebase, gate weakening, predecessor-result transfer, or no-op workflow churn.