Skip to content

doctor: a Local API section first, and no network checks on Only me (LS-6, R17) - #1906

Merged
jonathan308 merged 12 commits into
devfrom
feat/doctor-local-api
Nov 9, 2026
Merged

jonathan308 merged 12 commits into
devfrom
feat/doctor-local-api

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

LS-6, UX audit R17: a mode-aware darkbloom doctor. The quickstart's step 2 and the installer's first next step both run doctor. Before this PR it checked only what Darkbloom serving needs, and said nothing about the local API.

1. A LOCAL API section opens the report. No line shows the key or a speed. Every problem names the next command:

LOCAL API   (how this Mac serves you and your tools)
  [INFO] mode — Both, me first — Darkbloom pauses while you use this Mac, back after 2 idle minutes (serving now)
  [PASS] address — http://127.0.0.1:8001/v1 — up on port 8001
  [PASS] key file — ~/.darkbloom/local_token (`darkbloom local` shows the key)
  [PASS] OpenCode — points here (~/.config/opencode/opencode.jsonc)
  [WARN] Hermes — points at http://127.0.0.1:8000/v1, not this Mac's local API (http://127.0.0.1:8001/v1) (~/.hermes/config.yaml)
         ↳ fix: `darkbloom --hermes`
Line Cases
mode What the running provider serves, read as status reads it: Only me from its first load, "(starting)" until its API listens. Else [local] mode (saved). A saved choice that doesn't serve now is named. Not chosen yet: darkbloom start asks. On a pair: the pair's way (#1899's names) and where its API runs, or "this Mac is paired, but how the pair serves isn't chosen yet" (darkbloom cluster). A paired Mac serving alone (start --solo): its own way, "(this Mac serves alone, not the pair)"
address ✓ up on its port once it answers GET /health (2 s) · ✗ port doesn't answer → the command that starts it again as it serves now (below) · ✗ the address that couldn't listen → status's own fix with the next free port (--solo when serving alone) · Only me loading: "opens once its models are loaded" · ⚠ not running → darkbloom restart when the service is installed (it starts as saved), else darkbloom start · stopped pair · the other Mac runs the pair's API · a Mac whose own port passes the pair's API on (#1894) and can't now: ⚠ in status's words (memberAPIDown), e.g. "answers 503 for now", the other Mac away: wait, or darkbloom stop, then darkbloom start --solo
key file ✓ the file holding the API's key · ✗ none holds a running API's key → as the address line · none with --no-auth, or before the first start
OpenCode, Hermes Read and judged by start's own reader and check (#1904's ToolAddress): ✓ points here · ⚠ points elsewhere, at another key file (one holding the same key is fine), or has no address → darkbloom --opencode / --hermes · ⚠ config can't be read (why) · not set up (with the command). With no local API, only a tool still pointing at one is shown → darkbloom start --choose (darkbloom cluster on a pair)

The fix that starts a running local API again keeps the way it serves now:

Running now Fix
Only me in a terminal (start --local --here) press Ctrl-C in its window, then darkbloom start --local --here. restart never stops it, and would serve the saved choice in the background
The background service, serving the saved choice (or nothing saved) darkbloom restart
The background service, serving another way darkbloom start --local, --me-first or --local-endpoint --no-me-first
A paired Mac serving alone the same with --solo
The pair's API darkbloom restart

2. On Only me, the network checks are skipped. They are:

  • the coordinator's detailed checks (account link, mdm enrollment, coordinator health, trust);
  • the attestation key, App Attest, attestation readiness, trust, coordinator traffic and billing sections.

One line says why: darkbloom network — not needed (Only me): …. "Only me" means one of:

Model fit, runtime, version, hardware and security stay. --coordinator <url> runs the network checks anyway. darkbloom verify is unchanged.

The review's changes (after #1899 and #1904)

The independent review (review-1906.md, on 194e58a464) asked for changes, and to wait for #1899 and #1904. Both are merged. This branch merged dev c5263deaf1 (8293a2c617), then:

  • red 96feeb7a4c: the tests, on seams that keep the behaviour of 194e58a464. 12 of 36 fail, with 42 issues;
  • green 12a920838a: the changes below.
Finding Change
C1 restart on Only me The fix per way of serving (table above). "— not running" names restart when the service is installed (N6)
C2 Only me loading read as the network servesOnlyItsOwner first, as status reads it: "(starting)", and the network checks stay skipped
C3 a paired Mac serving alone Described by what serves; onlyMe follows it; its bind failure is shown; its commands take --solo
C4 one reader, one set of names Every mode name is #1899's LocalFirstWords.choice; DoctorLocalAPI.name goes. The tools are read by #1904's reader, which gains a form that says why a config can't be read (ToolAddress.readPointer), and judged by one check for start and doctor (ToolAddress.miss). Doctor's own JSONC and YAML readers, its address rule and HermesConfigPlan.providerEndpoint go
N1, N2, N4 The address that failed; a pair that hasn't chosen says so (darkbloom cluster); a tool left on a Darkbloom network pair is told darkbloom cluster
N8 surviving mutants D1, D2, D3 and D5 are each caught now (below)
N9 This description

The confirmation (review-1906.md, "Confirmation") found one case left from #1894, merged after that head: on a pair's member whose relay answers 503 while the other Mac is away, doctor said "✗ … port 8002 doesn't answer", fix darkbloom restart. This branch merged dev 5347bc3b81 (8fbed03d4c), then:

  • red 0870400399: aRelayThatCantAnswerForThePairSaysWhyAsStatusDoes; 1 of 37 tests fails, with 5 issues;
  • green ce51f13229: the address line says status's words (ClusterPairSummary.memberAPIDown) as a ⚠, also for a port another program holds. Nothing new is read.

Before / After: what you see

flowchart LR
  classDef bad fill:#fde2e1,stroke:#c0392b,color:#222
  classDef good fill:#dff5e3,stroke:#1e8449,color:#222
  classDef step fill:#e8eefc,stroke:#2e5cb8,color:#222
  subgraph Before
    B1["darkbloom doctor<br/>(Only me user)"]:::step --> B2["⚠ account link · ⚠ trust level<br/>✗ coordinator health (offline)"]:::bad
    B2 --> B3["nothing about the local API,<br/>its port, key file or tools"]:::bad
  end
  subgraph After
    A1["darkbloom doctor"]:::step --> A2["LOCAL API first:<br/>mode · address/port · key file · OpenCode · Hermes"]:::good
    A2 --> A3{"Only me?<br/>(also while it loads)"}:::step
    A3 -->|yes| A4["network checks: not needed (Only me)<br/>model fit · runtime · version stay"]:::good
    A3 -->|no| A5["network checks as before"]:::good
    A2 --> A6["each problem: ↳ fix: the next command,<br/>never restart beside Only me in a terminal"]:::good
  end
Loading

Before / After: code path

flowchart LR
  classDef old fill:#f2f2f2,stroke:#888,color:#222
  classDef new fill:#fff4d6,stroke:#b7950b,color:#222
  classDef same fill:#e8eefc,stroke:#2e5cb8,color:#222
  subgraph Before
    D0["Doctor.run"]:::old --> C0["buildCoordinatorDoctorChecks (always)"]:::same
    D0 --> R0["DoctorRunner.buildOperatorDiagnosis<br/>(network sections inline)"]:::old
  end
  subgraph After
    D1["Doctor.run"]:::new --> L1["DoctorLocalAPI.live(reads:) → lines(networkChecks:)<br/>DiagnosticSection.localAPI (first)"]:::new
    L1 --> T1["DoctorToolSetup.read"]:::new
    T1 --> T2["ToolAddress.readPointer · ToolAddress.miss<br/>(start's reader and check, #1904)"]:::new
    L1 --> S1["LocalEndpoint.readLiveInfo/keyFile · GET /health<br/>LocalFirstWords.choice/serving/whyNotUp (#1899)<br/>ServiceDrain.soloProviderState · Restart.terminalOnlyMe"]:::same
    D1 -->|"not Only me, or --coordinator"| C1["buildCoordinatorDoctorChecks"]:::same
    D1 --> R1["buildOperatorDiagnosis(networkChecks:)"]:::new
    R1 -->|networkChecks| N1["networkDiagnosis<br/>(the network sections, billing included)"]:::new
  end
Loading

Legend: yellow is new or changed, blue is reused as it is, grey is replaced.

Validation

CPU-only, in a sandbox that denies ~/.darkbloom*, the GPU, binds and connections on 8000/47420–47423, and writes to LaunchAgents and the tools' configs. Each run gets its own home and local-API directory. Xcode 27.2, nice -n 19, prod identity. Green is ce51f13229, on dev 5347bc3b81; the tree tested is byte for byte the one committed.

Suite Result
DoctorLocalAPITests (two whole-command exit tests on Only me with a stub coordinator: without --coordinator, no /health or attestation request; with it, the network checks run) 37/37 pass (red: 12 fail, 42 issues; then the relay's: 1 fails, 5 issues)
Doctor* (11 suites) 87/87 pass
ClusterPairMemberRelayCLITests (#1894's status words) 17/17 pass
ToolAddressTests, HermesConfigPlanTests, OpenCodeConfigPlanTests, StartToolIntegrationTests, ToolIntegrationTests 10, 18, 16, 16 and 23 pass
DarkbloomCLITests whole, without the 7 suites that run the built binary and 2 Metal tests (CI runs them) 1381 tests in 186 suites pass
Env-gated mutants (local only, never committed; on 12a920838a), DoctorLocalAPITests + ToolAddressTests each 12/12 caught: the review's D1, D2, D3 and D5, which survived before; and one each for C1, C2, C3, the .local name, live's reads, N6, the same key in another file, and the 4 MiB limit
make docs-check, make docs-impact-check BASE=origin/dev, scripts/changelog.py check 211 OK, coverage OK, 62 valid

The tool readers are tested against the files the real --opencode / --hermes writers produce in a temp home. One test sets up OpenCode with localhost and another key file holding the same key, and Hermes with key_cmd: /bin/cat local_token. It checks that start's notice and doctor both find nothing wrong, and that no line holds the key.

Docs

  • cli-reference.md: "The Local API section", with the restart fixes; the --coordinator row; start's tool notice points to it.
  • troubleshooting.md: the doctor checks table.
  • local-first.md: "Check how this Mac serves".
  • quickstart.md: the Verify step.
  • tool-integrations.md: doctor reads and judges the tools with start's reader and check.
  • Changelog fragment: doctor-local-api.md.

Limitations / notes

  • The /health probe dials the address local.json names (loopback for 0.0.0.0).
  • Review nits left out of this PR:
  • The confirmation's nits, also left: the production defaults of DoctorLocalAPI.Reads (terminalOnlyMe, soloState, serviceInstalled) have no test of their own; a service serving Both while the saved choice is Only me is told darkbloom start --me-first, where restart would serve Only me.
  • DoctorRunner.networkDiagnosis holds all the network sections, billing included (from the refactor pass).
  • Refactor pass: 194e58a464 (refactor-1906.md). Independent review: review-1906.md.

jonathan308 and others added 2 commits November 7, 2026 20:56
UX audit R17: `doctor` (the quickstart's step 2, the installer's first
next step) checks the account link, trust, MDM and the coordinator, which
a local-only user can't fix and doesn't need, and misses the local API
(port, key file, tools). It reads no `[local]`.

The tests ask for a Local API section, first in the report:
- `mode`: what the running provider serves (read as `status` reads it),
  else the saved `[local] mode`; a saved choice that doesn't serve now is
  named; nothing saved: `darkbloom start` asks; on a pair, the pair's way
  and the Mac that runs its API;
- `darkbloom network`: on Only me, the network checks are not needed,
  with the command that changes how this Mac (or the pair) serves;
- `address`: up on its port once it answers; a port that doesn't answer
  (`darkbloom restart`); a port in use with the next free one, in
  status's words; not running (`darkbloom start`); a stopped pair; the
  other Mac that runs the pair's API;
- `key file`: present (`darkbloom local` shows the key); none holding a
  running API's key (`darkbloom restart`); none with `--no-auth`;
- `OpenCode`, `Hermes`: Darkbloom's provider points here, elsewhere, or
  at another key file (`darkbloom start --opencode` / `--hermes`); a
  config Darkbloom can't read; not set up; a tool left pointing at a
  local API on a Darkbloom network Mac (`darkbloom start --choose`);
- the tools' configs are read from the files `start --opencode` and
  `--hermes` write (the real writers, in a temp home);
- no line holds the key or a speed (a guard: it passes already);
- the whole command on a Mac set to Only me: the section first, none of
  the network checks, and no coordinator request.

Seams, with today's behaviour: `DiagnosticSection.localAPI`;
`DoctorLocalAPI` says nothing and never skips the network checks;
`DoctorToolSetup` reads no config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…network on Only me

UX audit R17.

- A Local API section opens the report (`DiagnosticSection.localAPI`,
  `DoctorLocalAPI`). No line shows the key or a speed; each problem names
  the next command:
  - `mode`: the running provider's way, read as `status` reads it (its own
    local API: Only me or Both; none: Both when it failed to open, else the
    network), else `[local] mode`, in the start summary's words
    (`LocalFirstWords.serving`); a saved choice that doesn't serve now is
    named; nothing chosen: `darkbloom start` asks; on a pair, the pair's
    way and the Mac that runs its API;
  - `address`: ✓ up on its port once it answers `GET /health` (2 s); ✗ a
    port that doesn't answer (`darkbloom restart`); ✗ an API that couldn't
    listen, fixed in status's words (`LocalFirstWords.whyNotUp`, with the
    next free port); ⚠ not running (`darkbloom start`); a stopped pair; the
    other Mac that runs the pair's API;
  - `key file`: ✓ the file the API's key is in (`LocalEndpoint.keyFile`);
    ✗ none holds a running API's key (`darkbloom restart`); none with
    `--no-auth` or before the first start;
  - `OpenCode`, `Hermes`: Darkbloom's provider in the tool's own config
    (the file `start --opencode` / `--hermes` choose): points here,
    elsewhere or at another key file (`darkbloom start --opencode` /
    `--hermes`), can't be read (why), or isn't set up. On a Darkbloom
    network Mac only a tool still pointing at a local API is shown
    (`darkbloom start --choose`). `DoctorToolSetup` reads OpenCode's JSONC
    with `JSONCDocument`, and Hermes' YAML with the planner's own reader
    (`HermesConfigPlan.setUp`, appended to its file).
- On Only me (the running provider serves only its owner, or nothing runs
  and `[local] mode = "local"`; a pair serving locally only), the network
  checks are skipped: the coordinator's detailed checks (one
  `darkbloom network: not needed (Only me)` check stands for them) and the
  attestation key, App Attest, attestation readiness, trust, coordinator
  traffic and billing sections (`DoctorRunner.networkDiagnosis`, moved
  unchanged; `buildOperatorDiagnosis(networkChecks:)`). Model fit,
  runtime, version, hardware and security stay. `--coordinator <url>`
  runs them anyway. `darkbloom verify` is unchanged.

Docs: cli-reference (the Local API section, `--coordinator`),
troubleshooting (doctor checks), local-first.md (Check how this Mac
serves); changelog fragment `doctor-local-api.md`.

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

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

Request Review

jonathan308 and others added 2 commits November 7, 2026 21:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1901 (merged) made `darkbloom --opencode` / `--hermes` the short form
every hint and doc names. The Local API section's tool lines now name it
too: "not set up (`darkbloom --opencode` sets it up)", and the fix for a
tool pointing elsewhere or at another key file. Tests, docs and the
changelog fragment follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its Verify step said `darkbloom doctor` checks the Darkbloom network
(daemon connected, trust level, account link). It now opens with the
Local API section and, on Only me, skips the network checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd tests for what nothing covered

The required refactor pass (AGENTS.md) for #1906. Behaviour is unchanged: every line `doctor` prints, and when it
prints it, stays as it was.

- One place for each decision:
  - `DoctorLocalAPI.runsNetworkChecks(coordinatorOverride:)` says when the network's checks run: on every Mac but
    one set to Only me, and there too with `--coordinator`. `Doctor.run` used to decide it inline, and the tests
    only through a `diagnostics` property that nothing else read. That property now lives in the tests, built on
    the same function.
  - How the pair serves (`pairMode`) is read once. `onlyMe`, `hasLocalAPI` and the mode line follow it, or this
    Mac's own way when it isn't paired.
  - "The pair's API runs on the other Mac" is one property, used by the address and key file lines.
  - Billing joins the other network sections in `DoctorRunner.networkDiagnosis`, so one `networkChecks` test
    leaves them all out. The report groups lines by section, so where billing sits in the list changes nothing.
  - The tools' names and the command that sets each one up come from `IntegrationTool.displayName` and
    `ToolIntegrationStep.command`, the words `darkbloom --opencode` / `--hermes` print, instead of copies.
- Names: `HermesConfigPlan.setUp(in:provider:)` reads a config and writes nothing, so it is now
  `providerEndpoint(in:provider:)`, like the `HermesEdit` method it calls.
- The mode line's two cases read top to bottom: what the running provider serves, else the saved choice.
- Comments say the rule that doctor never prints the key, where each read happens: of `local.json` only whether
  there is a key, and of the tools' configs only the path of the key's file (OpenCode's `{file:…}`, Hermes'
  `key_cmd`). A key written into a config is never read.
- Tests, none weakened. Four new ones, and one more check, cover what no test did:
  - a key written into OpenCode's or Hermes' config is never shown;
  - `GET /health` goes to `local.json`'s address (loopback for an any-address bind, `[::1]` bracketed), and only
    a 200 counts;
  - without the network's checks the operator diagnosis drops exactly the network's lines, billing included,
    and keeps the rest unchanged;
  - a pairing record that can't be read never skips the network's checks;
  - `--coordinator` runs the network's checks on Only me.
  They pass on the PR head's sources. Each catches a mutant that the PR's tests didn't exercise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…pple warning only when real, the member never guesses

The required refactor pass (AGENTS.md) for #1908. Behaviour is unchanged, and
the tests only gain checks: no expectation was dropped or loosened.

ProviderCore:
- `ClusterOnboardingAppleCheck.Mac.warns` names the rule for a real Apple
  warning: a Mac that reports no App Attest authorization, and is held back
  by its key-generation safeguard, or whose part has run 2 minutes without
  one, or whose part's age is unknown. A Mac with the authorization, or with
  no trust status yet, never warns. `look` uses it, and its check words are
  spelled once (`isChecking` reads the same prefix and suffix).
- `ClusterOnboardingPairWait.words` decides what the pair waits for (the
  committed start, else Apple's check of a new part, else the coordinator's
  pairing); `pairLook` calls it. `isProgress` reads those words as progress.
  Before, the choice was inline in `pairLook`, which no test runs, and
  darkbloom spelled the coordinator's two phrases again (`pairingProgress`,
  removed: `state(ofStatus:)` calls `isProgress`).
- Comments state the invariants where they hold: the pause comes only from
  the part that runs rank 0 and reaches the other Mac as text in the leading
  Mac's status (one state-file read per status, nothing per request, no new
  message on the link or the heartbeat); `MeFirstWords` makes its words with
  the clock of the Mac whose part wrote the snapshot, so two clocks never mix;
  only the leading Mac's look decides between Apple's progress words and the
  warning, and every reader reads its words.
- `offeredWaitingWords` capitalizes with `ClusterOnboardingMacName.sentence`.

CLI:
- `localAPILines`, `servingLook` and `screenLine` say why: a Mac whose part
  doesn't run rank 0 never works the pause out, and only the pair's own look
  says a start's pair already serves.

Tests:
- ClusterPairStatusWordsTests: a Mac with App Attest, or with no trust status
  yet, never warns, whatever its age or safeguard; the warning starts at
  exactly 2 minutes; of two real warnings, this Mac's; the wait's words and
  `isProgress`. Each catches a mutant the PR's tests let through (a verified
  Mac warns; a Mac with no trust status warns; `>` for `>=`; the last Mac
  named; the wait ignores Apple's check; Apple's check outranks the committed
  start).
- ClusterPairCommandsTests: one `startingThePair` beside `alreadyServes` and
  `openingScreen` instead of seven spellings; `stoppedPair(model: false)`
  instead of `noModelStoppedPair()`. ClusterPairBothMeFirstCLITests: one
  `member()` fixture; a test name no longer says "since when".

Kept: `LocalFirstWords.minutes` and `idleMinutes`, which forward to
`MeFirstWords`: the open #1906 adds a caller.

Checks (Xcode 27.2, prod identity, nice 19, CPU only, sandboxed): all of
DarkbloomCLITests minus the binary-running suites and the two Metal tests,
1,200 tests in 172 suites at the PR head and here; the touched CLI suites
(158 tests); ProviderCore's touched suites, 44 tests (42 at the PR head, +2);
the plain-swiftc onboarding checks (1,941) and control checks (682); the
console checks, 79,395 of 79,396 (the one left runs /bin/ps, which the
sandbox denies; CI runs it). A 36,620-line transcript of every word the PR's
code says over many states is byte-identical at the PR head and here, once
the durations in 144 lines, which `clusterStatusLines` measures from the wall
clock, are masked. 16 env-gated mutants. docs-check, changelog-check and diff
--check are clean; docs-impact fails its "native inference" mapping as it does
at the PR head (the onboarding sources sit under ProviderCore/Inference).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…un-again line

- R2, Ctrl-C: `ModelLoadWait.run` asks the watch right after each look,
  before "nothing loading" can end the wait, so a press in the last pause
  stops it even when that look sees the model loaded. The step asks once
  more as the wait returns, before it reads the list again or writes:
  "Stopped before setting up OpenCode; nothing was written. Run
  `darkbloom --opencode` again." Past the wait Ctrl-C does what it did.
  `InterruptWatch.begin` sets its signal source up before it ignores the
  signal, so no press between the two is lost.
- R3, the run-again line: `.ready` carries what the process has loaded by
  its own word (`warmModels`; nil without a state of its own, and for
  Only me's server, whose state names none). `notLoaded` names this Mac's
  listed models the process hasn't loaded; without its word, those listed
  without a context, as before. So a route that dials out, whose router
  lists the catalog's limits for a model that isn't loaded, no longer
  hides the line.
- R4, the address: `ToolAddress.sameAddress` compares scheme, host and
  port in any case (the scheme's own port when none is given) and the
  path without one `/` at its end; `localhost`, `127.0.0.1` and `::1` are
  one host, and so is this Mac's Bonjour name (`Local.localHostName()`, as
  `darkbloom local` prints it) for an API on every address
  (`thisMacsNames`). The rule #1906's `doctor` uses, here for both.
- The changelog fragment says the above, and that the wait and the notice
  are single-Mac for now.

Green (prod identity, CPU-only, sandboxed): ModelLoadWaitTests 18/18,
ToolAddressTests 10/10, StartToolIntegrationTests 16/16; DarkbloomCLITests
1234 tests in 174 suites (the usual hardware and slow skips).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 2 commits November 8, 2026 17:17
…ng alone, one tool reader (red)

#1906's independent review (review-1906.md) asked for changes once #1899
and #1904 merged. With dev merged, these tests ask for them:

- The fix that starts a local API again (its port doesn't answer, or no
  key file holds its key) keeps the way it serves now (C1):
  - Only me in a terminal: "press Ctrl-C in its window, then
    `darkbloom start --local --here`". `restart` never stops it, and
    would serve the saved choice in the background (the Darkbloom
    network, for one);
  - a service serving the saved choice, or with none saved: `restart`;
  - a service serving another way: `start` with that way's flag
    (`--local`, `--me-first`, `--local-endpoint --no-me-first`);
  - `--solo` where a paired Mac serves alone; `restart` for the pair's
    own API.
- A stopped service that is installed: `restart` starts it again as
  saved (N6); without one, `start`.
- Only me's server loading its models (no local API yet) is Only me,
  "starting", and the network's checks are skipped; the address line
  says the API opens once its models are loaded (C2). A network
  provider waiting for its schedule stays the network.
- A paired Mac serving alone (`start --solo`) is described by what
  serves: its own way "(this Mac serves alone, not the pair)", the
  network's checks by that way, and its bind failure with
  `start --solo --port` (C3).
- A failed bind is named by the address that failed (N1).
- A pair that hasn't chosen how it serves says so, with `darkbloom
  cluster` (N2). A tool left pointing at a local API on a Darkbloom
  network pair names `darkbloom cluster` (N4).
- The tools are read and judged as `start` judges them (C4):
  - `localhost`, and this Mac's `.local` name for an API on every
    address, are this Mac;
  - another file holding the same key is the same key;
  - a `key_cmd` without a full path names no key file;
  - a config over 4 MiB is refused unread;
  - a Darkbloom block without an address names the tool's command.
- `live` reads whether this Mac serves alone, Only me in a terminal,
  the service, and this Mac's names, through stand-ins
  (`DoctorLocalAPI.Reads`).

Four tests cover lines no test did (the review's surviving mutants), and
pass already:
- the pair's way decides Only me while it serves (D1);
- a paired Mac's saved port isn't the pair's address (D2);
- `--coordinator` runs the network's checks on Only me, end to end (D3);
- the key file is the running API's port's first (D5).
`addressesOnThisMacCompareByPortAndPath` goes: the address rule is
#1904's, and `ToolAddressTests` covers it.

Seams, with today's behaviour:
- `DoctorToolSetup.Found` takes `ToolAddress`'s shape (`.notSetUp`,
  `.entry(ToolPointer)`, `.unreadable`), still from doctor's own reader
  and comparison;
- `DoctorLocalAPI.Facts` gains `servingAlone`, `terminalOnlyMe`,
  `serviceInstalled` and `thisMac`, unused;
- `live` takes `Reads`, but reads none of those.

12 of the 36 tests fail, with 42 issues; `ToolAddressTests` passes.

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

The review's changes (review-1906.md), now that #1899 and #1904 are in
dev. The red commit's 12 tests pass, and so do the other 24.

- A local API that doesn't answer, or whose key no file holds, is
  started again the way it serves now (C1, `DoctorLocalAPI.restartFix`):
  - Only me in a terminal (`Restart.terminalOnlyMe`): "press Ctrl-C in
    its window, then `darkbloom start --local --here`". `restart` never
    stops it, and with an older job installed it would put the Mac back
    on the Darkbloom network;
  - the background service serving the saved choice, or with none
    saved: `restart`;
  - a service serving another way than the saved choice: `start` and
    that way's flag, since `restart` serves the saved one;
  - `--solo` where a paired Mac serves alone; `restart` for the pair's
    API.
- "— not running" with the background service installed: `restart`
  starts it again as saved, without `start`'s questions (N6).
- Only me's server is Only me from its first load (#1899's rule, as
  `status` reads it): the mode line says "(starting)", the address line
  that the API opens once its models are loaded, and the network's
  checks stay skipped (C2).
- A paired Mac serving alone (`ServiceDrain.soloProviderState`) is
  described by what serves, "(this Mac serves alone, not the pair)":
  Only me and the network's checks follow it, its bind failure says
  `start --solo --port`, and its commands take `--solo` (C3).
- A failed bind names the address that failed (N1). A pair that hasn't
  chosen how it serves says so, with `darkbloom cluster` (N2). A tool
  left on a Darkbloom network pair names `darkbloom cluster` (N4).
- One reader and one set of names (C4):
  - the mode names are #1899's `LocalFirstWords.choice`, also for the
    pair's; `DoctorLocalAPI.name` goes;
  - the tools are read by #1904's reader, which gains a form that says
    why a config that is there can't be read (`ToolAddress.readPointer`,
    `OpenCodeConfigPlan.readPointer`, `HermesConfigPlan.readPointer`;
    `pointer` is that without the reason, so `start` is unchanged);
  - each tool is judged by one check, `ToolAddress.miss`, which
    `start`'s notice uses too: `localhost` and this Mac's `.local` name
    are here, another file holding the same key is the same key, a
    `key_cmd` without a full path names no file, and a config over
    4 MiB is refused unread;
  - `DoctorToolSetup` is a thin read over it; its own JSONC and YAML
    readers, its address rule and `HermesConfigPlan.providerEndpoint`
    go.
- `live` reads all this through stand-ins (`DoctorLocalAPI.Reads`).

The key is still never printed: the running API's is read only for
whether there is one, and the tools' key files are compared, never shown.

Docs: the Local API table in cli-reference.md (with a table of the
restart fixes), local-first.md, troubleshooting.md,
tool-integrations.md, and the changelog fragment.

Checks: 1357 tests in 184 suites of DarkbloomCLITests pass (without the
suites that run the built binary). Twelve env-gated mutants, each
caught: the review's D1, D2, D3 and D5, which survived before, and one
each for C1, C2, C3, the `.local` name, `live`'s wiring, N6, the same
key, and the 4 MiB limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 3 commits November 8, 2026 18:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (red)

The confirmation of #1906's review (review-1906.md, "Confirmation")
found one case left, from #1894 (merged into dev at 02:01Z). On a pair's
member Mac that passes the pair's API on through its own port, while the
other Mac is away the relay answers 503. There `doctor` says:

  ✗ address — http://127.0.0.1:8002/v1 — its server runs, but port 8002
    doesn't answer
    ↳ fix: `darkbloom restart`

`status` says instead that the port answers 503 for now, that the other
Mac isn't reachable, and to wait, or run `darkbloom stop`, then
`darkbloom start --solo` (`ClusterPairSummary.memberAPIDown`).

The test (`aRelayThatCantAnswerForThePairSaysWhyAsStatusDoes`) asks for
`status`'s words in doctor's address line, as a ⚠ with no `restart`:
- with the other Mac away (the relay answers 503);
- with another program holding this Mac's port, where no relay runs.

No seam: the test reads #1894's fields of `ClusterPairSummary`. 1 of the
37 tests fails, with 5 issues; the other 36 pass on dev `5347bc3b81`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a pair's Mac that passes the pair's API on through its own port
(#1894), doctor's address line now says why that port can't answer for
the pair now, as `status`, `darkbloom local` and `start --opencode` say
it (`ClusterPairSummary.memberAPIDown`), as a ⚠:
- with the other Mac away, the relay answers 503: "http://127.0.0.1:8002/v1
  on this Mac answers 503 for now. Your pair's other Mac (…) isn't
  reachable; this Mac relays to it. Requests resume when it's back, or
  run `darkbloom stop`, then `darkbloom start --solo`, to serve this Mac
  alone." It was "✗ … its server runs, but port 8002 doesn't answer",
  fix `darkbloom restart`, which doesn't bring the other Mac back;
- with another program holding its port, or while Darkbloom doesn't
  have the pair, the line `status` gives for each.

Nothing new is read: `ClusterPairSummary.local()` already fills the relay
state. A Mac serving alone (`start --solo`) isn't asked, as before.

Docs: the Local API table in cli-reference.md, the list there of the
commands that say these words, troubleshooting.md, and the changelog
fragment.

Checks: `DoctorLocalAPITests` 37/37 (the red test passes); `Doctor*`,
`ClusterPairMemberRelayCLITests`, `ToolAddressTests` and
`StartToolIntegrationTests` pass; 1381 tests in 186 suites of
DarkbloomCLITests pass on dev `5347bc3b81` (without the suites that run
the built binary).

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