Skip to content

fix(identity): persist unlink+relink in lifecycle order - #124

Closed
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/bc-e1259541-af28-4e1f-a467-08e9ff7961e1-8985
Closed

fix(identity): persist unlink+relink in lifecycle order#124
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/bc-e1259541-af28-4e1f-a467-08e9ff7961e1-8985

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Superseded

This unlink/relink lifecycle-order slice is fully contained in the verified successor chain #133#147#160. Do not merge this predecessor.

Fresh ancestry evidence:

#160 carries the lifecycle-order/history recovery behavior and adds the hosted dual-proof persist/recover command boundary. #160 remains Draft and must still satisfy exact-head CI/security/review gates. Closing this PR does not promote any successor behavior to protected-main truth.

cursoragent and others added 5 commits August 16, 2026 15:25
A buyer who links an anonymous assessment to a Keyverse account must
still see that link after process restart. Persist assessment_participant
plus append-only link and link-end evidence, reload through the domain
lifecycle, and fail closed on conflicting replay or a subject already
bound to another participant.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Keep TRACEABILITY, ADR-0020, ERD, and as-built schema pointing at the
opened persist/reload vehicle instead of an unnamed Active PR.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The Active PR #114 naming commit stored an empty ADR-0020. Restore the
accepted decision, including the #114 persistence status and APA 7
references, so identity-link governance is not silently deleted.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Apply each identity link and then its matching ends in one transaction so a complete in-memory unlink+relink aggregate survives restart. Cover one-shot persist, exact replay, and subject reuse after unlink.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Add a tenant-scoped current-subject lookup so a returning Keyverse login can find the same product-owned participant after the anonymous session token is gone. Ended or replaced subjects stay unfindable until they are current again.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@cursor
cursor Bot requested a review from seonghobae August 16, 2026 15:38
cursoragent and others added 2 commits August 16, 2026 15:39
Renumber the identity-link migration so it does not collide with #113 scoring-job health indexes on 0021. Name Active PR #124 as the merge candidate over #114.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Remove the accidentally committed build tree and ignore /target so later local verification cannot leak compiler outputs into the identity-link successor.

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

Do not merge #124 at 729f3c6. GitHub rejects REQUEST_CHANGES on this bot-authored PR from this automation identity, so this is a blocking COMMENT with the same verdict.

Lifecycle-order persist of a complete unlink+relink aggregate is the right #114 repair. The remaining buyer hole is that current-subject lookup and uniqueness still trust only current_participant_identity_link.

After that derived projection is deleted, load_participant_by_current_identity_subject returns None and a second participant can persist the same issuer-scoped subject as Inserted. ADR-0020 already says the projection is derivable and not the evidence source of truth. Unterminated participant_identity_link rows must answer both lookup and uniqueness.

Prefer the successor that adds those RED contracts. Do not fold HTTP, live Keyverse verification, or backup/restore dumps into this slice. Do not self-approve.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Add a composite foreign key so a link-end or current projection cannot
point at another participant's identity-link row. Name Active PR #133
as the landing vehicle over #124 and #114.

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.

Do not merge this head. Lifecycle-order persist is absorbed by #147. This branch still treats the derived current projection as lookup/uniqueness truth.

Prefer #147 (431eeca) over #133, this PR, and #114. Do not 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
Point TRACEABILITY, ADR-0020, ERD, and the as-built schema at this
successor so operators do not merge superseded #133, #124, or #114.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Point TRACEABILITY, ADR-0020, ERD, and the as-built schema at this
successor so operators do not merge superseded #147, #133, #124, or #114.

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