Repository navigation
feat(coordinator): move one Project to its own boundary in one transaction - #3072
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
6 of 12 tasks
Owner
Author
6 of 12 tasks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84dc8ce6f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
kunickiaj
force-pushed
the
feat/project-move-commit
branch
from
November 29, 2026 03:13
84dc8ce to
36df0b0
Compare
kunickiaj
force-pushed
the
feat/project-moves-contract
branch
2 times, most recently
from
November 29, 2026 03:52
056d907 to
f13948e
Compare
kunickiaj
force-pushed
the
feat/project-move-commit
branch
from
November 29, 2026 03:52
36df0b0 to
384a59a
Compare
8 of 12 tasks
…ction The coordinator moves one Project from an older scope to its managed_project boundary with one atomic batch on SQLite and D1. It reads what its conditions need, decides, and writes only if the batch's first statements find the same values again: the asking device's enrollment, key, Identity and revocation state; that the boundary has no scope or membership row; and a fingerprint of the older scope, its members, their enrollments and stored presence, and the revocations. A failed check aborts the whole batch, and the move reads again to say why. The version gate refuses the move until every authorized member of the older scope lists project_boundary_migration_v1 in its stored presence, and names the devices that don't. The batch then creates the boundary, copies only the older scope's active authorized members with their roles, writes one audit row each and logs the move. A repeated request returns the logged move. The move reads and writes nothing of readiness. The contract now says what the admin device records: recipients are people and Teams, every device the older scope authorized keeps access, a device bound to no person makes its scope wait, and a Project in two older scopes is held.
kunickiaj
force-pushed
the
feat/project-move-commit
branch
from
November 29, 2026 04:12
384a59a to
216cda6
Compare
7 of 12 tasks
8 of 12 tasks
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.

Description
The coordinator can now move one Project from its older scope to its own boundary. One atomic batch, on SQLite and D1, creates the
managed_projectboundary, gives it the older scope's authorized members with their roles, writes one membership audit row each, and logs the move. A move is one-way. It reads and writes nothing of readiness.What gets copied: the batch copies the members with one
INSERT ... SELECTthat reads them as they are when the write runs. A member counts as authorized with an active membership at the scope's epoch, an enabled enrollment and no revocation of the device or its key.Exclusions: the admin device sends
excluded_device_ids, such as devices of people removed from the Team. It also sendsteam_removal_seq, the group's Team removal sequence it built that list from. Team removals don't revoke the older scope's rows, so the sequence is what keeps the list current. A move whose group has recorded a removal since then is refused, and the admin device rebuilds the list.Refusals: a move is refused, and nothing is written, when:
project_boundary_migration_v1in its presence.The key and version refusals name the waiting devices.
Checks inside the write: the batch checks the asking device, the boundary, the removal sequence and the completeness of the copy again, and aborts as a whole if any changed. A repeated request returns the logged move.
Contract doc: it now also says what the admin device records. Recipients are only people and Teams, and every device the older scope authorized keeps access.
Type of Change
Testing
One contract suite runs on SQLite, emulated D1 and native D1 in the Worker. It covers:
Disabling each of the move's 26 checks in turn makes a test fail.
The D1 statement check,
pnpm run tscand the Biome ratchet pass. The full suite runs in CI.Relevant checks pass locally (
pnpm run tsc,pnpm run lint,pnpm run test)Added/updated tests for changes
Manually verified changes work as expected
Checklist
pnpm run lintpasses for touched files)