@tpsdev-ai/flair 0.55.2 → 0.57.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 (106) hide show
  1. package/README.md +18 -19
  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 +125 -26
  7. package/dist/commands/agent.js +22 -15
  8. package/dist/commands/attention.js +2 -2
  9. package/dist/commands/backup.js +2 -2
  10. package/dist/commands/bridge.js +40 -3
  11. package/dist/commands/doctor.js +91 -28
  12. package/dist/commands/export.js +2 -2
  13. package/dist/commands/federation.js +441 -68
  14. package/dist/commands/hook.js +4 -4
  15. package/dist/commands/init.js +59 -12
  16. package/dist/commands/mcp.js +2 -2
  17. package/dist/commands/migrate-harness-memory.js +8 -8
  18. package/dist/commands/rem.js +2 -2
  19. package/dist/commands/service.js +25 -1
  20. package/dist/commands/session.js +2 -2
  21. package/dist/commands/uninstall.js +2 -2
  22. package/dist/commands/upgrade.js +3 -3
  23. package/dist/doctor-client.js +5 -23
  24. package/dist/engine-version.js +2 -2
  25. package/dist/federation/scheduler.js +5 -5
  26. package/dist/install/clients.js +5 -10
  27. package/dist/keystore.js +10 -2
  28. package/dist/lib/auth-resolve.js +51 -5
  29. package/dist/lib/doctor-config-path.js +2 -2
  30. package/dist/lib/flair-paths.js +29 -0
  31. package/dist/lib/home.js +60 -0
  32. package/dist/lib/instance-identity-row.js +580 -0
  33. package/dist/lib/launchd-repair.js +6 -0
  34. package/dist/lib/mcp-enable.js +4 -4
  35. package/dist/lib/owned-pins.js +1 -13
  36. package/dist/lib/redact-token-id.js +197 -0
  37. package/dist/lib/socket-path-limit.js +120 -0
  38. package/dist/lib/uninstall-purge.js +2 -18
  39. package/dist/lib/upgrade-plain-tree.js +2 -2
  40. package/dist/mcp-client-assertion.js +3 -3
  41. package/dist/rem/runner.js +3 -3
  42. package/dist/rem/scheduler.js +5 -5
  43. package/dist/rem/snapshot.js +2 -2
  44. package/dist/resources/AgentSeed.js +4 -1
  45. package/dist/resources/Asset.js +3 -11
  46. package/dist/resources/Credential.js +4 -10
  47. package/dist/resources/Federation.js +232 -78
  48. package/dist/resources/Integration.js +8 -32
  49. package/dist/resources/Memory.js +58 -16
  50. package/dist/resources/MemoryBootstrap.js +19 -12
  51. package/dist/resources/MemoryCandidate.js +3 -11
  52. package/dist/resources/MemoryDedupStats.js +1 -1
  53. package/dist/resources/MemoryFeed.js +10 -2
  54. package/dist/resources/MemoryGrant.js +19 -40
  55. package/dist/resources/MemoryUsage.js +7 -20
  56. package/dist/resources/OAuth.js +62 -11
  57. package/dist/resources/Presence.js +135 -47
  58. package/dist/resources/Relationship.js +3 -11
  59. package/dist/resources/SemanticSearch.js +25 -13
  60. package/dist/resources/admin-layout.js +7 -2
  61. package/dist/resources/auth-middleware.js +32 -5
  62. package/dist/resources/bm25.js +13 -14
  63. package/dist/resources/federation-cleanup.js +289 -51
  64. package/dist/resources/health.js +48 -8
  65. package/dist/resources/in-process-api.js +2 -1
  66. package/dist/resources/instance-create-lock.js +363 -0
  67. package/dist/resources/instance-identity-rows.js +43 -0
  68. package/dist/resources/instance-identity.js +94 -10
  69. package/dist/resources/mcp-handler.js +9 -1
  70. package/dist/resources/mcp-tool-arguments.js +83 -0
  71. package/dist/resources/mcp-tools.js +4 -5
  72. package/dist/resources/memory-reflect-lib.js +17 -1
  73. package/dist/resources/memory-visibility.js +10 -7
  74. package/dist/resources/rate-limit.js +6 -4
  75. package/dist/resources/record-type-kit.js +47 -23
  76. package/dist/resources/search-readiness.js +7 -1
  77. package/dist/resources/semantic-retrieval-core.js +98 -3
  78. package/dist/resources/table-helpers.js +33 -0
  79. package/dist/resources/tool-descriptors/index.js +2 -2
  80. package/dist/src/keystore.js +10 -2
  81. package/dist/src/lib/home.js +60 -0
  82. package/dist/src/lib/instance-identity-row.js +580 -0
  83. package/dist/src/lib/redact-token-id.js +197 -0
  84. package/dist/src/rem/scheduler.js +5 -5
  85. package/dist/version-check.js +2 -2
  86. package/dist/version-handshake.js +2 -2
  87. package/docs/api-reference.md +32 -7
  88. package/docs/auth.md +19 -7
  89. package/docs/claude-code.md +5 -6
  90. package/docs/deploying-on-fabric.md +8 -4
  91. package/docs/deployment.md +26 -37
  92. package/docs/embedding-in-a-harper-app.md +4 -2
  93. package/docs/entity-vocabulary.md +5 -5
  94. package/docs/federation.md +48 -21
  95. package/docs/hosted-on-fabric.md +7 -4
  96. package/docs/integrations.md +24 -15
  97. package/docs/mcp-clients.md +44 -23
  98. package/docs/n8n.md +8 -8
  99. package/docs/notes/mcp-oauth-model2.md +12 -17
  100. package/docs/openclaw.md +29 -28
  101. package/docs/spoke-bringup.md +44 -22
  102. package/docs/standalone-local.md +12 -16
  103. package/docs/supply-chain-policy.md +21 -8
  104. package/docs/system-requirements.md +1 -1
  105. package/docs/upgrade.md +2 -2
  106. package/package.json +1 -1
package/docs/openclaw.md CHANGED
@@ -29,22 +29,34 @@ In your OpenClaw agent config, add the Flair plugin:
29
29
 
30
30
  ```json
31
31
  {
32
- "plugins": {
33
- "@tpsdev-ai/openclaw-flair": {
34
- "agentId": "my-agent",
35
- "flairUrl": "http://localhost:19926"
32
+ "plugins": {
33
+ "allow": ["openclaw-flair"],
34
+ "slots": {
35
+ "memory": "openclaw-flair"
36
+ },
37
+ "entries": {
38
+ "openclaw-flair": {
39
+ "enabled": true,
40
+ "hooks": {
41
+ "allowPromptInjection": true
42
+ },
43
+ "config": {
44
+ "url": "http://127.0.0.1:19926",
45
+ "autoRecall": true,
46
+ "autoCapture": false,
47
+ "maxRecallResults": 5,
48
+ "maxBootstrapTokens": 4000,
49
+ "agentId": "my-agent"
50
+ }
51
+ }
52
+ }
36
53
  }
37
- }
38
54
  }
39
55
  ```
40
56
 
41
- Or set environment variables:
42
-
43
- ```bash
44
- export FLAIR_AGENT_ID=my-agent
45
- export FLAIR_URL=http://localhost:19926
46
- ```
57
+ `allowConversationAccess` is required to enable auto-capture (the plugin also reads it for a startup warning and status), so this example, with `autoCapture: false`, leaves it out.
47
58
 
59
+ An optional `agentId` in `config` is an **allow-list**: it restricts which agents may be served but never substitutes for the host's per-invocation identity, which comes from host context on every call.
48
60
  ### 5. Restart the gateway
49
61
 
50
62
  ```bash
@@ -58,21 +70,20 @@ The Flair plugin adds these tools to your OpenClaw agent:
58
70
  | Tool | Description |
59
71
  |------|-------------|
60
72
  | `memory_store` | Write a memory with optional type, durability, and tags |
61
- | `memory_recall` | Semantic search over stored memories |
73
+ | `memory_search` | Semantic search over stored memories |
62
74
  | `memory_get` | Retrieve a specific memory by ID |
63
75
 
64
76
  ### Automatic Bootstrap
65
77
 
66
- On each new conversation, the plugin injects relevant context from Flair:
78
+ With `autoRecall` on (the default) and the host's `hooks.allowPromptInjection` enabled, the plugin handles `before_prompt_build`: it requests bootstrap context from Flair, up to `maxBootstrapTokens` and without passing a conversation topic, and returns it as `prependContext` when the context is non-empty. The context can include:
67
79
  - Soul entries (persistent personality and project context)
68
- - Recent memories (last 24h)
69
- - Relevant memories (semantically matched to the conversation topic)
80
+ - Recent memories (an adaptive window: 48 hours, widening to 7 and then 30 days when fewer than three are found)
70
81
 
71
- This happens automatically — no agent configuration needed beyond the plugin setup.
82
+ Without `hooks.allowPromptInjection` the plugin contributes no context and logs `prompt context disabled: policy` at startup.
72
83
 
73
84
  ## Multi-Agent
74
85
 
75
- Each OpenClaw agent gets its own isolated memory space:
86
+ Each OpenClaw agent writes with its `agentId` as a field (tags are optional); reads use owner plus visibility. A verified agent can read all its own records (private included) and other agents' non-private records on the instance; grants do not expand that read scope.
76
87
 
77
88
  ```bash
78
89
  flair agent add research-agent
@@ -80,13 +91,6 @@ flair agent add coding-agent
80
91
  flair agent add review-agent
81
92
  ```
82
93
 
83
- Agents can share memories via grants:
84
-
85
- ```bash
86
- # Let review-agent read coding-agent's memories
87
- flair grant coding-agent review-agent --scope read
88
- ```
89
-
90
94
  ## Soul (Personality)
91
95
 
92
96
  Set persistent context that shapes how the agent behaves:
@@ -103,10 +107,7 @@ Soul entries are included in every bootstrap — they're the agent's persistent
103
107
 
104
108
  ## Key Resolution
105
109
 
106
- The plugin resolves Ed25519 keys in this order:
107
- 1. `FLAIR_KEY_PATH` environment variable
108
- 2. `~/.flair/keys/<agent-id>.key`
109
- 3. `~/.tps/secrets/flair/<agent-id>-priv.key` (legacy TPS path)
110
+ The plugin finds Ed25519 keys for the host-provided agent identity: `keyPath` from config is only valid with a sole allowed agent (`agentId` set); otherwise the client resolves via `FLAIR_KEY_DIR` env var, then `~/.flair/keys/<agent-id>.key`, then `~/.tps/secrets/flair/<agent-id>-priv.key`. For each resolved home, `.flair` then the legacy path are checked in order before the next home.
110
111
 
111
112
  ## Troubleshooting
112
113
 
@@ -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,48 @@ 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 federation token --admin-pass-file ~/.flair/admin-pass > 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 federation token --admin-pass-file /path/to/hub-admin-pass \
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. `--admin-pass-file` reads it in-process (mode 0600 enforced), so it stays out of shell history and the process list; a literal on the command line would land in both. `--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` also accepts `--admin-pass` (kept for compatibility, but it lands in shell history and the process list) or `FLAIR_ADMIN_PASS` (suits CI).
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
149
  flair federation pair https://<hub-url> \
131
- --token-from ./pair-triple.json \
132
- --admin-pass "$FLAIR_ADMIN_PASS"
150
+ --admin-pass-file ~/.flair/admin-pass \
151
+ --token-from ./pair-triple.json
133
152
  ```
134
153
 
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."
154
+ The spoke admin credential (`--admin-pass-file ~/.flair/admin-pass`, or `FLAIR_ADMIN_PASS`/`--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
155
 
137
156
  ### 5d. What pairing does
138
157
 
@@ -146,7 +165,7 @@ The `--admin-pass` is required so the CLI can write the hub as a local `Peer` re
146
165
  ## 6. Sync for the First Time
147
166
 
148
167
  ```bash
149
- flair federation sync --admin-pass "$FLAIR_ADMIN_PASS"
168
+ flair federation sync --admin-pass-file ~/.flair/admin-pass
150
169
  ```
151
170
 
152
171
  Expected:
@@ -160,7 +179,7 @@ Then verify the pairing. `federation verify` pushes the canary itself — you
160
179
  do not need the systemd timer from §7 first:
161
180
 
162
181
  ```bash
163
- flair federation verify --admin-pass "$FLAIR_ADMIN_PASS"
182
+ flair federation verify --admin-pass-file ~/.flair/admin-pass
164
183
  flair federation reachability
165
184
  ```
166
185
 
@@ -267,18 +286,21 @@ grep port ~/.flair/config.yaml
267
286
  export FLAIR_URL=http://127.0.0.1:9926
268
287
  ```
269
288
 
270
- ### 🔸 Fabric hosts split REST and ops ports
289
+ ### 🔸 Harper Fabric hub vs a self-hosted explicit port
271
290
 
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):
291
+ 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
292
 
274
293
  ```bash
275
- flair federation pair https://fabric-node.example.com:19926/<instance> --token-from triple.json
294
+ flair federation pair https://<hub>.<org>.harperfabric.com \
295
+ --admin-pass-file ~/.flair/admin-pass \
296
+ --token-from ./pair-triple.json
276
297
  ```
277
298
 
278
- For explicit ops control:
299
+ 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
300
 
280
301
  ```bash
281
302
  flair federation pair https://fabric-node.example.com:19926/<instance> \
303
+ --admin-pass-file ~/.flair/admin-pass \
282
304
  --token-from triple.json \
283
305
  --ops-target https://fabric-node.example.com:19925
284
306
  ```
@@ -292,10 +314,10 @@ flair federation pair https://fabric-node.example.com:19926/<instance> \
292
314
  | Install | `npm install -g @tpsdev-ai/flair` |
293
315
  | Init spoke | `flair init --agent-id <id> --data-dir /data/flair --skip-soul` |
294
316
  | 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` |
317
+ | Hub: mint token | On the hub host: `(umask 077; set -C; flair federation token --admin-pass-file ~/.flair/admin-pass > triple.json)`. Harper Fabric hub (no shell): §5a `--target` + `--ops-target` |
318
+ | Spoke: pair | `flair federation pair <hub-url> --admin-pass-file ~/.flair/admin-pass --token-from ./triple.json` |
319
+ | Spoke: sync | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation sync` |
320
+ | Spoke: verify | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation verify` then `flair federation reachability` |
299
321
  | Watch loop | `flair federation watch --interval 30` |
300
322
 
301
323
  ---
@@ -79,27 +79,21 @@ All configuration lives in `~/.flair/`:
79
79
 
80
80
  ```
81
81
  ~/.flair/
82
- ├── config.yaml # port, bind host, embedding model
83
- ├── data/ # Harper database (RocksDB)
82
+ ├── config.yaml # port, opsPort, opsBind, httpBind
83
+ ├── data/ # Harper database (RocksDB); harper-config.yaml lives here
84
84
  ├── keys/ # Ed25519 keypairs per agent (mode 0600)
85
85
  └── backups/ # flair backup output
86
86
  ```
87
87
 
88
88
  ### Key config options (`~/.flair/config.yaml`)
89
89
 
90
- Flair's own config file uses **top-level** keys — there is no nested `http:`
91
- block, and no `http.host` (see [`deployment.md` — Direct network access](deployment.md#direct-network-access) for widening):
90
+ Flair reads four top-level keys from this file: `port`, `opsPort`, `opsBind`, and `httpBind`. There is no nested `http:` block and no `http.host`. `flair init` rewrites the file and drops every other key, so a `clustering:` or `logging:` block placed here does not survive and is not read. Embedding settings are the environment variables below, not keys in this file. Widening the HTTP listener is covered in [`deployment.md` — Direct network access](deployment.md#direct-network-access).
92
91
 
93
92
  ```yaml
94
- port: 19926 # API port (ops port = this - 1)
93
+ port: 19926
94
+ opsPort: 19925 # Harper operations API port
95
+ opsBind: 127.0.0.1 # operations API bind host
95
96
  httpBind: 127.0.0.1 # HTTP bind host; 0.0.0.0 widens (must include IPv4 loopback)
96
-
97
- clustering:
98
- nodeName: flair
99
-
100
- logging:
101
- level: warn
102
- stdStreams: true
103
97
  ```
104
98
 
105
99
  ### Environment variables
@@ -110,7 +104,7 @@ logging:
110
104
  | `HDB_ADMIN_PASSWORD` | Bootstrap password for the embedded Harper. After first start, the persisted user record is the source of truth. | Set at install time. See [secrets-and-keys.md](secrets-and-keys.md) for rotation. |
111
105
  | `FLAIR_KEY_PASSPHRASE` | Passphrase for AES-256-GCM encryption of federation private-key seeds. | Set explicitly for production federation deployments. |
112
106
  | `FLAIR_URL` | Override the Flair base URL for CLI commands (points to a remote instance). | When connecting from a different machine. |
113
- | `FLAIR_HTTP_BIND` | HTTP API bind host. Resolution order: `flair init --http-bind` > this variable > top-level `httpBind` in `~/.flair/config.yaml` > `127.0.0.1`. Only `127.0.0.1` or a wildcard (`0.0.0.0` / `::`) is accepted. | When the HTTP API must be reachable off-host; prefer recording it once with `flair init --http-bind 0.0.0.0`. See [deployment.md](deployment.md#direct-network-access). |
107
+ | `FLAIR_HTTP_BIND` | HTTP API bind host. On start, restart, and upgrade: this variable, then top-level `httpBind` in `~/.flair/config.yaml`, then `127.0.0.1`. `flair init --http-bind` writes that key. On Linux the CLI resolves this on every start, 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 this variable or the file; only `flair init` writes it. Only `127.0.0.1` or a wildcard (`0.0.0.0` / `::`) is accepted. | When the HTTP API must be reachable off-host; prefer recording it once with `flair init --http-bind 0.0.0.0`. See [deployment.md](deployment.md#direct-network-access). |
114
108
  | `FLAIR_EMBED_THREADS` | CPU threads for in-process embedding. Default is `max(1, availableParallelism() − 1)` — host-aware, one core left for Harper. | Pin a positive integer on a dedicated ingest host, or when the default leaves cores idle / oversubscribed. See [deployment.md](deployment.md#performance-related-environment-variables). |
115
109
  | `FLAIR_EMBED_GPU_LAYERS` | GPU layers to offload. Unset derives Metal (`99`) on Apple Silicon with a usable Metal prebuilt, else CPU (`0`). Stated on `/Health`. | Pin CPU with `0` on a Metal Mac, or force a layer count. See [deployment.md](deployment.md#performance-related-environment-variables). |
116
110
  | `FLAIR_HYBRID_RETRIEVAL` | Hybrid BM25 + vector retrieval (default on). | Set `false` to revert to HNSW-only. |
@@ -227,15 +221,17 @@ Available. Pair a local instance as a hub or spoke with another Flair instance:
227
221
 
228
222
  ```bash
229
223
  # On the hub — generate a one-time pairing token triple
230
- FLAIR_ADMIN_PASS=<hub-admin-password> flair federation token > triple.json
224
+ (umask 077; set -C; flair federation token --admin-pass-file ~/.flair/admin-pass > triple.json)
231
225
 
232
- # On the spoke — pair to the hub
233
- flair federation pair <hub-url> --token-from ./triple.json
226
+ # On the spoke — its own admin password writes the local Peer row
227
+ flair federation pair <hub-url> --admin-pass-file ~/.flair/admin-pass --token-from ./triple.json
234
228
 
235
229
  # Sync (one-shot)
236
230
  flair federation sync --admin-pass-file ~/.flair/admin-pass
237
231
  ```
238
232
 
233
+ `set -C` refuses an existing `triple.json`; remove an old one first (`rm triple.json`).
234
+
239
235
  Full walkthrough: [federation.md](federation.md).
240
236
 
241
237
  ---
@@ -38,14 +38,14 @@ Override per-run via `FLAIR_DEP_KEEP_CURRENT="pkg1,pkg2,@scope/pkg3"` env (addit
38
38
 
39
39
  ### 2. Exact-version pinning for production deps
40
40
 
41
- Every `dependencies` entry in any `package.json` must be a single concrete version (`"5.0.9"`), not a range (`"^5.0"`, `"~5.0.9"`, `">=5"`). Range specifiers expose us to silent supply-chain swaps every install — exactly the surface attackers exploit.
41
+ Some `dependencies` entries are exact-pinned (`harper@5.2.8`, `commander@14.0.3`, `jose@6.2.2`, `tweetnacl@1.0.3`), but others are range-spec'd (`harper-fabric-embeddings@^0.5.0`, `js-yaml@^4.3.2`, `semver@^7.8.5`, `tar@^7.5.22`). Most overrides use ranges (`^`/`~`), with one exact alias (`npm:empty-npm-package@1.0.0` for `react-native-fs`). The age gate (`scripts/check-dep-ages.mjs`, line 130) checks npm publish age for external entries in the `dependencies` field whose declared version starts with a digit (`/^\d/.test(version)`), excluding workspace-internal dependencies and the keep-current list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`); its default threshold is seven days.
42
42
 
43
- - `peerDependencies` may use ranges (host-provided; never installed by us). `devDependencies` are also exact-pinned for build reproducibility, though they don't ship in our published tarballs.
44
- - **Flair declares no optional peers today**, and no `optionalDependencies` at all. If either is ever proposed as an install-weight fix, the mechanism has now been measured twice (`@harperfast/oauth` flair#750, `node-llama-cpp` flair#887) and the result is counter-intuitive enough to be worth stating: **only `peerDependencies` + `peerDependenciesMeta.optional` is skipped by a default install** (npm and bun alike). A plain `optionalDependencies` entry *is* still installed by default — "optional" there means "a failed install is non-fatal", not "skipped" — so it buys no install-weight reduction whatsoever. Exact-pinning an optional peer (rather than ranging it) is also legitimate where the consuming code path is version-sensitive, so that an operator who installs a different version gets told the version they have is not the version that was tested.
43
+ - `peerDependencies` may use ranges: they state what the host project must provide, and they are never bundled into our published tarballs. They are still installed, because npm and Bun install non-optional peers by default: a consumer's install resolves them, and our own workspace install records the required peers of `langgraph-flair`, `n8n-nodes-flair` and `openclaw-flair` in `bun.lock` like any other dependency (the frozen-lockfile install does not check a recorded peer against its declared range; flair#1936). Most `devDependencies` are exact-pinned for build reproducibility; a few are ranged (`@types/semver@^7.8.0`). They don't ship in our published tarballs.
44
+ - **Flair declares no optional peers today**, and no `optionalDependencies` at the root; `packages/flair-bench/package.json` (line 38) declares some. If either is ever proposed as an install-weight fix, the mechanism has now been measured twice (`@harperfast/oauth` flair#750, `node-llama-cpp` flair#887) and the result is counter-intuitive enough to be worth stating: **only `peerDependencies` + `peerDependenciesMeta.optional` is skipped by a default install** (npm and bun alike). A plain `optionalDependencies` entry *is* still installed by default — "optional" there means "a failed install is non-fatal", not "skipped" — so it buys no install-weight reduction whatsoever. Exact-pinning an optional peer (rather than ranging it) is also legitimate where the consuming code path is version-sensitive, so that an operator who installs a different version gets told the version they have is not the version that was tested.
45
45
 
46
46
  Note the corollary, measured during flair#893: an optional peer that is simply *absent* installs silently — npm prints no warning at all — so it cannot be relied on to prompt anyone to install it. Anything a user must install for a feature to work needs to be documented, or detected and reported at runtime.
47
- - `bun.lock` is committed and frozen-lockfile installed in CI. Any unintended dep drift fails the workspace-deps consistency gate.
48
- - Pin updates happen via deliberate, test-gated PRs — never auto-merged. **Renovate is enabled** (`.github/renovate.json`) to *propose* these updates on a schedule, but it respects the bake-time cooldown (`minimumReleaseAge: "7 days"`, matching `FLAIR_DEP_MIN_AGE_DAYS`) and opens PRs only — `automerge` is off, so every bump flows through the full test suite + K&S review. Renovate uses `rangeStrategy: "pin"` so it proposes exact-version bumps (never re-widens to ranges) and shares the keep-current allow-list with `check-dep-ages.mjs`. Vulnerability alerts bypass the cooldown so security fixes aren't delayed.
47
+ - `bun.lock` is committed and `bun install --frozen-lockfile` is run in CI (`.github/workflows/test.yml`, ~121). That lockfile gate fails when package.json and bun.lock disagree; `scripts/check-workspace-deps.mjs` compares each recognized internal `@tpsdev-ai/*` dependency's literal declared version to the version the target package ships, and accepts `workspace:` declarations (e.g. `workspace:*` at `packages/cursor-wake-runner/package.json`, line 22; skip at `scripts/check-workspace-deps.mjs`, line 59).
48
+ - Pin updates happen via deliberate, test-gated PRs — never auto-merged. **Renovate is enabled** (the shared org preset at `.github/renovate-preset.json`, with `.github/renovate.json` holding only flair-specific exceptions) to *propose* these updates on a schedule, but it respects the bake-time cooldown (`minimumReleaseAge: "7 days"`, matching `FLAIR_DEP_MIN_AGE_DAYS`) and opens PRs only — `automerge` is off, so every bump flows through the full test suite + K&S review. Renovate uses `rangeStrategy: "pin"` so it proposes exact-version bumps (never re-widens to ranges) and shares the keep-current allow-list with `check-dep-ages.mjs`. Vulnerability alerts bypass the Renovate cooldown, so Renovate can propose an advisory fix immediately; the CI age gate can still hold a fresh pinned npm production dependency.
49
49
 
50
50
  ### 3. Internal dep version lockstep
51
51
 
@@ -109,9 +109,11 @@ Run it locally with `node scripts/audit-gate.mjs --explain`.
109
109
 
110
110
  ## Automation
111
111
 
112
- ### `.github/renovate.json` — deliberate, cooldown-gated update proposals
112
+ ### The shared org preset — `.github/renovate-preset.json` (`.github/renovate.json` holds only flair-specific exceptions)
113
113
 
114
- Renovate opens PRs to propose dependency updates so we don't drift behind upstream indefinitely — but on our terms, not the registry's. It is configured to never auto-merge (`automerge: false`), to pin (`rangeStrategy: "pin"`, consistent with §2), and to respect the bake-time cooldown (`minimumReleaseAge: "7 days"`, matching `FLAIR_DEP_MIN_AGE_DAYS` in `check-dep-ages.mjs`) so it only proposes versions that have already cleared the detection window. Non-major updates are grouped; majors land as isolated PRs. The keep-current allow-list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`) mirrors the script's `DEFAULT_KEEP_CURRENT` — keep the two in lockstep when either changes. Vulnerability alerts bypass the cooldown. Every Renovate PR still runs the full CI suite (including the bake-time and workspace-deps gates) and is K&S-reviewed before merge.
114
+ Renovate opens PRs to propose dependency updates so we don't drift behind upstream indefinitely — but on our terms, not the registry's. The org preset (`.github/renovate-preset.json`) is common to all tpsdev-ai repos; `.github/renovate.json` holds only flair-specific overrides (workspace-internal dep exclusions, keep-current allow-list)
115
+
116
+ Renovate is configured to never auto-merge (`automerge: false`), to pin (`rangeStrategy: "pin"`, consistent with §2), and to respect the bake-time cooldown (`minimumReleaseAge: "7 days"` by default, matching `FLAIR_DEP_MIN_AGE_DAYS` in `check-dep-ages.mjs`), so by default it proposes only versions that have cleared the detection window — the two named exceptions are vulnerability fixes and the keep-current list below. Non-major updates are grouped per ecosystem (npm/Bun, Python, GitHub Actions, Docker); a manager outside those four gets no ecosystem-wide group from the four explicit rules (groups inherited from config:recommended may still apply); majors land as isolated PRs. The keep-current allow-list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`) mirrors the script's `DEFAULT_KEEP_CURRENT` — keep the two in lockstep when either changes. Vulnerability alerts bypass the cooldown: Renovate can propose an advisory fix immediately. Flair's CI age gate (`check-dep-ages.mjs`) can still block a fresh pinned npm production dependency; other fresh versions follow the 7-day cooldown unless an explicit exception, such as the keep-current list, applies. The control for the fast-track is not the cooldown: it is `automerge: false` plus the full CI suite (including the bake-time and workspace-deps gates) and a K&S review on every Renovate PR. Docker image digests in Dockerfiles and compose files land in the docker group; images in workflow `container:`/`services:` are proposed by the github-actions manager and land in the github-actions group. The preset is in the CODEOWNERS trust root (`@heskew`): Renovate reads it from the default branch for every repo that extends it, so a change to it takes the same human as a change to the release tagger.
115
117
 
116
118
  ### `scripts/check-workspace-deps.mjs` (already shipped, PR #368)
117
119
 
@@ -119,7 +121,7 @@ Fails any PR where a workspace package declares an internal `@tpsdev-ai/*` dep a
119
121
 
120
122
  ### `scripts/check-dep-ages.mjs` (this PR)
121
123
 
122
- Fails any PR with an external pinned production dep version published less than `FLAIR_DEP_MIN_AGE_DAYS` ago (default 7). Queries the npm registry's `time` map. Workspace-internal deps exempt. Wired into the `test-unit` job.
124
+ Fails any PR with an external pinned production dep version published less than `FLAIR_DEP_MIN_AGE_DAYS` ago (default 7). Queries the npm registry's `time` map. Workspace-internal deps exempt. Wired into the `test-unit` job. Its limits, stated: it covers npm production dependencies only (not the Python, Docker or GitHub Actions updates the Renovate preset proposes), and it reads the same registry publish timestamp Renovate does, so it is a second line against the cooldown being removed from the config — not against a release whose publish date lies.
123
125
 
124
126
  Configurable:
125
127
 
@@ -173,6 +175,17 @@ chmod +x scripts/check-dep-ages.mjs
173
175
 
174
176
  The script has no external dependencies — node 18+ is enough.
175
177
 
178
+ To adopt the same Renovate preset in your repo, make your `.github/renovate.json`:
179
+
180
+ ```json
181
+ {
182
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
183
+ "extends": ["github>tpsdev-ai/flair//.github/renovate-preset"]
184
+ }
185
+ ```
186
+
187
+ Add `packageRules` only for your own exceptions. The preset carries no `@tpsdev-ai/**` exclusion: a repo whose own release process bumps tpsdev-ai workspace packages adds the same `{ "matchPackageNames": ["@tpsdev-ai/**"], "enabled": false }` rule flair keeps in `.github/renovate.json`, otherwise their non-major updates join the non-major npm group (major updates stay isolated, like every other major).
188
+
176
189
  ---
177
190
 
178
191
  ## Exceptions and incident response
@@ -24,7 +24,7 @@ Flair runs Harper v5 (a Node.js HTTP+storage runtime) plus a small CLI/MCP layer
24
24
  - **Embedding cache.** First semantic search per cold daemon loads `nomic-embed-text-v1.5` into memory (~270 MB). Subsequent searches reuse it. If you disable embeddings (text-only search), strip ~270 MB.
25
25
  - **HNSW index.** In-memory vector index over the agent's memories. Grows linearly with memory count; expect ~1 KB per memory plus the 768-dim vector (~1.5 KB).
26
26
  - **Harper transaction log.** Bounded by retention window; grows during writes, compacts on idle.
27
- - **MCP clients.** Each `flair-mcp` subprocess holds ~40–50 MB. Long-lived MCP host (Claude Code) restarts spawn fresh ones; orphaned ones from the host crashing should be cleaned up by the parent-exit watcher (PR pending).
27
+ - **MCP clients.** Each `flair-mcp` subprocess holds ~40–50 MB. Long-lived MCP host (Claude Code) restarts spawn fresh ones; a lost subprocess exits on reparenting to PID 1 or stdin close/end.
28
28
 
29
29
  ## Scaling expectations
30
30
 
package/docs/upgrade.md CHANGED
@@ -45,8 +45,8 @@ for each already-wired client (`~/.claude.json`, `~/.claude/settings.json`,
45
45
  `~/.codex/config.toml`, `~/.codex/hooks.json`, and the other auto-wired clients).
46
46
  Pass `--all` to also see `flair-client` (normally hidden as a
47
47
  transitive dependency). **Other integrations upgrade in their own ecosystem, not via
48
- `flair upgrade`:** `pi-flair` (pi's plugin manager), `langgraph-flair` / `hermes-flair`
49
- (pip / your Python package manager), `n8n-nodes-flair` (n8n's Community Nodes UI).
48
+ `flair upgrade`:** `pi-flair` (pi's plugin manager), `langgraph-flair` (an npm module), `hermes-flair`
49
+ (reinstall the plugin from a flair checkout: `hermes plugins install path:<flair>/packages/hermes-flair`), `n8n-nodes-flair` (n8n's Community Nodes UI).
50
50
 
51
51
  If the running instance's exec path is a **plain extracted tree** (npm pack +
52
52
  `npm install --omit=dev`, typically under systemd — no git checkout, not the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/flair",
3
- "version": "0.55.2",
3
+ "version": "0.57.0",
4
4
  "packageManager": "bun@1.3.10",
5
5
  "description": "Identity, memory, and soul for AI agents. Cryptographic identity (Ed25519), semantic memory with local embeddings, and persistent personality — all in a single process.",
6
6
  "type": "module",