Repository navigation
Conversation
Add dormant tracked credential and activation operations to the incoming arrival composition. Credentials: a bound, pending arrival can be issued one tracked access/refresh family, either to the saved browser user or as the cookie-less continuation of an accepted createAccount admission presented with the current arrival code. Family creation, arrival association and revocation of prior families commit in one authority transaction; tokens are returned only after commit. Saved-user recovery with a fresh email code replaces earlier refresh families. Ordinary login, refresh and account checks are unchanged and still refuse a pending account. Activation: one fenced operation checks canonical PLC head, endpoint, repository key, rotation custody, handle, placement, saved-user binding and backend state before anything is journaled, activates through the admin status hook, observes the backend active, then settles the attempt and completes the arrival in one transaction. A lost acknowledgement stays uncertain until isolation or drain recovery. Storage: completeArrivalActivation now requires the exact placed provisioning account and activates it in the same transaction, and settleArrivalAttempt accepts receipts already resolved by an approved recovery. No schema change. No routes are mounted. This work was assisted by a machine
|
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 #27. Implements plan 011: tracked migration credentials and one guarded activation operation.
Everything here is dormant. No routes are mounted, nothing is operator-visible yet, and there is no schema change, so there is no Changeset. Plan 012 mounts it and carries the Changeset.
What changes
composeIncomingArrivalnow takes a requiredlegacyargument and adds these callables:issueArrivalSessionissueCreationSessioncreateAccountrefreshArrivalSessionrecoverArrivalSessionauthorizeArrivalAccessactivateArrivalAsUseractivateArrivalWithCredentialCredentials
at+jwtwith the placement PDS DID as audience; refresh tokens use the Entryway service DID. No migration-only scope.refreshSessionnow shares a helper with the arrival refresh; its behaviour is unchanged.Activation
updateSubjectStatushook, observe the backend active, then settle the attempt and complete the arrival in one transaction.Changes to shared and previously reviewed code
These need review from both developers.
migration-arrival.ts,account-storage.ts, the two ports), code only:completeArrivalActivationnow requires the exact placed account (provisioning, same email, handle and PDS) and activates it in the same transaction through a new sharedactivatePlacedAccount, which goes throughsaveAccount.settleArrivalAttemptalso accepts a receipt already resolved by an approved recovery (unappliedorreplay-safe), so a superseded activation attempt is settled at completion.incoming-activationattempt step.arrivalBackendnow throwsOperationConflicton a placement change, where provisioning previously got a plainErrorwith the same message.requestDigestis exported fromoperation-ownership.tsand reused.tests/support/helpers/incoming-arrival-fixture.mjs. The live and restart helpers pass the newlegacyargument and activation callback.Decisions recorded in
docs/incoming-migration.mdcreateAccountadmission on a bound arrival is enough to obtain the first family. The source JWT is not re-checked, because it cannot verify after cutover. A leaked code could therefore win the first issuance; the window closes at first issuance or code expiry, and recovery revokes that family.incoming-recoverandincoming-activatebudgets at the existing limits.OperationConflict; a lost first response is recovered throughrecoverArrivalSession.Validation
Run natively on Node 24 at this head:
npm run build,check,lint,format:check,schema:check: exit 0.typecheckandcheck:architecture(157 files, 0 violations) passed in review.npm run test:unit: 756 tests, 737 pass, 0 fail, 19 skipped.incoming-arrival-storage: 169 pass, 2 skipped.incoming-credentials: 33 pass.incoming-activation: 50 pass.npm run test:incoming-reconciliation: 23 pass, 0 fail.reconciliation-requiredbranches in the completion transaction.Not run locally: PostgreSQL. This PR changes storage code, so the plan's both-dialect gate is unmet until the
databasesjob passes here. The live, Atmosphere in a Box and browser suites were also not run.Not in this PR
admitIncomingstill takes its owner from a browser session, so the cookie-lesscreateAccountflow does not work end to end until plan 012 adds a tool-facing admission.🤖 Generated with Claude Code