@tpsdev-ai/flair 0.62.0 → 0.63.1

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 (257) hide show
  1. package/README.md +14 -13
  2. package/SECURITY.md +73 -43
  3. package/config.yaml +11 -11
  4. package/dist/bridges/runtime/execute.js +1 -0
  5. package/dist/bridges/runtime/import-runner.js +4 -0
  6. package/dist/bridges/types.js +1 -0
  7. package/dist/build-info.json +3 -3
  8. package/dist/cli.js +309 -205
  9. package/dist/commands/agent.js +325 -137
  10. package/dist/commands/attention.js +2 -0
  11. package/dist/commands/backup-approval.js +218 -0
  12. package/dist/commands/backup.js +37 -33
  13. package/dist/commands/bootstrap.js +5 -1
  14. package/dist/commands/bridge.js +10 -0
  15. package/dist/commands/deploy.js +37 -7
  16. package/dist/commands/doctor.js +206 -42
  17. package/dist/commands/export.js +144 -15
  18. package/dist/commands/federation.js +653 -68
  19. package/dist/commands/grant.js +5 -6
  20. package/dist/commands/help.js +25 -0
  21. package/dist/commands/idp.js +14 -19
  22. package/dist/commands/import.js +167 -34
  23. package/dist/commands/init.js +380 -164
  24. package/dist/commands/integrity.js +5 -6
  25. package/dist/commands/keys.js +12 -8
  26. package/dist/commands/mcp.js +157 -79
  27. package/dist/commands/memory.js +38 -17
  28. package/dist/commands/migrate-harness-memory.js +9 -3
  29. package/dist/commands/orgevent.js +5 -10
  30. package/dist/commands/principal.js +32 -39
  31. package/dist/commands/quality.js +26 -3
  32. package/dist/commands/reembed.js +468 -111
  33. package/dist/commands/rem.js +484 -65
  34. package/dist/commands/restore.js +352 -44
  35. package/dist/commands/search.js +2 -0
  36. package/dist/commands/service.js +109 -2
  37. package/dist/commands/soul.js +0 -6
  38. package/dist/commands/status.js +165 -124
  39. package/dist/commands/test.js +4 -1
  40. package/dist/commands/upgrade.js +53 -22
  41. package/dist/commands/workspace.js +7 -8
  42. package/dist/deploy.js +59 -3
  43. package/dist/doctor-client.js +9 -25
  44. package/dist/fabric-upgrade.js +12 -2
  45. package/dist/federation/presence-send.js +139 -0
  46. package/dist/federation/scheduler.js +148 -12
  47. package/dist/federation-verify.js +269 -177
  48. package/dist/install/clients.js +171 -35
  49. package/dist/keystore.js +77 -10
  50. package/dist/lib/agent-id-rule.js +44 -2
  51. package/dist/lib/agent-key-file.js +509 -0
  52. package/dist/lib/agent-rotation-lock.js +249 -0
  53. package/dist/lib/atomic-write.js +3 -3
  54. package/dist/lib/auth-resolve.js +1040 -64
  55. package/dist/lib/backup-approval-store.js +612 -0
  56. package/dist/lib/backup-artifact.js +343 -0
  57. package/dist/lib/config-critical-section.js +212 -25
  58. package/dist/lib/connect-phase.js +33 -0
  59. package/dist/lib/daemon-liveness.js +2 -1
  60. package/dist/lib/federation-pair-access.js +4 -0
  61. package/dist/lib/federation-retry-queue.js +283 -0
  62. package/dist/lib/federation-retry-row.js +101 -0
  63. package/dist/lib/instruction-event-contract.js +17 -0
  64. package/dist/lib/instruction-event-doctor.js +102 -0
  65. package/dist/lib/key-dir.js +203 -0
  66. package/dist/lib/launchd-management.js +21 -6
  67. package/dist/lib/local-instance-pair.js +8 -1
  68. package/dist/lib/mcp-enable.js +14 -15
  69. package/dist/lib/memory-attributes.js +2 -0
  70. package/dist/lib/memory-provider-timeout.js +33 -0
  71. package/dist/lib/mqtt-config.js +132 -0
  72. package/dist/lib/mqtt-listener-doctor.js +104 -0
  73. package/dist/lib/node-alias-path.js +50 -2
  74. package/dist/lib/open-live-row.js +20 -0
  75. package/dist/lib/ops-url.js +52 -0
  76. package/dist/lib/promotion-content-hash.js +20 -0
  77. package/dist/lib/remote-admin-pass.js +157 -0
  78. package/dist/lib/restore-archive.js +760 -0
  79. package/dist/lib/restore-verify.js +1 -1
  80. package/dist/lib/scheduler-platform.js +13 -0
  81. package/dist/lib/service-repoint.js +13 -4
  82. package/dist/lib/skill-assignment-preflight.js +159 -0
  83. package/dist/lib/skill-seed.js +125 -10
  84. package/dist/lib/skill-tombstone-doctor.js +133 -0
  85. package/dist/lib/soul-scope-fields.js +26 -0
  86. package/dist/lib/terminal-text.js +32 -0
  87. package/dist/lib/uninstall-purge.js +266 -11
  88. package/dist/lib/upgrade-prior-liveness.js +2 -1
  89. package/dist/mcp-client-assertion.js +7 -14
  90. package/dist/memory-id-checkpoint.js +28 -7
  91. package/dist/mqtt-off-deploy.js +550 -0
  92. package/dist/rem/promote-policy.js +3 -3
  93. package/dist/rem/restore.js +302 -26
  94. package/dist/rem/runner.js +220 -58
  95. package/dist/rem/scheduler.js +21 -4
  96. package/dist/resources/A2AAdapter.js +131 -178
  97. package/dist/resources/AdminMemory.js +2 -0
  98. package/dist/resources/AdminMemoryCandidates.js +116 -0
  99. package/dist/resources/Agent.js +155 -45
  100. package/dist/resources/AgentCard.js +4 -0
  101. package/dist/resources/AgentKeyRegister.js +56 -22
  102. package/dist/resources/AgentReadPosition.js +7 -0
  103. package/dist/resources/AgentSeed.js +232 -107
  104. package/dist/resources/AutoPromoteCandidates.js +413 -84
  105. package/dist/resources/Credential.js +6 -8
  106. package/dist/resources/Federation.js +219 -57
  107. package/dist/resources/FederationRetry.js +4 -4
  108. package/dist/resources/InstructionVersion.js +1 -1
  109. package/dist/resources/MCPClientMetadata.js +6 -3
  110. package/dist/resources/Memory.js +1348 -271
  111. package/dist/resources/MemoryArchive.js +149 -64
  112. package/dist/resources/MemoryBootstrap.js +12 -22
  113. package/dist/resources/MemoryCandidate.js +16 -2
  114. package/dist/resources/MemoryConsolidate.js +2 -2
  115. package/dist/resources/MemoryFeed.js +360 -147
  116. package/dist/resources/MemoryMaintenance.js +290 -72
  117. package/dist/resources/MemoryPurge.js +138 -22
  118. package/dist/resources/MemoryReflect.js +68 -14
  119. package/dist/resources/MemoryReindex.js +91 -13
  120. package/dist/resources/Message.js +11 -2
  121. package/dist/resources/OAuth.js +156 -39
  122. package/dist/resources/OAuthClient.js +1 -1
  123. package/dist/resources/OrgEvent.js +292 -29
  124. package/dist/resources/OrgEventCatchup.js +7 -0
  125. package/dist/resources/OrgEventMaintenance.js +48 -10
  126. package/dist/resources/PairingToken.js +1 -1
  127. package/dist/resources/Presence.js +31 -11
  128. package/dist/resources/PromoteMemoryCandidate.js +8 -2
  129. package/dist/resources/RecordUsage.js +2 -4
  130. package/dist/resources/Soul.js +2 -0
  131. package/dist/resources/SoulFeed.js +2 -1
  132. package/dist/resources/WorkspaceLatest.js +4 -0
  133. package/dist/resources/XAA.js +36 -10
  134. package/dist/resources/a2a-stream.js +313 -0
  135. package/dist/resources/a2a-url.js +4 -5
  136. package/dist/resources/agent-admin.js +10 -1
  137. package/dist/resources/agent-auth.js +98 -68
  138. package/dist/resources/agent-read-position-lib.js +4 -1
  139. package/dist/resources/agent-status-guard.js +9 -7
  140. package/dist/resources/auth-middleware.js +166 -42
  141. package/dist/resources/authority-field-guard.js +9 -11
  142. package/dist/resources/auto-promote-lib.js +8 -5
  143. package/dist/resources/basic-auth-header.js +21 -0
  144. package/dist/resources/bm25-index-service.js +4 -5
  145. package/dist/resources/dedup-cluster.js +6 -1
  146. package/dist/resources/embeddings-provider.js +25 -0
  147. package/dist/resources/federation-classify.js +89 -0
  148. package/dist/resources/federation-retry-lib.js +6 -81
  149. package/dist/resources/health.js +75 -19
  150. package/dist/resources/host-pointer/registry.js +29 -0
  151. package/dist/resources/host-pointer-adapter.js +1 -0
  152. package/dist/resources/in-process-api.js +74 -11
  153. package/dist/resources/in-process.js +24 -22
  154. package/dist/resources/instruction-version-record.js +251 -7
  155. package/dist/resources/internal-authority.js +13 -0
  156. package/dist/resources/mcp-client-metadata-fields.js +4 -0
  157. package/dist/resources/mcp-handler.js +146 -13
  158. package/dist/resources/mcp-oauth-flag.js +12 -14
  159. package/dist/resources/mcp-oauth.js +446 -53
  160. package/dist/resources/mcp-tool-scopes.js +69 -0
  161. package/dist/resources/mcp-tools.js +70 -22
  162. package/dist/resources/memory-declared-attributes.js +1 -0
  163. package/dist/resources/memory-embed-hash.js +56 -0
  164. package/dist/resources/memory-host-source.js +5 -2
  165. package/dist/resources/memory-reflect-lib.js +1 -1
  166. package/dist/resources/memory-write-lock.js +202 -23
  167. package/dist/resources/memory-write-response.js +1 -1
  168. package/dist/resources/memory-write-transaction.js +243 -0
  169. package/dist/resources/migration-boot.js +17 -12
  170. package/dist/resources/migrations/boot-progress.js +25 -0
  171. package/dist/resources/migrations/data-dir.js +16 -3
  172. package/dist/resources/migrations/dir-safety.js +60 -2
  173. package/dist/resources/migrations/embedding-stamp.js +315 -49
  174. package/dist/resources/migrations/graph-heal.js +9 -2
  175. package/dist/resources/migrations/ledger.js +5 -2
  176. package/dist/resources/migrations/lock.js +867 -80
  177. package/dist/resources/migrations/progress.js +71 -10
  178. package/dist/resources/migrations/runner.js +212 -18
  179. package/dist/resources/migrations/state.js +36 -1
  180. package/dist/resources/migrations/status.js +2 -13
  181. package/dist/resources/migrations/synthetic-test-migration.js +78 -12
  182. package/dist/resources/migrations/types.js +26 -1
  183. package/dist/resources/migrations/visibility-backfill.js +111 -70
  184. package/dist/resources/oauth-discovery.js +0 -5
  185. package/dist/resources/object-body-guard.js +12 -5
  186. package/dist/resources/org-event-reserved.js +92 -0
  187. package/dist/resources/org-event-write-fault.js +19 -0
  188. package/dist/resources/owner-field-guard.js +1 -1
  189. package/dist/resources/owner-scoped-write-policy.js +65 -21
  190. package/dist/resources/owner-scoped-writes.js +37 -6
  191. package/dist/resources/path-id-rewrite.js +76 -0
  192. package/dist/resources/presence-internal.js +5 -5
  193. package/dist/resources/promotion-binding.js +43 -0
  194. package/dist/resources/promotion-stamp.js +124 -33
  195. package/dist/resources/protocol-context.js +189 -0
  196. package/dist/resources/record-type-kit.js +2 -4
  197. package/dist/resources/request-target.js +28 -1
  198. package/dist/resources/request-transaction.js +11 -1
  199. package/dist/resources/seed-reservation.js +1 -2
  200. package/dist/resources/semantic-retrieval-core.js +7 -6
  201. package/dist/resources/server-row-validation.js +71 -0
  202. package/dist/resources/skill-manifest.js +4 -3
  203. package/dist/resources/skill-version-write.js +400 -27
  204. package/dist/resources/skill-write-fault.js +6 -3
  205. package/dist/resources/skill-write-policy.js +2 -1
  206. package/dist/resources/soul-write-policy.js +26 -7
  207. package/dist/resources/table-helpers.js +1 -1
  208. package/dist/resources/table-subscription-policy.js +518 -85
  209. package/dist/resources/table-subscriptions.js +20 -7
  210. package/dist/resources/txn-pause-point.js +122 -5
  211. package/dist/resources/usage-recording.js +54 -46
  212. package/dist/resources/write-back.js +176 -11
  213. package/dist/resources/write-journal-context.js +5 -0
  214. package/dist/resources/write-journal.js +289 -0
  215. package/dist/src/keystore.js +77 -10
  216. package/dist/src/lib/agent-id-rule.js +44 -2
  217. package/dist/src/lib/atomic-write.js +3 -3
  218. package/dist/src/lib/federation-retry-row.js +101 -0
  219. package/dist/src/lib/instruction-event-contract.js +17 -0
  220. package/dist/src/lib/key-dir.js +203 -0
  221. package/dist/src/lib/memory-attributes.js +2 -0
  222. package/dist/src/lib/open-live-row.js +20 -0
  223. package/dist/src/lib/scheduler-platform.js +13 -0
  224. package/dist/src/lib/soul-scope-fields.js +26 -0
  225. package/dist/src/rem/promote-policy.js +3 -3
  226. package/dist/src/rem/scheduler.js +21 -4
  227. package/docs/access-control.md +39 -21
  228. package/docs/api-reference.md +161 -52
  229. package/docs/auth.md +69 -38
  230. package/docs/claude-code.md +3 -3
  231. package/docs/deploying-on-fabric.md +118 -2
  232. package/docs/deployment.md +17 -0
  233. package/docs/embedding-in-a-harper-app.md +23 -21
  234. package/docs/entity-vocabulary.md +7 -11
  235. package/docs/federation.md +29 -2
  236. package/docs/hosted-on-fabric.md +1 -1
  237. package/docs/integrations.md +11 -11
  238. package/docs/mcp-clients.md +7 -5
  239. package/docs/notes/mcp-agent-auth-consumer.md +4 -9
  240. package/docs/notes/mcp-oauth-model2.md +6 -6
  241. package/docs/openclaw.md +1 -1
  242. package/docs/quickstart-fabric.md +2 -2
  243. package/docs/quickstart.md +3 -3
  244. package/docs/releasing.md +13 -13
  245. package/docs/rem.md +24 -3
  246. package/docs/secrets-and-keys.md +9 -14
  247. package/docs/standalone-local.md +29 -2
  248. package/docs/supply-chain-policy.md +28 -20
  249. package/docs/the-team.md +2 -2
  250. package/docs/upgrade.md +29 -5
  251. package/package.json +18 -11
  252. package/schemas/agent.graphql +3 -3
  253. package/schemas/federation.graphql +10 -7
  254. package/schemas/memory.graphql +7 -2
  255. package/templates/bin/flair-rem-nightly.sh.tmpl +7 -1
  256. package/templates/launchd/start-flair-with-admin-pass.sh +188 -10
  257. package/dist/resources/soul-adk-guard.js +0 -68
@@ -15,7 +15,6 @@ We don't pull in any newly-published dep version for **at least 7 days** after i
15
15
  - The most-attacked window is "compromise published, defenders haven't yet noticed." Most malicious packages get flagged by Socket.dev, npm advisory, GitHub security advisory, or human reports within 1-7 days. Our delay puts us behind that detection front.
16
16
  - pnpm 11 shipped this as a default at 1 day (May 4 2026). We chose 7 as a more conservative posture for a security-adjacent project.
17
17
  - Workspace-internal `@tpsdev-ai/*` deps are exempt. We publish ourselves; we have direct visibility into our own changes; our 0.8.0 → 0.8.1 patch turnaround was same-day and we want to keep that latitude.
18
- - Tunable via `FLAIR_DEP_MIN_AGE_DAYS` env var if a specific run needs a different threshold. Don't bypass; document the exception.
19
18
 
20
19
  #### 1a. Keep-current allow-list
21
20
 
@@ -34,35 +33,34 @@ Adding to this list is a deliberate decision. The bar:
34
33
 
35
34
  Document any addition here, in this section, alongside the package name. The doc is the audit trail.
36
35
 
37
- Override per-run via `FLAIR_DEP_KEEP_CURRENT="pkg1,pkg2,@scope/pkg3"` env (additive — adds to the default allow-list, doesn't replace it).
36
+ Local runs without `--ci` can add to the default allow-list via `FLAIR_DEP_KEEP_CURRENT="pkg1,pkg2,@scope/pkg3"`.
38
37
 
39
38
  #### 1b. Dated exemptions for security pins
40
39
 
41
- A security patch can be newer than the bake window, and pinning it is the right move. The gate accepts an explicit, dated exemption in `.github/dep-age-allowlist.json`: one entry per checked exact-pinned `package` and `version` (in `dependencies`, `optionalDependencies` or `overrides`), with a GHSA-formatted id (`ghsa`), `added`, `expires` and a `reason`. Review verifies that the version fixes the advisory.
40
+ A security patch can be newer than the bake window, and pinning it is the right move. The gate accepts an explicit, dated exemption in `.github/dep-age-allowlist.json`: one entry per checked `package` and `version` (an exact pin, or the version bun.lock resolves a range to; §2), with a GHSA-formatted id (`ghsa`), `added`, `expires` and a `reason`. Review verifies that the version fixes the advisory.
42
41
 
43
- - An entry exempts an otherwise checked pin only while unexpired; `expires` is the first day it no longer applies.
44
- - An **expired** entry fails the gate before any registry request; removing it lets an otherwise checked pin be age-checked. Re-read the `reason` before re-dating; removing the entry once the version has aged past the window is the normal outcome.
45
- - A fresh checked pin with no matching entry fails; keep-current pins are skipped. A malformed entry also fails.
42
+ - An entry exempts an otherwise checked version only while unexpired; `expires` is the first day it no longer applies.
43
+ - An **expired** entry fails the gate before any registry request; removing it lets an otherwise checked version be age-checked. Re-read the `reason` before re-dating; removing the entry once the version has aged past the window is the normal outcome.
44
+ - A fresh checked version with no matching entry fails; keep-current packages are skipped. A malformed entry also fails.
46
45
 
47
- `FLAIR_DEP_MIN_AGE_DAYS` remains a threshold control: it moves the bar for every checked pin at once and leaves no record. A per-pin exemption belongs in this allowlist.
46
+ A per-pin exemption belongs in this allowlist.
48
47
 
49
48
  ### 2. Exact-version pinning for production deps
50
49
 
51
- Some `dependencies` entries are exact-pinned (`harper@5.3.1`, `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`). Overrides are mostly ranges (`^`/`~`). The age gate (`scripts/check-dep-ages.mjs`, with the collection rule in `collectDeps` in `scripts/lib/check-dep-ages-collect.mjs`) checks npm publish age for non-exempt external exact pins in `dependencies`, `optionalDependencies` and `overrides` — root and every workspace package.json. In `dependencies` and `optionalDependencies` a specifier is classified by the same version classifier the override grammar uses: an exact version is age-checked, a range such as `1.x` or `^1` is not; in `overrides`, nested rules included, it is an exact declaration, and an `npm:` alias is checked against its target. Workspace-internal dependencies, the keep-current list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`) and exact pins with a matching unexpired exemption in `.github/dep-age-allowlist.json` (§1b) are exempt; the default threshold is seven days. The gate reads manifests, not the lockfile: an exact version is age-checked, a range is printed as not age-checked, and a refused dependency or override form fails the gate.
50
+ Some `dependencies` entries are exact-pinned (`harper@5.3.6`, `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`). Overrides are mostly ranges (`^`/`~`). The age gate (`scripts/check-dep-ages.mjs`, with the collection and resolution rules in `scripts/lib/check-dep-ages-collect.mjs`) checks npm publish age for non-exempt external entries in `dependencies`, `devDependencies`, `optionalDependencies` and `overrides` — the root package.json and each `packages/<name>/package.json`. An exact pin is checked at its declared version (an exact `npm:` alias at its target's), except in `devDependencies`, where exact pins are not checked. A range is checked at the version bun.lock resolves it to: a dependency range through its workspace's own lock entry (`<workspace>/<name>`) when the lock carries one, else the hoisted entry (`<name>`), and a root range through the hoisted entry, where `<name>` is the declared key, so an `npm:` alias is found under its alias; an override range through the installed copies in its scope — every copy of the package for a top-level rule, and for a nested rule (`overrides["a"]["b"]`) the copies of `b` installed below a copy of `a`, key by key along the rule's path. A range the gate cannot resolve fails the gate: a dependency range with no lock entry, or declared in a manifest the lock's `workspaces` map does not list or (outside the root) lists under another name, a lock entry that installs a different package than the declaration names (an alias's target), an override whose key path carries a version selector (`a@^1`), which the gate does not evaluate, or a nested override below a copy whose dependencies bun.lock does not record; so does a `bun.lock` the gate cannot read, such as a `workspaces` map that is not an object or a workspace entry without a string `name`. The gate reads the root package.json and each `packages/<name>/package.json`; a `bun.lock` workspace outside those fails the gate, as does a missing `bun.lock` when the root package.json declares `workspaces`. An override range with no installed copy in its scope has nothing to check and is named in the output. Workspace-internal dependencies and the keep-current list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`), both matched on the package a declaration installs (an `npm:` alias's target, never its key), and checked versions with a matching unexpired exemption in `.github/dep-age-allowlist.json` (§1b) are exempt; the default threshold is seven days. A refused `dependencies`, `devDependencies`, `optionalDependencies` or `overrides` form fails the gate, as does a non-string specifier or a non-object field in the first three. The gate reads `bun.lock` as written. For checked ranged declarations, the gate age-checks the versions selected from `bun.lock`. The same CI job (`test-unit`) then runs `bun install --frozen-lockfile`, which with bun 1.3.10 refused a `workspaces` array, a workspace entry with no `name`, a missing workspace entry and a wrong workspace `name` (exit 1), and, for a lock recording a workspace's range at a version outside that range, installed the recorded version, the one the gate checks; it does not check a recorded version against its declared range, nor a recorded peer (flair#1936).
52
51
 
53
- - `peerDependencies` may use ranges: they state what the host project must provide. They are still installed, but an exact-pin check of our declaration does not describe what actually gets installed — the consumer resolves them from a range. This is the reason we do not include peers in the bake-time gate (not "never bundled into tarballs"): the gate checks versions we actually pull, and we don't pull a peer declaration at face value. Our 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.
52
+ - `peerDependencies` may use ranges: they state what the host project must provide. They are still installed, but an exact-pin check of our declaration does not describe what actually gets installed — the consumer resolves them from a range. The bake-time gate does not age-check peer declarations. Our 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`), and a ranged one is age-checked at its lock resolution like a `dependencies` range. They don't ship in our published tarballs.
54
53
  - **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.
55
54
 
56
55
  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.
57
- - `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).
58
- - 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.
56
+ - `bun.lock` is committed and `bun install --frozen-lockfile` is run in CI (the `test-unit` job's "Install dependencies" step in `.github/workflows/test.yml`, after the bake-time step). That lockfile gate fails on the package.json and bun.lock mismatches bun detects, not on every one (§2 lists those measured, and a recorded version outside its declared range that it accepts); `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).
57
+ - 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; `automerge` is off, so every bump flows through the full test suite + K&S review. Renovate uses `rangeStrategy: "replace"` so it preserves declared ranges and shares the keep-current allow-list with `check-dep-ages.mjs`; an exact pin still receives exact-version updates. 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.
59
58
 
60
59
  ### 3. Internal dep version lockstep
61
60
 
62
61
  Every `@tpsdev-ai/*` dep declared in any workspace package must match the version that workspace package ships. Enforced by `scripts/check-workspace-deps.mjs` in the test-unit CI job.
63
62
 
64
63
  - Why: prevents the v0.8.0 bug shape where `openclaw-flair@0.8.0` declared `@tpsdev-ai/flair-client@0.5.0`, shipping a 3-version-old client to consumers of the published tarball.
65
- - See `notes/dogfood-log.md` for the full incident.
66
64
 
67
65
  ### 4. Workspace `bun.lock` is the source of truth
68
66
 
@@ -104,15 +102,24 @@ Both mechanisms independently forced a pass (`|| echo` made the shell exit 0, so
104
102
  | `class` | `no-patch-published`, `vendor-pinned`, or `remediation-available` |
105
103
  | `introducedBy` | the dependency edge that pulls it in |
106
104
  | `reason` | why it cannot be fixed here, specifically |
107
- | `added`, `expires` | hard dates; lifetime is capped by severity |
105
+ | `added`, `expires` | each must be a real calendar date. Lifetime is `expires − added`; `added` must be on or before its id's first introduction day: the earliest UTC day of a commit containing it with no prior occurrence in ancestry within the pinned lineage. Ids compare case-insensitively |
106
+ | `overCapApproval` | an over-cap entry's approval: `approvedBy`, `reason`, `approvedOn` and `expires`. `approvedBy` records a name; the gate does not verify that name. Approval is reviewed in the PR |
108
107
  | `removeWhen` | the concrete condition that retires the entry |
109
108
 
110
- `scripts/audit-gate.mjs` fails the build on: an unlisted advisory, a malformed entry, an entry parked beyond its severity cap (critical 30 days, high 60, moderate/low 180), an **expired** entry, a **stale** entry whose advisory no longer appears, or a `no-patch-published` entry for which a patched version has since shipped. That last pair matters — an allowlist that only ever grows is the same failure with more ceremony.
109
+ An advisory can have several entries (for example one per install source or dependency chain), and one entry may still name several sources; an entry is identified by its `ghsa`, `package`, `sources` and `introducedBy`. At most one entry per advisory and package may name `bun` or the root npm install. When an advisory has several entries, each entry that names another consumer install must have an `introducedBy` chain that resolves to an installed copy there, and each reported copy must be covered by exactly one entry. `vendor-pinned` is refused for `bun`, which the root `overrides` control.
110
+
111
+ `scripts/audit-gate.mjs` fails the build on: an unlisted advisory, a malformed entry, an entry whose `added` is after today or later than its id's first introduction day, or a first history day after today for an id in the current entries, an entry whose `expires − added` span exceeds its severity cap (critical 30 days, high 60, moderate/low 180) without a valid over-cap approval, an **expired** entry, a **stale** entry whose advisory no longer appears (or, for an advisory with several entries, an entry that covers no reported location in a source it names), or, when the registry re-check succeeds, a `no-patch-published` entry for which a patched version has since shipped. An entry over its cap passes only with `overCapApproval` carrying all four members, a non-blank name and reason, real calendar dates, `approvedOn` no later than today and before its `expires`, and an entry that does not outlive the approval. The approval itself must not last longer than the severity cap, so it cannot extend an entry past `approvedOn` plus that cap; nothing is parked further than today plus the cap. That bound is on the expiry, not on the `added`-to-`expires` span. An `overCapApproval` on an entry within its cap is still validated, and an invalid one fails the build. `.github/audit-allowlist.json` is the fixed history path, pinned to its creation commit `847c40549c85dd9eb805b20f1790bf6956e8f38c` in the script. A shallow clone, a start outside HEAD's ancestry, a missing path at that start or any descendant in HEAD's ancestry, unreadable history, a non-JSON blob, a blob without an `entries` array, an allowlist naming more than 1,000 advisory ids (the history reader refuses it), or a malformed `policy.maxLifetimeDaysBySeverity` (a missing, non-numeric, non-positive, non-finite or over-ceiling value for one of the four severities, or a key other than those four) fails the run before advisory matching.
112
+
113
+ The four ceilings are pinned in `scripts/audit-gate.mjs` (`MAX_LIFETIME_DAYS_BY_SEVERITY`); `policy.maxLifetimeDaysBySeverity` may set a lower cap for a severity but cannot raise one. The gate fails when that block omits a severity, names a non-numeric value (a numeric string, `null`, `true` or an array), a non-positive or non-finite number, or a value above the ceiling; a severity outside the four fails closed.
114
+
115
+ Bun maps a missing or null advisory severity to `unknown`; npm first falls back to the package severity and uses `unknown` only if both are missing or null. A blank string stays blank; a non-null, non-string value selected by these fallbacks makes parsing throw. Both fail closed. `unknown` is not one of the four severities, so it has no lifetime cap: an allowlist entry with severity `unknown` is refused as malformed (`no lifetime cap is configured for severity "unknown"`), and without such an entry the advisory is reported as not allowlisted. Fix it, or wait for the source to classify it.
111
116
 
112
117
  When an entry expires the build fails and a human re-decides. **That is the mechanism working, not a flaw.** Re-dating an entry without re-reading its reason is how this file rots back into the thing it replaced.
113
118
 
114
119
  Run it locally with `node scripts/audit-gate.mjs --explain`.
115
120
 
121
+ `node scripts/ci/list-harper-bundled.mjs` prints harper's bundled packages and installed versions from `node_modules/harper/node_modules`. Root overrides do not replace those copies in a bun install, and `bun audit` reads only `bun.lock`, where those copies do not appear.
122
+
116
123
  **Standing rule for every check in this repo:** any check that is advisory-only must carry, in a comment at its own definition, what would make it blocking and when that gets re-evaluated. Advisory is a terminating state with a defined promotion event, never a resting place.
117
124
 
118
125
  ---
@@ -123,7 +130,7 @@ Run it locally with `node scripts/audit-gate.mjs --explain`.
123
130
 
124
131
  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)
125
132
 
126
- 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.
133
+ Renovate is configured with `automerge: false`, `rangeStrategy: "replace"` (§2), and `minimumReleaseAge: "7 days"` by default. The explicit ecosystem rules group `minor`, `patch`, `pin`, and `digest` updates per ecosystem (npm/Bun, Python, GitHub Actions, Docker); groups inherited from config:recommended may also apply. The shared preset leaves major updates ungrouped; repository-specific rules can group them. 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 npm dependency version it checks (an exact pin, or the version bun.lock resolves a range to; §2). 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 and GitHub Actions updates with types `minor`, `patch`, `pin`, or `digest` receive the corresponding ecosystem group. These explicit rules do not group `pinDigest` updates. 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.
127
134
 
128
135
  ### `scripts/check-workspace-deps.mjs` (already shipped, PR #368)
129
136
 
@@ -131,7 +138,9 @@ Fails any PR where a workspace package declares an internal `@tpsdev-ai/*` dep a
131
138
 
132
139
  ### `scripts/check-dep-ages.mjs` (this PR)
133
140
 
134
- Fails when a checked external exact-pinned production dep version was published less than `FLAIR_DEP_MIN_AGE_DAYS` ago (default 7) without a matching unexpired exemption; keep-current pins are skipped. Queries the npm registry's `time` map. Checks `dependencies`, `optionalDependencies` and `overrides` (root and every workspace package.json) — npm and bun install optionalDependencies by default; the gate checks exact override declarations, including conditional rules, not installed versions. Workspace-internal deps and exact pins with a matching unexpired exemption in `.github/dep-age-allowlist.json` (§1b) are exempt; a range is printed, not age-checked, and a refused dependency or override form fails the gate. Wired into the `test-unit` job. Its limits, stated: it does not check `peerDependencies` (resolved from a range by the consumer's install) nor `devDependencies` (don't ship in our tarballs) — 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.
141
+ Fails when a checked external dependency version is younger than the bake-time threshold without a matching unexpired exemption; keep-current packages are skipped, matched on the package a declaration installs (an `npm:` alias's target). Queries the configured registry's `time` map (the npm registry by default). Checks `dependencies`, `devDependencies`, `optionalDependencies` and `overrides` (the root package.json and each `packages/<name>/package.json`; a `bun.lock` workspace outside those fails the gate) — npm and bun install optionalDependencies by default. An exact pin outside `devDependencies` is checked at its declared version; a range at the version bun.lock resolves it to, with an override range checked at the installed copies in its scope (§2). A range the gate cannot resolve fails the gate, and an override range with no installed copy in its scope is named in the output, with nothing to check. Workspace-internal deps and checked versions with a matching unexpired exemption in `.github/dep-age-allowlist.json` (§1b) are exempt; a refused `dependencies`, `devDependencies`, `optionalDependencies` or `overrides` form fails the gate. Wired into the `test-unit` job. Its limits, stated: non-empty or malformed `resolutions` in root or workspace manifests are refused; it does not check `peerDependencies` (resolved from a range by the consumer's install) nor exact `devDependencies` pins (don't ship in our tarballs) — 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.
142
+
143
+ Local runs without `--ci` can set `FLAIR_DEP_MIN_AGE_DAYS`, `FLAIR_DEP_KEEP_CURRENT` and `FLAIR_NPM_REGISTRY`; `--ci` refuses the first two when set and uses the committed defaults, and accepts `FLAIR_NPM_REGISTRY` only when it names a loopback host (the tests serve their fixture registry there; the gate does not check what serves it). The workflow check rejects any of these variables, and `FLAIR_CHECK_DEP_AGES_ROOT`, in the gate step's, its job's or the workflow's `env`. Not covered: an earlier step in the same job that starts its own registry on loopback and exports the variable through `$GITHUB_ENV`. That is a code change to the workflow, and review is what catches it.
135
144
 
136
145
  Configurable:
137
146
 
@@ -162,10 +171,10 @@ Mirrors the CI test-unit gates locally so issues are caught at `git commit` time
162
171
 
163
172
  Runs three checks before each commit:
164
173
  - `check-workspace-deps.mjs` — workspace internal-dep version lockstep
165
- - `check-dep-ages.mjs` — supply-chain bake-time (≥7 days for external pinned deps)
166
- - `check-impl-term-leaks.sh` — no Bead refs / impl labels in user-facing docs, `CHANGELOG.md`, or `.changelog/`
174
+ - `check-dep-ages.mjs` — supply-chain bake-time (≥7 days for the external dependency versions §2 describes)
175
+ - `check-impl-term-leaks.sh` — no Bead refs / impl labels in user-facing docs, `CHANGELOG.md`, or `.changelog/` <!-- docs-freshness-allow: names the files the gate scans -->
167
176
 
168
- Each check matches a CI gate exactly so the local and remote outcomes can't drift. Bypass with `git commit --no-verify` when warranted (rare; CI will still catch you). Skip just the dep-ages check (the slowest one, ~2-5s of registry fetches) with `FLAIR_PRECOMMIT_SKIP_DEP_AGES=1 git commit`.
177
+ Bypass with `git commit --no-verify` when warranted (rare; CI will still catch you). Skip just the dep-ages check (the slowest one, ~2-5s of registry fetches) with `FLAIR_PRECOMMIT_SKIP_DEP_AGES=1 git commit`.
169
178
 
170
179
  ---
171
180
 
@@ -213,7 +222,6 @@ Add `packageRules` only for your own exceptions. The preset carries no `@tpsdev-
213
222
 
214
223
  ## See also
215
224
 
216
- - `notes/dogfood-log.md` — internal incidents that have shaped this policy
217
225
  - `scripts/check-workspace-deps.mjs` — the workspace-internal dep consistency gate
218
226
  - `scripts/check-dep-ages.mjs` — the bake-time dep guard
219
227
  - `ops/scripts/git-hooks/pre-commit-secret-guard.sh` — pre-commit secret blocker (cross-repo)
package/docs/the-team.md CHANGED
@@ -15,7 +15,7 @@ If you're trying to run your own multi-agent team using Flair as the memory laye
15
15
  | **Pulse** | EA / intel scanning / coordination | OpenClaw | Claude API | cloud VM |
16
16
  | **Nathan** | Founder / product owner / human-in-the-loop | (human) | (human) | wherever |
17
17
 
18
- Every agent has its own Ed25519 identity in Flair. They sign every memory write and every read. **Writes are isolated at the Flair API layer** — Sherlock can't accidentally (or maliciously) write into Pulse's memory, because the signature won't verify for anyone but Pulse. Reads are a different story: within one Flair instance, any verified agent can read any other agent's **non-private** memory — that's the shipped model (open-within-org read, no grant needed), not a gap. Which memories are non-private is decided at write time: visibility defaults from durability, so `permanent`/`persistent` writes land `shared` and `standard`/`ephemeral` writes land `private`. A teammate's scratch context is therefore owner-only until someone shares it deliberately, and an agent keeps something genuinely sensitive owner-only regardless of durability by writing it with `visibility: private`. The hard access boundary is the **federation edge** (a separate Flair instance), not reads within one.
18
+ Every agent has its own Ed25519 identity in Flair. They sign every memory write and every read. **Writes are isolated at the Flair API layer** — Sherlock can't accidentally (or maliciously) write into Pulse's memory, because the signature won't verify for anyone but Pulse. Reads are a different story: within one Flair instance, non-private memories pass the base visibility check without a grant; non-admin by-id and collection reads of retained closed skills additionally require readable current authority. That's the shipped model (open-within-org read), not a gap. Which memories are non-private is decided at write time: visibility defaults from durability, so `permanent`/`persistent` writes land `shared` and `standard`/`ephemeral` writes land `private`. A teammate's scratch context is therefore owner-only until someone shares it deliberately, and an agent keeps something genuinely sensitive owner-only regardless of durability by writing it with `visibility: private`. The hard access boundary is the **federation edge** (a separate Flair instance), not reads within one.
19
19
 
20
20
  ## How memory flows
21
21
 
@@ -50,7 +50,7 @@ No agent can write into another agent's memory — that's enforced server-side b
50
50
 
51
51
  The reverse also holds, and it is the part worth internalising: a `standard` or `ephemeral` write lands `private`, so an agent's day-to-day working context is *not* team-searchable by default. Commit something at `permanent`/`persistent` durability, or pass `visibility: shared`, when you mean the team to find it. An agent that needs something owner-only whatever its durability (a draft not ready for the team, a sensitive finding pre-disclosure) marks it `visibility: private` explicitly.
52
52
 
53
- When agents need to *coordinate* — a direct, targeted handoff rather than ambient searchable memory — they pass **explicit messages** through TPS mail (a separate signed delivery channel; see [tpsdev-ai/cli](https://github.com/tpsdev-ai/cli)). That's a different concern from memory visibility: TPS mail is for "I need you, specifically, to see this now"; Flair memory is the shared, searchable record everyone (except where `private`) can draw on later.
53
+ When agents need to *coordinate* — a direct, targeted handoff rather than ambient searchable memory — they pass **explicit messages** through TPS mail (a separate signed delivery channel; see [tpsdev-ai/cli](https://github.com/tpsdev-ai/cli)). That's a different concern from memory visibility: TPS mail is for "I need you, specifically, to see this now"; Flair memory is the shared, searchable record, subject to visibility, lifecycle filters and, on non-admin Memory by-id and collection reads of retained closed skills, the current-authority check.
54
54
 
55
55
  ## Why these splits
56
56
 
package/docs/upgrade.md CHANGED
@@ -158,11 +158,21 @@ exactly a shape flair supports:
158
158
  | Linux systemd user unit (the one proven above) | one `WorkingDirectory=` (the served tree) and one `ExecStart=` of `<node> <harper.js> run .` or `<launcher> <admin-pass file> <node> <harper.js>`, optional `-` prefix | drop-ins (any location systemd reports, or `<unit>.d` beside the file), any other argument (operator arguments are never rewritten), quoting, `%` specifiers, `$` variables, line continuations, other `ExecStart=` prefixes, and a new path that would need quoting |
159
159
  | Both, when moving to a different installed tree | the old tree is an npm-global install; its flair version and this CLI's are strict semver and this CLI's is not older (prereleases count: `0.57.0-beta.1` is older than `0.57.0`) | a plain tree or checkout (separately managed), an unreadable, non-semver or newer version (a downgrade cannot be ruled out) |
160
160
 
161
- A unit that serves this CLI's tree with a different, existing node is treated
162
- as a deliberate pin: `flair init` leaves it, and init and `flair doctor` report it
163
- with the hand edit that would move it. A plist that already serves this CLI's
164
- tree has a missing runtime path replaced without the version check in the table,
165
- which applies only to a move between trees. The write is atomic and
161
+ Apart from the Homebrew case below, a unit that serves this CLI's tree with a
162
+ different, existing node is treated as a deliberate pin: `flair init` does not
163
+ change that node path. With valid target paths and existing other runtime
164
+ paths, init leaves the unit unchanged and reports the pin; `flair doctor`
165
+ reports the pin with the hand edit that would move it. A systemd unit with a
166
+ missing runtime path is refused. A plist that already serves this CLI's tree
167
+ has a missing runtime path replaced without the version check in the table,
168
+ which applies only to a move between trees. In a plist or federation-sync shim that serves this CLI's tree and that
169
+ `flair init` accepts for re-pointing (a plist must pass the macOS row of the
170
+ table above), an existing node path in Homebrew's Cellar
171
+ (`<prefix>/Cellar/<formula>/<version>/bin/node`) is replaced by
172
+ `<prefix>/opt/<formula>/bin/node` when that alias resolves to the same binary.
173
+ A plist can replace a missing runtime path and an eligible Cellar node in the
174
+ same write.
175
+ The write is atomic and
166
176
  lands only over the bytes it was planned from — the file is read as a regular
167
177
  file (a symlink is refused, not followed) whose bytes are valid UTF-8 (anything
168
178
  else is refused before planning), and its bytes are re-checked immediately
@@ -416,6 +426,20 @@ stayed split for days after 0.30.0 was the incident this closes.
416
426
 
417
427
  ### Post-deploy fleet verify
418
428
 
429
+ By default, both `flair deploy` and `flair upgrade --target` set every MQTT
430
+ listener off in the target's configuration before deploying, then, after the
431
+ deploy's restart, request the shared worker threads' restart that applies it
432
+ when Flair is an isolated application (a fresh isolated deploy restarts only
433
+ Flair's own worker; otherwise the deploy's own restart covers the shared
434
+ workers) and read the saved configuration back, failing when it does not read
435
+ off (`--ops-target` / `FLAIR_OPS_TARGET` name the operations API for both;
436
+ `--no-restart` and `--no-verify` skip the restart request and the read-back).
437
+ They report what they set and requested; they do not probe the listeners,
438
+ and workers that have not restarted may still serve their previous listener
439
+ configuration. Pass `--keep-mqtt-config` to skip all of it and leave an MQTT
440
+ configuration you turned on deliberately
441
+ ([deploying-on-fabric.md](deploying-on-fabric.md#mqtt-configuration)).
442
+
419
443
  As of flair#636, both `flair deploy` and `flair upgrade --target` automatically run a
420
444
  fleet convergence sweep after a successful deploy — Harper's own "Successfully
421
445
  deployed" (and the served-API verify above) only confirm the *origin* node; nothing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/flair",
3
- "version": "0.62.0",
3
+ "version": "0.63.1",
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",
@@ -66,7 +66,7 @@
66
66
  "@harperfast/oauth": "2.9.0",
67
67
  "@types/js-yaml": "4.0.9",
68
68
  "commander": "14.0.3",
69
- "harper": "5.3.1",
69
+ "harper": "5.3.6",
70
70
  "harper-fabric-embeddings": "^0.5.0",
71
71
  "jose": "6.2.2",
72
72
  "js-yaml": "^4.3.2",
@@ -78,9 +78,9 @@
78
78
  "react-native-fs": "npm:empty-npm-package@1.0.0",
79
79
  "@harperfast/fulltext": "npm:empty-npm-package@1.0.0",
80
80
  "brace-expansion": "^5.0.12",
81
- "undici": "~8.10.2",
82
- "fast-uri": "^4.1.5",
83
- "hono": "^4.13.5",
81
+ "undici": "8.12.2",
82
+ "fast-uri": "4.2.3",
83
+ "hono": "4.13.16",
84
84
  "js-yaml": "^4.3.2",
85
85
  "adm-zip": "^0.6.1",
86
86
  "@opentelemetry/core": "^2.8.0",
@@ -90,17 +90,24 @@
90
90
  "form-data": "^4.0.6",
91
91
  "mysql2": "^3.22.0",
92
92
  "mariadb": "3.5.4",
93
- "qs": "^6.16.0",
94
- "fastify": "^5.12.5",
93
+ "qs": "6.16.1",
94
+ "fastify": "^5.12.7",
95
95
  "lodash": "^4.18.0",
96
- "ip-address": "^10.5.1",
97
- "joi": "^17.13.7",
96
+ "ip-address": "^10.7.4",
97
+ "zod": "4.6.7",
98
+ "body-parser": "2.4.0",
99
+ "joi": "17.13.9",
98
100
  "moment": "^2.31.0",
99
101
  "@grpc/grpc-js": "^1.14.5",
100
102
  "http-cache-semantics": "^4.3.0",
101
103
  "proxy-addr": "^2.0.8",
102
- "@modelcontextprotocol/sdk": "1.31.0",
103
- "handlebars": "4.7.10"
104
+ "@modelcontextprotocol/sdk": "1.32.0",
105
+ "handlebars": "4.7.10",
106
+ "simple-git": "4.0.2",
107
+ "@simple-git/argv-parser": "2.0.1",
108
+ "node-forge": "1.4.3",
109
+ "systeminformation": "5.33.16",
110
+ "@hono/node-server": "2.1.6"
104
111
  },
105
112
  "devDependencies": {
106
113
  "@playwright/test": "1.59.1",
@@ -23,11 +23,11 @@ type Agent @table(database: "flair") @export {
23
23
  createdAt: String!
24
24
  updatedAt: String
25
25
  originatorInstanceId: String @indexed # federation-edge-hardening slice 1 — write-time instance identity,
26
- # stamped server-side in resources/Agent.ts's post()/put() via
26
+ # stamped server-side in resources/Agent.ts's post() via
27
27
  # resources/originator-instance.ts from resources/instance-identity.ts's
28
28
  # localInstanceId(). On CREATE the local id is stamped (a request-body value is
29
- # ignored); on UPDATE the STORED value stands (a body value neither replaces nor
30
- # clears it). Nullable (existing rows read null = clean upgrade); preserved
29
+ # ignored); on UPDATE (put(), which only updates an existing row, and patch())
30
+ # the STORED value stands (a body value neither replaces nor clears it). Nullable (existing rows read null = clean upgrade); preserved
31
31
  # (never re-stamped) as the record flows through federation sync merges. See
32
32
  # schemas/memory.graphql's Memory.originatorInstanceId for the full contract —
33
33
  # same field, same idiom, this is one of the 4 synced tables
@@ -33,6 +33,7 @@ type Peer @table(database: "flair") @export {
33
33
  lastSyncAt: String # last contact with this peer (liveness signal)
34
34
  lastMergeAt: String # last sync where merged > 0 (data-progress signal)
35
35
  lastSyncCursor: String # Lamport clock or ISO timestamp for incremental sync
36
+ presenceLastSyncAt: String # sender-side per-table Presence watermark (flair#2578).
36
37
  relayOnly: Boolean # true for spoke-to-spoke peers announced by hub
37
38
  pairedAt: String
38
39
  createdAt: String! @indexed
@@ -41,9 +42,11 @@ type Peer @table(database: "flair") @export {
41
42
 
42
43
  # Sender-owned federation retry bookkeeping (flair#2455). The table is shaped
43
44
  # for one row per (peer, table, record) the receiver refused for a reason a
44
- # later re-offer could clear, plus locally observed unconfirmed sends. No
45
- # production sender path creates rows yet (a later slice activates the sender);
46
- # rows an admin writes are readable now. Local bookkeeping, EXCLUDED from
45
+ # later re-offer could clear, plus locally observed unconfirmed sends. The
46
+ # generic-Memory sender (`runFederationSyncOnce`) creates a pending row on a
47
+ # retryable refusal or a first indeterminate outcome, and updates it on later
48
+ # attempts, outcomes and source changes; rows an admin writes are readable now.
49
+ # Local bookkeeping, EXCLUDED from
47
50
  # federation policy and the receive mapping, so no inbound sync record can write
48
51
  # it (a pushed record naming it that passes the receiver's payload-id check
49
52
  # skips as `unknown_table`). Admin-only on every
@@ -61,16 +64,16 @@ type FederationRetry @table(database: "flair") @sealed @export {
61
64
  table: String! # the source table name
62
65
  recordId: String! # the source row id
63
66
  state: String! @indexed # "pending" | "terminal"
64
- firstRefusedAt: String! @indexed # age is measured from here (the T bound)
65
- attempts: Int! @indexed # reserved and persisted before each send (the N bound)
66
- episodeId: String # RESERVED for sender activation (flair#2455 slice 3): the obligation's generation, for rejecting stale completions; nothing sets or checks it yet
67
+ firstRefusedAt: String! @indexed # the obligation's first recorded time (a refusal or an indeterminate outcome); the sender enforces no age bound yet
68
+ attempts: Int! @indexed # incremented and persisted once per sender-level offer of a row that already has a valid pending row, before the send (a first ordinary offer has none); adaptive batch splitting can send the row more than once under one reservation; the sender enforces no attempt bound yet
69
+ episodeId: String # RESERVED: the sender does not generate it; a terminal update copies an existing value from the row it transitions — intended as the obligation's generation, for rejecting stale completions
67
70
  recordFingerprint: String # content fingerprint, for exhausted-row suppression
68
71
  lastReason: String # the closed SkipReason, or a local reason
69
72
  lastAttemptSyncId: String # the sync that last reserved an attempt
70
73
  lastAttemptAt: String
71
74
  completedAt: String # when the row became terminal
72
75
  resolution: String # which terminal outcome ended it
73
- bound: String # "attempts" | "age" | "both" for retry_exhausted; null otherwise
76
+ bound: String # RESERVED: the sender does not set a non-null value; a terminal update writes null — "attempts" | "age" | "both" for retry_exhausted; null otherwise
74
77
  createdAt: String!
75
78
  updatedAt: String
76
79
  }
@@ -98,17 +98,18 @@ type Memory @table(database: "flair") {
98
98
  # /RecordUsage (resources/RecordUsage.ts) and citation-on-write
99
99
  # (resources/Memory.ts post()/put() → recordCitations(), which also
100
100
  # validates each cited id against the writer's read scope,
101
- # flair#775). It does a targeted get-then-put increment on this
102
- # field alone (never through Memory.put() — see RecordUsage.ts's
101
+ # flair#775). It increments through the raw table (see RecordUsage.ts's
103
102
  # module doc for why: usage feedback writes to ANOTHER agent's
104
103
  # memory, and Memory's ownership check would 403 every legit
105
104
  # call). Drives usageBoost in resources/scoring.ts, which replaces
106
105
  # retrievalBoost in compositeScore (retrievalCount was the
107
106
  # contaminated "retrieval counted as usage" signal root-caused in
108
107
  # flair#623).
108
+ writeBackWriteId: String
109
109
  promotionStatus: String # null | "pending" | "approved" | "rejected"
110
110
  promotedAt: String
111
111
  promotedBy: String # authenticated agentId who approved
112
+ promotionContentHash: String # server-only SHA-256 of the stored, post-redaction content at stamping time (flair#2478)
112
113
  archived: Boolean @indexed
113
114
  archivedAt: String
114
115
  archivedBy: String # authenticated agentId who archived
@@ -392,6 +393,10 @@ type MemoryCandidate @table(database: "flair") @export {
392
393
  visibilityRationale: String # flair#1257 slice 3: the team-relevance justification paired with
393
394
  # visibilityRuling — the auditable "why shared" recorded on the candidate.
394
395
  # Nullable/additive, same clean-upgrade contract as scopeTag above.
396
+ promotedRowId: String # flair#2645: id of the Memory row the auto-promote sweep wrote for this
397
+ # candidate. Server-written; a later sweep reuses only the row this names.
398
+ promotedRowInstanceToken: String # flair#2645: that row's server-stamped incarnation token, recorded with the
399
+ # id. Nullable/additive — candidates written before this read null.
395
400
  }
396
401
 
397
402
  # Asset — binary blobs (screenshots, images) stored out-of-record via Harper's
@@ -12,5 +12,11 @@
12
12
  # NODE_BIN is an ABSOLUTE path resolved at enable time — the shim performs
13
13
  # zero PATH lookups at run time. Do not replace it with a bare `node`: that
14
14
  # would hand binary selection to whatever PATH the service manager carries.
15
+ #
16
+ # ADMIN_PASS_FILE is the ABSOLUTE path of the owner-only admin-password file,
17
+ # also resolved at enable time. The shim passes that path as ONE single-quoted
18
+ # argument. The CLI reads the password from that file when the cycle runs; the
19
+ # value is never written into this script, passed in argv, or exported into
20
+ # the environment.
15
21
  set -e
16
- exec "{{NODE_BIN}}" "{{FLAIR_BIN}}" rem nightly run-once
22
+ exec {{NODE_BIN}} {{FLAIR_BIN}} rem nightly run-once --admin-pass-file {{ADMIN_PASS_FILE}}