Repository navigation
Conversation
Writing a new result Artifact's owner after approval committed let online ownership migration claim it first and fail the approval with 409. Write the owner (or stage its recovery intent for external stores) in the approval transaction instead. Refs oceanbase#2456 (6)
ctxloop
requested review from
Fengzdadi,
PsiACE,
beatenevo,
frf12 and
hidb4ai
as code owners
December 3, 2026 03:10
This branch has not been deployed
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.
Which issue or RFC does this PR close?
Refs #2456 (6).
Rationale for this change
When Access is
enforcedand an approval publishes a new Artifact (target is None), approval commits first and writes the Artifact's owner afterward, outside both the approval transaction and the owner recovery outbox.If
POST /v1/access/ownership/applyruns in that window, ownership migration claims the Artifact with the migration Principal. The approval then fails with 409artifact-owner, and the migration Principal remains the owner.What changes are included in this PR?
on_commithook toReviewService.approveandScopedReviewApplication.approvefor Experience, Skill (including Dreamderive_skill), and Profile Candidates. Target-revising Dream families and tag Candidates do not run it.tests/e2e/test_access_ownership_migration.pyfor failed owner writes, online migration racing approval (Experience and Profile, local and external stores), and ownerless approval retry.Are there any user-facing changes?
Yes. If writing the new Artifact's owner fails during
enforcedapproval (target is None):pending). Before, approval committed an ownerless Artifact.owner-recovery-pendinginstead of claiming it, and retrying approval delivers the owner and returns 200.Public APIs and persisted formats do not change.
How was this change tested?
tests/e2e/test_access_ownership_migration.py.uv run pytest tests/e2e/test_access_ownership_migration.py -q -n 4: 50 passed.uv run pytest tests/e2e/test_candidate_review.py -q -n 4: 2 passed, 1 skipped.uv run ruff check,uv run ruff format --check, anduv run ty checkpassed on all modified files.Tests use local SQLite single-database and two-database external Access store configurations. No live external Access backend acceptance is claimed.
AI usage statement
I used Claude Code (Claude Opus 5.5), Gemini 4 Neon, and Codex (GPT-6.1-sol) to write, rebase, and audit this change. I selected the approach and examined the diff and tests.