Skip to content

fix(cluster): DevNet round 2: what both pairs' validations found, the agent setup guide, plain-words changelog - #1783

Merged
jonathan308 merged 37 commits into
devfrom
integrate/devnet-round-2
Nov 4, 2026
Merged

jonathan308 merged 37 commits into
devfrom
integrate/devnet-round-2

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

DevNet round 2 in one PR: six branches merged in order, their conflicts resolved, and one integration commit. It fixes
what two DevNet validations of dev 6497e8e7a8 found (the production M5 Ultra pair: A-n; pair-2, an M3 Ultra and an
M5 Max: P2-n), updates the agent setup guide after its first real run, and puts the 0.10.8 changelog in plain words.
Each branch's own PR body follows as a comment.

The M5 Ultra pair (DevNet 6497e8e7a8)

  • A-1: the DevNet app names darkbloom-dev, and the app "Darkbloom Dev", in every command and hint it shows for a
    pair: the setup screens and their live operations, start/restart's card, cluster stop --service, cluster local, pair --forget, and the link follower's Local Network hint.
  • A-2 (with P2-1): when macOS keeps a Mac's link follower off the local network, the follower's own refusal is the
    truth, not the service's broadcast probe; every screen says so and what to do on that Mac.
  • A-3: the ✗ gives the other Mac's own reason when it can't dial.
  • A-4 (and P2-10, its mirror case): the ✗ after a part keeps ending names the Mac whose worker ended, from this
    Mac's own incident records, of this install only; otherwise it says it can't tell and blames neither Mac.
  • A-5: the DevNet app's pair API stays on port 8000; the docs say both apps use it, so one serves a pair at a time.
  • A-9: the mode chosen for a model is the one that loads, GLM-5.3-Flash included.
  • A-10: a planned switch's clean stops aren't shown as crashes (also P2-12's B18).
  • A-11: restart, stop, cluster stop --service and a script start say what they wait for and their bound
    instead of going quiet. The split setup after a leader-only restart underneath it is reported, not changed.
  • A-12: the leading Mac's service log notes a following window's status once a minute, not every second.
  • A-13: each install keeps its own incident log (incidents.dev.json) and corrupt copy, and reads only its own
    records.

Pair-2

  • P2-1: see A-2. The joining Mac's window, the leading Mac's ✗ and darkbloom start say plainly what to do on the
    refused Mac, and the leading Mac's wait ends at once once its own part has run 20 s.
  • P2-2: the remaining DevNet outputs name darkbloom-dev: no-terminal cluster, the status lines, Ctrl-C, the pair
    update hints, and the setup's Local Network hint, which also names the app.
  • P2-3: darkbloom start ends at once on a Local Network refusal, with what to do and exit 1, and says when it
    replaces a session service with the login agent.
  • P2-4: Retry starts a stopped pair again, and q leaves a start's wait.
  • P2-5: darkbloom-dev doctor no longer fails right after install on a paired Mac; a saved setup others can open
    fails with the fix (chmod 600 …).
  • P2-6: assessed in the cancel branch: expected trade-offs, not bugs; no change.
  • P2-7: the joining Mac's window shows how the leading Mac's start is going.
  • P2-8: on the Mac that follows, a person's cluster status and status wait at most 10 s for the leading Mac; a
    running part's status reads its log only when it is a link follower, and only once the log grew.
  • P2-9: a client that disconnects during a long prompt frees its lane at once instead of stalling the pair.
  • P2-11: the ✓ card says "Starts by itself at login on both Macs." only when both Macs' cluster services do;
    otherwise it names the Mac that doesn't, or says the other Mac doesn't say. The status the Macs exchange now carries
    startsAtLogin.
  • P2-13: the leading Mac's cluster status --json fills other_mac.answers.
  • P2-16: uninstalling one install of a serving pair beside the other install stops the pair first, on both Macs, and
    says so before it waits.

Docs

  • G-1 to G-12: the agent setup guide's fixes from its first real run, then for the fixed build.
  • Changelog wording: plain words for the 0.10.8 cluster fragments.

Not in this PR: A-6 (a stale roster after a re-pair), A-7 and P2-15 (a long prompt holds other first tokens under
mixed load; by design for 0.10.8), A-8 (explained: the listed split is planned while a serving model holds memory),
P2-12's B15 and B19, P2-14 (the DevNet app reads the production app's pairing as its own), and the shelved
request-limits branch (the catalog's Qwen max_output_length 65,536 against the pair's 32,768; the owner's call).

Linked issue

None filed: the findings of two DevNet validations of dev 6497e8e7a8 (on the production M5 Ultra pair, A-n; on
pair-2, an M3 Ultra and an M5 Max, P2-n), and of the agent setup guide's first real run (G-1 to G-12).

Test plan

On the integrated head 5732dda926, prod identity unless noted, then re-run by an independent validator with the same
results. Its two commits on top (ef3461aaba, Notes item 8) touch only a check runner, its stand-in and a changelog
line. 1b7723ed76 (Notes item 9) changes one on-screen string, re-checked with
ClusterServiceStopReasonTests|ClusterOnboardingPeerLabelTests (32 passed). The final head 41a73a8da8 (item 10)
changes three doc comments for Release Integrity. Every check binary ran under sandbox-exec with a profile that denies ~/.darkbloom*
(no-darkbloom.sb); every swift test was filtered and --skip-build:
sandbox-exec … env DARKBLOOM_RELEASE_ENVIRONMENT=prod nice -n 19 swift test --disable-sandbox --skip-build --filter '…'.

  • DARKBLOOM_RELEASE_ENVIRONMENT=prod swift build --build-tests --jobs 6: OK; no new warning in the touched files.
  • ProviderCoreTests, the 8-suite onboarding filter
    (ClusterOnboardingPeerLabelTests|ClusterPlacementTensorWidthTests|ClusterPlacementTensorWidthRegisteredTests|DistributedAutomaticBatchPlannerTests|MiMoImageOnboardingSelectionTests|ChildExitWaitConventionTests|ClusterServiceLogScanTests|ClusterServiceStopReasonTests):
    77 tests in 8 suites passed (the Local Network branch's 75, plus the integration's two). It includes
    ClusterServiceStopReasonTests and F1's real-records test.
  • fix(cluster): on a paired Mac, darkbloom start/stop/restart/status control the pair; plain cluster status --json (stacked on #1764) #1774's 8 suites: 67 passed.
  • The CLI pair suites (fix(cluster): on a paired Mac, darkbloom start/stop/restart/status control the pair; plain cluster status --json (stacked on #1764) #1774's seven pair suites, without its look-run suite, plus ClusterConsoleCommandTests,
    ClusterDevNetFindingsTests and StatusCommandRunTests): 72 tests in 10 suites passed (71, plus the follower
    test).
  • The CLI branch's new suites (ClusterPairTwoFindingsTests, ClusterBoundedWaitScopeTests,
    ClusterServiceStartsAtLoginTests (P2-11's status field), ClusterInstalledReferenceTests): 10 tests in 4 suites passed.
  • Neighbouring command suites: 114 tests in 17 suites passed. feat(provider): the Darkbloom mark and live line on the everyday commands, in a terminal only (stacked on #1774) #1777's look: 22 in 2. The CLI side's
    ProviderCore set: 52 in 8. P2-16's prod set: 96 (92 in 5 + 4 in 1).
  • Dev identity (a swift build --build-tests without DARKBLOOM_RELEASE_ENVIRONMENT): P2-16's dev set 33
    passed
    (29 in 1 + 4 in 1, as in the uninstall branch's own dev run); the DevNet-name tests 6 passed:
    theNamesAreThisBuildsWithoutBeingSet (with nothing set, the names are darkbloom-dev and "Darkbloom Dev"),
    followerWritesTheWordsTheServiceReads ("Allow Darkbloom Dev under"), onboardingTextsNameTheIdentity,
    clusterTextsNameTheIdentity, startCardNamesTheIdentity and remainingTextsNameTheIdentity.
  • Red first for the integration's new behaviour: the P2-11 card check failed 6 times against the merged screens
    with only its knob added; the DevNet exit test for the setup's names failed with 3 issues, and the follower test with
    1 ("Allow darkbloom under"). All green after.
  • ClusterOnboardingChecks: 1204 passed, 0 failed (1180 + the P2-11 check's 24). Control 229/0, placement flow-run 33 and setup 264 (with
    the runner fix, Notes item 7), provisioning 161/0, diagnostics pass, GLM image admission PASS (40 CPU
    checks)
    , library placement pass. ClusterConfigurationChecks pass (9 file groups, the provider config
    file, 14 configuration groups), with the stand-in from Notes item 8; it didn't compile on the CLI branch's change.
  • libs/darkbloom-cluster ObservabilityChecks, inside the sandbox through a temporary xcrun shim that adds
    swiftc -disable-sandbox: 213 passed, 0 failed (212 + the CLI branch's A23).
  • libs/darkbloom-cluster, the cancel branch's steps: RemoteChecks (the whole DarkbloomClusterRemoteTests target) 87 XCTest + 3 Swift Testing, 0 failures; LinkWorkerChecks 16 of 16 groups; ProcessChecks, focused (owner, readiness, retirement, endpoint, partial admission, clean stop, provider pipe, deadline pipe, clean-stop pipe) pass; QualificationChecks (SDKROOT=macosx) 79 of 80: the 80th, PairDriverTests.testRefusesWhileAWorkerFromThisPathIsStillRunningAndCountsIt, counts worker processes by path, which the sandbox hides, and fails the same way on dev (the cancel branch's run)
  • ClusterInstalledSessionChecks: compiled, not run: all 6 executables (Swift 6, warnings as errors). ClusterConsoleChecks isn't run: it doesn't compile here or at
    6497e8e7a8 (its file list lacks ClusterApprovalFallback; a follow-up).
  • swift build --jobs 6 --product darkbloom (prod): OK.
  • make docs-check 207 files OK · make docs-impact-check BASE=6497e8e7a8 74 changed files at ef3461aaba (73 at 5732dda926), coverage OK · make changelog-check
    55 valid fragments · make changelog-preview exit 0 · git diff --check clean.
  • Not run: live Macs; the forbidden suites; an unfiltered swift test. The pair-2 re-test after the DevNet build:
    • P2-9's exact repro (repro2.py 61000 15);
    • the P2-1, P2-3, P2-4 and P2-7 screens, and a member just allowed;
    • B13/P2-2's strings, and P2-5's doctor;
    • both kill shapes for A-4/P2-10 (the member's worker killed 3 times, then the leader's: each ✗ names the right Mac);
    • P2-16 (the member's uninstall stops the leader cleanly), P2-11's card on both Macs, and the guide's steps;
    • A-9's GLM pipeline on the M5 Ultra pair.

Components touched

  • provider-swift (Swift CLI): the cluster setup screens, follow and live operations; the cluster service and its
    Local Network check; the pair commands, status, doctor, uninstall and link follower; the incident log's per-install
    file. Also libs/darkbloom-cluster: DarkbloomClusterRemote's incident log and its snapshot, and the worker owner's
    shared exit marker (F1); DarkbloomClusterProcess's lane cancel (P2-9); their checks.
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

All local, or between the two Macs over their cable. No coordinator protocol, HTTP endpoint, config key or CLI flag
changes; the registration and the release's cluster runtime facts are unchanged.

  • The incident record's optional install field (A-13): written by this build, left out when absent and read as
    production's. schema_version stays 1, and an unknown field is ignored (F3).
  • Separate incident files: production keeps ~/.darkbloom/cluster/incidents.json; another install keeps its own,
    incidents.<install>.json (incidents.dev.json), and its own corrupt copy. Every reader and writer opens this
    build's through ClusterIncidentLog.forThisInstall, A-4's ✗ included (integration edit 4). DevNet records already in
    incidents.json count as production's until they age out or are dismissed.
  • ClusterServiceStatus.startsAtLogin: Bool? (JSON startsAtLogin, between the two Macs; darkbloom status --json shows service.starts_at_login): each Mac's cluster service sets it in every status it answers. An older
    build ignores it; nil from an older build means unknown, which the card says as "the other Mac doesn't say".
  • The running part's lastError (ClusterServiceStatus.Child.lastError, existing): a running link follower's
    Local Network refusal, where it was nil while the part ran; an ended part's reason reads the follower's last dial. A
    reader on an older build shows it as that Mac's error line.
  • cluster status --json: no new keys; other_mac.answers is filled on the leading Mac.

Documentation impact

  • Canonical documentation updated

  • No documentation needed — reason:

  • docs/provider/two-mac-cluster.md: the chosen mode; the ✗ for each Mac's worker; Local Network on each screen;
    darkbloom start, Retry and q; the joining Mac's view; the card's login line per Mac.

  • docs/provider/cli-reference.md: darkbloom start on a paired Mac; the waits; darkbloom uninstall's step 2.

  • docs/provider/troubleshooting.md: the uninstall's pair stop.

  • docs/provider/agent-setup.md: the guide's G-1 to G-12 and the fixed build.

  • docs/architecture/inference.md: the person's family, Local Network truth, one CLI name and one app name, the
    incident files per install, startsAtLogin, and the pair's shutdown cancelling a lane still in its prompt.

  • docs/developer/test.md: the new cancel check.

Changelog

  • Added or updated this PR's unique changelog.d/<topic>.md fragment and ran make changelog-check.

  • No user-visible change, or an explicitly authorized release/history change.

  • New: cluster-cancel-mid-prefill.md (P2-9).

  • Appended: cluster-everyday-commands-on-a-pair.md (the CLI side, both rounds), cluster-candidate-findings.md (the
    onboarding and Local Network bullets, and the card's login line), provider-uninstall-keep-or-remove.md (P2-16),
    provider-agent-setup-guide.md (the guide).

  • Reworded: cluster-candidate-findings.md, cluster-console-clarity.md,
    cluster-start-says-serving-only-when-loaded.md and provider-uninstall-keep-or-remove.md (plain words).

  • make changelog-check: 55 valid fragments. The 0.10.8 section of make changelog-preview was read as a user: one overlap fixed. In "Two-Mac cluster: Serve locally only starts the faster local plan, and a closing link names the other Mac", the earlier bullet says the ✗ names the other Mac's side instead of blaming this Mac, and the A-4 bullet now says the ✗ names the Mac whose worker actually stopped, "this Mac's included", so the two don't read as contradicting. The everyday-commands entry keeps one incidents bullet and one DevNet-names bullet per CLI round; each is true. The independent validation found one more: cluster-console-clarity.md said every start's card ends with "Starts by itself at login on both Macs.", which P2-11's bullet now limits to both Macs starting at login; that bullet now says the card says whether it starts by itself at login on each Mac.

Notes for reviewers

Merge order (each a signed merge commit, "Merge () into the DevNet round 2 integration"):

# Branch Head Merge Conflicts
1 fix/cluster-local-network-truth (contains the onboarding stack 3a0cc09c49) 8552ba7109 f80a0a4e97 none
2 fix/cluster-cli-devnet-findings e1a8541320 8075ea1f41 3
3 fix/cluster-cancel-mid-prefill 5786f46ad8 4240ecc7b4 none
4 fix/uninstall-member-tells-leader de739bd8dc a4404ad933 none
5 docs/changelog-0108-wording 1dc9271662 96dbac97c8 none
6 docs/agent-setup-first-run f35866d88a 7ef22a01a0 none

Then the integration commit 5732dda926, the independent validation's two commits (item 8 below) and one wording
commit (item 9) and one comment-only commit (item 10). The request-limits branch is shelved.

The three conflicts (merge 2), each keeping both sides:

  1. ClusterService.swift, the unpair line when the other Mac isn't reached: the CLI branch's reason (a
    ClusterSetupFailure's own text) with the Local Network branch's \(OnboardingLive.cli), so the line has one naming
    mechanism, without the CLI branch's ClusterOnboardingCommand.named wrapper. Production bytes are unchanged.
  2. ClusterLinkFollowerCommand.swift, the follower's refusal: line 1 from the Local Network branch (the phrase from the
    shared constant ClusterService.localNetworkRefusal, which A-3 reads), line 2 from the CLI branch (the app's name;
    edit 2 then gives it one source).
  3. ClusterPairCommands.swift, waitUntilServing: the Local Network branch's early return when this Mac's service
    reports blocked, then the CLI branch's status tracking (its heartbeat lines and bound). The Local Network branch's
    other two spots in serve (the session-service line; the blocked instruction and exit 1) merged on their own. The
    guide quotes lines from both sides.

Two fragments auto-merged across branches and were read after: provider-uninstall-keep-or-remove.md keeps the
wording branch's sentence and the uninstall branch's bullet; cluster-candidate-findings.md keeps the plain words and
the Local Network branch's bullets.

The integration commit:

  1. One CLI name: ClusterOnboardingCommand.name starts from BuildEnvironment.current.cliName in the package
    (#if SWIFT_PACKAGE; the checks that compile the screens alone keep "darkbloom" and set theirs with use), and
    OnboardingLive.cli reads it. The startup and wizard use(…) calls set the same value again and go. Production bytes
    are unchanged.
  2. One app name: ClusterService.appName (BuildEnvironment.current.appDisplayName) everywhere; the screens' seam
    starts from it. Cluster.LinkFollower.localNetworkApp(cli:) goes, and production's follower hint now says "Allow
    Darkbloom under …", as the ✗ does (decided).
  3. The follower writes the words the service reads from ClusterService's constants: its prefix, "connected",
    "session opened" and "link refused: " (the third phrase followerRefusal reads). Bytes unchanged.
  4. A-4 reads this install's incidents: ownWorker passes ClusterIncidentLog.forThisInstall() instead of
    production's file. F1's real-records test passes, its records and expectations unchanged.
  5. P2-11, the card's login line (ClusterOnboardingFlow.loginLine): "on both Macs" only when this Mac's service
    outlives its window and the other Mac's startsAtLogin is true; otherwise it names the Mac that doesn't, or says
    the other Mac doesn't say. The new operation otherMacStartsAtLogin asks the other Mac's status over the cable.
    The guide's card line holds as written (an example; verify checks each Mac).
  6. P2-2 in the setup: the member's Local Network hint names the app; its command and the stop line already followed
    OnboardingLive.cli.
  7. Found in validation: placement flow-run and setup didn't compile on the CLI branch's changes (its own
    validation didn't run them). run-flow.sh now compiles ClusterIncidentLog+Install.swift and BuildEnvironment,
    as the CLI branch did for the diagnostics runner; the setup runner gets a stand-in for ClusterOnboardingCommand
    (OnboardingCommandStandIn.swift).
  8. Found in independent validation (two signed commits on top):
    • 252dbdd7bd: ClusterConfigurationChecks didn't compile either, for the same reason as the setup runner
      (ClusterConfiguration.swift names the command with ClusterOnboardingCommand.named). It now compiles the same
      stand-in. Red: it fails to compile on 5732dda926 and passes on 6497e8e7a8; green: it passes, and setup still
      passes 264. Not run in CI.
    • ef3461aaba: the changelog line above (cluster-console-clarity.md).
  9. Plain words (1b7723ed76): the ✗ line for a worker that ended on this Mac said "its worker ended (worker_crashed
    in its incident log)". It now says "its worker ended unexpectedly"; cluster status still lists the incident with
    its code.
  10. Release Integrity (41a73a8da8): scripts/test-provider-identity.py allows the DevNet and staging names only in
    the generated identity, and three doc comments added in this round quoted them. They now say the value comes from
    the build identity. Comment-only; the build and docs-impact-check pass, and the whole Release Integrity list passes
    locally except .github/scripts/test-threat-diagnostics.py, which fails only under the local Python 3.14.

Where to look: ClusterOnboardingLive.swift (useMode, ownPart, ownWorker, readinessOnce, waitReady,
otherMacStartsAtLogin); ClusterService.swift (followerRefusal, runningPartRefusal, the follower's words,
appName); ClusterOnboardingFlow.swift (ClusterOnboardingCommand, loginLine, Retry and q);
ClusterPairCommands.swift (serve, waitUntilServing); ClusterIncidentLog+Install.swift;
ClusterWorkerPair.swift and ClusterWorkerRequest.swift (the lane cancel); ProviderUninstall.swift (stopBothMacs).

Limits and follow-ups:

  • The joining Mac shows the leader's status and the Retry hint, not its ✗ block. Whether macOS prompts on a headless
    login agent is unverified.
  • A pair without lanes still runs an abandoned prompt to its end.
  • An older build that writes the incident log rewrites it without install; an older production build lists DevNet's
    incidents until it runs this code.
  • ClusterConsoleChecks doesn't compile (since 10-31). A-6, A-7/P2-15, P2-12's B15/B19 and P2-14 are open.
  • The integration commit was reviewed by the independent validation, not by a separate refactor subagent (see
    Refactor Pass).

Before And After

Behaviour

Before

flowchart TD
  LN["the member's follower is kept off the local network by macOS"] --> X1["leader ✗: the other Mac did not answer · its part is running, no error · start waits 10 min"]
  K["the leading Mac's own worker is killed"] --> X2["✗ blames the other Mac's worker"]
  G["GLM: Pipeline chosen"] --> X3["tensor parallel loads"]
  C["a client disconnects during a long prompt"] --> X4["the pair stalls until the prompt ends"]
  U["uninstall the serving member's DevNet app"] --> X5["the leader loops: part ended … starting it again"]
  D["the DevNet app on a Mac with both apps"] --> X6["names darkbloom · shares production's incident log · doctor fails"]
  Card["the ✓ card"] --> X7["Starts by itself at login on both Macs, from this Mac alone"]
Loading

After

flowchart TD
  LN["the member's follower is kept off the local network by macOS"] --> Y1["every screen: macOS keeps Darkbloom Dev off the local network there · turn it on · Retry; start exits 1 at once"]
  K["the leading Mac's own worker is killed"] --> Y2["✗ names this Mac's worker, from this install's incident records"]
  G["GLM: Pipeline chosen"] --> Y3["pipeline loads"]
  C["a client disconnects during a long prompt"] --> Y4["its lane retires at once; the next request is served"]
  U["uninstall the serving member's DevNet app"] --> Y5["the pair stops first, on both Macs"]
  D["the DevNet app on a Mac with both apps"] --> Y6["names darkbloom-dev and Darkbloom Dev · incidents.dev.json · doctor passes"]
  Card["the ✓ card"] --> Y7["on both Macs only when both start at login; otherwise it names the Mac"]
Loading

Code flow

Before

flowchart LR
  probe["ClusterLocalNetworkAccess probe: one broadcast"] --> st["serviceState"]
  inc["ClusterIncidentLog.defaultFile: one shared file"] --> kt["keepsEndingTitle: closed means the other Mac"]
  nm["literal darkbloom · use at startup · localNetworkApp(cli:)"] --> txt["texts"]
  card["pairCard: serviceOutlivesWindow"] --> line["login line"]
  pf["ClusterWorkerPair: a leaving consumer during prefill"] --> cs["clean stop: waits for the prompt"]
  un["ProviderUninstall: SIGTERM this install's service"] --> loop["the leader restarts its member"]
Loading

After

flowchart LR
  fw["link follower writes ClusterService's words"] --> fr["followerRefusal"] --> le["status lastError"] --> scr["setup screens · follow · readinessOnce · darkbloom start"]
  fti["ClusterIncidentLog.forThisInstall"] --> ow["ownWorker(inIncidentLog:since:rank:otherRanks:)"] --> kt["keepsEndingTitle / errorLines"]
  be["BuildEnvironment.current"] --> nm["ClusterOnboardingCommand.name · ClusterService.appName"] --> txt["OnboardingLive.cli · ClusterPairSummary.cli · follower hint"]
  sal["the other Mac's ClusterServiceStatus.startsAtLogin"] --> card["pairCard: loginLine(thisMac:otherMac:)"]
  pf["ClusterWorkerPair: a lane still in its prompt"] --> lc["lease cancel: the lane retires alone"]
  un["ProviderUninstall: stopBothMacs"] --> own["then this install's service"]
Loading

Refactor Pass

Each branch had its own dedicated refactor pass; its full PR body, with its refactor sections, is posted as a comment.

  • fix/cluster-local-network-truth (with the onboarding stack): the onboarding refactor 7e7ddc6952 and F1's fix
    3a0cc09c49 (A-4 counts only this Mac's own worker exits, from the real records), then the Local Network addenda
    f4eae6bb3b (the ✗ worded for the screen that shows it, one refusal rule for ended and running parts, one app name)
    and 8552ba7109 (only a link follower's log is scanned, cached by its size; a refusal blocks only while the follower
    runs and after the leader's part ran 20 s). See comment 1.
  • fix/cluster-cli-devnet-findings: two refactor passes (9cc3b4ab2c: names and the incident contract pinned;
    539ee67e1a: an allocation-free Ctrl-C handler, one stderr writer, an accurate doc), then three review issues closed
    (1727df88de red, e1a8541320). See comment 2.
  • fix/cluster-cancel-mid-prefill: 5786f46ad8 adds the missing guard (a lane that produced a token keeps the clean
    stop) and makes the comments and docs accurate for lane pairs; behaviour unchanged. See comment 3.
  • fix/uninstall-member-tells-leader: e0c90d3574 renames the seam (stopBothMacs, PairStopOutcome) and
    de739bd8dc says what the pair's stop waits for, red first. See comment 4.
  • docs/changelog-0108-wording: a wording-only change; each sentence checked against the code and docs; no separate
    pass. See comment 5.
  • docs/agent-setup-first-run: f35866d88a keeps the card's login line true either way and quotes the DevNet app's
    path; 30 quoted screen lines checked against the fix heads. See comment 6.
  • The integration commit 5732dda926 had no separate refactor subagent: this integration was done without
    delegating. Checked instead: production bytes are unchanged except the decided follower hint and P2-11's card line;
    the screens' standalone compile keeps production's names; each new behaviour was red first; and the validation above
    ran on the commit. A fresh agent then validated the integrated branch independently and reviewed this commit as a
    refactor pass would: nothing that blocks the PR (two style nits left for later); it added the two commits in Notes
    item 8.

jonathan308 and others added 30 commits November 4, 2026 00:54
- cluster-candidate-findings (#1781): a title for users, "measured on one
  pair", the speculative assistant by its documented name, and the ✗
  title's old "starting; " head said plainly. The last bullet is
  unchanged.
- cluster-start-says-serving-only-when-loaded (#1764): the joining Mac's
  setup ends with the same ✓ or ✗ as the leading Mac (as #1778 says),
  not "pointing to the leader's screen".
- cluster-console-clarity (#1778): Qwen 3.8 27B's tensor-parallel-only
  rule said once, with why; what a person sees instead of "scope switch",
  "a choice forwarded from the other Mac uses the planner's mode" and the
  older-build leader; the joining Mac's ending in one bullet; the
  registration line's old wording named.
- provider-uninstall-keep-or-remove (#1772): on a pair, uninstall stops
  both Macs, as darkbloom stop does there.

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

From the DevNet validation of 6497e8e on the M5 Ultra pair:
- A-1: the DevNet app's start card, `cluster stop --service`, its
  refusal, `cluster local` and the follower's Local Network hint name
  `darkbloom` instead of the identity's CLI (and app).
- A-11: restart (and a script start) wait minutes with no output; each
  wait must say what it waits for and its bound.
- A-13: both installs share ~/.darkbloom/cluster/incidents.json; each
  install's feed should hold its own (older records: production).
- A-12: a following window's `status` requests log once a second.
Adds the API these need with today's behavior: LinkFollower's
localNetworkApp(cli:), a progress-delay seam and Wait.heartbeat,
ClusterIncidentLog's install, ClusterService.logsControl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The DevNet build of dev 6497e8e (0.10.6-dev.branch.76) on the
production M5 Ultra pair, overnight/candidate-0108-proof.md "DevNet
validation of 6497e8e", table A-1…A-13:

- A-9: choosing Pipeline for GLM-5.3-Flash loaded tensor parallel again.
  useMode compared the choice with the listing's first mode, not with the
  plan the adopt uses; GLM's listing put Pipeline first while its plan was
  tensor parallel, so nothing was kept. useMode now always keeps the
  person's family (keptFamily), and localAdopt plans again in it only when
  the listed plan's mode isn't in it (replansInFamily). A-8's moving split
  isn't the same cause: the listing is planned while the serving model's
  parts hold memory, and the adopt plans again once they gave it back.
- A-4: when this Mac's own worker died, its part also ended "closed" and
  the ✗ blamed the other Mac. ownWorker reads this Mac's incident log:
  worker_crashed from the part it leads since the wait began names this
  Mac's worker; none keeps B17's wording; an unreadable log (or a Mac
  that doesn't lead) blames neither. The title and the lines read one
  snapshot.
- A-3: a member kept off the local network logged why and ended cleanly,
  so the leader's ✗ said "Make sure it is on". ClusterService.lastError
  carries that refusal as the part's reason, which the member already
  publishes in its status.
- A-1 (onboarding part): commands in the live operations and the cluster
  service name BuildEnvironment.current.cliName (17 + 2 code lines).
- A-10 (B18): a planned switch's clean stops showed as parts that ended.
  endShown: a stop (stopped, or exit 0 with no reason) isn't an end on
  either Mac; an exit 0 that says why still is.

Red: behaviour-preserving seams first, then the tests: 22 tests with 5
issues (A-4 3, A-9 1, A-3 1); A-10 10 tests with 3 issues. Green:
ProviderCoreTests 8-suite filter 68 tests and #1774's 8 suites 67 tests
(prod build); onboarding 1165/0 (the real runner, sandboxed); control
229/0, placement flow-run 33, setup 264, provisioning 161/0,
diagnostics, the placement library's checks and GLM image admission (40)
pass; product build OK; docs gates OK.

Reported, not changed: A-11's follower keeps its old setup after a
leader-only restart until the next adopt. Not reached: A-6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the DevNet validation of 6497e8e on the M5 Ultra pair:
- A-1: one runtime CLI name. main.swift names it at startup
  (ClusterOnboardingCommand.use(BuildEnvironment.current.cliName));
  ClusterPairSummary.cli reads it, and the pair texts interpolate it: the
  start/restart card, cluster stop (--service, its refusal and help),
  cluster local, and the status/doctor/desktop/start hints. ProviderCore's
  texts are named with it: the leadership refusal, pair --forget's line
  (which no longer prints a raw ClusterSetupFailure), the approval
  refusal, "not paired" and the tensor assistant's "press m". The
  follower's Local Network hint names the app to allow ("Darkbloom Dev").
  Production output is byte-identical.
- A-11: stop, restart and cluster stop --service say what they wait for
  when the stop request runs past 3 s (up to about 6 min) and while the
  parts end (with their bound); a script start says it waits until the
  pair serves (with its bound) and repeats an unchanged status once a
  minute.
- A-13: each incident records its install; each install's feed (status,
  diagnostics, cluster incidents) holds its own records and the older
  unstamped ones (production's). The store is libs/darkbloom-cluster's
  DarkbloomClusterRemote.
- A-12: the leader logs a following window's status requests once a
  minute, and every other command each time.
- A-5: the port stays 8000; two-mac-cluster.md says both apps use it.
Docs: cli-reference (waits), two-mac-cluster (port, DevNet names),
architecture/inference (runtime name, shared incident log); changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; pin the incident install contract

- `Cluster.Stop.stopPair(_:progressAfter:)` is now `stopBothMacs(_:progressAfter:)`. It sat in the same type as
  `pairStop(role:serving:)`, which decides who stops, and the two call sites read
  `switch Self.pairStop(...) { case .leaderStopsBoth: stopped = Self.stopPair(...)`. Private; no behaviour change.
- `ClusterIncidentInstallTests` also expects `ClusterIncidentLog.unstampedInstall` to equal
  `BuildEnvironment.prod.rawValue` (the library's literal for records without an install must be production's case
  name), and `ClusterObservability`'s log to carry `BuildEnvironment.current.rawValue` (the provider's per-install
  wiring had no test). Two assertions added; none removed; the test count is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ame neither Mac on an unreadable incident log

- `lastErrors` and `keepsEndingTitle` have their own doc comments again: `ownWorker` and `OwnWorker` had been
  inserted between each declaration and its doc. The docs of `linkClosedError`, `keepsEndingTitle`, `errorLines`'
  rule and `chosenFamilies` now say what the fix changed.
- `ownPart(since:)` reads this Mac's part once for the ✗ title and the per-Mac lines. `lastErrors` uses the
  caller's read whole; it used to read the status again when that read had no part.
- `ownWorker(inIncidentLog:since:)` reads the feed once. A log that is missing or can't be read (its `loadError`:
  too large, malformed, another schema) now blames neither Mac, as the docs and the PR say, instead of reading as
  "no crash here" and blaming the other Mac. A test covers a missing log, a malformed log, the other Mac's record,
  the time window and a field this build doesn't know.
- `endShown` loses its unused `own` parameter. `replansInFamily` is written as a guard.
- The live operations use `Self.cli`, the file's idiom. The service uses `OnboardingLive.cli` instead of keeping
  a second copy.
- The A-9 test no longer has a tautology over a local constant.
- two-mac-cluster.md: on the Mac that doesn't lead, the ✗ blames neither Mac too.

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

On a lane pair, a started request whose consumer goes away before its first
token is asked for a clean stop, which ends it only at its first token: the
pair first finishes the whole prompt while every newer request waits. The new
check, against scripted ranks, expects such a request to be cancelled (its lane
alone retires at once, nothing fenced, the pair serves the next request), and
a pair without lanes to keep the clean stop. Red on dev: the request keeps its
lane and neither rank is told to end the prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to G-12)

An agent followed docs/provider/agent-setup.md literally on pair-2 (M3 Ultra
leads, M5 Max follows) with the DevNet build of dev at 6497e8e and found
twelve guide bugs (overnight/devnet-validation-pair2.md §2). Every quoted
screen line is re-checked against that run's screens.

- G-1, G-2: a marked DevNet variant ("DevNet (testers only)"): darkbloom-dev,
  ~/.darkbloom-dev, Darkbloom Dev.app, the DevNet installer, Build: dev and
  the dev coordinator, port 8001, and what X.Y.Z-dev.branch.N means (not a
  release number, so "older builds" doesn't apply). Rule 9 now allows the
  DevNet installer when the human asks for DevNet.
- G-3: after installing another app on a paired Mac, Pair again may not
  appear; choose Start over on both Macs (it unpairs the Mac for both apps).
- G-4: doctor's "[FAIL] cluster savedConfiguration …" before the first setup
  is expected (go on); a later build stops reporting it.
- G-5: act on the first "Local link:" line (real output quoted); step 4.3
  reads `darkbloom status --solo`.
- G-6: both Connect lines (local and over SSH), "✓ Paired. This Mac (…)
  leads.", no password when the port is already set up, the 30 s hint.
- G-7: the Local Network step can be missing while macOS blocks the
  service: the human checks System Settings on each Mac (Screen Sharing on a
  Mac with no display); a troubleshooting row for the ✗ and the follower's
  "link refused … may not reach the local network"; a later build names it.
- G-8, G-9: the working lines print only in colour; a real model list and
  loading line.
- G-10: Retry only waits for a stopped part; Ctrl-C, then darkbloom cluster.
- G-11: DevNet's result block still prints darkbloom; type darkbloom-dev.
- G-12: uninstalling one of two installs keeps the shared pairing, cable
  setup and models, asks no password, leaves the other service running.
- The person-only list says plainly what an agent can't do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stops the pair first

Pair-2 (P2-16): uninstalling the member of a serving pair beside the other
install stopped the member's service cleanly but never told the leader,
which logged "this Mac's part ended (exit 1) … starting it again" and
looped. As tests, with stand-ins only (never real launchd, processes or
network):

- The pair is asked to stop first, on both Macs, then this Mac's service
  stops, then the files go. The summary says so, and has no other-Mac line
  while the pair still works through the other install.
- When the other Mac doesn't answer, this Mac's part still stops locally,
  the run does not fail, and the summary ends with the other Mac's name and
  the command to run there.
- The pair is not asked for the other install's service, nor on the
  one-install path, whose `cluster stop --service` asks the leader itself.
- The dry run names the pair's stop.

Red at 6497e8e: a runtime probe with the old API found no pair stop
before the service's; the tests above do not compile (no `PairStop`,
`Operations.stopPair`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the leader, a `worker_crashed` recorded with source "leader" can be about either Mac's worker. In the DevNet run,
the member's four kills were recorded on the leader as "ClusterWorkerOwnerError: closed | rank 1 follower said: …".
A-4 therefore named the leader for the member's worker, which reversed B17.

`ownWorker` now decides from the record's message:
- it names this Mac only when the record is this Mac's rank's own exit record (`worker-exit-v1 rank=<rank>`, with
  any redacted prefix);
- it names the other Mac, in B17's words, only when the record is what that Mac's link follower said
  (`rank <other> follower said:`);
- otherwise it names neither Mac.

Both formats are now shared with the code that writes them: `ClusterWorkerOwnerService.workerExitMarker`
(DarkbloomClusterRemote) and `DistributedInstalledSession.followerSaid(rank:)`. The output is unchanged.

The new test loads Mac A's real records:
- each of the 4 member kills names the other Mac;
- each of the 4 leader kills names this Mac;
- both kinds in one wait name neither;
- a malformed log names neither.
Against the previous rule it fails with 5 issues.

Also:
- F2: `ClusterService.localNetworkRefusal` is now public, and `cluster link-follower` writes that same phrase.
- F4: `offeredReadiness` and the "rank 0 on the other Mac ended" line no longer show clean stops as ends either.
- F5: `readyWaitSeconds` names the 15-minute wait. `lastErrors` reads incidents since this start's wait began.
- F6: `useMode` itself is now tested, through `useListing` and `keptFamily(forModel:)`. That test fails against the
  base's rule.
- Docs:
  - two-mac-cluster.md says which record names which Mac;
  - cli-reference.md describes the follower's local-network line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…I side (red)

From the DevNet validation on pair-2:
- A-13: a non-production install keeps its own incident file
  (incidents.dev.json), which an older build never reads or rewrites;
  ClusterIncidentLog.forThisInstall opens this build's.
- P2-2: no-terminal `cluster`, the cluster service status lines and
  the Ctrl-C line still name `darkbloom` in the DevNet app.
- P2-5: a provider configuration the installer left readable by others
  (no setup saved yet) makes doctor fail "unsafe, empty or oversized";
  with a setup saved it must say the fix.
- P2-11: a Mac's cluster service tells the other Mac whether it starts
  at login (ClusterServiceStatus.startsAtLogin).
- P2-13: the leading Mac's other_mac.answers is null while they serve.
- P2-8: the leading Mac's answer on the Mac that follows is unbounded
  in the CLI and silent while slow.
Adds the API these need with today's behavior: defaultFile(homeDirectory:
install:), forThisInstall, startsAtLogin (field and check),
ClusterOnboardingTerminal.stoppedLine, ClusterPairSummary.boundedStatus.

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

A consumer that goes away (a closed client connection, a coordinator cancel)
asks the pair's lease for a clean stop, which ends a request only at its next
committed token. Before its first token that means finishing the whole
prompt: on DevNet a client that closed its connection 15 s into a 60K-token
prompt on a Qwen 3.8 27B tensor-parallel pair kept both Macs prefilling it
for about 4 minutes. The pair prefills one prompt at a time, oldest first, so
every newer request waited behind it and failed at its own first-token
deadline, while the pair still reported serving.

On a pair whose lanes retire alone, ClusterWorkerRequest.requestCleanStop now
refuses a request that has produced no token yet, so the engine cancels it:
both ranks end only that lane at their next step boundary and the next
request is served at once. A request that has produced a token keeps the
clean stop, and so does a pair without such lanes, where a cancel ends the
pair.

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

P2-16: beside the other install, step 2 stopped this install's running
cluster service with SIGTERM, as `cluster stop --local-only` does, and the
leader kept restarting its part for a member that was gone.

When this install's service runs, step 2 now first asks the pair to stop on
both Macs (`Operations.stopPair`), as `darkbloom stop` on either Mac does:
the leader stops both, a serving member asks the leader over the control
channel. Then the service stops and its agent goes, as before. The pairing,
the cable port setup and the shared cluster files stay. If the other Mac
does not answer, only this Mac's part stops (as before), and the summary
ends with "The other Mac (<name>) did not answer, so its part may keep
restarting: run `<cli> cluster stop` on it." The other install's service
and the one-install path are unchanged.

The CLI reference's step 2, a troubleshooting row and the changelog
fragment say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-1, P2-3, P2-4, P2-7

Pair-2's DevNet run (overnight/devnet-validation-pair2.md) and the M5 Ultra
pair's headless Mac B (A-2):

- P2-1 + A-2: macOS kept a member's link follower off the local network
  ("link refused: connectFailed (unreachable) … this process may not reach
  the local network") while the service's own probe, one broadcast datagram
  from the service process, logged "allowed". The follower keeps running and
  retrying, so its Mac's status said "running, no error" and the first setup
  ended "the other Mac did not answer". The follower's own last dial now
  decides: ClusterService.followerRefusal (the refusal, or a link opened
  since) is a running part's published lastError (no new field);
  ClusterLocalNetworkAccess.state reads it as blocked whatever the probe
  found. The leading Mac's wait ends at once on the member's refusal
  (otherMacRefused) with what to do there (localNetworkRefusalLines); the
  joining Mac's follow says its own refusal once (localNetworkBlockedLines);
  the wizard's step names the build's app (ClusterService.appName via
  ClusterOnboardingCommand.app) and says plainly where to turn it on,
  through Screen Sharing on a Mac with no display.
- P2-3: darkbloom start on the member, with no terminal, replaced its
  session service silently and then waited 10 min 37 s with no reason.
  ClusterPairCommands (three spots: serve's service step, its end, and
  waitUntilServing's loop) says what the service step does, ends the wait
  at once when this Mac's service reports blocked, and says the instruction
  instead of the loading lines, exit 1.
- P2-4: Retry after the pair was stopped only waited for parts nothing would
  start, and q was ignored. Retry on a stopped pair says so and serves;
  the start's wait leaves at q, Esc or Ctrl-C (as a key) with a line.
- P2-7: the joining Mac's window showed nothing while the leader sat at ✗.
  The follow says each new state of the leader's start, and where to choose
  Retry once a part ended there.

Red: ProviderCoreTests theFollowersOwnRefusalIsTheTruth after seams holding
today's behaviour, 4 issues; onboarding's new checks against today's
sources, 1174/6. Green: onboarding 1180/0 (the real runner, sandboxed;
one existing check's expected last line reworded with the new wording);
ProviderCoreTests 8-suite filter 69 tests and #1774's 8 suites 67 tests
(prod build); control 229/0, placement flow-run 33, setup 264,
provisioning 161/0, diagnostics, the placement library's checks and GLM
image admission (40) pass; product build OK; docs gates OK.

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

From the DevNet validation on pair-2:
- A-13: a non-production install keeps its own incident file
  (ClusterIncidentLog.defaultFile(homeDirectory:install:):
  incidents.dev.json), which an older build never reads or rewrites;
  production keeps incidents.json. Every reader and writer opens this
  build's with ClusterIncidentLog.forThisInstall (the helper for the
  onboarding branch's A-4 read); the install stamp stays as a second
  check. The snapshot reads the install's file.
- P2-2: the remaining DevNet names: no-terminal `cluster`, the "Cluster
  service" status lines (named by the CLI's Status.clusterServiceLines),
  the Ctrl-C line (made before the signal handlers are set), the member
  supervisor's restart hint and the pair update hints.
- P2-5: a provider configuration other users can open that saves no
  setup (the installer writes it so for a non-production coordinator)
  is no saved setup, so doctor no longer fails on a fresh DevNet
  install; one that saves a setup fails with `chmod 600 <file>`.
- P2-11: each Mac's cluster service reports startsAtLogin in its status
  (under its login agent's supervisor, agent installed; no launchctl).
- P2-13: on the leading Mac, other_mac.answers is true while both run
  the cluster or confirm its leader.
- P2-8: on the Mac that follows, cluster status and status wait at most
  10 s for the leading Mac's answer, say so after 3 s, then show this
  Mac's own view.
The ClusterConsole/Diagnostics/InstalledSession check runners compile
ClusterObservability.swift by name; they now also compile its
dependencies (ProviderBuildEnvironment, ClusterIncidentLog+Install).
Docs: cli-reference (other_mac.answers, the bound, doctor's saved
setup), architecture/inference (per-install files, startsAtLogin);
changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings this branch (162cf34: P2-1/A-2, P2-3, P2-4, P2-7) up to the final
onboarding head: 68130a8, the refactor pass 7e7ddc6 and F1 3a0cc09.

Conflict, ClusterOnboardingLive.swift, two hunks:
- readinessOnce: this branch's one fetch of the member's status and its
  final refusal (otherMacRefused → otherMacLocalNetworkLine), with the
  head's endShown(member.child), which lost its own: parameter (F4).
- the helpers: this branch's otherMacRefused, localNetworkRefusalLines
  and otherMacLocalNetworkLine, then the head's endShown doc and
  signature (also used by offeredReadiness and the rank 0 line).
Merged on their own: ownPart(since:) read once, the rank-aware
ownWorker(inIncidentLog:since:rank:otherRanks:), readyWaitSeconds and
waitBegan (F5), Self.cli with ClusterService.cli gone, the useMode test
(F6); and this branch's waitReady refusal branch, the follow, Retry and
q, followerRefusal/serviceState, and its three ClusterPairCommands
spots.

In the merge:
- waitReady's refusal branch passes ownPart(since: began) to lastErrors,
  so both ✗ paths read this Mac's part once, scoped to this start.
- One phrase, one constant: followerRefusal matches F2's public
  ClusterService.localNetworkRefusal. It also needs the follower's
  "connected" and "session opened" lines (a refusal stays in the log
  after Local Network is turned on, and the follower doesn't log one per
  retry), now ClusterService.followerLinkOpenedLines, shared the same
  way. ClusterLinkFollowerCommand still spells those words itself; that
  file is the CLI branch's, so it is left for integration.

Validation (prod-identity build; runners sandboxed, ObservabilityChecks
outside the sandbox): onboarding 1180/0; ProviderCoreTests 8-suite
filter 71 tests; #1774's 8 suites 67 tests; control 229/0, placement
flow-run 33, setup 264, provisioning 161/0; diagnostics, GLM image
admission (40), library placement pass; ObservabilityChecks 212/0;
product build OK; docs-check 207, changelog 54,
docs-impact-check BASE=6497e8e7a8 OK, git diff --check clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ay what shutdown cancels

The refactor pass over the cancel-mid-prefill fix. Behaviour is unchanged.

- ClusterWorkerPairAdmissionDeadlineTests: a lane that has produced a token
  keeps the clean stop. Its consumer leaves at its first token and does what
  the engine does (the clean stop, else a cancel) from inside the token
  callback: the lease accepts, and no rank is told to cancel. The check fails
  when producedToken is never set, and when it is set only after the token
  reached the consumer (both tried as mutants: its 3 assertions fail, the
  class's other 6 tests pass).
- ClusterWorkerPair.shutdown and ClusterWorkerPairTiming.cleanStopWaitNanoseconds:
  a cancel ends the ranks except on a pair whose lanes retire alone, where it
  ends only that lane; such a lane still in its prompt takes no clean stop and
  is cancelled without the wait.
- ClusterWorkerRequest.requestCleanStop: the doc states the lane exception
  with the rule it qualifies, and names ClusterWorkerPair.lanesRetireAlone.
- docs/architecture/inference.md: the pair's shutdown cancels such a lane
  without waiting, too. docs/developer/test.md: the new check.
- The changelog entry in plain words, with its limit: a pair that serves one
  request at a time still runs the prompt to its end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stop's pairStop

- `ProviderUninstall.Operations.stopPair` is now `stopBothMacs`, and its result `ProviderUninstall.PairStop` is now
  `PairStopOutcome`. The live closure called `Cluster.Stop.pairStop(role:serving:)`, which returns another
  `PairStop` (who stops), and returned this one (how the stop ended), in the same lines. `stopBothMacs` is also the
  name the cluster CLI branch gives its own pair stop for `cluster stop --service`.
- `otherMacStillServingLine` is now `otherMacNoAnswerLine`: it is shown when the other Mac did not answer (`.noAnswer`,
  `pairNoAnswer`), and that Mac's part keeps restarting rather than serving.
- The live pair stop is `Uninstall.stopBothMacs(_:)`, over the `ClusterPairActions` `darkbloom stop` uses
  (`ClusterPairActions.live(config: nil)`: the same `ClusterOnboardingOperations.live(.clusterService(config: nil,
  worker: nil))` resume and stop), still run detached. A new test pins its mapping with stand-in actions: a serving
  member and a leader ask the pair; an idle member and an unpaired Mac don't; a failure is no answer, with its lines;
  an unreachable cluster is no answer.

No behaviour change; no assertion removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide ships in the same dev round as the fixes for the first real run's
product bugs, so it now describes that build instead of 6497e8e. Every
quoted line is checked against the fix heads' code:
fix/cluster-local-network-truth 9a1d633, fix/cluster-cli-devnet-findings
935dbe4 and fix/uninstall-member-tells-leader 4a3b0f0.

- Port: a pair's local API is on 8000 in both apps (the lowest port up to
  8020 free on both Macs when another program holds 8000; the card says
  which), only one app serves a pair at a time, and 8001 is only the DevNet
  app's single-Mac default (ClusterLocalServing.sharedPort).
- Local Network (P2-1): the leader's ✗ comes at once ("The other Mac can't
  reach this Mac over the cable: macOS keeps Darkbloom there off the local
  network", then where to turn it on); the joining Mac's "This Mac can't
  reach the other Mac over the cable: …"; a scripted start ends at once,
  exit 1. Still the person's action, in System Settings, without waiting for
  a prompt.
- Retry and q (P2-4): Retry starts a stopped pair; q, Esc or Ctrl-C leaves
  with "Left the start: …", exit 1. The joining Mac's lines (P2-7).
- doctor (P2-5): no cluster FAIL before the first setup ("Saved setup:
  notConfigured"); the chmod 600 FAIL for a saved setup others can open.
- DevNet names darkbloom-dev everywhere (P2-2); the waiting lines of stop,
  restart and a scripted start (A-11); the scripted start's session-service
  line (P2-3); the follower's 3 s / 10 s status lines (P2-8); uninstall asks
  the pair to stop first and names a silent other Mac (P2-16).
- Every "a later build …" note and every line about a fixed bug is gone;
  G-3 (Start over after installing the other app) stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Beside the other install, step 2 asks the pair to stop before it stops this install's cluster service. That stop
answers once both Macs have stopped, after their accepted requests (the stop over the cable gives up after 330 s), and
meanwhile the uninstall printed nothing after "→ Remove this install's cluster service": minutes of silence.

`Uninstall.stopBothMacs` now says, before it waits, once and only when it asks the pair (a leader, or a serving
member): "Asking the pair to stop; accepted requests finish first (up to about 6 min)."
(`ProviderUninstall.pairStopWaitLine`), through `ClusterPairCommands.printLine` (flushed), as step 1 says its drain's
deadline before it waits. Nothing else prints differently.

Red first: with the test's new expectations on e0c90d3, the tests target did not compile, 5 x "extra argument 'say'
in call": the pair's stop had no way to say anything. Green: 96/96 (the uninstall's prod set), 66 in 9 (#1774's set).

Docs: `cli-reference.md` step 2 names the line, and no longer also says "the pair is not stopped": beside the other
install, the pair is asked to stop when this install's service serves it, and the other install's pair is not asked.
The changelog line says it is said.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it; a refusal the follower got past no longer counts

- A start run from the joining Mac's own window forwards its wait to the leader. For a refused member, the leader
  answered with its own line ("the other Mac can't reach this Mac …"), so the joining Mac's ✗ told its person to fix
  the leading Mac. `readinessOnce` now words the line for the screen that shows it (`localNetworkLine(forwarded:)`).
  `waitReady` gives the joining Mac its own instruction (`localNetworkBlockedLines`, "then choose Retry here").
- A-3's reason for an ended part read the last refusal even after the follower had connected. So a planned stop
  after Local Network was turned on published a stale refusal:
  - the leader's wait ended at once with a ✗;
  - `endShown` showed the clean stop as an end;
  - the Mac read as blocked.
  The ended part's reason now reads the follower's last dial too (`followerRefusal`), one rule for running and ended
  parts. The A-3 case with no later link is unchanged.
- `ClusterService.appName` is the identity's `appDisplayName` (the bundle's `CFBundleName`), no longer the bundle's
  file name minus ".app". The strings are the same for all three identities.
- Docs: `two-mac-cluster.md` and `architecture/inference.md` say both.

Red first: 3 issues, 1 for the forwarded wording and 2 for the stale refusal. Then green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter, an accurate saved-setup read doc

- `ClusterOnboardingTerminal`'s signal handler wrote the cursor-show sequence from an `Array` it built inside the
  handler, an allocation that can deadlock if the signal lands inside malloc. It writes a `StaticString` now (the
  same 6 bytes, checked), so the handler only reads statics made beforehand, writes and exits.
- `ClusterPairSummary.sayOnStandardError` repeated the CLI's `printError`; it calls it now (same bytes).
- `optionalInstalledReference`'s doc said "diagnostics-only", but the setup screens, approval checks and member
  supervision read it too, so the relaxation for a file others can read reaches them; and "a file only other users
  can open" read as a file its owner can't open. Both corrected.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…line; DevNet app path quoted

The refactor pass on the agent setup guide (head 606bdc5). Behaviour described is unchanged; the guide reads the
same for production and DevNet, with these fixes for a literal reader:

- Step 7.3: the card has "a line about starting at login (such as `Starts by itself at login on both Macs.`)", and
  verify checks it on each Mac, whatever it says. True now (the card reads this Mac only) and once the card reads the
  other Mac's `startsAtLogin`; the guide no longer says what the card computes.
- Verify (two Macs): `service.starts_at_login` false on a Mac is a STOP: the person runs `darkbloom cluster` there
  (the product's own hint), then check again. The sentence moves under the exit-status table, so "Otherwise" again
  refers to "not serving".
- DevNet names: `~/.darkbloom-dev/"Darkbloom Dev.app"`, quoted, so step 1.4's codesign commands work when substituted
  (the first run's agent had to quote it).
- Step 5.4: the joining Mac ends with the same ✓ or ✗ block; `You can close this window.` only after ✓.
- Step 5.3: the Local Network line is an example (over SSH it names this Mac's screen).
- Local Network row: Retry where the ✗ offers it (usually the leader); a start run from the joining Mac shows its ✗
  there.
- System Settings paths use → throughout, as the screens do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a per-install corrupt aside (red)

From the review of the pair-2 round:
- The 10-second wait also ran on the leading Mac, naming "the leading
  Mac" about itself, and bounded a script start's looks, whose
  timed-out forwards could pile up. A person's `cluster status` or
  `status` on the Mac that follows is the only bounded read.
- Both installs moved a corrupt incident log to incidents.corrupt.json;
  DevNet's must be kept as incidents.dev.corrupt.json (ObservabilityChecks
  A23).
Adds, at today's behavior, the seam that sees whether a read asks for the
bounded wait and ClusterPairSummary.statusLines(leads:slow:…).

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

The review of the pair-2 round raised three behaviour issues:
- The 10-second wait ran on the leading Mac too, saying "the leading
  Mac's answer" about itself. ClusterPairSummary.statusLines bounds only
  when this Mac doesn't lead; the leading Mac's status waits as before.
- A script start's or restart's looks were bounded too, so a timed-out
  look left its forward running beside the next one. Only a person's
  read (`live(config:bounded:)` from `cluster status` and `status`) is
  bounded; the scripted wait's looks wait as before, inside their own
  overall bound and lines.
- A corrupt incident log was moved to incidents.corrupt.json by both
  installs. The aside is named after its file: incidents.dev.corrupt.json
  for DevNet; production's name stays (ObservabilityChecks A23).
Docs: architecture/inference names each install's corrupt copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efusal counts only while the follower can still be refused

The status scan, which is part of P2-8 (a member's `status` took up to 29 s):
- A running part's `lastError` now reads the log only for a link follower (`runningPartRefusal`). That is the only
  part that writes a refusal: rank 0, a coordinator-paired member and a solo server never do.
- The result is remembered by the log's size since the part started, so a status read with nothing new written reads
  nothing. Before, every read walked up to 8 MiB back under the service's lock, and the joining Mac's window asks
  every second.
- The output is the same.

A member just allowed no longer reads as refused:
- The follower redials 20 ms doubling to 1 s apart, plus up to a quarter of jitter
  (`ClusterLinkControlClient.connectLoop`). But it logs a refusal only when the refusal value changes (`note`), and
  every connect failure is the same `.connectFailed`. So after Local Network is turned on, a dial that now fails
  because the leading Mac's part isn't listening is never logged. The old refusal stays the follower's last line
  until it connects.
- Retry never restarts a running follower. So the leader's Retry, or the joining Mac's own, could end at once on the
  old refusal with the same ✗: while the leading Mac's part was between restarts (up to 30 s apart), and at once after
  Retry started a stopped pair, from the ended follower's reason.

The change:
- Only a running follower's refusal blocks (`otherMacRefused`, `ClusterLocalNetworkAccess.state`).
- The leader's wait ends on it only once its own part, which hosts the listener the follower dials, has run
  `refusalSettleSeconds` (20 s: its start up to the listener, plus a dial and its handshake; `refusalIsCurrent`).
- A later "link refused:" line, a dial that got further and failed another way, supersedes the refusal.
- A still-blocked member still gets the Local Network ✗ without waiting for the start to give up.

Red first: 16 tests, 9 issues; then green.
Docs: two-mac-cluster.md and architecture/inference.md.

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

The onboarding stack (68130a8, refactor 7e7ddc6, F1 3a0cc09) and
pair-2 P2-1/A-2, P2-3, P2-4, P2-7 (162cf34, merge 9a1d633, refactor
addendum f4eae6b, addendum 2 8552ba7). No conflicts.

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

The CLI side of both DevNet rounds: A-1 CLI, A-11, A-13, A-12, A-5, and
pair-2's A-13 per-install incident file, P2-2, P2-5, P2-11, P2-13, P2-8,
with both refactor passes and three review closures.

Three conflicts, each kept both sides:
- ClusterService.swift, the unpair line when the other Mac isn't
  reached: the CLI branch's reason (a ClusterSetupFailure's own text,
  else the error) with the Local Network branch's command name
  `\(OnboardingLive.cli)`, so there is one naming mechanism there and no
  ClusterOnboardingCommand.named wrapper; production bytes are unchanged
  ("darkbloom"). The integration edit makes the two name sources one.
- ClusterLinkFollowerCommand.swift, the follower's refusal: line 1 from
  the Local Network branch (the phrase from its shared constant,
  ClusterService.localNetworkRefusal), line 2 from the CLI branch (the
  app named for the running identity). The integration edit replaces
  the CLI branch's helper with ClusterService.appName.
- ClusterPairCommands.swift, waitUntilServing's loop: the Local Network
  branch's early return when this Mac's service reports blocked, then
  the CLI branch's status tracking (heartbeat lines, the wait's bound).
Merged on their own: the Local Network branch's other two spots in
serve (the session-service line, the blocked instruction and exit 1),
and the CLI branch's forThisInstall readers and startsAtLogin.

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

P2-9: a lane whose consumer leaves during its prompt is cancelled and
freed at once (test 66121ed, fix 55e3c93, refactor pass 5786f46:
a lane's clean stop after its first token is guarded; the docs say what
shutdown cancels). P2-6 assessed in its PR body. No conflicts.

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

P2-16: a serving member's uninstall beside the other install stops the
pair before this install's serving part, and says what the pair's stop
waits for (test 8ce0886, fix 4a3b0f0, refactor pass e0c90d3 and
de739bd). No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 6 commits November 4, 2026 02:00
…ntegration

Plain words for the 0.10.8 cluster changelog fragments. Docs only. No
conflicts; the uninstall fragment keeps this branch's reworded sentence
and the uninstall branch's appended line.

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

The agent setup guide's fixes from its first real run (G-1 to G-12),
round 2 (the fixed build) and its refactor pass (the card's login line
true either way; the DevNet app path quoted). Docs only. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… this install's incidents, per-Mac login line

The integration edits after merging the six DevNet round 2 branches.

1. One CLI name: ClusterOnboardingCommand.name starts from
   BuildEnvironment.current.cliName in the package (#if SWIFT_PACKAGE; the
   checks that compile the screens alone keep "darkbloom" and set theirs
   with use), and OnboardingLive.cli reads it. The wizard's and main.swift's
   own use(...) calls set the same value again and go. Production bytes are
   unchanged.
2. One app name: ClusterService.appName (the identity's appDisplayName)
   everywhere. The screens' seam starts from it and the link follower's
   refusal reads it; Cluster.LinkFollower.localNetworkApp(cli:) goes.
   Production's hint now says "Allow Darkbloom under ..." (decided), as the
   ✗ does. The DevNet exit test that pinned "darkbloom" through the helper
   now checks the follower's real output.
3. The follower writes the words the service reads from ClusterService's
   constants (followerLinePrefix, followerConnected, followerSessionOpened,
   followerLinkRefused); followerLinkOpenedLines and followerLinkRefusedLine
   are built from them. Bytes unchanged.
4. A-4 reads this install's incidents: OnboardingLive.ownWorker passes
   ClusterIncidentLog.forThisInstall() (its file and install filter)
   instead of production's defaultFile; the static reader takes the log, and
   F1's real-records test passes it, its records and expectations unchanged.
5. P2-11, the ✓ card's login line (loginLine): "on both Macs" only when this
   Mac's service outlives its window and the other Mac's status says
   startsAtLogin; otherwise it names the Mac that doesn't, or says the other
   Mac doesn't say. The new operation otherMacStartsAtLogin reads the other
   Mac's status over the cable (default true). The guide's card line holds
   (an example; verify checks each Mac).
6. P2-2 in onboarding: the member's Local Network hint names the app; its
   command and the stop line already named OnboardingLive.cli, which now
   follows the identity in exit tests too.

7. Found in validation: placement flow-run and setup didn't compile on
   the CLI branch's changes (its validation didn't run them). run-flow.sh
   now compiles ClusterIncidentLog+Install.swift and BuildEnvironment, as
   the CLI branch did for the diagnostics runner; the setup runner gets
   OnboardingCommandStandIn.swift (production's name), in its stand-in
   pattern.

The development-build check (developmentBuildKeepsTheWindowsOpen) now says
the other Mac's service doesn't start at login either, as in a real
development pair; the card then says to keep both windows open, as before.
The changelog's A-4 sentence says the ✗ names this Mac's worker too, so it
doesn't read as contradicting the earlier "names the other Mac's side".

Red first:
- theLoginLineNamesTheMacThatDoesNot against the merged screens with only
  the knob added: 6 failures; green with the change.
- onboardingTextsNameTheIdentity (DevNet identity): 3 issues;
  followerWritesTheWordsTheServiceReads: 1 issue ("Allow darkbloom under").
Guards: onlyThisInstallsRecordsNameThisMac, theNamesAreThisBuildsWithoutBeingSet.
Docs: two-mac-cluster.md (the login line), architecture/inference.md (one
CLI name, one app name, the follower's phrases); changelog: a bullet in
cluster-candidate-findings.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d's stand-in

ClusterConfigurationChecks compiles ClusterConfiguration.swift without the
onboarding screens. Since the CLI branch, its tensorAssistantServesLocally
names the command with ClusterOnboardingCommand.named, so the check stopped
compiling ("cannot find 'ClusterOnboardingCommand' in scope"), as the
placement setup check had; neither runs in CI.

It now compiles the setup check's OnboardingCommandStandIn.swift
(production's name), as it already compiles the installed session's
AttestationSignerStandIn.swift.

Red: on the integrated head 5732dda the check fails to compile. On dev
6497e8e it passes (9 file groups, the provider config file, 14
configuration groups). Green with this change: the same three pass, and
placement setup still passes 264.

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

Read as a user, the 0.10.8 section contradicted itself: the console's
bullet said every start ends with "Starts by itself at login on both
Macs.", and P2-11's bullet says the card says so only when the cluster
service on both Macs does, and otherwise names the Mac where it doesn't.

The console's bullet now names the line by what it tells (whether it
starts by itself at login on each Mac), as the guide does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ✗ line for a worker that ended on this Mac named the incident code ("worker_crashed in its incident log"). It now says "its worker ended unexpectedly"; the incident list in `cluster status` keeps the code.

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

vercel Bot commented Nov 4, 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 Nov 4, 2026 11:07am UTC
d-inference-console-ui-dev Error Error Nov 4, 2026 11:07am UTC
d-inference-landing Ready Ready Preview Nov 4, 2026 11:07am UTC
darkbloom-status Ready Ready Preview Nov 4, 2026 11:07am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 4, 2026 11:07am UTC

Request Review

@jonathan308

Copy link
Copy Markdown
Collaborator Author

PR body of fix/cluster-local-network-truth at 8552ba7109, merged into integrate/devnet-round-2 as f80a0a4e97.
Title: Two-Mac cluster onboarding: the mode chosen loads, the ✗ names the right Mac, Local Network truth (DevNet A-9, A-4, A-3, A-1, A-10; pair-2 P2-1/A-2, P2-3, P2-4, P2-7)

Summary

Onboarding fixes from two DevNet runs of dev (0.10.6-dev.branch.76): the production M5 Ultra pair, and pair-2 (an
M3 Ultra and an M5 Max).

The mode chosen for a model is the one that loads, GLM included (A-9).

The ✗ after a part keeps ending names the right Mac (A-4, A-3, A-10).

  • It names the Mac whose worker ended, from that Mac's own records, or says it can't tell.
  • It gives the other Mac's own reason when that Mac can't dial.
  • A planned switch's stops aren't shown as crashes.

Local Network truth (P2-1, A-2). When macOS's Local Network privacy keeps a Mac's link follower off the cable:

  • the follower's own refusal decides, not the app's broadcast check;
  • the joining Mac, the leading Mac's ✗ and darkbloom start all say plainly what to do on that Mac;
  • darkbloom start ends its wait at once, and says when it replaces a session service (P2-3).

Also:

  • Retry starts a stopped pair again, and q leaves a start's wait (P2-4).
  • The joining Mac's window shows the leading Mac's start (P2-7).
  • The DevNet app names its own command in more onboarding lines (A-1).

Linked issue

None: the DevNet validations' findings A-1, A-2, A-3, A-4, A-9, A-10 (overnight/candidate-0108-proof.md, "DevNet
validation of 6497e8e") and P2-1, P2-3, P2-4, P2-7 (overnight/devnet-validation-pair2.md).

Test plan

Every check binary was compiled outside the sandbox and run under a sandbox-exec profile that denies ~/.darkbloom*,
except ObservabilityChecks, which ran outside it. Every swift test ran as sandbox-exec … env DARKBLOOM_RELEASE_ENVIRONMENT=prod nice -n 19 swift test --disable-sandbox --skip-build --filter '…', against a
DARKBLOOM_RELEASE_ENVIRONMENT=prod build.

  • ProviderCoreTests filtered to
    ClusterOnboardingPeerLabelTests|ClusterPlacementTensorWidthTests|ClusterPlacementTensorWidthRegisteredTests|DistributedAutomaticBatchPlannerTests|MiMoImageOnboardingSelectionTests|ChildExitWaitConventionTests|ClusterServiceLogScanTests|ClusterServiceStopReasonTests:
    71 tests in 8 suites passed.
    • It includes aChosenPipelineIsKeptWhenTheListingPutsItFirst and the useMode test (A-9, F6),
      aWorkerThatEndsHereIsNamedHere and the real-records incident tests (A-4, F1), aLocalNetworkRefusalIsThePartsReason
      (A-3), aCleanStopIsNotAnEnd (A-10, F4), and theFollowersOwnRefusalIsTheTruth (P2-1).
    • Each was red first: A-9/A-4/A-3 5 issues; A-10 3; F1 5; P2-1 4.
  • fix(cluster): on a paired Mac, darkbloom start/stop/restart/status control the pair; plain cluster status --json (stacked on #1764) #1774's 8 suites (ClusterPairCommandsTests.swift): 67 tests in 8 suites passed.
  • bash provider-swift/Tests/ClusterOnboardingChecks/run.sh (binary sandboxed): 1180 passed, 0 failed.
    • It includes theJoiningMacSaysWhenItsServiceIsKeptOffTheLocalNetwork (P2-1),
      theJoiningMacShowsTheLeadersStateWhileItWaits (P2-7) and retryStartsAStoppedPairAndQLeavesTheWait (P2-4).
    • Red: 1174/6.
  • ClusterControlChecks, placement flow-run and setup, ClusterModelProvisioningChecks provisioning: 229/0 · 33 · 264 · 161/0.
  • Diagnostics, GLM image admission, library placement: pass · PASS, 40 CPU checks · pass.
  • libs/darkbloom-cluster/Tests/ObservabilityChecks/run.sh: 212 passed, 0 failed.
  • swift build --jobs 6 --product darkbloom (prod): OK.
  • make docs-check, make changelog-check, make docs-impact-check BASE=6497e8e7a8, git diff --check: OK.
  • Not run: live Macs. The next run should cover:
    • the GLM pipeline choice, and both kill shapes (A-9, A-4/F1);
    • a member whose follower is refused, MacBook and headless Studio, and whether macOS prompts there (P2-1);
    • darkbloom start with no terminal (P2-3);
    • Retry after cluster stop --service (P2-4);
    • a planned switch (A-10).

Components touched

  • provider-swift (Swift CLI):
    • the onboarding flow, follow and live operations;
    • the cluster service and its Local Network check;
    • the worker owner's and the installed session's shared markers (F1);
    • darkbloom's ClusterPairCommands (three spots);
    • ClusterLinkFollowerCommand (F2: the refusal phrase from its constant).
  • libs/darkbloom-cluster (DarkbloomClusterRemote: the classifier's worker-exit-v1 cases; ObservabilityChecks).
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes

  • Yes — described above and matching side updated

  • No record field, wire field, config key or CLI flag changes.

  • ClusterServiceStatus.Child.lastError, existing:

    • a running part's now carries its follower's Local Network refusal; before, it was nil while the part ran;
    • an ended part's now also carries a refusal it logged (A-3);
    • a reader on an older build shows it as that Mac's error line.
  • The incident log is read, never written. A-4 counts only this Mac's rank's own exit record (worker-exit-v1 rank=<rank>) and what the other Mac's follower said (rank <other> follower said:), both shared with their writers.
    An unknown field is ignored (F3: A-13's build field must stay optional, schema version 1).

  • local-network.json is unchanged; the service's state also reads its published status.

  • Shared phrases are public constants in ClusterService: localNetworkRefusal (written by the follower, F2), and
    followerLinkOpenedLines (the follower should write it from the constant; see Notes).

Documentation impact

  • Canonical documentation updated
  • No documentation needed — reason:

Updated:

  • docs/provider/two-mac-cluster.md, "When something is in the way":
    • the chosen mode loads;
    • the ✗ for this Mac's own worker, for an unknown side, and for a member kept off the local network;
    • planned stops;
    • the follower's refusal on each screen, with the instruction;
    • darkbloom start; Retry and q; the joining Mac's view.
  • docs/provider/cli-reference.md, darkbloom start: what a paired Mac's start says first, and how it ends on a refusal.
  • docs/architecture/inference.md: the person's family (keptFamily, replansInFamily), and Local Network truth
    (followerRefusal, ClusterLocalNetworkAccess.state, otherMacRefused).

Changelog

  • Added or updated this PR's unique changelog.d/<topic>.md fragment and ran make changelog-check.
  • No user-visible change, or an explicitly authorized release/history change.

Two bullets appended to changelog.d/cluster-candidate-findings.md; its title and wording belong to another PR.
make changelog-check: 54 valid.

Notes for reviewers

Where to look:

  • ClusterOnboardingLive.swift:
    • useMode, keptFamily, replansInFamily;
    • ownPart, ownWorker(inIncidentLog:…), keepsEndingTitle, errorLines, endShown;
    • readinessOnce and waitReady (the final refusal), otherMacRefused.
  • ClusterService.swift: followerRefusal, the status's lastError, and lastError's refusal fallback.
  • ClusterLocalNetworkAccess.state.
  • ClusterOnboardingFollow.followStart (the refusal and the leader's state).
  • finishStart's Retry, and waitForParts (leaving).
  • ClusterPairCommands.serve and waitUntilServing (three spots).

Decisions:

  • A-4 names a Mac only from that Mac's own record. It never infers from "closed" alone; an unreadable log blames
    neither Mac.
  • P2-1's truth is the process that dials. The follower's own last dial decides, which no broadcast probe can stand
    in for. The leading Mac's wait ends at once on it, since it can't clear until someone acts.
  • A-8, explained, not changed: the listed split is planned while a serving model holds memory; the adopt plans again
    once it is released.

For integration with the CLI branch:

  • ClusterService.swift and ClusterPairCommands.swift hunks are listed in the report.
  • Keep one app-name helper: ClusterService.appName rather than localNetworkApp(cli:).
  • Have ClusterLinkFollowerCommand write followerLinkOpenedLines' words from the constant.

Limits:

  • The joining Mac shows the leader's status and the Retry hint, not its ✗ block: the ✗ isn't published.
  • Whether macOS prompts on a headless launchd agent is unverified.
  • Ctrl-C leaves through the key path only when the console delivers it as a key.
  • A-11's follower keeps its old setup after a leader-only restart until the next adopt (reported, not changed).

Follow-ups: A-6, A-11, P2-2, the remaining P2 and A rows outside onboarding.

Before And After

Behaviour

Before

flowchart TD
  G["GLM: Pipeline chosen (listed first)"] --> TP["tensor parallel loads again"]
  W["a worker killed on either Mac"] --> X1["✗ the link keeps closing; the other Mac's worker ended … (wrong for this Mac's own kill)"]
  S["planned switch"] --> R["live row: parts ended (exit 0, stopped)"]
  F["member's follower refused by macOS (the probe said allowed)"] --> X2["leader ✗: The other Mac did not answer over the cable … · its part is running, no error"]
  F --> J["member's window: nothing"]
  St["darkbloom start (no terminal)"] --> Q["silently replaces the session service · waits 10 min · no reason"]
  Re["✗ Retry after cluster stop --service"] --> Wt["waits for parts nothing starts; q ignored"]
Loading

After

flowchart TD
  G["GLM: Pipeline chosen"] --> PP["kept; the adopt plans again in pipeline; pipeline loads"]
  W["a worker killed"] --> I{"this Mac's incident records since the wait"}
  I -->|this Mac's rank's own exit| X1["✗ this Mac's worker keeps ending"]
  I -->|the other Mac's follower said| X2["✗ the other Mac's worker ended or the cable dropped"]
  I -->|neither, both, or unreadable| X3["✗ can't be told; blames neither"]
  S["planned switch"] --> R["clean stops aren't ends"]
  F["member's follower refused"] --> Pub["its status: its part can't reach the local network …"]
  Pub --> X4["leader ✗ at once: macOS keeps Darkbloom Dev there off the local network · turn it on there (Screen Sharing if no display) · Retry"]
  Pub --> J["member's window and darkbloom start: the same instruction for this Mac"]
  Re["✗ Retry on a stopped pair"] --> Wt["starting both Macs again · wait (q leaves with a line)"]
Loading

Code flow

Before

flowchart LR
  um["useMode: planned = modes.first"] --> ad["localAdopt: listed plan"]
  t["keepsEndingTitle: closed → the other Mac"]
  probe["startServiceProbe (broadcast)"] --> st["serviceState() = report"]
  child["status lastError: nil while running"]
  retry["finishStart .retry → waitForParts (no leave)"]
Loading

After

flowchart LR
  um["useMode: keptFamily"] --> ad["localAdopt: replansInFamily"]
  op["ownPart(since:) once"] --> ow["ownWorker(inIncidentLog:since:rank:otherRanks:)"] --> t["keepsEndingTitle / errorLines"]
  log["follower log: localNetworkRefusal / followerLinkOpenedLines"] --> fr["followerRefusal"] --> child["status lastError while running"]
  child --> st["ClusterLocalNetworkAccess.state: blocked"] --> scr["wizard · follow · darkbloom start"]
  child --> lead["readinessOnce: otherMacRefused → waitReady ends at once"]
  retry["finishStart .retry: Stopped → serve"] --> wfp["waitForParts: leaving → .left"]
Loading

Refactor Pass

Outcome: a refactor commit (7e7ddc6952) and the fix for the one finding it raised (3a0cc09c49). Screen text
changes only where the refactor's findings change it.

  • Refactor (7e7ddc6952):
    • doc comments reattached to lastErrors and keepsEndingTitle;
    • one read of this Mac's part for both the ✗ title and the lines (ownPart);
    • an incident log that can't be read blames neither Mac;
    • endShown without its unused parameter, replansInFamily as a guard, Self.cli in the live operations;
    • the service's duplicate cli and a tautology in a test removed.
  • F1, fixed (3a0cc09c49): A-4 counts only this Mac's own worker exits.
    • Mac A's real incident log showed the problem: for the member's kills, the leader recorded source=leader,
      worker_crashed, "…closed | rank 1 follower said: …". So the A-4 rule blamed the leader for the member's worker,
      which reversed B17.
    • The ✗ now names this Mac only for this Mac's rank's own exit record (worker-exit-v1 rank=<rank>, with any
      redacted prefix). It names the other Mac, in B17's words, only for what that Mac's follower said
      (rank <other> follower said:). Otherwise it blames neither Mac.
    • Both formats are shared with their writers: ClusterWorkerOwnerService.workerExitMarker and
      DistributedInstalledSession.followerSaid.
    • A test loads the 30 real records: 4 member kills give the other Mac, 4 leader kills give this Mac, both kinds in
      one wait give neither, and a malformed log gives neither. It fails against the old rule with 5 issues.
  • F2, fixed: the follower writes ClusterService.localNetworkRefusal, the phrase A-3 reads. The constant lives in
    ClusterService.swift. The CLI branch's rewording of the app name on the next line can conflict only on those
    adjacent lines.
  • F3, for the CLI branch: A-13's build field must be optional, with schema_version kept at 1. This build already
    ignores an unknown field (tested).
  • F4, fixed: clean stops aren't shown as ends while registering with Darkbloom (offeredReadiness) or in the
    "rank 0 on the other Mac ended" line. Before, three of them could end the wait with a ✗.
  • F5, fixed: readyWaitSeconds names the 15-minute wait. lastErrors reads incidents since this start's wait
    began, including for the diagnostics file saved from the ✗.
  • F6, fixed: useMode itself is tested on GLM's listing. The test fails against the base's rule.
  • Validation:

Refactor Pass addendum (P2-1, P2-3, P2-4, P2-7)

Outcome: one signed commit (f4eae6bb3b): two fixes found in review, and the app's name from one source.

  • The Local Network ✗ names the Mac it happened on, on either screen. A start run from the joining Mac's own
    window forwards its wait to the leader, which answered with its own wording. So the joining Mac's ✗ told its person
    to turn on Local Network on the leading Mac. The line is now worded for the screen that shows it
    (localNetworkLine(forwarded:)). The joining Mac gets its own instruction ("On this Mac: … then choose Retry
    here"); the leader's ✗ is unchanged.
  • A refusal the follower got past no longer counts. A-3's reason for an ended part read the last refusal even
    after the follower had connected. A planned stop after Local Network was turned on would then:
    • end the leader's wait at once with the Local Network ✗;
    • show the clean stop as an end;
    • make darkbloom start exit 1.
      Ended and running parts now use one rule (followerRefusal: the follower's last dial). A refusal with no later
      link is still the reason.
  • The app's name: ClusterService.appName is the identity's appDisplayName (its CFBundleName, which the Local
    Network pane lists), with the same strings. For integration, the CLI branch's localNetworkApp(cli:) should become
    ClusterService.appName. The flow keeps ClusterOnboardingCommand.app only as its standalone-compile seam.
  • Checked, unchanged:
    • the follower log read: bounded at 8 MiB, a missing or replaced log, since the part started, a refusal cleared
      only by a later link;
    • memberQuickEnds and the stop-reason path;
    • the instant ✗ fires only on EHOSTUNREACH's refusal line, and F1 and F4 still hold;
    • Retry's Stopped check, and q/Esc/Ctrl-C leaving without stranding the start's mark;
    • P2-3's exit codes;
    • the docs.
  • Noted, not changed:
    • status() scans the part's log for the refusal on every call under the service's lock, even on a part that
      can't have one;
    • a just-allowed member reads as refused until its follower dials again;
    • Retry matches "Stopped" by its text.
  • Validation:

Addendum 2 (8552ba7109): the status scan, and a member just allowed.

  • The status scan, part of P2-8. A running part's status read its log for a follower refusal on every call, under
    the service's lock, walking up to 8 MiB back even on rank 0, which never writes one. The joining Mac's window asks
    every second. Now only a link follower's log is read, and only once it grew since the last read. The output is the
    same, and a test counts the scans.
  • A member just allowed no longer shows the same ✗.
    • The follower dials about once a second while refused (20 ms doubling to 1 s), but logs a refusal only when it
      changes, and every connect failure is the same .connectFailed. So after Local Network was turned on, a dial
      failing only because the leading Mac's part wasn't listening (between restarts, up to 30 s apart) left the old
      refusal as its last line.
    • Retry never restarts a running follower. So Retry could end at once on that stale refusal with the same ✗, and
      after Retry started a stopped pair it read the ended follower's old refusal.
    • Now only a running follower's refusal blocks. The leader's wait ends on it only once its own part, which hosts
      the listener, has run 20 s, long enough for one more dial. A dial that failed another way since supersedes it.
    • A still-blocked member still gets the Local Network ✗ without waiting for the start to give up.
  • Validation:

@jonathan308

Copy link
Copy Markdown
Collaborator Author

PR body of fix/cluster-cli-devnet-findings at e1a8541320, merged into integrate/devnet-round-2 as 8075ea1f41.

Summary

Fixes the CLI-side findings of two DevNet validations (6497e8e7a8 on the M5 Ultra pair, and pair-2), plus the three
behaviour issues raised in review:

  • Names: the DevNet app names darkbloom-dev, and the app "Darkbloom Dev", in every command it prints for a pair.
  • Waits: long waits say what they wait for and their bound. On the Mac that follows, a person's cluster status
    or status waits at most 10 s for the leading Mac. The leading Mac's own status and a script start's checks wait as
    before.
  • Incidents: each install keeps its own incident log (Darkbloom Dev: incidents.dev.json) and its own corrupt
    copy.
  • Doctor: no longer fails on a freshly installed DevNet app; a saved setup others can open says the fix.
  • Status the Macs exchange: it says whether each Mac's service starts at login. The leading Mac's
    other_mac.answers is filled.
  • Service log: the leading Mac's notes a following window's status once a minute.
  • Port: stays 8000, and the docs say both apps use it.

Linked issue

No issue: DevNet findings A-1, A-5, A-11, A-12, A-13 (M5 Ultra pair) and P2-2, P2-5, P2-8, P2-11, P2-13 (pair-2).
This follows #1774. The onboarding-side findings are fixed separately.

Test plan

  • Red first, three times: f64ef5250d (6 tests, 12 issues), f5378a8b76 (6 tests, 13 issues), and
    1727df88de (2 tests, 4 issues; ObservabilityChecks A23 failing).
  • env DARKBLOOM_RELEASE_ENVIRONMENT=prod swift build --build-tests, then filtered swift test --skip-build, sandboxed:
    • pair suites plus ClusterDevNetFindingsTests: 71 tests in 10 suites;
    • ClusterPairTwoFindingsTests and ClusterBoundedWaitScopeTests: 5 tests in 2 suites;
    • neighbouring command suites: 114 tests in 17 suites;
    • feat(provider): the Darkbloom mark and live line on the everyday commands, in a terminal only (stacked on #1774) #1777's DarkbloomCommandLookTests and DarkbloomCommandLookRunTests: 22 tests in 2 suites;
    • ProviderCore: ClusterIncidentInstallTests, ClusterPairingProviderTests, ClusterObservabilityTests,
      ClusterServicePairingChangeTests and the ClusterApproval{Sync,Watch,TensorAssistant,TensorShares}Tests:
      52 tests in 8 suites. Also ClusterInstalledReferenceTests and ClusterServiceStartsAtLoginTests: 4 tests in
      2 suites.
  • DevNet identity: exit tests call ClusterOnboardingCommand.use("darkbloom-dev") and check:
    • the card, cluster stop --service, its refusal, cluster local and the Local Network hint;
    • the no-terminal cluster line, the "Cluster service" lines and the Ctrl-C line.
    • Production output is byte-identical: existing exact-output tests pass, except one that expects the new wait line.
  • libs/darkbloom-cluster/Tests/ObservabilityChecks/run.sh: 213 passed, inside the sandbox via an xcrun shim
    adding swiftc -disable-sandbox.
  • provider-swift/Tests/ClusterOnboardingChecks/run.sh: 1165 passed at 539ee67e1a; none of its sources changed
    since. ClusterDiagnosticsChecks: passed at 539ee67e1a.
  • git diff --check, make docs-check, make docs-impact-check BASE=6497e8e7a8, make changelog-check,
    make changelog-preview.
  • Not run:
    • ClusterInstalledSessionChecks: compiled, not run.
    • ClusterConsoleChecks: doesn't compile, here or at 6497e8e7a8; its file list lacks ClusterApprovalFallback.

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX: libs/darkbloom-cluster (DarkbloomClusterRemote's incident log and snapshot)
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes: described above and matching side updated

All local or between the two Macs; no coordinator protocol change, no CLI flag change, no version bump.

  • The status the Macs exchange (ClusterServiceStatus, link control channel) gains an optional startsAtLogin.
    An older build ignores it. Nil from an older build means unknown.
  • Incident records gain an optional install, left out when absent.
    • A non-production install keeps its own file, ~/.darkbloom/cluster/incidents.<install>.json, and its own
      corrupt copy, incidents.<install>.corrupt.json. Production's names don't change.
    • Older records in incidents.json count as production's. DevNet records written there before this change stay
      until they age out (200 records) or are dismissed.
  • cluster status --json: no new keys. other_mac.answers is now filled on the leading Mac (true, false, or null
    when unknown).
  • Installer: not changed. It still writes a non-production provider.toml as 0644, and the provider now copes
    with that. Writing it as 0600 needs a coordinated update of the platform's served install.sh.

Documentation impact

  • Canonical documentation updated:
    • docs/provider/cli-reference.md: the waiting lines, other_mac.answers, the 10 s bound on the Mac that
      follows, and the doctor's saved-setup rule.
    • docs/provider/two-mac-cluster.md: both apps serve a pair's API on 8000, and the DevNet names.
    • docs/architecture/inference.md: the runtime CLI name, per-install incident files and corrupt copies,
      forThisInstall, startsAtLogin and the control log.
  • No documentation needed — reason:

Changelog

  • Added or updated this PR's unique changelog.d/<topic>.md fragment and ran make changelog-check.
    Nine lines in changelog.d/cluster-everyday-commands-on-a-pair.md.
  • No user-visible change, or an explicitly authorized release/history change.

Notes for reviewers

  • One name: main.swift calls ClusterOnboardingCommand.use(BuildEnvironment.current.cliName) before parsing.
    • The CLI reads ClusterPairSummary.cli; ProviderCore texts use ClusterOnboardingCommand.named.
    • ClusterServiceAgentPlan's lines are named by the CLI (Status.clusterServiceLines), because
      ClusterSupervisionChecks compiles that folder without ClusterOnboardingFlow.swift.
    • The Ctrl-C handler only writes bytes made before it is set.
  • Waits: the bounds are unchanged: start 600 s, stop teardown 60 s, restart teardown 300 s, and the routed stop
    330 s, said as "about 6 min".
  • The 10 s bound: only a person's cluster status or status on the Mac that follows uses it
    (live(config:bounded:) → statusLines(leads:slow:) → boundedStatus).
    • The leading Mac's status, and a script start's or restart's checks, wait as long as the answer takes, as before.
    • The forward inside ClusterOnboardingLive.status() stays bounded at 30 s, sent again up to 4 times while
      leadership moves.
  • Incidents: use ClusterIncidentLog.forThisInstall(homeDirectory:redact:) (ProviderCore) for this build's log.
    The onboarding branch's A-4 read should switch to it at the merge.
  • P2-5's root cause is scripts/install.sh bind_provider_coordinator leaving provider.toml at 0644. The
    provider's own saves write 0600.
  • P2-11: the card itself is in ClusterOnboardingFlow.swift (onboarding PR). This PR adds the field it needs.
  • Left to the onboarding PR:
    • the names at ClusterOnboardingLive.swift:2033 and :597 (localNetworkHint; the app is
      BuildEnvironment.current.appDisplayName);
    • the card's login line;
    • a shorter bound for a read-only forwarded status.

Before And After

Before: behavior

flowchart TD
  A["DevNet app: card, hints, cluster stop --service, no-terminal cluster, Ctrl-C, status service line"] --> B["print darkbloom ..."]
  C["darkbloom-dev restart"] --> D["stop up to 330 s, teardown up to 300 s: no output"]
  E["both installs"] --> F["one incidents.json and one corrupt copy"]
  F --> G["older build rewrites it: stamps lost, logs mixed"]
  H["fresh DevNet install, paired Mac"] --> I["doctor: FAIL cluster savedConfiguration, exit 1"]
  J["leader cluster status --json while serving"] --> K["other_mac.answers null"]
  L["member cluster status"] --> M["silent, up to 30 s per forward"]
  N["leader's card"] --> O["Starts at login on both Macs, from this Mac alone"]
Loading

After: behavior

flowchart TD
  A["DevNet app: the same outputs"] --> B["print darkbloom-dev ... and Darkbloom Dev"]
  C["darkbloom-dev restart"] --> D["says each wait and its bound"]
  E["DevNet install"] --> F["its own incidents.dev.json and incidents.dev.corrupt.json"]
  E2["production"] --> F2["incidents.json: own records plus unstamped"]
  H["fresh DevNet install, paired Mac"] --> I["doctor: no saved setup yet, no FAIL"]
  H2["saved setup in a file others can open"] --> I2["FAIL with: run chmod 600 file"]
  J["leader cluster status --json while serving"] --> K["other_mac.answers true"]
  L["member cluster status or status"] --> M["after 3 s says it waits; at 10 s shows its own view"]
  L2["leader status, and a script start's checks"] --> M2["wait as before, no bound"]
  N["each Mac's status"] --> O["startsAtLogin for the other Mac's card"]
Loading

Before: code flow

flowchart LR
  W["wizard only"] -->|use cliName| N["ClusterOnboardingCommand.name"]
  T["CLI and ProviderCore texts"] --> Lit["literal darkbloom"]
  Obs["ClusterObservability, ClusterService, ClusterDiagnostics"] --> Shared["defaultFile: incidents.json"]
  Doc["doctor"] --> Strict["optionalInstalledReference: private read only"]
  Live["liveFacts"] --> Fwd["operations.status"]
Loading

After: code flow

flowchart LR
  Main["main.swift"] -->|use cliName| N["ClusterOnboardingCommand.name"]
  N --> CLI["ClusterPairSummary.cli and Status.clusterServiceLines"]
  N --> PC["ClusterOnboardingCommand.named"]
  Obs["ClusterObservability, ClusterService, ClusterDiagnostics"] --> FTI["ClusterIncidentLog.forThisInstall"]
  FTI --> Own["defaultFile homeDirectory install: incidents.install.json"]
  Doc["doctor"] --> Ref["optionalInstalledReference: no setup in an open file is not configured"]
  Live["live config bounded"] --> SL["statusLines leads slow"]
  SL -->|follower and a person's read| BS["boundedStatus: 10 s, said after 3 s"]
  SL -->|leader, or a script start's check| Fwd["operations.status, as before"]
  Svc["cluster service status"] --> SAL["ClusterServiceAgent.startsAtLogin"]
Loading

Refactor Pass

A dedicated refactor subagent reviewed the change (AGENTS.md § Required Refactor Pass). It made one small commit that
doesn't change behavior, 9cc3b4ab2c:

  • cluster stop --service's pair stop is now named stopBothMacs. The old name was too close to
    pairStop(role:serving:), which decides who stops.
  • The incident test also pins ClusterIncidentLog.unstampedInstall to BuildEnvironment.prod.rawValue, and checks
    that the provider's log carries this build's install. Assertions were added; none were removed.

Checked and unchanged:

  • The waiting line's lock: no line prints after the answer, it can't deadlock with the look, and its timer lives at
    most 3 s.
  • The CLI name: it is set before parsing and doesn't leak between tests.
  • Production output: byte-identical except the new waiting lines and the forget line's text.
  • The waits' bounds.
  • The live line, redrawn around every new line.
  • latestSeq cursors.
  • Reading the incident log in both directions.

Known limits:

  • An older build that writes the incident log rewrites it without install.
  • An older production build keeps listing DevNet's incidents until production runs this code.

Rerun after the pass (prod build identity, sandboxed):

  • Tests: 71 pair tests, 114 neighbouring tests, 22 look tests and 51 ProviderCore tests pass.
  • ObservabilityChecks: 212 passed. It runs outside the sandbox because the compiler's macro plugin can't load
    inside it.
  • Gates: git diff --check, make docs-check, make docs-impact-check BASE=6497e8e7a8 and make changelog-check
    pass.

Refactor Pass addendum

A dedicated refactor subagent reviewed the pair-2 round (f5378a8b76, 935dbe4779). It made one behaviour-preserving
commit, 539ee67e1a:

  • The setup screen's Ctrl-C handler no longer allocates: it writes a static literal and bytes made before the handlers
    are set. The bytes are the same.
  • cluster status --json's waiting lines use the CLI's printError.
  • optionalInstalledReference's doc is accurate: it isn't diagnostics-only. The setup screens, approval checks and
    member supervision read it too.

Checked and unchanged:

  • Incident records: install stays optional and schema_version stays 1 in both files. Every provider reader and
    writer uses ClusterIncidentLog.forThisInstall. Cursors and epochs are per file. DevNet records already in
    incidents.json count as production's until they age out or are dismissed.
  • P2-5 trusts nothing from a file others can read: it returns only "no saved setup". A saved setup there fails
    with chmod 600. Symlinks, hard links, other owners and writable files fail as before.
  • The 10-second wait: no line after the answer, and --json output stays pure.
  • startsAtLogin: optional both ways.

Known limits:

  • The 10-second wait also runs on the leading Mac, where its lines name "the leading Mac".
  • A script start's bounded looks can overlap their forwards.
  • The corrupt-incident aside name is shared by both installs.

Rerun (prod build identity, sandboxed):

  • Tests: 71 pair, 3 + 4 new, 114 neighbouring, 22 look and 52 ProviderCore tests pass.
  • Runners: ObservabilityChecks 212 passed, ClusterOnboardingChecks 1165 passed, and ClusterDiagnosticsChecks
    passed. ClusterInstalledSessionChecks compiles, and wasn't run.
  • ClusterConsoleChecks doesn't compile, here or at 6497e8e7a8: its file list lacks ClusterApprovalFallback.
  • Gates: git diff --check, make docs-check, make docs-impact-check BASE=6497e8e7a8 and make changelog-check
    pass.

All three known limits are closed in 1727df88de (red) and e1a8541320: the 10-second wait runs only for a person's
cluster status or status on the Mac that follows; a script start's checks wait as before; and each install keeps
its own corrupt copy (incidents.dev.corrupt.json, ObservabilityChecks A23).

@jonathan308

Copy link
Copy Markdown
Collaborator Author

PR body of fix/cluster-cancel-mid-prefill at 5786f46ad8, merged into integrate/devnet-round-2 as 4240ecc7b4.
Title: cluster: a client that disconnects during a long prompt no longer stalls the pair

Summary

A client that closed its connection during a long prompt kept a two-Mac pair busy for minutes. The pair's lease took
the consumer's departure as a clean stop, which ends a request only at its first token, so both Macs prefilled the whole
prompt (DevNet pair-2: 253 s for 61,815 tokens). A tensor-parallel pair prefills one prompt at a time, oldest first, so
every newer request waited behind it and failed at its own first-token deadline ("Response generation failed", or 429
once the lanes filled), while status said "✓ Serving". Now, on a pair whose lanes retire alone, a request that has
produced no token yet takes no clean stop: the engine cancels it, both ranks end only that lane at their next step
boundary, and the next request is served at once. Requests that produced a token, and pairs without lanes, keep the clean
stop.

Linked issue

None filed. DevNet validation finding P2-9 (pair-2, 0.10.6-dev.branch.76 of dev 6497e8e7a8), 2026-11-04.

Test plan

  • Red on dev with only the test added (66121ed307), green with the fix (55e3c930b1):
    ClusterWorkerPairAdmissionDeadlineTests.testAConsumerThatLeavesDuringItsPromptFreesItsLaneAtOnce
    (bash libs/darkbloom-cluster/Tests/RemoteChecks/run.sh; scripted ranks, rank 0 inside a long prompt).
    • Red: the request keeps its lane and neither rank is told to end the prompt (4 failures).
    • Green: it retires at once with 0 tokens, both ranks receive its cancel, nothing is fenced, the pair stays valid and
      serves the next request.
  • Regression guard, green before and after: a pair without lanes keeps the clean stop before the first token
    (testWithoutLanesARequestStillInItsPromptKeepsTheCleanStop), and ProcessChecks CleanStopTests (4 groups, actual
    children) and ProviderCleanStopPipeCheck (the provider's lease source) pass unchanged; a lane that has produced a
    token keeps the clean stop (testALaneThatProducedATokenKeepsTheCleanStop).
  • RemoteChecks, whole target: 87 XCTest + 3 Swift Testing, 0 failures.
  • LinkWorkerChecks: 16/16.
  • ProcessChecks (owner, readiness, retirement, endpoint, partial admission, clean stop, provider pipe, deadline pipe,
    clean-stop pipe): pass.
  • QualificationChecks (pair driver and lane cancellation through the real pair): 79/80. The 80th counts worker processes by path, which the test sandbox hides, and fails identically on dev in the same sandbox.
  • make docs-check, make docs-impact-check BASE=dev, make changelog-check, git diff --check.
  • On pair-2 (owner's list): repro2.py 61000 15. The long prompt's lane retires within one prefill step and the
    health checks right after answer in about 0.4 s.

Components touched

  • provider-swift (Swift CLI): the change is in libs/darkbloom-cluster (DarkbloomClusterProcess), which the
    provider links
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes. No wire format changes: a cancel is an existing command, and the lease contract
    already lets requestCleanStop decline ("the caller falls back to cancel()").

Documentation impact

  • Canonical documentation updated: docs/architecture/inference.md (when a departed consumer's request is cancelled
    instead of stopped cleanly, and why), docs/developer/test.md (the checks).

Changelog

  • Added changelog.d/cluster-cancel-mid-prefill.md and ran make changelog-check.

Notes for reviewers

  • Root cause. DistributedCBv2Engine.stop(.cancelled) asks the lease for a clean stop. The lease accepts it and ends
    the request at its first committed token, so nothing reaches the ranks until the prompt finishes. The only thing that
    could end it sooner is the request's first-token deadline: 10 s plus a per-token share sized to the setup's request
    deadline, about 875 s for a 62K prompt on pair-2. With one prompt prefilling at a time
    (QwenTensorParallelBatchDriver), the abandoned prompt blocks every newer request.
  • No state stays stuck afterwards. A prompt cut at its first token is followed by health requests in 0.42 s. The
    "after it retired" failures on DevNet came from other abandoned prompts next at the head: the cancel test's four 16K
    prompts, then a 20,528-token request left in flight when the soak stopped.
  • Not a regression. The clean stop on departure dates from 2026-10-09, and the engine, the lease and the driver's
    prefill choice are the same in v0.10.7. Lanes, which are on by default only since 0.10.7, make the failures visible as
    admitted requests that time out. cluster: an admission deadline ends that request, not the pair #1762 is not involved: these requests reserved in 131–155 ms.
  • Why the cancel is safe. On a lane pair a cancel retires that lane alone. It is the path every prefill_stall and
    coordinator cancel already takes in production, and it is bounded by the 30 s lane retirement wait, against one prefill
    step (about 9 s). The cost is the abandoned prompt's partial prefix capture, which is no longer stored.
  • Shutdown. A lane still in its prompt is now cancelled at once by the pair's shutdown instead of being waited for.
    It still retires alone.
  • Follow-ups (not here):
    • a pair without lanes still runs an abandoned prompt to its end, because a cancel there ends the pair;
    • status could say when a serving pair's last requests all failed;
    • A-7's head-of-line blocking under heavy mixed load (accepted as by design for 0.10.8).

Before And After

Before: behavior

sequenceDiagram
  autonumber
  participant Client
  participant Engine as Leader engine
  participant Lease as Pair lease
  participant Ranks as Both ranks (TP batch)
  participant Next as Newer requests
  Client->>Engine: 60K-token prompt
  Engine->>Ranks: reserve, start (lane 1)
  Client--xEngine: closes the connection 15 s in
  Engine->>Lease: requestCleanStop()
  Lease-->>Engine: accepted (stop at the first token)
  Note over Ranks: nothing sent: both Macs prefill the whole prompt (about 4 min)
  Next->>Ranks: admitted to other lanes
  Note over Ranks: one prompt prefills at a time, oldest first
  Note over Next: each times out at its first-token deadline (about 11 s): "Response generation failed", then 429s
  Ranks-->>Lease: first token, clean stop, retired
Loading

After: behavior

sequenceDiagram
  autonumber
  participant Client
  participant Engine as Leader engine
  participant Lease as Pair lease
  participant Ranks as Both ranks (TP batch)
  participant Next as Newer requests
  Client->>Engine: 60K-token prompt
  Engine->>Ranks: reserve, start (lane 1)
  Client--xEngine: closes the connection 15 s in
  Engine->>Lease: requestCleanStop()
  Lease-->>Engine: declined (a lane with no token yet)
  Engine->>Lease: cancel()
  Lease->>Ranks: cancel lane 1
  Ranks-->>Lease: retired (cancelled) at the next step boundary
  Next->>Ranks: served at once
Loading

Before / After: code

flowchart TB
  subgraph Before
    direction TB
    b1["DistributedCBv2Engine.stop(.cancelled)"] --> b2["lease.requestCleanStop()"]
    b2 --> b3["ClusterWorkerRequest: accepted, cleanStopRequested"]
    b3 --> b4["ranks prefill to the first token"]
    b4 --> b5["tokenDecision(.cleanStop): finished, retired"]
  end
  subgraph After
    direction TB
    a1["DistributedCBv2Engine.stop(.cancelled)"] --> a2["lease.requestCleanStop()"]
    a2 --> a3{"lanes retire alone and no token yet?"}
    a3 -->|"yes"| a4["false: engine calls lease.cancel()"]
    a4 --> a5["both ranks retire that lane at the next step"]
    a3 -->|"no"| a6["accepted: clean stop at the next token, as before"]
  end
  classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d;
  classDef good fill:#dcfce7,stroke:#15803d,color:#14532d;
  class b4 bad;
  class a4,a5 good;
Loading

Refactor Pass

A dedicated refactor subagent reviewed the fix and added one signed commit (5786f46ad8). Behaviour is unchanged.

  • The missing guard: testALaneThatProducedATokenKeepsTheCleanStop (RemoteChecks). On a lane pair the consumer leaves at its first token and, from inside the token callback, does what the engine does. The lane takes the clean stop and no rank is told to cancel. I also ran two mutants of the fix: the token flag never set, and the flag set only after the token reached the consumer. Each fails all 3 of the new test's assertions, and the class's other 6 tests pass.
  • Comments made accurate for lane pairs: ClusterWorkerPair.shutdown and ClusterWorkerPairTiming.cleanStopWaitNanoseconds said a cancel ends the ranks. On a pair whose lanes retire alone it ends only that lane, and a lane still in its prompt is now cancelled without the clean-stop wait. ClusterWorkerRequest.requestCleanStop's doc states the lane exception with the rule it qualifies.
  • Docs: docs/architecture/inference.md says the pair's shutdown also cancels such a lane without waiting. docs/developer/test.md lists the new check. The changelog entry is in plain words and states its limit: a pair that serves one request at a time still runs the prompt to its end.
  • Callers, no change needed:
    • The engine's stop(.cancelled) covers a consumer that leaves, an admission or submission cancel, and a host stop. It falls back to lease.cancel(), which retires only that lane: no fence, no pair failure.
    • ClusterWorkerPair.shutdown cancels a lane still in its prompt at once. Both ranks retire the lane and still answer the shutdown.
    • drainAndShutdown waits for every request's release before shutdown, so it never asks for a clean stop or cancels.
    • DistributedPipeRequestLease.requestCleanStop records a consumer stop only when the pair's request accepts it.
    • producedToken is written and read under the request lock, and it is set before the token reaches the consumer.
  • Revalidated at 5786f46ad8:
    • RemoteChecks: 87 XCTest + 3 Swift Testing, 0 failures.
    • LinkWorkerChecks: 16/16.
    • ProcessChecks (focused): pass, including clean stop (4 groups) and clean-stop pipe (2).
    • QualificationChecks: 79/80. The 80th is the same sandbox-only PairDriverTests.testRefusesWhileAWorkerFromThisPathIsStillRunningAndCountsIt, which fails identically on dev.
    • make docs-check, make docs-impact-check BASE=dev, make changelog-check, git diff --check: pass.
  • Follow-up, not in this PR: a scripted check of the pair's shutdown with a lane still in its prompt, which needs both scripted ranks to hold the request.

@jonathan308

Copy link
Copy Markdown
Collaborator Author

PR body of fix/uninstall-member-tells-leader at de739bd8dc, merged into integrate/devnet-round-2 as a4404ad933.

Summary

Uninstalling the member of a serving pair, beside the other install on the same Mac, no longer leaves the leader looping (pair-2's P2-16). Before, step 2 stopped this install's cluster service with SIGTERM, as cluster stop --local-only does, and the leader logged "this Mac's part ended (exit 1) … starting it again" for a member that was gone.

Now step 2 first asks the pair to stop on both Macs, as darkbloom stop on either Mac does; then it stops this install's service and removes its agent. When the other Mac doesn't answer, only this Mac's part stops, as before, and the summary ends with that Mac's name and the command to run there. The shared pairing, cable port setup and cluster files stay exactly as before.

Linked issue

Closes # (pair-2 DevNet validation, P2-16; follow-up to #1780)

Test plan

  • swift build --build-tests (prod and dev identities)
  • Prod, sandboxed: swift test --skip-build --filter 'ProviderUninstallTests|UninstallCommandTests|LaunchAgentRemovalTests|LaunchAgentLifecycleTests|WatchdogLaunchAdapterTests|ClusterServiceAgentTests': 96/96 (3 new tests)
  • Prod, sandboxed: fix(cluster): on a paired Mac, darkbloom start/stop/restart/status control the pair; plain cluster status --json (stacked on #1764) #1774's stop-path set: 66 in 9
  • Dev identity, sandboxed: ProviderUninstallTests|UninstallCommandTests: 33/33
  • The wait line: red (compile), then green
  • Red first: a runtime probe at 6497e8e7a8 found no pair stop before the service's; the new tests didn't compile there
  • make docs-check, make docs-impact-check BASE=6497e8e7a8, make changelog-check, git diff --check
  • On pair-2: §5.4 again (uninstall the serving member's DevNet app); the leader should log a clean stop instead of "part ended (exit 1) … starting it again"

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes. It uses the existing pair stop of darkbloom stop / cluster stop.
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated: docs/provider/cli-reference.md (darkbloom uninstall, step 2) and docs/provider/troubleshooting.md.
  • No documentation needed — reason:

Changelog

  • Added or updated this PR's unique changelog.d/<topic>.md fragment and ran make changelog-check. A line in the still-unreleased changelog.d/provider-uninstall-keep-or-remove.md.
  • No user-visible change, or an explicitly authorized release/history change.

Notes for reviewers

  • The new seam is ProviderUninstall.Operations.stopBothMacs, returning PairStopOutcome: .stopped, .notServing or .noAnswer(why). The command wires it to Uninstall.stopBothMacs, the pair stop darkbloom stop runs: ClusterPairActions.live(config: nil), resume(), Cluster.Stop.pairStop(role:serving:), then stop(). It says what it waits for first. A leader stops both Macs; a serving member asks the leader. It does not remove any agent; --service / removeFromLogin would remove the other install's agent too.

  • Order in the shared step 2:

    1. refuse a service it can't tell apart (unchanged);
    2. ask the pair to stop, only when the running service is this install's;
    3. boot out this install's own agent, then SIGTERM a session service of this install (unchanged).

    The check right before the first deletion is unchanged.

  • No answer: the run doesn't fail. This install is gone either way, but the summary ends with "The other Mac () did not answer, so its part may keep restarting: run <cli> cluster stop on it."

  • Unchanged:

    • the other install's running service (the pair isn't asked);
    • the one-install path (cluster stop --service already asks the leader);
    • the pairing, the cable port setup and ~/.darkbloom/cluster*.
  • Tests use stand-ins for the lock holder, its stop and the pair's stop: never real launchd, processes or network.

Before And After

flowchart LR
  subgraph Before["Before (pair-2 §5.4)"]
    direction TB
    b1["darkbloom-dev uninstall on the serving member<br/>(production app also on this Mac)"] --> b2["step 2: SIGTERM this install's service<br/>(as cluster stop --local-only)"]
    b2 --> b3["leader: 'this Mac's part ended (exit 1) … starting it again'<br/>'the lease to the other Mac did not go through' — loops"]
  end
  subgraph After
    direction TB
    a1["darkbloom-dev uninstall on the serving member"] --> a2["step 2: stopPair()<br/>(as darkbloom stop: the member asks the leader; both stop)"]
    a2 -->|stopped| a3["SIGTERM this install's (now idle) service; remove its agent"]
    a2 -->|no answer| a4["local stop as before;<br/>summary: 'The other Mac (name) did not answer … run `darkbloom-dev cluster stop` on it.'"]
    a3 --> a5["check before deleting → delete this install's files<br/>pairing, cable, cluster files stay"]
    a4 --> a5
  end
Loading
flowchart LR
  subgraph Code["Code path (After)"]
    direction TB
    c1["ProviderUninstall.run (shared path)"] --> c2["removeOwnClusterService(label, keptFor:, otherMac:, operations:)"]
    c2 --> c3["operations.stopBothMacs()<br/>Uninstall.stopBothMacs: says the wait line → resume → Cluster.Stop.pairStop → stop()"]
    c2 --> c4["ClusterServiceAgent.remove(label:) · operations.stopClusterService(pid)"]
    c1 --> c5["summary: otherMacNoAnswerLine when the pair did not answer"]
  end
Loading

Refactor Pass

The dedicated refactor subagent ran. Verdict: changed. Two signed commits on 4a3b0f0afc; the head is now de739bd8dc.

  • Fix (adds behaviour; red first): beside the other install, step 2 asks the pair to stop, and that stop can wait up to 330 s while accepted requests finish. Until now the uninstall printed nothing after → Remove this install's cluster service.

    • It now says Asking the pair to stop; accepted requests finish first (up to about 6 min). once, right before it waits, and only when it asks the pair.
    • The line is ProviderUninstall.pairStopWaitLine, said by Uninstall.stopBothMacs.
    • Red: against the refactor commit, the test did not compile (extra argument 'say'). Green after the fix.
  • Refactor (no behaviour change):

    • Operations.stopPair is now stopBothMacs, and PairStop is now PairStopOutcome. The live closure used this PairStop and Cluster.Stop.PairStop / pairStop in the same lines, and stopBothMacs is the CLI branch's name for the same stop.
    • otherMacStillServingLine is now otherMacNoAnswerLine.
    • The live pair stop is now Uninstall.stopBothMacs(_:say:), over ClusterPairActions as darkbloom stop builds them. A test with stand-in actions now covers it.
  • Docs: cli-reference.md step 2 no longer says both "the pair is not stopped" and "the pair is asked to stop first", and it names the wait line. The changelog line is updated.

  • Checked and left:

    • The detached stop blocks one pool thread for its bound and is not cancelled with the run, as with cluster stop --service.
    • A throw counts as no answer. .noAnswer also covers an unreachable cluster or the leader's own failure; the step's detail says which.
    • "the other Mac (name)" is built by hand in three places, though ClusterOnboardingMacName.other(named:) exists. That's a follow-up.
  • Validation:

    Every test run was sandboxed, filtered and --skip-build.

@jonathan308

Copy link
Copy Markdown
Collaborator Author

PR body of docs/changelog-0108-wording at 1dc9271662, merged into integrate/devnet-round-2 as 96dbac97c8.
Title: docs(changelog): plain words for the 0.10.8 cluster fragments

No PR body was written for this branch; this one is composed from its report (prepare-0.10.8.md §8).

Summary

Plain words for four 0.10.8 changelog fragments, read as a user would. The internal terms ("candidate", "tensor
assistant", "scope switch") are gone, and each changed sentence was checked against the code or the canonical docs.
Docs only: 4 files in changelog.d/, +21/−22.

Linked issue

None: the 0.10.8 preparation's changelog review (overnight/prepare-0.10.8.md §4 and §8).

Test plan

  • make changelog-check: 54 valid fragments.
  • make changelog-preview: exit 0, 54 entries under ## Unreleased. The 16 dev fragments for 0.10.8 were read in
    full, rendered on their own, as a user would.
  • make docs-check: 207 files OK.
  • git diff --check 6497e8e7a8 HEAD: clean.

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs (changelog fragments only)

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated
  • No documentation needed — reason: changelog wording only; each sentence was checked against the canonical docs.

Changelog

  • Updated existing unreleased fragments (no new one) and ran make changelog-check.
  • No user-visible change, or an explicitly authorized release/history change.

Notes for reviewers

Each change, with what it was checked against:

1. cluster-candidate-findings.md (#1781). I edited only the existing text: the title, bullet 1 and the end of bullet 2. The last bullet (DevNet command names) is byte-identical, so another branch's appended bullet merges cleanly; git merge-file with a simulated append exits 0.

  • Title: "Two-Mac cluster: findings of the 0.10.8 candidate on real Macs" → "Two-Mac cluster: Serve locally only starts the faster local plan, and a closing link names the other Mac".
  • "…so Qwen 3.8 27B tensor parallel keeps its tensor assistant (the candidate measured 15.7 tok/s without it, 36–39 with it on the same pair)" → "…so Qwen 3.8 27B in tensor parallel keeps the speculative assistant that only local serving uses (measured on one pair: 15.7 tok/s without it, 36–39 tok/s with it)".
  • "the title no longer shows the internal "starting; " word" → "the ✗ title no longer begins with "starting; "".
  • Checked against:
    • commit e1d7c292b9 (B14: 15.7 against 36–39 tok/s, on one pair);
    • two-mac-cluster.md: "the speculative assistant … only on a cluster that serves locally only"; with mtp_mode = "on" such a pair is not offered and serves on the local API, so "only local serving uses" holds either way;
    • ClusterOnboardingLive.keepsEndingTitle/endsClause, which drop the progress head "starting".

2. cluster-start-says-serving-only-when-loaded.md (#1764). The last bullet ended "…until its solo server answers; the other Mac shows it as the same outcome block, and its setup now ends by pointing to the leader's screen." It now ends "…until its solo server answers. The other Mac shows the same outcome block, and its setup ends with the same ✓ or ✗ as the leading Mac."

3. cluster-console-clarity.md (#1778).

Qwen, said once, with why. Two bullets became one.

  • Before: "Choosing tensor parallel plans for Qwen 3.8 27B as for any model; its pipeline modes stay out, as its features (images, video, committed-token logprobs) need tensor parallel, and a forced pipeline says so instead of an internal error." plus "A mode is offered only if it keeps every feature: Qwen 3.8 27B offers tensor parallel only (pipeline would drop its image, video and logprob support). The mode is chosen on the leading Mac; a choice forwarded from the other Mac uses the planner's mode."
  • After: "A mode is offered only where it keeps every feature of the model. Qwen 3.8 27B is therefore offered in tensor parallel only: in pipeline it would lose image and video input and logprobs. Choose the mode on the leading Mac; a model chosen on the Mac that follows starts in the mode Darkbloom's plan picks."
  • Checked against two-mac-cluster.md ("…a model chosen on the following Mac is passed to the leading Mac without its mode, so it starts in the planner's mode") and commit 8a9993ebd7 (B4).
  • Dropped "plans as for any model" and "a forced pipeline…" on purpose:
    • the internal error was a pre-release bug of the new mode choice, never in 0.10.7;
    • forcing a mode is the developer setting DARKBLOOM_CLUSTER_FORCE_MODE, which release builds refuse (ClusterForcedModeSetting).

The joining Mac's ending. Two bullets became one, and "Only a leader on an older build leaves it to test the pair itself." is dropped: a pair of mixed builds can't serve together, and the notes say both Macs must run 0.10.8.

  • After: "…follows the start, and ends with the leading Mac's own outcome instead of a test of its own: ✓ with the leading Mac's response time, or the same ✗ and reason ("Choose Retry on the other Mac" after ✗). Both windows tell the same story, serving locally only or through Darkbloom, also when the leading Mac's test request fails or when it checks with Darkbloom before it offers the pair (until then, neither Mac's status shows ✓). q leaves and the pair keeps going."
  • That replaces "(its status says so until it has, as a start, never ✓)".
  • Checked against two-mac-cluster.md steps 2 and 3.

The registration line, its own bullet.

  • Before: "…instead of the approval line."
  • After: "…instead of "Registered with the coordinator as a cluster member" and the approval's ID, which read as if Darkbloom had already accepted the pair."
  • Checked against ClusterOnboardingReady.registeredNotice (also in v0.10.7) and offeredLine, whose comment says the approval line read as "accepted".

"Scope switch".

  • Before: "…a failed test of the serving model (or its Retry, or a scope switch's test) after a passing start shows ✗ with "The last test from the leading Mac failed." instead of the start's time under ✓, and a scope switch clears both results."
  • After: "The status shows the leading Mac's latest test. When a later test fails (testing the serving model again, its Retry, or the test after switching between local only and serving through Darkbloom), the status shows ✗ with "The last test from the leading Mac failed." instead of the earlier ✓ and response time. Switching between local only and serving through Darkbloom clears the test results, as a new start or a stop does."
  • Checked against commit 9bfc59e977: clearTestResults runs on the next start or serve, a scope switch and a stop.

4. provider-uninstall-keep-or-remove.md (#1772, #1780), optional.

  • Before: "Both choices stop serving the way darkbloom stop does, stop this Mac's part of a two-Mac pair, remove every…"
  • After: "Both choices stop serving the way darkbloom stop does. On a Mac in a two-Mac pair, that means both Macs stop, from either Mac, and this Mac's cluster service is turned off; when the other Mac doesn't answer, only this Mac's part stops. Then they remove every…"
  • Checked against UninstallCommand.stopClusterPart: it runs cluster stop --service, and falls back to --local-only when "the pair could not stop together (the other Mac did not answer)". Also against two-mac-cluster.md "Uninstall" ("the pair stops first, from either Mac").

Before And After

The before → after of each sentence is under Notes for reviewers.

Refactor Pass

Not run: a wording-only change to four changelog fragments, with no code. Each changed sentence was checked against the
code or the canonical docs, as listed above.

@jonathan308

Copy link
Copy Markdown
Collaborator Author

PR body of docs/agent-setup-first-run at f35866d88a, merged into integrate/devnet-round-2 as 7ef22a01a0.
Title: docs(provider): agent setup guide after its first real run: DevNet variant, Local Network, the fixed build

Summary

An AI agent followed docs/provider/agent-setup.md literally to set up a two-Mac pair (M3 Ultra leads, M5 Max follows)
with the DevNet build of dev at 6497e8e7a8, and found 12 guide bugs. This PR fixes them and describes the build
that ships with the product fixes for that run. It adds:

  • a marked DevNet variant (darkbloom-dev, the DevNet installer, Darkbloom Dev.app; a pair's local API on 8000 in
    both apps);
  • the person's Local Network step in System Settings, without waiting for a prompt;
  • the screens that now say when macOS keeps a Mac off the local network;
  • the fixed Retry and leaving, doctor's saved-setup rule, and the waiting lines of stop, restart and a scripted
    start.

Linked issue

None filed: the 2026-11-04 DevNet validation of dev @ 6497e8e7a8 on pair-2 (guide bugs G-1 to G-12; product bugs
P2-1 to P2-16).

Test plan

  • G-1 to G-12 fixed at the lines the validation named; lines that described since-fixed bugs replaced with the fixed
    behaviour.
  • Every quoted line checked against the fix heads' code (117 lines: 65 found as literals, the rest confirmed as
    composed strings or from the run's screens). The only ones not in Darkbloom code are the coordinator's HTTP errors
    and codesign output.
  • make docs-check (207 files OK), make docs-impact-check BASE=6497e8e7a8 (coverage OK),
    make changelog-check (54 valid fragments), git diff --check (clean); 19 in-page anchors resolve.
  • A second literal run by an agent (the owner's Hermes agent) on the fixed build, on production and on DevNet.

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated: docs/provider/agent-setup.md. The DevNet names link to their canonical table
    (dev build identity), and the two-installs uninstall
    links to the CLI reference.
  • No documentation needed — reason:

Changelog

  • Updated changelog.d/provider-agent-setup-guide.md (one bullet) and ran make changelog-check.
  • No user-visible change, or an explicitly authorized release/history change.

Notes for reviewers

  • Merge after the fix branches it describes; until they land, several quoted lines don't exist in dev:
    • fix/cluster-local-network-truth @ 9a1d633ddd: the onboarding stack, with Local Network truth (P2-1), the
      scripted start's lines (P2-3), Retry and leaving (P2-4) and the joining Mac's lines (P2-7);
    • fix/cluster-cli-devnet-findings @ 935dbe4779: darkbloom-dev everywhere in the DevNet app (P2-2), the waiting
      lines (A-11), doctor's saved-setup rule (P2-5), the follower's 3 s / 10 s status (P2-8), and the port docs;
    • fix/uninstall-member-tells-leader @ 4a3b0f0afc: uninstall asks the pair to stop first (P2-16).
  • Those two branches conflict in ClusterService.swift, ClusterLinkFollowerCommand.swift and
    ClusterPairCommands.swift. The guide quotes lines from both sides of ClusterPairCommands.swift (P2-3's and A-11's),
    so the resolution must keep both.
  • Not covered: fix/cluster-cancel-mid-prefill (P2-9), since the guide doesn't cover clients leaving mid-request.
  • Still true and kept:
    • after installing the other app on a paired Mac, choose Start over on both Macs (P2-14 isn't fixed);
    • the card's login line is given only as an example; verify checks service.starts_at_login on each Mac, so the guide
      holds before and after the card reads the other Mac's startsAtLogin;
    • whether macOS prompts a headless Mac's login agent is unverified, so the person checks System Settings.

Before And After

flowchart TB
  subgraph Before["Before (the guide in dev at 6497e8e7a8)"]
    A1["agent reads agent-setup.md"] --> B1{"DevNet?"}
    B1 -->|"rule 9 forbids darkbloom-dev"| X1["refuse, or guess every name"]
    A1 --> D1["step 2: doctor exit 1 on cluster savedConfiguration"] --> S1["STOP"]
    A1 --> P1["step 5.3: wait for a Local Network step"] --> N1["never shown; macOS blocks the other Mac's link"]
    N1 --> F1["✗ did not answer over the cable: no matching row"]
  end
  subgraph After["After (the fixed build)"]
    A2["agent reads agent-setup.md"] --> B2{"network the person chose"}
    B2 -->|production| P2["steps 1–7"]
    B2 -->|DevNet| V2["DevNet (testers only): darkbloom-dev, DevNet installer, Darkbloom Dev.app, pair API on 8000"] --> P2
    P2 --> D2["step 2: no cluster FAIL before the first setup; chmod 600 line if the file is open to others"]
    P2 --> L2["step 5.3: STOP; the person turns on Local Network in System Settings on each Mac"]
    L2 --> C2["verify: cluster status --json on each Mac"]
    L2 -->|"still off at the start"| T2["✗ at once: macOS keeps Darkbloom there off the local network → turn it on, Retry"]
  end
Loading

Refactor Pass

A dedicated refactor subagent reviewed docs/provider/agent-setup.md at 606bdc561c. It read the page as an agent that
follows it literally, on production and on DevNet. It checked 30 quoted screen lines against the fix heads' code, with
file and line: fix/cluster-local-network-truth @ 9a1d633ddd, fix/cluster-cli-devnet-findings @ 935dbe4779 and
fix/uninstall-member-tells-leader @ 4a3b0f0afc. They also match those branches' later tips, f4eae6bb3b and
de739bd8dc. All 30 match. The port rule matches ClusterLocalServing.sharedPort. All 31 anchors resolve. One signed
commit, f35866d88a (+21 −17, page only):

  • The card's login line holds before and after the per-Mac card change: step 7.3 gives
    Starts by itself at login on both Macs. as an example only and says verify checks it on each Mac. Verify now says
    what to do when service.starts_at_login is false on a Mac: the person runs darkbloom cluster there (the
    product's own hint).
  • A DevNet command fix: ~/.darkbloom-dev/"Darkbloom Dev.app" is quoted, so step 1.4's codesign commands work when
    the DevNet names are substituted.
  • Wording:
    • the joining Mac ends with the same ✓ or ✗ block;
    • the Local Network prompt line is an example (over SSH it names this Mac's screen);
    • Retry is chosen where the ✗ offers it;
    • System Settings paths use → throughout.

Gates: make docs-check (207 files OK), make docs-impact-check BASE=6497e8e7a8 (coverage OK), make changelog-check
(54 valid fragments), git diff --check (clean). Merge-tree is clean against all the fix heads.

…ments

Release Integrity's test-provider-identity.py allows the DevNet and staging names only in the generated identity. Three doc comments added in this round quoted them; they now say the value comes from the build identity.

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 — 41a73a8d Deployed Nov 4, 2026 by vercel[bot]
Preview – d-inference-landing — 41a73a8d Deployed Nov 4, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 41a73a8d Deployed Nov 4, 2026 by vercel[bot]
Preview – darkbloom-status — 41a73a8d Deployed Nov 4, 2026 by vercel[bot]
Preview – d-inference — 41a73a8d Deployed Nov 4, 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.

1 participant