Skip to content

cluster: the guided setup asks the DevNet coordinator for its own approval - #1689

Open
davidtai wants to merge 6 commits into
devfrom
cluster/owner-approvals
Open

davidtai wants to merge 6 commits into
devfrom
cluster/owner-approvals

Conversation

@davidtai

@davidtai davidtai commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Goal

On DevNet a cluster pair gets its own cluster approval from the coordinator, so nobody adds approval rows by hand (David, 2026-10-31: "auto approval should be on"). This is the provider half. The coordinator half is darkbloom-platform #642 (final at 1c15a59ab9).

Change

  • Request. ClusterApprovalRequest sends POST <coordinator>/v1/cluster/owner-approvals with the account credential (Authorization: Bearer, the saved auth_token). The body has feat(monitoring): alert on production backup failure and backup absence #642's four fields in the vector's order:
    • provider_version: from the installed app's Contents/Info.plist;
    • model: the setup's publicModelID;
    • artifact_sha256: the setup's capability.artifactSHA256;
    • schedule: 1 or 2.
      A 200 or 201 must hold one owner approval whose policy_sha256 this Mac derives from the canonical bytes.
  • Reading. ClusterApprovalFetch.fetch(providerConfiguration:) also reads GET /v1/cluster/owner-approvals with the credential, verifies each policy_sha256, and adds those entries to the public list. 401, 403 and 404 mean the account holds none, and the public answer stays as it is (production, staging). Any other failure of either half is the answer, so a partial answer never withdraws a saved approval. The existing match and save on both Macs run unchanged on this list.
  • When.
    • After the guided setup's Test stage.
    • At the cluster service's checks (start, after an update or re-adopt, every minute) while the setup holds no approval.
    • Renewal: an owner approval within 7 days of not_after is deleted (DELETE …/owner-approvals/{id}) and then requested again.
    • A local-only cluster, a pair approval saved by hand, and an operator's approval are never asked for or renewed.
  • Failures. Every outcome is one line, Cluster approval request: …, and none stops serving. After a refusal (403/404, 400, 409) or a request this Mac cannot send, the service waits for its next run or an update. After a failure (no answer, 5xx), it asks again at the next check.
  • Shared vector. Fixtures/coordinator-wire/owner_cluster_approval_vector.json is byte for byte feat(monitoring): alert on production backup failure and backup absence #642's coordinator/tests/api/testdata/owner_cluster_approval_vector.json. The provider must send exactly its request bytes, and its reply must decode to the canonical hex and to policy_sha256 1683c2ac…b148.

Before

flowchart LR
  T[Test stage passed] --> G[GET /v1/cluster/approvals<br/>public list]
  G --> M{entry for model,<br/>schedule, artifact?}
  M -- no --> L[serve locally]
  M -- yes --> S[save on both Macs<br/>start as cluster members]
  O[operator posts rows by hand] -.-> G
Loading

After

flowchart LR
  T[Test stage passed<br/>or service check, no approval held<br/>or owner approval within 7 d] --> R{renewal?}
  R -- yes --> D[DELETE /v1/cluster/owner-approvals/id]
  R -- no --> P
  D --> P[POST /v1/cluster/owner-approvals<br/>4 fields, Bearer token]
  P --> Line[one status line;<br/>never stops serving]
  P --> G[GET /v1/cluster/approvals<br/>+ GET /v1/cluster/owner-approvals]
  G --> M{entry for model,<br/>schedule, artifact?}
  M -- no --> L[serve locally]
  M -- yes --> S[save on both Macs<br/>start as cluster members]
Loading

Locks

  • No lock is added or removed.
  • ClusterService.ownerRequestSettled is one more field under the service's existing lock, beside approvalChecked, and has the same leaf use.

Hooked up

  • OnboardingLive.localRegister → ClusterApprovalRequest.ensureBlocking, then ClusterApprovalFetch.fetchBlocking, which now includes fetchOwned.
  • ClusterService.checkApproval: decide → answer(saved) → ensureBlocking, then fetchBlocking.
  • ClusterOnboardingDriver.register waits for the parts only when lines other than approvalRequestNotice come back.

Validation

PR CI only; nothing runs on the laptop.

ClusterApprovalRequestTests runs against the real local MockCoordinator. The mock now reads the POST body as strictly as #642 does and serves GET and DELETE on /v1/cluster/owner-approvals. The tests cover:

  • the shared vector;
  • the setup's request bytes and credential;
  • the renewal: delete then request; a delete failure stops it; a 404 delete goes on;
  • an operator approval that is never renewed;
  • 403/404, 409, 500, 302 not followed, an unreadable 201, and a 400 for a bad body;
  • the cases where nothing is sent;
  • no answer;
  • the owner list joined to the public list;
  • 401/403/404 on the owner list;
  • a failed half;
  • strict owner decoding, including a policy_sha256 mismatch.

OnboardingChecks covers the request line alone and the request line followed by a registration.

Not in this PR

Jonathan's items that are not this PR's provider scope (mainnet build-pinned approvals, public qualification of GLM-5.3-Flash and Qwen3.8-27B, grants, the Qwen3.8-27B DevNet catalog entry, and the end-to-end proof on the real pair) are answered in the review reply.

Refactor pass

The repository's dedicated refactor subagent pass did not run: this worker cannot start subagents. That gate is open for the orchestrator.

🤖 Generated with Claude Code

…roval

After the Test stage passes, the control leader POSTs the pair's model
approval request (model, prefill schedule, installed app version from
Contents/Info.plist) to /v1/cluster/approvals with the account credential,
then runs the existing fetch, match and save path unchanged. 200/201,
403/404 and every failure are one "Cluster approval request: ..." line that
stops nothing; the setup waits for the parts only when the registration
stopped them. Not sent for a local-only cluster or a hand-saved pair
approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Oct 31, 2026 1:38am UTC
d-inference-console-ui-dev Error Error Oct 31, 2026 1:38am UTC
d-inference-landing Ready Ready Preview Oct 31, 2026 1:38am UTC
darkbloom-status Ready Ready Preview Oct 31, 2026 1:38am UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 31, 2026 1:38am UTC

Request Review

jonathan308
jonathan308 previously approved these changes Oct 31, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
jonathan308 previously approved these changes Oct 31, 2026

@jonathan308 jonathan308 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review against darkbloom-platform #642 (the coordinator half, head a8c7f4862d). Checked at 5e739ebb16: as written, the two halves do not connect, so a pair would still get no approval.

  1. Path. ClusterApprovalRequest sends POST <coordinator>/v1/cluster/approvals. #642 routes POST /v1/cluster/owner-approvals (with GET and DELETE /v1/cluster/owner-approvals/{id}) and serves only GET on /v1/cluster/approvals. Against #642 the request fails and the setup prints only the Cluster approval request: … line.
  2. Body. This PR sends 3 fields, {"model","provider_version","schedule"}. #642's ownerClusterApprovalRequest is strict and requires exactly 4: provider_version, model, artifact_sha256, schedule (400 otherwise). The member already has the digest: the saved setup's capability.artifactSHA256, which is what #1685's selection compares a model approval's artifact_sha256 with.
  3. Finding the new approval. After the request, OnboardingLive.localRegister runs the existing fetch, which reads the public GET /v1/cluster/approvals. #642 does not list owner approvals there ("GET /v1/cluster/approvals does not list owner approvals"), so the match and save never see the new row. Use the approval in the 201/200 reply, or GET /v1/cluster/owner-approvals with the same credential, and run the same match and save on it.
  4. Tests. MockCoordinator adds router.post("/v1/cluster/approvals") and accepts the 3-field body, so ClusterApprovalRequestTests pass against a shape the coordinator does not serve. A shared vector (path, exact body bytes, reply) pinned in both repos would catch this.
  5. Draft. The description says "The PR stays a draft until the coordinator's final API shape is confirmed", but it is open as ready for review.

Checked and fine: the installed DevNet app's CFBundleShortVersionString is 0.10.5-dev.branch.16, which passes #642's -dev. check.

Scope note: owner approvals are model approvals, so they are development-only and serve the owner only (no parity qualification may name one). jonathan308 also wants automatic approval on mainnet and public traffic for GLM-5.3-Flash and Qwen3.8-27B; that is being handled separately.

@jonathan308

Copy link
Copy Markdown
Collaborator

Follow-up: the complete list of what jonathan308 decided on 2026-10-31 that #1689 and darkbloom-platform #642 need to cover together, so that no separate PRs are needed. Items 1–3 of my first review (path, body, listing) still apply.

1. Automatic approval on mainnet too, not only DevNet. #642 answers 403 outside a development deployment, and owner approvals are model approvals, which #636 limits to development by design. Production needs its own automatic path that keeps the build pinned. Production deliberately keeps build-pinned approvals, so the coordinator must still know the exact worker and libraries a pair runs. One way is the original #602/#1660 design: the signed release registers its own build-pinned approvals with its release key.

2. Automatic public traffic for exactly GLM-5.3-Flash and Qwen3.8-27B, and no other model. Owner decision: both are publicly qualified ("they are both good to go"), in tensor parallel. Today no parity qualification may name a model approval, so an owner approval can never serve public traffic. Needed:

  • promotable parity qualifications for those two models' approvals (tensor_parallel family, both schedules), created automatically, never by hand;
  • EIGENINFERENCE_CLUSTER_PUBLIC_ROUTING=true on DevNet and in production.

Every other model's clusters stay owner-only.

3. The public request envelope for those two models:

  • sampling and tool calls allowed;
  • token bounds are the model's own limits;
  • images and video follow the model's catalog input_modalities.

GLM-5.3-Flash lists text, image and video, and its tensor-parallel path takes media as the single-Mac product does (ClusterGLMMedia: up to 16 images and 8 videos), so GLM clusters must take public image and video requests.

4. No grant that blocks GLM tensor parallel. GLM's bundled cross-cable records hold a single pipeline_v1 run. A pair-serving grant built from them would name only pipeline, and "an approval with grants, none of which names a plan's family, does not serve that plan" would then refuse GLM tensor_parallel_v1 sessions. M5 members meet GLM's single-Mac requirements (apple_m5, mlx_nax, glm5_next_v1, 256 GB) without a grant.

5. Hands-off over time. #1689 asks only in the guided setup, after the Test stage. Pairs that are already set up, or re-adopted after an update, never ask. Nothing renews before the 90-day not_after either: #642 makes renewal a DELETE then POST, and nothing does it. The cluster service should ask at start, after an update, and whenever no approval is held, and renew before expiry.

6. Capacity. Owner rows share NativeRuntimeCatalogLimit (64) with operator rows. DevNet holds 50 operator rows today, so about 14 slots remain at 8 per account.

7. Proven end to end on the real pair. The DevNet pair pair-eeff75264860 (leader mac-928917db1830, member mac-cff934455dca, both on 0.10.5-dev.branch.16) registered by itself under devnet/glm-5.3-flash/s1 at 00:31Z, but no session has formed. Both members wait with 0 of 2 ranks ready, and the leader logs a coordinator error every 30 s (the provider keeps that text private, so the reason has to come from the coordinator's logs). Done means three things on this pair:

  • a session forms;
  • an owner request and a public request for GLM-5.3-Flash (including one with an image) are answered;
  • the same holds for Qwen3.8-27B.

@jonathan308

Copy link
Copy Markdown
Collaborator

One more for the list:

8. Qwen3.8-27B is not in DevNet's model catalog. GET https://api.dev.darkbloom.dev/v1/models/catalog lists only Qwen3.5-9B, ternary-bonsai-2-27b and glm-5.3-flash (checked 2026-10-31 ~01:20Z). #642 refuses an owner approval unless model is "an active catalog model whose weight hash is artifact_sha256", so a Qwen3.8-27B pair gets 403 on DevNet. It also cannot be routed there at all, owner or public. EigenLabs/Qwen3.8-27B-4bit-mtp needs a DevNet catalog entry (and its production entry needs confirming) before item 2 can be met for it.

@davidtai

Copy link
Copy Markdown
Collaborator Author

Thanks, Jonathan. Status of each point, across #1689 and darkbloom-platform #642:

…and renewed by the service

- POST /v1/cluster/owner-approvals with the four fields of the coordinator's
  shape (provider_version, model, artifact_sha256, schedule), in the order
  of the shared vector; the 200/201 answer must be one owner approval whose
  policy_sha256 this Mac derives.
- The fetch also reads GET /v1/cluster/owner-approvals with the account
  credential and joins its entries to the public list (401/403/404: none;
  any other failure of either half is the answer).
- The cluster service asks at its checks while the setup holds no approval,
  and renews an owner approval within 7 days of not_after (DELETE, then
  POST). A refusal waits for the next service run or update; every outcome
  is one line and stops nothing.
- Pin darkbloom-platform's owner_cluster_approval_vector.json byte for byte;
  MockCoordinator reads the POST body as strictly as the coordinator and
  serves DELETE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidtai

Copy link
Copy Markdown
Collaborator Author

Reply to the review, by item. Head 35506a67f5.

First review

  1. Path. Fixed. POST /v1/cluster/owner-approvals (ClusterApprovalRequest.path).
  2. Body. Fixed. The body has exactly feat(monitoring): alert on production backup failure and backup absence #642's four fields in the vector's order: provider_version, model, artifact_sha256 (the saved setup's capability.artifactSHA256) and schedule.
  3. Finding the new approval. Fixed. With the account credential, the fetch also reads GET /v1/cluster/owner-approvals, verifies each policy_sha256 against the canonical bytes this Mac derives, and adds those entries to the public list. The existing match and save then run on that list. The POST reply is verified the same way. 401, 403 and 404 on the owner list mean "none", so production and staging see the public answer unchanged.
  4. Tests. Fixed.
  5. Draft. The PR body no longer says draft.

Follow-up list

  • 5. Hands-off over time. Done in this PR. At each check, the cluster service asks (POST, idempotent) while the setup holds no approval. That covers service start, an update or re-adopt (the re-adopted setups hold none), and a withdrawn approval. It renews an owner approval within 7 days of not_after: DELETE, then POST. A delete failure stops the renewal; a 404 delete goes on. Every outcome is one line and none stops serving. After a refusal (403/404, 400, 409) the service waits for its next run or an update; after a failure (no answer, 5xx) it asks again at the next check.
  • 6. Capacity. Coordinator side. feat(monitoring): alert on production backup failure and backup absence #642 now gives owner approvals their own budget (409 at 64 owner approvals). The provider shows the 409 as Cluster approval request: refused by the coordinator (HTTP 409). and keeps serving.
  • 1, 2, 3, 4 and 8 (mainnet build-pinned automatic approvals, public qualification and the request envelope for GLM-5.3-Flash and Qwen3.8-27B, the GLM tensor-parallel grant, and the Qwen3.8-27B DevNet catalog entry): not in this PR. They are coordinator, release or catalog work, and owner approvals are owner-only model approvals by design. They are handled separately, as the review notes.
  • 7. End to end on the real pair. This needs this PR merged and released to DevNet together with feat(monitoring): alert on production backup failure and backup absence #642 deployed. The session-forming error on pair-eeff75264860 under devnet/glm-5.3-flash/s1 comes before this change and has to be read from the coordinator's logs.

…the request

ClusterApprovalRequest.exchange repeated the fetch's session setup (ephemeral,
no redirect, timeout, no stores) and read the answer with session.data, with no
size bound. Both now go through ClusterApprovalFetch.send, which reads at most
maximumBytes and only for a status the caller reads. The request's own
timeoutSeconds is gone (the fetch's, the same 10 s, applies). MockCoordinator's
public approvals route uses the same answer helper as the owner routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ered

A registered answer kept the request open (retries), so a pair whose setup
still held no approval after the check asked the coordinator every minute
for the rest of the run, with one log line each time: a pair serving
locally with an approval set aside for failing parts (that approval is not
taken again by the same build), or a setup whose save is refused. When the
other Mac refused the save, every minute also stopped and restarted both
parts. Any answer but a failure now settles the need it answered (request,
or renew that id); a renewal is a new need, an update clears it as before.
The settled need is read once per check, so the decision taken again under
the command lock still reads the list the first one asked for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit settled a registered need as soon as the coordinator
answered. A check that then found the command lock busy saved nothing, and
the pair (not offered, so not asked every minute) kept no approval until
the next service run. The need is now settled when the check ends, except
after a busy lock, so the next check asks and saves again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch had an error being deployed

2 failed and 3 active deployments
Preview – eigen-homepages-darkbloom — a94f303c Deployed Oct 31, 2026 by vercel[bot]
Preview – d-inference-landing — a94f303c Deployed Oct 31, 2026 by vercel[bot]
Preview – darkbloom-status — a94f303c Deployed Oct 31, 2026 by vercel[bot]
Preview – d-inference — a94f303c Deployed Oct 31, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — a94f303c Deployed Oct 31, 2026 by vercel[bot]
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.

2 participants