@tpsdev-ai/flair 0.55.2 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +3 -3
  2. package/dist/bridges/builtins/markdown.js +2 -2
  3. package/dist/bridges/discover.js +2 -2
  4. package/dist/bridges/runtime/allow-list.js +2 -2
  5. package/dist/build-info.json +3 -3
  6. package/dist/cli.js +10 -12
  7. package/dist/commands/attention.js +2 -2
  8. package/dist/commands/backup.js +2 -2
  9. package/dist/commands/doctor.js +39 -28
  10. package/dist/commands/export.js +2 -2
  11. package/dist/commands/federation.js +185 -38
  12. package/dist/commands/hook.js +4 -4
  13. package/dist/commands/init.js +30 -8
  14. package/dist/commands/mcp.js +2 -2
  15. package/dist/commands/migrate-harness-memory.js +8 -8
  16. package/dist/commands/rem.js +2 -2
  17. package/dist/commands/service.js +25 -1
  18. package/dist/commands/session.js +2 -2
  19. package/dist/commands/uninstall.js +2 -2
  20. package/dist/commands/upgrade.js +3 -3
  21. package/dist/doctor-client.js +5 -23
  22. package/dist/engine-version.js +2 -2
  23. package/dist/federation/scheduler.js +5 -5
  24. package/dist/install/clients.js +5 -10
  25. package/dist/keystore.js +10 -2
  26. package/dist/lib/auth-resolve.js +5 -5
  27. package/dist/lib/doctor-config-path.js +2 -2
  28. package/dist/lib/flair-paths.js +29 -0
  29. package/dist/lib/home.js +60 -0
  30. package/dist/lib/launchd-repair.js +6 -0
  31. package/dist/lib/mcp-enable.js +4 -4
  32. package/dist/lib/owned-pins.js +1 -13
  33. package/dist/lib/socket-path-limit.js +120 -0
  34. package/dist/lib/uninstall-purge.js +2 -18
  35. package/dist/lib/upgrade-plain-tree.js +2 -2
  36. package/dist/mcp-client-assertion.js +3 -3
  37. package/dist/rem/runner.js +3 -3
  38. package/dist/rem/scheduler.js +5 -5
  39. package/dist/rem/snapshot.js +2 -2
  40. package/dist/resources/OAuth.js +62 -11
  41. package/dist/resources/Presence.js +135 -47
  42. package/dist/resources/admin-layout.js +7 -2
  43. package/dist/resources/memory-reflect-lib.js +17 -1
  44. package/dist/src/keystore.js +10 -2
  45. package/dist/src/lib/home.js +60 -0
  46. package/dist/src/rem/scheduler.js +5 -5
  47. package/dist/version-check.js +2 -2
  48. package/dist/version-handshake.js +2 -2
  49. package/docs/api-reference.md +31 -6
  50. package/docs/auth.md +14 -2
  51. package/docs/deploying-on-fabric.md +5 -4
  52. package/docs/deployment.md +26 -37
  53. package/docs/embedding-in-a-harper-app.md +4 -2
  54. package/docs/entity-vocabulary.md +5 -5
  55. package/docs/federation.md +39 -19
  56. package/docs/hosted-on-fabric.md +7 -5
  57. package/docs/mcp-clients.md +29 -12
  58. package/docs/spoke-bringup.md +41 -22
  59. package/docs/standalone-local.md +12 -16
  60. package/package.json +1 -1
@@ -44,14 +44,14 @@ the schema section so the catalog is complete.
44
44
 
45
45
  | Class | Credential | Typical grant |
46
46
  |-------|------------|---------------|
47
- | **Public** | none | Discovery, health, OAuth well-known, Presence roster (field-allowlisted) |
47
+ | **Public** | none | Discovery, health, OAuth well-known. `GET /Presence` is public only when the instance opts in to a public roster (`PRESENCE_PUBLIC_ROSTER=true`) — by default it needs a verified reader. See [Presence for API consumers](#presence-for-api-consumers). |
48
48
  | **Ed25519 agent** | `TPS-Ed25519` header | Default agent path. Writes as self only. Reads follow the resource's read-scope (below). |
49
49
  | **Admin Basic** | Harper `HDB_ADMIN_PASSWORD` / `FLAIR_ADMIN_PASSWORD` | Whole-instance operator. Bypasses agent scoping, including `private` memory. Used by the web admin and `n8n-nodes-flair`. |
50
50
  | **Operator / internal** | Admin Basic, or a deliberate `internalContext()` call inside the process | Soul mutations and `AgentSeed`. Agent Ed25519 keys — including admin-agent keys — cannot author Soul. |
51
51
  | **Federation body-sig** | Ed25519 over the request body + timestamp/nonce; pairing uses a one-time token | `/FederationPair`, `/FederationSync`. Harper role gate is open; the handler is the auth boundary. |
52
52
  | **OAuth bearer** | Access token from Flair's AS or `@harperfast/oauth` | `/mcp` only, and only when `FLAIR_MCP_OAUTH=true` plus a public issuer. Off by default (path 404s). |
53
53
 
54
- Anonymous HTTP is denied on every agent-facing table. A by-id miss and a
54
+ Anonymous HTTP is denied on every agent-facing table (and on `GET /Presence`, which needs a verified reader unless the instance enables the public-roster opt-in). A by-id miss and a
55
55
  by-id deny both return **404**, never 403, so ids are not an existence oracle.
56
56
 
57
57
  ### Read-scope vocabulary
@@ -107,8 +107,8 @@ is `GET /Name/<id>` unless noted.
107
107
  | POST | `/Agent` | Admin Basic | Create principal. Also `POST /AgentSeed` (operator/internal only — not an admin-agent key). |
108
108
  | PUT / PATCH | `/Agent/<id>` | Ed25519 | An agent updates **only its own** record. |
109
109
  | DELETE | `/Agent/<id>` | Admin Basic | Deprovision. |
110
- | GET | `/Presence` | Public | Roster, field-allowlisted. `currentTask` is null for anonymous callers; verified agents see the text. |
111
- | POST | `/Presence` | Ed25519 | Heartbeat. Agent writes only its own row (403 cross-agent). Stamps `flairVersion` / `harperVersion`. |
110
+ | GET | `/Presence` | Verified reader | Roster. Requires a valid `TPS-Ed25519` agent signature or the admin credential; an anonymous request gets 401. An instance may opt in to a public roster with `PRESENCE_PUBLIC_ROSTER=true`, in which case an unverified reader gets the allowlisted roster with `currentTask`, `flairVersion`, and `harperVersion` as null. Thresholds: [Presence for API consumers](#presence-for-api-consumers). |
111
+ | POST | `/Presence` | Ed25519 | Heartbeat. Agent writes only its own row (403 cross-agent). Stamps `flairVersion` / `harperVersion` on the row. |
112
112
  | PUT / DELETE | `/Presence/<id>` | Ed25519 | Own row only. Collection PUT is not a public bypass. |
113
113
  | GET | `/Soul`, `/Soul/<id>` | Ed25519 | Any verified agent; unscoped (identity/discovery). |
114
114
  | POST / PUT / PATCH / DELETE | `/Soul` | **Operator / internal** | Not Ed25519. Learned Memory text cannot be copied in as Soul. See [docs/auth.md](auth.md#soul-authorship). |
@@ -295,8 +295,33 @@ client-writable even if a client sends them. Full comments live in
295
295
  | `currentTask` | String | Free text; verified-agent read only |
296
296
  | `activity` | String | `coding` \| `reviewing` \| `planning` \| `debugging` \| `idle` |
297
297
  | `activityUpdatedAt` | BigInt | When activity/task were asserted |
298
- | `flairVersion` | String | Serving `@tpsdev-ai/flair` version |
299
- | `harperVersion` | String | Serving Harper version |
298
+ | `flairVersion` | String | Serving `@tpsdev-ai/flair` version. Null when redacted or never stamped — see below. |
299
+ | `harperVersion` | String | Serving Harper version. Same redaction. Also null when the server could not resolve Harper's version. |
300
+
301
+ ### Presence for API consumers
302
+
303
+ `GET /Presence` requires a **verified reader** by default. A verified reader is a request carrying a valid `TPS-Ed25519` agent signature from an agent registered on this instance, or the admin credential. An anonymous — or otherwise unverified — request gets **401**, not a redacted roster. The roster is org-visible data (who is working, on what class of activity, and how recently) and is not published by default.
304
+
305
+ An instance that runs a public status page opts back in with the presence config key `PRESENCE_PUBLIC_ROSTER=true` (the same env-var channel as the thresholds below); it is **off by default** and is documented as *publishes your roster to the internet*. With it on the behaviour is exactly as it was before: an anonymous caller gets the field-allowlisted roster (id, display name, role, runtime, activity fields, `presenceStatus`, `lastHeartbeatAt`), and three fields are redacted to `null` unless the request carries a valid `TPS-Ed25519` agent signature: `currentTask`, `flairVersion`, and `harperVersion`. Anonymous callers, unsigned loopback, Basic admin, and in-process calls without that signature are unverified readers of the content gate. The nulls are intentional. Version strings are withheld so a public roster cannot fingerprint the instance (the same split as public `/Health` versus Ed25519 `/HealthDetail`). A null `flairVersion` on an unverified read does not mean the peer lacks a version, and it does not mean the peer cannot accept a directed handoff.
306
+
307
+ A verified reader still sees `null` for a version the row never stored. Heartbeats stamp the running server's versions; a row written before that stamp, and not heartbeated since, has no value to return. `harperVersion` is also null when this process could not resolve Harper's package version. That null means unknown, not redacted.
308
+
309
+ `presenceStatus` is liveness of `lastHeartbeatAt`. The idle threshold defaults to 90 seconds and the offline threshold defaults to 10 minutes. A tuned instance overrides those numbers with `PRESENCE_IDLE_THRESHOLD_MS` and `PRESENCE_OFFLINE_THRESHOLD_MS` (milliseconds). Read the live values from those variables; the 90s and 10m figures below are only what an unset process uses. An unset, empty, zero, or non-numeric value falls back to that default:
310
+
311
+ | Age of `lastHeartbeatAt` | `presenceStatus` |
312
+ |---|---|
313
+ | Missing, or not a finite number | `offline` |
314
+ | Negative (stamp ahead of the server clock) | `active` |
315
+ | Younger than the idle threshold (`PRESENCE_IDLE_THRESHOLD_MS`, default 90s) | `active` |
316
+ | Younger than the offline threshold (`PRESENCE_OFFLINE_THRESHOLD_MS`, default 10 min) | `idle` |
317
+ | At or beyond the offline threshold, when the idle threshold is at or below it | `offline` |
318
+ | At or beyond the idle threshold, when the idle threshold is above the offline threshold (the idle status never occurs then) | `offline` |
319
+
320
+ The rows are checked in that order and the first match wins. `derivePresenceStatus` (`resources/Presence.ts`) returns `active` while the age is strictly below `PRESENCE_IDLE_THRESHOLD_MS`, even when that age is already at or past `PRESENCE_OFFLINE_THRESHOLD_MS`. The ordering these rows describe is an idle threshold strictly below the offline threshold. An age equal to the offline threshold is `offline` only when the idle threshold is at or below the offline threshold; when the idle threshold is above it, the `active` row matches first and the status is `active`.
321
+
322
+ `activityFresh` uses a different stamp: `activityUpdatedAt` when that is a finite number, otherwise `lastHeartbeatAt`. It is true while that stamp is younger than the **offline** threshold (`PRESENCE_OFFLINE_THRESHOLD_MS`, default 10 minutes), including when the stamp is in the future. While it is true, `activity` is the stored label (`coding`, `reviewing`, `planning`, `debugging`, or `idle`). When it is false, `activity` is reported as `idle`, `lastActivity` keeps the stored label, and `currentTask` is null even for a verified reader. `activityAgeMs` is how old that stamp is.
323
+
324
+ A peer can therefore show `presenceStatus: "offline"`, `activity: "idle"`, `lastActivity: "coding"`, and `activityFresh: false` at once: the heartbeat is past the offline threshold, and the live activity label has lapsed. Gate "is this agent doing this now" on `activityFresh` (and `activityAgeMs`). Read `presenceStatus` for heartbeat liveness. Read `lastActivity` as what they were doing, not what they are doing.
300
325
 
301
326
  ### Memory (`schemas/memory.graphql`)
302
327
 
package/docs/auth.md CHANGED
@@ -273,12 +273,24 @@ flair idp add \
273
273
 
274
274
  ### JIT Provisioning
275
275
 
276
- First-time IdP users are automatically created as `unverified` principals. An admin can promote them to `verified` or `admin` via:
276
+ First-time IdP users are automatically created as `unverified` principals.
277
+
278
+ Trust tier and admin are different fields. `flair principal promote` changes only `defaultTrustTier`. It takes the principal id and a tier:
277
279
 
278
280
  ```bash
279
- flair principal promote <principal-id>
281
+ flair principal promote <principal-id> <tier>
280
282
  ```
281
283
 
284
+ `<tier>` is one of `endorsed`, `corroborated`, or `unverified`. There is no `verified` tier and no `admin` tier. The command writes `defaultTrustTier` and does not write `role` or `admin`, so it cannot grant admin.
285
+
286
+ Admin authority is `role: admin` on the Agent record. `admin: true` is the mirror the server keeps in step with that role; setting the mirror alone does not grant admin. The CLI that writes both is:
287
+
288
+ ```bash
289
+ flair principal add <principal-id> --admin
290
+ ```
291
+
292
+ `add` upserts the Agent row. If `~/.flair/keys/<principal-id>.key` already exists, that key is reused and is not regenerated. The upsert writes the record this command builds, including `role: admin` and `admin: true` when `--admin` is set. With `--admin` and no `--trust`, the trust tier written is `endorsed`.
293
+
282
294
  ### CLI Reference
283
295
 
284
296
  | Command | Description |
@@ -164,17 +164,18 @@ No shell on the hub, so mint the token remotely rather than over `ssh`:
164
164
 
165
165
  ```bash
166
166
  # On any machine — note --ops-target, this hits the ops API
167
- FLAIR_ADMIN_PASS=<hub-admin-password> flair federation token \
167
+ (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat /path/to/hub-admin-pass)" flair federation token \
168
168
  --target https://<cluster>.<org>.harperfabric.com \
169
- --ops-target <ops-url> > ./pair-triple.json
169
+ --ops-target <ops-url> > ./pair-triple.json)
170
170
 
171
171
  # On the spoke
172
- flair federation pair https://<cluster>.<org>.harperfabric.com \
172
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<cluster>.<org>.harperfabric.com \
173
173
  --token-from ./pair-triple.json
174
174
  ```
175
175
 
176
176
  `federation token` takes `--admin-pass`, **not** `--admin-pass-file`. The triple holds a
177
- one-time credential — delete it after pairing (60-min TTL, `--ttl`).
177
+ one-time credential — delete it after pairing (60-min TTL, `--ttl`). `set -C` refuses to
178
+ overwrite an existing `pair-triple.json`, so remove an old one first.
178
179
 
179
180
  ### Federation is push-only
180
181
 
@@ -136,43 +136,33 @@ Then set `FLAIR_URL=http://localhost:19926` on the client.
136
136
 
137
137
  ### Direct network access
138
138
 
139
- Flair reads the HTTP bind host from three places — the first one set wins:
139
+ On `flair start`, `flair restart`, and `flair upgrade` the HTTP bind host is resolved in this order. The first one set wins. None of those commands take an `--http-bind` flag:
140
140
 
141
- 1. `flair init --http-bind <host>`
142
- 2. `FLAIR_HTTP_BIND` in the Flair process environment
143
- 3. a **top-level** `httpBind:` key in `~/.flair/config.yaml`
141
+ 1. `FLAIR_HTTP_BIND` in the Flair process environment
142
+ 2. a **top-level** `httpBind:` key in `~/.flair/config.yaml`
143
+ 3. `127.0.0.1`
144
144
 
145
- `127.0.0.1` is the default when none is set. **Only hosts that include IPv4
146
- loopback are accepted** — `127.0.0.1` itself, or a wildcard (`0.0.0.0` / `::`).
147
- Every credentialed self-call Flair makes hardcodes `127.0.0.1`, so a bind that
148
- excludes it is refused: it would leave those calls pointing at a dead port
149
- while every bind check still passed.
145
+ `flair init --http-bind <host>` is how that `httpBind` key gets written. During `init` the flag wins over `FLAIR_HTTP_BIND`, and the host that won is persisted. On Linux the CLI starts Harper directly and resolves the bind on every start, so a later start follows the list above and an env var in the service's environment overrides the file. On macOS the resolved bind is stored in the launchd job instead of being re-read on the launchd reload path: any restart that goes through it — `flair restart` included, and a restart launchd starts itself (a reboot, a crash, KeepAlive) — reuses that stored value and does not re-read `FLAIR_HTTP_BIND` or `config.yaml`; only `flair init` writes it.
150
146
 
151
- To widen deliberately, pass the flag — or record it in config so the choice
152
- survives `flair restart` / `flair upgrade`, neither of which takes the flag:
147
+ **Only hosts that include IPv4 loopback are accepted** — `127.0.0.1` itself, or a wildcard (`0.0.0.0` / `::`). Every credentialed self-call Flair makes hardcodes `127.0.0.1`. A bind that excludes that address is refused: those calls would point at a dead port while every bind check still passed. A specific LAN address is not accepted. Loopback is the default so a single-host install does not expose the HTTP surface, including unauthenticated `/Health`, on every interface.
148
+
149
+ To widen deliberately, record a wildcard so the choice survives restart and upgrade:
153
150
 
154
151
  ```bash
155
152
  flair init --http-bind 0.0.0.0
156
153
  ```
157
154
 
158
155
  ```yaml
159
- # ~/.flair/config.yaml — top-level, NOT nested under `http:`
156
+ # ~/.flair/config.yaml — top-level key. There is no nested `http:` block.
160
157
  httpBind: 0.0.0.0
161
158
  ```
162
159
 
163
- > **`http.host` is not read.** Earlier versions of this page told you to widen
164
- > the bind with a nested `http.host:` key. **Flair never read that key**, and
165
- > from 0.55.0 it is ignored outright: an install that was only ever wide
166
- > because the old default bound every interface will narrow to `127.0.0.1` on
167
- > the next `flair restart` or `flair upgrade`. The block below is kept so this
168
- > section stays findable from a snippet you may already have — **do not copy
169
- > it**; use `httpBind:` (or `--http-bind` / `FLAIR_HTTP_BIND`) instead.
160
+ A nested `http.host` (or `http.port`) is not read. An install that was only wide because an older default bound every interface narrows to `127.0.0.1` on the next `flair restart` or `flair upgrade` unless `FLAIR_HTTP_BIND` or `httpBind` names a wildcard.
170
161
 
171
- ```yaml
172
- # OLD — ignored by Flair. Replace with `httpBind:` as above.
173
- http:
174
- port: 19926
175
- host: 0.0.0.0 # listen on all interfaces
162
+ **Confirm the bind.** `flair status` prints the URL the CLI dials. That URL stays on loopback even when the listener is widened, so it is not the bind. After a Flair-managed start, Harper records the listener it was given as `http.port` in the instance data directory (default `~/.flair/data/harper-config.yaml`, legacy name `harperdb-config.yaml`). The value is host-qualified, for example `127.0.0.1:19926`, `0.0.0.0:19926`, or `[::]:19926`. The live socket shows the same address:
163
+
164
+ ```bash
165
+ lsof -nP -iTCP:19926 -sTCP:LISTEN
176
166
  ```
177
167
 
178
168
  **Security:** Flair uses Ed25519 authentication. Agents must present a valid signature to read or write. However, the `/Health` endpoint is unauthenticated. For internet-facing deployments, put Flair behind a reverse proxy with TLS.
@@ -185,26 +175,25 @@ All configuration lives in `~/.flair/`:
185
175
 
186
176
  ```
187
177
  ~/.flair/
188
- ├── config.yaml # port, bind host, embedding model
189
- ├── data/ # Harper database
178
+ ├── config.yaml # port, opsPort, opsBind, httpBind
179
+ ├── data/ # Harper database (harper-config.yaml lives here)
190
180
  ├── keys/ # Ed25519 keypairs per agent
191
181
  └── backups/ # flair backup output
192
182
  ```
193
183
 
194
184
  ### Key config options (`~/.flair/config.yaml`)
195
185
 
196
- ```yaml
197
- # Top-level keys — Flair's config has no nested `http:` block, and no
198
- # `http.host`.
199
- port: 19926 # API port (ops port = this - 1)
200
- httpBind: 127.0.0.1 # HTTP bind host (see "Direct network access" above)
186
+ Flair reads four top-level keys from this file: `port`, `opsPort`, `opsBind`, and `httpBind`. `flair init` rewrites the file with those keys and drops anything else, including a `clustering:` or `logging:` block and any embedding-model key. Embedding threads, GPU layers, and the model directory are environment variables in the table below, not keys in this file.
201
187
 
202
- clustering:
203
- nodeName: flair
188
+ `clustering` and `logging` are not read from `~/.flair/config.yaml` or from `<dataDir>/harper-config.yaml` by anything in this repository, so they are not given a home here. Harper itself does read its own clustering and logging settings — from its `harperdb-config.yaml` — so configure those there, not here. Harper's generative `models:` block, when REM needs one, does belong in `<dataDir>/harper-config.yaml`. See [rem.md](rem.md).
204
189
 
205
- logging:
206
- level: warn
207
- stdStreams: true
190
+ ```yaml
191
+ # ~/.flair/config.yaml — only these keys are read. A later `flair init`
192
+ # rewrites the file and drops every other key.
193
+ port: 19926
194
+ opsPort: 19925 # Harper operations API port
195
+ opsBind: 127.0.0.1 # operations API bind host
196
+ httpBind: 127.0.0.1 # HTTP bind host (see "Direct network access" above)
208
197
  ```
209
198
 
210
199
  ### Environment variables
@@ -217,7 +206,7 @@ Set these in the Flair process environment (`~/Library/LaunchAgents/ai.tpsdev.fl
217
206
  | `HDB_ADMIN_PASSWORD` | Bootstrap password for the embedded Harper. After first start, the persisted user record is the source of truth; rotate via the Harper ops API, not by changing this env var. | Set at install time. See [secrets-and-keys.md](secrets-and-keys.md) for rotation. |
218
207
  | `FLAIR_KEY_PASSPHRASE` | Passphrase used to derive the AES-256-GCM key that wraps federation private-key seeds at rest. Auto-generated to `~/.flair/keys/.passphrase` if unset. | Set explicitly for production federation deployments so the passphrase isn't auto-generated and lost on disk wipe. |
219
208
  | `HTTP_PORT` | Override the Harper HTTP port. Useful for sandboxes; production deployments should configure the port in `config.yaml` instead. | Rare. |
220
- | `FLAIR_HTTP_BIND` | Bind address for the Harper **HTTP API**. Resolution order: `flair init --http-bind` > this variable > the top-level `httpBind` key `flair init` persists in `~/.flair/config.yaml` > `127.0.0.1`. Only `127.0.0.1` or a wildcard (`0.0.0.0` / `::`) is accepted — the listener must include IPv4 loopback for Flair's own `127.0.0.1` self-calls. Every Flair-managed Harper start re-asserts the resolved value, so the persisted key is what survives `flair restart` / `flair upgrade`. | Only for deployments that need the HTTP API reachable off-host — set it to `0.0.0.0`, or record it once with `flair init --http-bind 0.0.0.0`. Single-host installs want the loopback default. |
209
+ | `FLAIR_HTTP_BIND` | Bind address for the Harper **HTTP API**. On start, restart, and upgrade the order is this variable, then the top-level `httpBind` key in `~/.flair/config.yaml`, then `127.0.0.1`. `flair init --http-bind` writes that key (the flag wins over this variable during init). Only `127.0.0.1` or a wildcard (`0.0.0.0` / `::`) is accepted — the listener must include IPv4 loopback for Flair's own `127.0.0.1` self-calls. See [Direct network access](#direct-network-access). | Only for deployments that need the HTTP API reachable off-host — set it to `0.0.0.0`, or record it once with `flair init --http-bind 0.0.0.0`. Single-host installs want the loopback default. |
221
210
  | `FLAIR_OPS_BIND` | Bind address for the Harper **ops API**. Resolution order: `flair init --ops-bind` > this variable > the `opsBind` key `flair init` persists in `~/.flair/config.yaml` > `127.0.0.1`. Every Flair-managed Harper start re-asserts the resolved value, so the persisted key is what makes a choice survive `flair restart` / `flair upgrade`. | Only for deployments that genuinely need remote ops admin (multi-host / Fabric) — set it to `0.0.0.0`, or record it once with `flair init --ops-bind 0.0.0.0`. Single-host installs want the loopback default. |
222
211
 
223
212
  ### Performance-related environment variables
@@ -272,12 +272,14 @@ flair memory search "deploy schedule" --agent mybot
272
272
  Federation, which has no in-process equivalent:
273
273
 
274
274
  ```bash
275
- flair federation token --admin-pass <hub-admin-pass> > triple.json
276
- flair federation pair <hub-url> --token-from ./triple.json
275
+ (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token > triple.json)
276
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair <hub-url> --token-from ./triple.json
277
277
  flair federation sync enable --interval 300
278
278
  flair federation status
279
279
  ```
280
280
 
281
+ `set -C` makes the redirect refuse an existing `triple.json` (and `umask 077` only modes a file it creates); remove an old one first (`rm triple.json`). `--admin-pass` is also accepted but puts the password in shell history and process listings; prefer the environment form above (or a secret manager).
282
+
281
283
  `sync enable` landed **after 0.30.0**; on an older install, schedule the one-shot yourself.
282
284
 
283
285
  A `SyncLog` row reads `direction: "pull"` — the receiver's label for a push it accepted. `"push"` is never written. Not a pull path.
@@ -10,9 +10,9 @@ matching across free-text fields.
10
10
  This document is that convention. It's written down and enforced by a small validator
11
11
  (`resources/entity-vocab.ts`) **before** anything is built on top of it, because three
12
12
  surfaces already consume entity strings today (the `Relationship` graph's `subject`/`object`,
13
- and the new `entities` fields on `WorkspaceState`/`OrgEvent`/`Memory`), plus a future
14
- attention query and any future MCP scope field — retrofitting a divergent vocabulary later
15
- is expensive.
13
+ and the new `entities` fields on `WorkspaceState`/`OrgEvent`/`Memory`), plus the attention
14
+ query and bootstrap collision surfacing (both shipped in later slices) and any future MCP
15
+ scope field — retrofitting a divergent vocabulary later is expensive.
16
16
 
17
17
  > This doc covers the vocabulary and validator only — the foundation slice of the attention
18
18
  > plane (flair#675). The attention query ("what touches entity E in the last N days") and
@@ -84,7 +84,7 @@ Per the attention-plane spec's K&S-approved refinements, `entities: [String] @in
84
84
  - `WorkspaceState` (`schemas/workspace.graphql`)
85
85
  - `OrgEvent` (`schemas/event.graphql`)
86
86
  - `Memory` (`schemas/memory.graphql`) — added in v1 (not deferred to v2) for index-pushdown
87
- uniformity across all three sources the future attention query joins.
87
+ uniformity across all three sources the attention query (shipped in a later slice) joins.
88
88
 
89
89
  Existing rows on all three tables simply carry no `entities` — readers must tolerate absence,
90
90
  the same pattern already used for `Presence.activityUpdatedAt`. No migration, no backfill.
@@ -111,7 +111,7 @@ vocabulary; wiring that validation is a follow-up, not part of this foundation s
111
111
 
112
112
  ## What's explicitly NOT in this slice
113
113
 
114
- - The attention query (`AttentionQuery` / `flair attention <entity>`) that joins Memory,
114
+ - The attention query (`AttentionQuery` / `flair attention <type:value>`) that joins Memory,
115
115
  Relationship, WorkspaceState, Presence, and OrgEvent by entity — shipped in flair#678
116
116
  (`resources/AttentionQuery.ts`), a later slice.
117
117
  - Bootstrap collision surfacing ("others in the room") — shipped in flair#681
@@ -4,7 +4,7 @@ Hub-and-spoke sync between Flair instances. A hub instance coordinates sync for
4
4
 
5
5
  ## Overview
6
6
 
7
- Federation lets multiple Flair instances share memories, relationships, and agent records **in one direction per call**. Each instance maintains its own Ed25519 identity. Sync requests are signed and verified against pinned peer public keys.
7
+ Federation lets multiple Flair instances share memories, relationships, and agent records **in one direction per call**. Each instance maintains its own Ed25519 identity. Sync requests are signed and verified against pinned peer public keys. A push omits private memories — see [What a push sends](#what-a-push-sends).
8
8
 
9
9
  ```
10
10
  Spoke A ──[POST /FederationSync]──▶ Hub
@@ -35,7 +35,7 @@ Pairing connects a spoke to a hub with mutual key pinning and an auth-aware hand
35
35
  On the hub machine, the admin runs `flair federation token`. The command emits a JSON triple containing a one-time bootstrap credential:
36
36
 
37
37
  ```bash
38
- flair federation token --admin-pass <hub-admin-password>
38
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token
39
39
  ```
40
40
 
41
41
  Output (a single JSON object):
@@ -56,10 +56,10 @@ On the spoke machine:
56
56
 
57
57
  ```bash
58
58
  # From a file
59
- flair federation pair <hub-url> --token-from /path/to/triple.json
59
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair <hub-url> --token-from /path/to/triple.json
60
60
 
61
61
  # From stdin
62
- cat triple.json | flair federation pair <hub-url> --token-from -
62
+ cat triple.json | FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair <hub-url> --token-from -
63
63
  ```
64
64
 
65
65
  **4. Behind the scenes**
@@ -76,21 +76,24 @@ Earlier designs relied on `allowCreate=true` combined with body-only authenticat
76
76
 
77
77
  ## Fabric Pairing Example
78
78
 
79
- When the hub runs on Harper Fabric, adapt the hub URL to the Fabric pattern:
79
+ A managed Harper Fabric hub has no shell. Mint the triple from any machine that can reach it, then pair from the spoke. `FLAIR_ADMIN_PASS` on that mint is the **hub/cluster** admin (the admin file on the hub host, or a secret manager), not the spoke's `~/.flair/admin-pass`. `--admin-pass` is also accepted but puts the password in shell history and process listings; prefer the environment form below. The full bring-up, including why `--ops-target` names port 9925, is [spoke-bringup.md §5a](spoke-bringup.md#harper-fabric-hub-no-shell). <!-- docs-freshness-allow: Fabric ops API port, not legacy data port -->
80
80
 
81
81
  ```bash
82
- # 1. Hub admin generates the triple (on the Fabric host)
83
- ssh hub-host
84
- flair federation token --admin-pass <hub-admin-password> > /tmp/pair-triple.json
85
-
86
- # 2. Transfer the triple to the spoke admin (out-of-band)
87
- scp hub-host:/tmp/pair-triple.json ./pair-triple.json
88
-
89
- # 3. Spoke admin pairs using the Fabric URL
90
- flair federation pair https://<fabric-node>:19926/<instance-name> --token-from ./pair-triple.json
82
+ # 1. On any machine (the spoke itself is fine) — no ssh, no scp.
83
+ # umask 077 sets the mode of a file the redirect CREATES; set -C makes the redirect
84
+ # refuse to overwrite an existing one, so a retry cannot truncate-and-reuse a looser file.
85
+ # /path/to/hub-admin-pass is a 0600 file holding the HUB admin password, not ~/.flair/admin-pass on this machine; a literal here would land in shell history.
86
+ (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat /path/to/hub-admin-pass)" flair federation token \
87
+ --target https://<hub>.<org>.harperfabric.com \
88
+ --ttl 60 \
89
+ --ops-target https://<hub>.<org>.harperfabric.com:9925 > ./pair-triple.json) # docs-freshness-allow: Fabric ops API port, not legacy data port
90
+
91
+ # 2. On the spoke — the SPOKE admin password (its own ~/.flair/admin-pass) writes the local Peer row; the mint above used the hub admin
92
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<hub>.<org>.harperfabric.com \
93
+ --token-from ./pair-triple.json
91
94
  ```
92
95
 
93
- Replace `<fabric-node>`, `<instance-name>`, and `<hub-admin-password>` with your actual values.
96
+ Replace `<hub>` and `<org>` with your actual values, and point `/path/to/hub-admin-pass` at a 0600 file holding the hub admin password on the minting machine. The pair step's admin password is the spoke's, used to write the local Peer row.
94
97
 
95
98
  Running the hub on Fabric has its own considerations — port derivation against a managed
96
99
  `443` endpoint, why the sync driver can only be installed on a machine you control, and
@@ -106,6 +109,20 @@ flair federation sync --admin-pass <password>
106
109
  # Output: ✅ Synced 12 records (0 skipped) in 145ms
107
110
  ```
108
111
 
112
+ ### What a push sends
113
+
114
+ Each sync pushes rows changed since the cursor from four tables: `Memory`, `Soul`, `Agent`, and `Relationship`. `Presence` is not in that set.
115
+
116
+ **Memory rows with `visibility` exactly `"private"` are left behind.** Durability is not the filter. `"shared"` and any other present value are included. Soul, Agent, and Relationship have no `visibility` field, so this rule does not apply to them.
117
+
118
+ A Memory row with **no `visibility` field still syncs, on purpose.** Those rows were written before the field existed. The push uses the same predicate as cross-agent read (`resolveReadScope` in `resources/memory-read-scope.ts`): only the literal string `"private"` is private. Missing, `null`, and anything else stay non-private so pre-field rows keep replicating exactly as they did. That is the migration rule, not a hole in the filter.
119
+
120
+ Private means owner-only on this instance. A peer that received the row would hold a copy other agents on that instance could read. Holding the row back is the point of `private`.
121
+
122
+ Durability still explains a count gap that is entirely `standard` rows. When a write omits `visibility`, the server defaults it from durability: `permanent` and `persistent` become `shared`; `standard`, `ephemeral`, and an omitted durability become `private`. A standard memory therefore stays on the spoke unless the writer set `visibility` to `shared`. Ephemeral memories are private-only at write time, so they never federate. That is the default and the ephemeral constraint, not a second filter and not loss of memories that were stored as shared.
123
+
124
+ `flair federation verify` writes its canary as `durability: "standard"` and `visibility: "shared"` for this reason. When every changed Memory row was withheld, sync says they were held back for private visibility instead of reporting that nothing changed.
125
+
109
126
  ### Keeping it synced
110
127
 
111
128
  `flair federation sync` is one-shot and `flair federation watch` only runs
@@ -255,13 +272,16 @@ Federation uses record-level last-write-wins (LWW) with ISO timestamp comparison
255
272
 
256
273
  ## Troubleshooting
257
274
 
258
- ### config.yaml port drift
275
+ ### Listen port drift
276
+
277
+ There is no `federation.port` key. Federation uses the hub's HTTP listen port. The spoke's pair URL has to use that port.
259
278
 
260
- If the hub's configured port in `config.yaml` differs from the port the spoke is targeting, federation requests fail with a connection error. Verify the port matches between the spoke's pair URL and the hub's `config.yaml` (`federation.port` or the instance's listen port).
279
+ On the hub, the listen port Harper last bound is `http.port` in the instance data directory (default `~/.flair/data/harper-config.yaml`). A default install also records a top-level `port:` in `~/.flair/config.yaml`. That file's port keys are `port` and `opsPort` only.
261
280
 
262
281
  ```bash
263
- # On the hub, confirm the listening port
264
- grep -E 'port|federation' ~/.flair/config.yaml
282
+ # On the hub. `http.port` is host-qualified, for example 127.0.0.1:19926.
283
+ grep -A2 '^http:' ~/.flair/data/harper-config.yaml
284
+ grep -E '^(port|opsPort):' ~/.flair/config.yaml
265
285
  ```
266
286
 
267
287
  ### Local FederationInstance fetch needs auth
@@ -213,16 +213,18 @@ See [upgrade.md](upgrade.md#upgrading-a-fabric-deployed-instance) for the full w
213
213
  Available. Pair a local spoke to a Fabric-hosted hub:
214
214
 
215
215
  ```bash
216
- # On any machine (no shell on the hub) — generate a pairing token triple
217
- FLAIR_ADMIN_PASS=<hub-admin-password> flair federation token \
216
+ # On any machine (no shell on the hub) — generate a pairing token triple. /path/to/hub-admin-pass is a 0600 file holding the HUB admin password (never a literal on the command line: it would land in shell history)
217
+ (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat /path/to/hub-admin-pass)" flair federation token \
218
218
  --target https://<cluster>.<org>.harperfabric.com \
219
- --ops-target <ops-url> > ./pair-triple.json
219
+ --ops-target <ops-url> > ./pair-triple.json)
220
220
 
221
- # On the spoke — pair to the Fabric hub
222
- flair federation pair https://<cluster>.<org>.harperfabric.com \
221
+ # On the spoke — the SPOKE admin password (its own ~/.flair/admin-pass) writes the local Peer row
222
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<cluster>.<org>.harperfabric.com \
223
223
  --token-from ./pair-triple.json
224
224
  ```
225
225
 
226
+ `set -C` refuses an existing `./pair-triple.json`; remove an old one first (`rm ./pair-triple.json`).
227
+
226
228
  ### Pairing limitation
227
229
 
228
230
  The scheduled sync driver (`flair federation sync enable`) writes a launchd job or systemd timer **on the machine running the CLI** — it cannot be installed on a Fabric node. A periodic one-shot from the spoke machine is the workaround.
@@ -32,7 +32,20 @@ flair status
32
32
 
33
33
  > **`flair: command not found` right after installing?** Your npm global prefix's bin dir isn't on PATH (common with a user prefix like `~/.npm-global`) — run `export PATH="$(npm prefix -g)/bin:$PATH"`, persist that line in your shell profile, and `flair doctor` will print the exact line for your shell any time.
34
34
 
35
- Flair runs as a local server at `http://127.0.0.1:19926` by default. The MCP server connects to it on demand via Ed25519-signed requests; nothing leaves your machine unless you explicitly route to a remote Flair instance.
35
+ Flair runs as a local server at `http://127.0.0.1:19926` by default. The MCP server this page configures connects to it on demand via Ed25519-signed requests; nothing leaves your machine unless you explicitly route to a remote Flair instance.
36
+
37
+ ## Two MCP paths
38
+
39
+ The snippets below are the **local** path. Flair also has a native `/mcp` endpoint, and the two are not substitutes. The [README](../README.md#one-install-one-binary) names both; this section is why each exists.
40
+
41
+ | Client | Path | Auth |
42
+ |--------|------|------|
43
+ | MCP client on this machine (Claude Code, Cursor, Codex, Gemini, and the snippets below) | `npx -y @tpsdev-ai/flair-mcp@<version>` stdio adapter | Ed25519 over HTTP to the instance |
44
+ | Remote MCP client that must dial a public HTTPS origin | Native `/mcp` on the instance | OAuth bearer. Unmounted until `FLAIR_MCP_OAUTH=true` and a public issuer are set (otherwise the path 404s). |
45
+
46
+ Native `/mcp` is remote-only by design. The OAuth authorization server fetches client metadata over HTTPS and refuses private, loopback, and link-local hosts. `flair mcp enable` refuses localhost, loopback, RFC1918, IPv4 link-local, and `.local`. Set `FLAIR_MCP_OAUTH=true` — that is the one value that enables both Flair's `/mcp` route and the OAuth component. A loopback Flair cannot be the origin those clients dial. The stdio adapter is the local path because it speaks the instance's Ed25519 HTTP API and does not need that public origin.
47
+
48
+ `flair init` writes the stdio adapter. Turning on native `/mcp` is a separate operator step for a publicly reachable instance, documented from the API side in [api-reference.md](api-reference.md#mcp-tools).
36
49
 
37
50
  ---
38
51
 
@@ -286,22 +299,26 @@ If you see (a) the agent calling the `bootstrap` tool returning soul + recent me
286
299
 
287
300
  ## What the MCP server exposes
288
301
 
289
- Twelve tools, kept deliberately small:
302
+ Clients on this page talk to the stdio server `@tpsdev-ai/flair-mcp`. Its `tools/list` advertises these sixteen tools, in this order. The embedded HTTP `/mcp` handler is a different set: it also advertises `memory_basement`, `memory_restore`, and `attention`, and it does not advertise `relationship_store` or `flair_catchup`.
290
303
 
291
304
  | Tool | What it does |
292
305
  |---|---|
293
- | `memory_search` | Semantic search across your agent's memories |
294
- | `memory_store` | Save a memory with type, durability, tags, visibility. Auto-dedups near-duplicates. Optional `usedMemoryIds` cites memories that informed the write |
295
- | `memory_update` | Update an existing memory by ID — overwrite in place, or version it with `preserveHistory`. Optional `usedMemoryIds` for citation-on-write |
306
+ | `memory_search` | Semantic search across the caller's own and other agents' non-private memories |
307
+ | `memory_store` | Save a memory (type, durability, tags, visibility), attributed to the authenticated agent. Optional `usedMemoryIds` cites memories that informed the write |
308
+ | `skill_store` | Write a skill-tagged memory. `trigger` is the recall text; `content` is the procedure. Durability is forced to persistent, and SkillScan rejects a dangerous payload before embed |
309
+ | `skill_search` | Rank skills by their trigger against a task. Returns a catalog (id, name, trigger, description, tags, agentId), not the procedure |
310
+ | `skill_get` | Fetch one skill's full procedure by id. Own skills and shared skills only; a private skill owned by someone else is not returned |
311
+ | `memory_update` | Update a memory by id. Overwrites in place, or pass `preserveHistory` to write a superseding version. Optional `usedMemoryIds` |
296
312
  | `memory_get` | Fetch a specific memory by ID |
297
- | `memory_delete` | Remove a memory |
298
- | `relationship_store` | Record a subject-predicate-object relationship triple (e.g. "nathan manages flair") |
299
- | `bootstrap` | Get session-start context: soul + recent memories + predicted-relevant context |
300
- | `soul_set` | Runtime writes are refused; use operator credentials through `flair soul set` |
313
+ | `memory_delete` | Delete one of your own memories |
314
+ | `relationship_store` | Assert a subject-predicate-object triple (for example "nathan manages flair"). Asserting the same triple again updates that row |
315
+ | `bootstrap` | Session-start context: soul, memories, and predicted context. Pass `subjects` for predictive loading |
316
+ | `soul_set` | Advertised as setting a soul entry. The server refuses runtime Soul writes, including this tool's Ed25519 call; operators use `flair soul set` |
301
317
  | `soul_get` | Get a soul entry |
302
- | `flair_workspace_set` | Set your agent's current workspace state (ref/branch, phase, task) in the Office Space |
303
- | `flair_orgevent` | Publish an org-wide coordination event (claim/release/status) to the Office Space |
304
- | `record_usage` | Report that recalled memories were actually used (id + optional one-line how-it-was-used). Drives `usageCount` / `usageBoost` |
318
+ | `flair_workspace_set` | Set this agent's workspace state (ref, label, provider, task, phase, summary) in the Office Space |
319
+ | `flair_orgevent` | Publish an org-wide coordination event (claim, release, or status), attributed to the caller |
320
+ | `flair_catchup` | Drain this agent's own org-event catch-up feed. Page with `after`; advance the watermark with `ack` |
321
+ | `record_usage` | Report that recalled memories were actually used (`memoryId` or `memoryIds`, plus optional `attribution`). Drives `usageCount` / `usageBoost` |
305
322
 
306
323
  Writes are scoped per-agent (your `FLAIR_AGENT_ID`) and enforced by Flair's server, not by client convention — you can't write as another agent. Reads are more open by design: any agent on the same Flair instance can read any other agent's **non-private** memories, with no grant to set up (open-within-org read; see [SECURITY.md](../SECURITY.md)).
307
324
 
@@ -97,15 +97,9 @@ At this point you'll see your instance ID, public key, and role: `spoke`. The pe
97
97
 
98
98
  ## 5. Pair with the Hub
99
99
 
100
- ### 5a. Generate a pairing token on the hub
100
+ ### 5a. Generate a pairing token
101
101
 
102
- On the **hub host**, an admin runs:
103
-
104
- ```bash
105
- flair federation token --admin-pass <hub-admin-pass> > pair-triple.json
106
- ```
107
-
108
- Output (a single JSON object):
102
+ The command prints one JSON object. Tokens expire after **60 minutes** by default. Use `--ttl <minutes>` to extend.
109
103
 
110
104
  ```json
111
105
  {
@@ -116,23 +110,47 @@ Output (a single JSON object):
116
110
  }
117
111
  ```
118
112
 
119
- Tokens expire after **60 minutes** by default. Use `--ttl <minutes>` to extend.
113
+ #### Hub you can shell into
114
+
115
+ On the **hub host**, an admin runs:
116
+
117
+ ```bash
118
+ (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token > pair-triple.json)
119
+ ```
120
+
121
+ `umask 077` sets the mode of a file the redirect CREATES; an existing file keeps its mode, so `set -C` (noclobber) makes the redirect refuse to overwrite it. Remove an old `pair-triple.json` first (`rm pair-triple.json`).
122
+
123
+ #### Harper Fabric hub (no shell)
124
+
125
+ A Fabric-deployed hub is a Harper component on a managed cluster. There is no host to shell into. Mint the triple from any machine that can reach the hub — for a personal spoke, that machine is the spoke — and name both the data URL and the ops URL:
126
+
127
+ ```bash
128
+ (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat /path/to/hub-admin-pass)" flair federation token \
129
+ --target https://<hub>.<org>.harperfabric.com \
130
+ --ttl 60 \
131
+ --ops-target https://<hub>.<org>.harperfabric.com:9925 > pair-triple.json) # docs-freshness-allow: Fabric ops API port, not legacy data port
132
+ ```
133
+
134
+ `/path/to/hub-admin-pass` is a 0600 file holding the **HUB** admin password on the minting machine, not the spoke's `~/.flair/admin-pass`, which authenticates only the spoke. A literal on the command line would land in shell history, so read it from the file (or a secret manager). `--ops-target` is the Harper operations API on the same hostname at port 9925. <!-- docs-freshness-allow: Fabric ops API port, not legacy data port --> A portless `https://` `--target` derives that same port. Pass `--ops-target` so the URL is the one you chose. An explicit port other than 443 still derives as REST port minus one, which is not this ops port. `federation token` reads the admin password from `FLAIR_ADMIN_PASS` (or from `--admin-pass`). `--admin-pass` is also accepted but puts the password in shell history and process listings; prefer the file form above (or a secret manager).
120
135
 
121
136
  ### 5b. Transfer the triple to the spoke
122
137
 
138
+ When the triple was minted **on the hub host**, copy it to the spoke:
139
+
123
140
  ```bash
124
141
  scp hub-host:/path/to/pair-triple.json ./pair-triple.json
125
142
  ```
126
143
 
144
+ When it was minted with `--target` against a Fabric hub, the file is already on the machine that ran the command. If that machine is the spoke, this step is done. The file holds a one-time credential — delete it after pairing.
145
+
127
146
  ### 5c. Pair from the spoke
128
147
 
129
148
  ```bash
130
- flair federation pair https://<hub-url> \
131
- --token-from ./pair-triple.json \
132
- --admin-pass "$FLAIR_ADMIN_PASS"
149
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<hub-url> \
150
+ --token-from ./pair-triple.json
133
151
  ```
134
152
 
135
- The `--admin-pass` is required so the CLI can write the hub as a local `Peer` record. Without it, pairing succeeds on the hub side but the spoke never records its peer, and `flair federation sync` reports "No hub peer configured."
153
+ The spoke admin credential (`FLAIR_ADMIN_PASS` as above, or `--admin-pass`) is required so the CLI can write the hub as a local `Peer` record. Without it, pairing succeeds on the hub side but the spoke never records its peer, and `flair federation sync` reports "No hub peer configured."
136
154
 
137
155
  ### 5d. What pairing does
138
156
 
@@ -267,18 +285,19 @@ grep port ~/.flair/config.yaml
267
285
  export FLAIR_URL=http://127.0.0.1:9926
268
286
  ```
269
287
 
270
- ### 🔸 Fabric hosts split REST and ops ports
288
+ ### 🔸 Harper Fabric hub vs a self-hosted explicit port
271
289
 
272
- Fabric deployments split the REST API and the Harper operations API onto adjacent ports. The derivation rule is **ops = REST − 1**. When pointing a CLI at a remote Fabric instance, pass the REST URL and the ops URL is derived automatically — substitute the hub's actual REST port (19926 for a fresh deployment, or whatever it was provisioned with):
290
+ A managed Harper Fabric hub (`https://<hub>.<org>.harperfabric.com`, HTTPS on 443) serves the operations API on port 9925 of the same hostname. <!-- docs-freshness-allow: Fabric ops API port, not legacy data port --> Mint the pairing token with `--target` and `--ops-target` as in [§5a](#harper-fabric-hub-no-shell). Pairing from the spoke still uses the public hub URL:
273
291
 
274
292
  ```bash
275
- flair federation pair https://fabric-node.example.com:19926/<instance> --token-from triple.json
293
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<hub>.<org>.harperfabric.com \
294
+ --token-from ./pair-triple.json
276
295
  ```
277
296
 
278
- For explicit ops control:
297
+ A self-hosted instance that publishes an explicit REST port still uses ops = REST − 1 (a fresh local install is 19926 → 19925). Pass that ops URL with `--ops-target` when you are not on the box:
279
298
 
280
299
  ```bash
281
- flair federation pair https://fabric-node.example.com:19926/<instance> \
300
+ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://fabric-node.example.com:19926/<instance> \
282
301
  --token-from triple.json \
283
302
  --ops-target https://fabric-node.example.com:19925
284
303
  ```
@@ -292,10 +311,10 @@ flair federation pair https://fabric-node.example.com:19926/<instance> \
292
311
  | Install | `npm install -g @tpsdev-ai/flair` |
293
312
  | Init spoke | `flair init --agent-id <id> --data-dir /data/flair --skip-soul` |
294
313
  | Check status | `flair status` / `flair federation status` |
295
- | Hub: mint token | `flair federation token --admin-pass <pass> > triple.json` |
296
- | Spoke: pair | `flair federation pair <hub-url> --token-from ./triple.json --admin-pass <pass>` |
297
- | Spoke: sync | `flair federation sync --admin-pass <pass>` |
298
- | Spoke: verify | `flair federation verify --admin-pass <pass>` then `flair federation reachability` |
314
+ | Hub: mint token | On the hub host: `(umask 077; set -C; FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token > triple.json)`. Harper Fabric hub (no shell): §5a `--target` + `--ops-target` |
315
+ | Spoke: pair | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair <hub-url> --token-from ./triple.json` |
316
+ | Spoke: sync | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation sync` |
317
+ | Spoke: verify | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation verify` then `flair federation reachability` |
299
318
  | Watch loop | `flair federation watch --interval 30` |
300
319
 
301
320
  ---