Repository navigation
Conversation
Expose owner-checked renewArrival and cancelArrival from the incoming arrival composition so a lost preparation response can be recovered without another allocation. Renewal rotates the one-time arrival code for the same arrival and is refused once the arrival is cancelled or provisioned, or while its allocation is uncertain. Admissions already recorded survive renewal: continuations accept the generation recorded at admission instead of requiring the current one. A superseded, unknown or expired code now fails admission with ArrivalExpired whether or not an admission exists. Cancellation is limited to arrivals with no persisted obligation, no pending external attempt and an unchanged canonical PLC head. Both operations require origin/CSRF checks and a fresh email code. The callables stay dormant; no routes are mounted. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
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
|
|
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.



Part of TECH-681. Stacked on #23. Completes the saved-user lifecycle slice of plan 010.
What changes
composeIncomingArrivalgains two owner-checked callables,renewArrivalandcancelArrival. They stay dormant: no routes are mounted, and nothing is operator-visible, so there is no Changeset.Renewal rotates the one-time arrival code for the same arrival, so a lost preparation response is recovered without another allocation.
ArrivalExpiredonce the arrival is cancelled or provisioned, and withOperationRecoveryRequiredwhile its allocation is uncertain.Cancellation is limited to arrivals with no persisted obligation, no pending external attempt and an unchanged canonical PLC head. A prepared arrival always holds a reservation, so it cannot be cancelled. Cancel is idempotent, including after a crash between the local cancel and release of the DID claim.
Both require origin/CSRF checks, a browser session and a fresh email code. An unknown operation and another user's operation return the same 404 after the same proof work.
Changes to previously reviewed behaviour
These two points touch code accepted in #22/#23 and need review from both developers.
ArrivalExpiredbefore any request comparison, whether or not an admission exists for that body. Previously an old code gotAccountMismatchorOperationConflictdepending on state, and an exact replay of an accepted admission succeeded without a valid code. Exact replay now needs the current, unexpired code.After a renewal, re-submitting an already admitted body stays an
OperationConflict(the request digest includes the code generation). Recovery goes through the saved continuations, which plan 012 will mount.Decisions recorded
incoming-renewandincoming-cancelbudgets at the existing limits.docs/incoming-migration.mddescribes the behaviour above and adds renewal to the C1 error table.Validation
Run natively on Node 24 at this head:
npm run build,typecheck,check,lint,format:check,check:architecture,schema:check: exit 0.npm run test:unit: 667 tests, 648 pass, 0 fail, 19 skipped.tests/contracts/incoming-arrival-composition.test.mjs: 82 pass, 0 fail.npm run test:incoming-reconciliation: 23 pass, 0 fail.Not run locally: the PostgreSQL dialect contract run and the live, Atmosphere in a Box and browser suites. No database code changed; these are left to CI.
Known limits
provision-arrival.tsis defensive only:continueCreationrefuses first, so no test reaches it independently.com.atproto.*passed to the internal admission callable now returnsArrivalExpired, notInvalidRequest. The plan 012 adapter must validate the method before calling it.🤖 Generated with Claude Code