Skip to content

feat(coordinator): add the Project move admin route and the device move-log read - #3073

Merged
kunickiaj merged 2 commits into
mainfrom
feat/project-move-routes
Nov 29, 2026
Merged

kunickiaj merged 2 commits into
mainfrom
feat/project-move-routes

Conversation

@kunickiaj

@kunickiaj kunickiaj commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Description

Adds the two coordinator routes for Project moves.

  • POST /v1/admin/groups/:group_id/project-moves takes the admin secret and source_scope_id, boundary_scope_id, device_id, excluded_device_ids and team_removal_seq. It answers with one of:
    • the logged move;
    • a 409 that names the refusal reason and its devices;
    • a 400 for a malformed body;
    • a 503 when the coordinator has no move storage.
  • GET /v1/project-moves?group_id= answers a signed device of the group with every logged move, oldest first, so a device can tell which of its Projects moved.
  • The deployment guide says what migration 0058 adds. Until it's applied, both routes answer project_moves_unavailable.

No build lists project_boundary_migration_v1 in its presence yet, so the version gate refuses every move for now.

Type of Change

  • 🚀 Feature (new functionality)
  • 🐛 Bug fix (fixes an issue)
  • 📚 Documentation (docs-only change)
  • 🔧 Maintenance (refactor, chore, CI, etc.)
  • 🧪 Testing (test-only changes)

Testing

  • Route tests cover:

    • refusal without the admin secret;
    • the fields passed to the store;
    • each malformed body, including the exclusion and removal-sequence fields;
    • the 409 and 503 answers;
    • the signed device read, and its refusal of unsigned requests and a missing group.
  • pnpm run tsc and 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

  • Code follows project style (pnpm run lint passes for touched files)
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T04:13:52.450854Z 0937b17 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b13db0fb53

ℹ️ 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
kunickiaj force-pushed the feat/project-move-routes branch from b13db0f to bb11238 Compare November 29, 2026 03:12
@kunickiaj
kunickiaj force-pushed the feat/project-move-commit branch from 84dc8ce to 36df0b0 Compare November 29, 2026 03:13
@kunickiaj
kunickiaj force-pushed the feat/project-move-routes branch from bb11238 to 6656ec2 Compare November 29, 2026 03:52
@kunickiaj
kunickiaj force-pushed the feat/project-move-commit branch from 36df0b0 to 384a59a Compare November 29, 2026 03:52
@kunickiaj kunickiaj mentioned this pull request Nov 29, 2026
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.
…ve-log read

POST /v1/admin/groups/:group_id/project-moves takes the admin secret and the older scope, boundary and asking device, and answers with the logged move, a 409 refusal that names its reason and devices, or 503 without the move storage. GET /v1/project-moves?group_id= answers a signed device of the group with every logged move, oldest first. The deployment guide says what migration 0058 adds.
@kunickiaj
kunickiaj force-pushed the feat/project-move-commit branch from 384a59a to 216cda6 Compare November 29, 2026 04:12
@kunickiaj
kunickiaj force-pushed the feat/project-move-routes branch from 6656ec2 to 0937b17 Compare November 29, 2026 04:12
Base automatically changed from feat/project-move-commit to main November 29, 2026 04:30
@kunickiaj
kunickiaj merged commit 1b0fb64 into main Nov 29, 2026
24 of 38 checks passed
@kunickiaj
kunickiaj deleted the feat/project-move-routes branch November 29, 2026 04:35
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.

1 participant