Skip to content

fix(consent): fail closed on ambiguous durable tail - #134

Closed
cursor[bot] wants to merge 25 commits into
mainfrom
cursor/bc-d8125716-fffd-4e6d-9842-7daaa7ac9338-9285
Closed

fix(consent): fail closed on ambiguous durable tail#134
cursor[bot] wants to merge 25 commits into
mainfrom
cursor/bc-d8125716-fffd-4e6d-9842-7daaa7ac9338-9285

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Superseded

This ambiguous durable-tail slice is fully contained in #142. Do not merge this predecessor.

Fresh ancestry evidence immediately before closure:

#142 retains the fail-closed unique-tail rule and removes the stale event-identity ordering claim, with additional tied-tail persistence evidence. The separate #123 line was observed as divergent from #142 and is not claimed contained by this closure.

#142 remains Draft and still requires unchanged exact-head CI/security/review gates. Closing this PR does not promote successor behavior to protected-main truth.

seonghobae and others added 24 commits August 14, 2026 18:15
Reject a grant-only snapshot after a stored revocation by locking the
participant ledger and requiring the durable event tail to match the
envelope before enqueue. Record the Active PR composition in
traceability, changelog, ERD, UML, and as-built schema.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Exercise missing ledger or event rows, time and identity mismatch,
timestamp overflow, and dropped relations so the tail lock stays at
full statement and branch coverage.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Same-millisecond grant then revoke must bind the later-inserted revoke, not a lexicographically larger grant event_ref. Keep the ledger FOR UPDATE lock and fail closed on a grant-only snapshot after that revoke.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Reject a consent/outbox bind when two events share occurrence time and
created_at, and require every durable event identity in the submitted
ledger so opaque event_ref cannot reopen the #112 grant-beside-revoke hole.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@cursor
cursor Bot requested a review from seonghobae August 16, 2026 15:47
Point TRACEABILITY, ERD, UML, and AS_BUILT at #134 so agents do not land
#70, #112, #120, or #123.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Prefer #142 over #134. The earlier head still documents event identity
as a durable-tail key.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (#134 729a2bd)

The unique fail-closed slice is sound: after persist, the adapter locks consent_ledger, requires every durable consent_event identity in the submitted ledger, selects the tail by occurred_at_unix_ms DESC, created_at DESC, and rejects a tied physical tail instead of using opaque event_ref.

Do not merge this head. Module rustdoc still says the tail is ordered by occurrence time, insertion time, then event identity. That is the exact tie-breaker this PR claims to remove. Function rustdoc and the SQL are correct; the module contract is not.

Prefer successor #142 (cursor/bc-67661417-bfc3-45ad-bb83-dcde94bd10d5-3ec5). It aligns the rustdoc, proves both tied grant and tied revoke envelopes leave integration_outbox empty, and updates ADR-0006 to Helsinki 2024 plus ISO/IEC 29184:2020 / TS 27560:2023.

Do not merge #70 3180620, #112 040bcf7, #120 3f72446, or #123 6643041.

Known residual, not a #134/#142 blocker: persist_consent_ledger remains a public write path. Next after #142 lands: make persist_consent_ledger_with_outbox the sole product consent write path, then POST /v1/consents.

Independent non-author approval and required checks on the unchanged exact head remain merge gates. Never self-approve.

View PR

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (#134 729a2bd)

The unique fail-closed slice is sound: after persist, the adapter locks consent_ledger, requires every durable consent_event identity in the submitted ledger, selects the tail by occurred_at_unix_ms DESC, created_at DESC, and rejects a tied physical tail instead of using opaque event_ref.

Do not merge this head. Module rustdoc still says the tail is ordered by occurrence time, insertion time, then event identity. That is the exact tie-breaker this PR claims to remove. Function rustdoc and the SQL are correct; the module contract is not.

Prefer successor #142 (cursor/bc-67661417-bfc3-45ad-bb83-dcde94bd10d5-3ec5). It aligns the rustdoc, proves both tied grant and tied revoke envelopes leave integration_outbox empty, and updates ADR-0006 to Helsinki 2024 plus ISO/IEC 29184:2020 / TS 27560:2023.

Do not merge #70 3180620, #112 040bcf7, #120 3f72446, or #123 6643041.

Known residual, not a #134/#142 blocker: persist_consent_ledger remains a public write path. Next after #142 lands: make persist_consent_ledger_with_outbox the sole product consent write path, then POST /v1/consents.

Independent non-author approval and required checks on the unchanged exact head remain merge gates. Never self-approve.

View PR

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Keep the authorization write-path gate independent of durable-tail
ordering and point agents at #142 instead of #134.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@seonghobae seonghobae closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants