feat(access): persist attachment-view grants in SQLite - #510
seonghobae wants to merge 64 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks 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 |
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks 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 |
1 similar comment
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks 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 |
|
Admission-state correction for exact head Finding: no current APPROVED review. This PR is being moved from Ready to Draft/Proposed. It remains open and its commits, reviews, threads, and valid delta are preserved. Return it to Ready only after the causal blocker is repaired and the unchanged or non-force-reconciled exact head has fresh terminal Checks, zero substantive unresolved findings, and any then-required current-head/latest-push independent approval. No bypass, synthetic status or approval, manual rerun, Force Push, review dismissal, or Close is used. |
Buyer and security impact
This bounded stacked #413 slice turns the framework-neutral access-grant domain in #506 into durable, restart-safe SQLite state suitable for later attachment-view and stream runtime migrations. It does not change URL transports by itself and therefore does not close #413.
Exact current stack and scope
feat/access-grant-domain-413@f3ae1f1f4ee66024776507d75f8fb752b2bf748c(feat(access): add short-lived opaque grant domain #506);e1206cedf482df4626cc7b84d5ad7800147b28e6;0ee0c8e9ed10072c5925250b79e6c24ffbafc85a;CHANGELOG.md;docs/doctoring/sqlite-access-grant-persistence.md;package.json;server/access_grant_sqlite.mjs;server/db.mjs;tests/unit/access-grant-audit-outbox.test.mjs;tests/unit/access-grant-sqlite-edge.test.mjs;tests/unit/access-grant-sqlite.test.mjs;tests/unit/coverage-script-contract.test.mjs.The parent’s current access-grant hardening, Playwright lock update, documentation, tests, and all protected-
developbehavior are preserved outside those nine paths.Reconciliation repair
Fresh state showed this child had diverged from live parent #506 and was 11 parent commits behind. A first non-destructive two-parent reconciliation commit (
4f472291...) fixed ancestry but reused the stale child tree. Once the live parent became the merge base, that exposed four unintended parent regressions indocs/doctoring/short-lived-access-grant-domain.md,package-lock.json,server/access_grant_domain.mjs, andtests/unit/access-grant-domain-edge.test.mjs; the resulting Server Tests run failed. That intermediate head is defective evidence and must never be reused.The causal repair at
e1206ced...rebuilds the child tree from exact current parent tree426141d10f01bc028b22423ef52a0a70e0358510and overlays only the nine child-owned blobs. Fresh comparison now proves ahead-only/zero-behind ancestry and exactly the intended nine-file semantic delta, with no deletion or weakening of the parent’s access-grant authority snapshot, edge tests, package lock, or doctoring contract.Durable adapter contract
access_grantsand the immutable audit outbox only during database bootstrap, never during a request;snake_caseschema objects and normalized relations;membership_id:token_versionstate;TDD and verification boundary
The original persistence regression imported an intentionally absent
server/access_grant_sqlite.mjsand failed RED withERR_MODULE_NOT_FOUNDbefore implementation. Focused tests cover replay, wrong-resource non-consumption, cross-tenant isolation, attachment readiness, session/membership invalidation, membership removal/re-add, resource deletion, stream grants, restart durability, bootstrap idempotence, schema/FK constraints, adapter failures, transactional audit rollback, historical evidence retention, and c8 registration.After the reconciliation repair, all predecessor-head checks and reviews are historical. Exact-head workflows for
e1206ced...have been freshly created and are non-passing until terminal; central SAST/Security results remain subject to the organization-owned exact-head evidence repair in.github#1222. No predecessor, synthetic, queued, skipped, absent, status-only, model-only, or author-only evidence is merge authority.Standards, rollback, and integration boundary
docs/doctoring/sqlite-access-grant-persistence.mdrecords active-PR versus protected-shipped truth, state and transaction models, tenant boundaries, 3NF/naming decisions, rollback, TDD evidence, and APA 7 references to RFC 6750, RFC 9700/BCP 240, and current SQLite foreign-key/isolation/transaction documentation.Rollback removes the adapter, bootstrap call, focused tests, coverage registrations, doctoring record, and SQLite-specific changelog entries together. It must not delete production data without a separately reviewed migration/recovery decision.
This PR does not close #413 or #433. Authenticated exchange routes, browser/runtime migrations, revocation hooks, PostgreSQL parity, calendar-subscription lifecycle, UI flows, and eventual rejection of general session JWT query transport remain separate bounded work.
Merge gate
Keep this PR Draft until the unchanged exact head has terminal exact-head CI/browser/owned-coverage/docstring/security/dependency/supply-chain evidence, zero valid unresolved findings, and the required qualifying independent approval. Do not integrate independently of #506. After #506 reaches protected
develop, reconcile this bounded semantic diff onto the resulting protected head and regenerate all then-applicable evidence.Refs #413 and #433