@tpsdev-ai/flair 0.59.0 → 0.63.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.
- package/README.md +10 -10
- package/SECURITY.md +49 -5
- package/config.yaml +23 -12
- package/dist/bridges/builtins/mem0.js +63 -28
- package/dist/bridges/runtime/execute.js +1 -0
- package/dist/bridges/runtime/import-runner.js +12 -0
- package/dist/bridges/runtime/load-plugin.js +42 -13
- package/dist/bridges/runtime/yaml-loader.js +4 -2
- package/dist/bridges/types.js +1 -0
- package/dist/build-info.json +3 -3
- package/dist/cli.js +1054 -367
- package/dist/commands/agent.js +233 -90
- package/dist/commands/attention.js +4 -3
- package/dist/commands/backup-approval.js +218 -0
- package/dist/commands/backup.js +211 -39
- package/dist/commands/bootstrap.js +3 -1
- package/dist/commands/bridge.js +172 -119
- package/dist/commands/deploy.js +71 -8
- package/dist/commands/doctor.js +711 -146
- package/dist/commands/export.js +57 -23
- package/dist/commands/federation.js +787 -82
- package/dist/commands/grant.js +5 -6
- package/dist/commands/help.js +25 -0
- package/dist/commands/hook.js +155 -2
- package/dist/commands/idp.js +27 -19
- package/dist/commands/import.js +136 -20
- package/dist/commands/init.js +469 -200
- package/dist/commands/integrity.js +387 -0
- package/dist/commands/keys.js +247 -58
- package/dist/commands/mcp.js +108 -52
- package/dist/commands/memory.js +203 -35
- package/dist/commands/migrate-harness-memory.js +3 -2
- package/dist/commands/orgevent.js +51 -47
- package/dist/commands/presence.js +4 -3
- package/dist/commands/principal.js +428 -62
- package/dist/commands/quality.js +13 -1
- package/dist/commands/reembed.js +141 -17
- package/dist/commands/relationship.js +2 -1
- package/dist/commands/rem.js +537 -80
- package/dist/commands/restore.js +413 -65
- package/dist/commands/search.js +6 -4
- package/dist/commands/service.js +235 -40
- package/dist/commands/soul.js +4 -9
- package/dist/commands/status.js +94 -38
- package/dist/commands/test.js +7 -3
- package/dist/commands/upgrade.js +77 -23
- package/dist/commands/workspace.js +13 -11
- package/dist/component-env.js +31 -41
- package/dist/deploy.js +136 -4
- package/dist/doctor-client.js +534 -92
- package/dist/engine-version-contract.js +1 -0
- package/dist/engine-version.js +23 -3
- package/dist/fabric-upgrade.js +12 -2
- package/dist/federation/presence-send.js +139 -0
- package/dist/federation-verify.js +273 -180
- package/dist/hook-install.js +670 -6
- package/dist/install/clients.js +171 -35
- package/dist/keystore.js +72 -0
- package/dist/lib/action-recall-runtime.js +328 -0
- package/dist/lib/agent-home-fields.js +132 -0
- package/dist/lib/agent-home.js +427 -0
- package/dist/lib/agent-id-rule.js +88 -0
- package/dist/lib/agent-roster.js +33 -0
- package/dist/lib/atomic-write.js +1 -1
- package/dist/lib/auth-resolve.js +1069 -60
- package/dist/lib/backup-approval-store.js +612 -0
- package/dist/lib/backup-artifact.js +343 -0
- package/dist/lib/capture-runtime.js +124 -0
- package/dist/lib/config-critical-section.js +212 -25
- package/dist/lib/connect-phase.js +33 -0
- package/dist/lib/credential-status-rule.js +78 -0
- package/dist/lib/daemon-liveness.js +43 -11
- package/dist/lib/doctor-run.js +75 -37
- package/dist/lib/durability-copy.js +10 -0
- package/dist/lib/embedding-space-doctor.js +75 -0
- package/dist/lib/federation-pair-access.js +4 -0
- package/dist/lib/federation-retry-queue.js +283 -0
- package/dist/lib/federation-retry-row.js +101 -0
- package/dist/lib/flair-agent-role.js +4 -0
- package/dist/lib/hub-url.js +12 -0
- package/dist/lib/init-admin-pass.js +88 -12
- package/dist/lib/init-listener-environ.js +1 -2
- package/dist/lib/init-occupied-listener.js +15 -111
- package/dist/lib/init-spawn-attribution.js +73 -0
- package/dist/lib/init-tcp-probe.js +33 -0
- package/dist/lib/instance-identity-row.js +20 -0
- package/dist/lib/instruction-event-contract.js +17 -0
- package/dist/lib/instruction-event-doctor.js +102 -0
- package/dist/lib/launchd-management.js +38 -3
- package/dist/lib/listener-table.js +268 -0
- package/dist/lib/local-delete-instance.js +27 -0
- package/dist/lib/local-instance-pair.js +256 -0
- package/dist/lib/mcp-enable.js +1182 -341
- package/dist/lib/mcp-oauth-env-core.js +133 -0
- package/dist/lib/mcp-oauth-env.js +125 -0
- package/dist/lib/mcp-spec.js +17 -1
- package/dist/lib/memory-attributes.js +4 -0
- package/dist/lib/memory-id-policy.js +46 -0
- package/dist/lib/memory-integrity.js +309 -0
- package/dist/lib/memory-provider-timeout.js +33 -0
- package/dist/lib/memory-purge-response.js +20 -0
- package/dist/lib/mqtt-config.js +132 -0
- package/dist/lib/mqtt-listener-doctor.js +104 -0
- package/dist/lib/open-live-row.js +20 -0
- package/dist/lib/ops-table-count.js +25 -0
- package/dist/lib/ops-url.js +52 -0
- package/dist/lib/owned-pins.js +67 -10
- package/dist/lib/peer-status.js +27 -0
- package/dist/lib/principal-status.js +29 -0
- package/dist/lib/process-start-time.js +76 -12
- package/dist/lib/promotion-content-hash.js +20 -0
- package/dist/lib/proto-safe-record.js +42 -0
- package/dist/lib/record-id-path.js +25 -0
- package/dist/lib/reembed-server-support.js +66 -0
- package/dist/lib/restore-archive.js +760 -0
- package/dist/lib/restore-verify.js +104 -0
- package/dist/lib/scheduler-platform.js +10 -6
- package/dist/lib/secret-keys.js +25 -0
- package/dist/lib/secrets-push.js +50 -22
- package/dist/lib/skill-assignment-preflight.js +159 -0
- package/dist/lib/skill-seed-pending.js +24 -0
- package/dist/lib/skill-seed.js +448 -0
- package/dist/lib/skill-tombstone-doctor.js +133 -0
- package/dist/lib/soul-scope-fields.js +26 -0
- package/dist/lib/stop-start-recovery.js +54 -0
- package/dist/lib/uninstall-purge.js +266 -11
- package/dist/lib/upgrade-prior-liveness.js +2 -1
- package/dist/lib/using-flair-skill.js +87 -0
- package/dist/mcp-client-assertion.js +114 -14
- package/dist/memory-id-checkpoint.js +347 -0
- package/dist/memory-node-compare.js +207 -0
- package/dist/mqtt-off-deploy.js +550 -0
- package/dist/packages/flair-mcp/src/secret-redaction.js +113 -0
- package/dist/rem/promote-policy.js +3 -3
- package/dist/rem/restore.js +303 -26
- package/dist/rem/runner.js +317 -96
- package/dist/rem/scheduler.js +21 -4
- package/dist/resources/A2AAdapter.js +131 -178
- package/dist/resources/AdminMemory.js +2 -0
- package/dist/resources/AdminMemoryCandidates.js +116 -0
- package/dist/resources/Agent.js +463 -33
- package/dist/resources/AgentCard.js +4 -0
- package/dist/resources/AgentKeyRegister.js +248 -0
- package/dist/resources/AgentKeyRegistration.js +28 -0
- package/dist/resources/AgentReadPosition.js +7 -0
- package/dist/resources/AgentSeed.js +238 -107
- package/dist/resources/AutoPromoteCandidates.js +413 -78
- package/dist/resources/Credential.js +183 -10
- package/dist/resources/Federation.js +915 -145
- package/dist/resources/FederationRetry.js +140 -0
- package/dist/resources/InstructionVersion.js +220 -0
- package/dist/resources/Integration.js +300 -25
- package/dist/resources/MCPClientMetadata.js +6 -3
- package/dist/resources/Memory.js +3300 -758
- package/dist/resources/MemoryArchive.js +171 -53
- package/dist/resources/MemoryBootstrap.js +122 -61
- package/dist/resources/MemoryCandidate.js +37 -3
- package/dist/resources/MemoryConsolidate.js +2 -2
- package/dist/resources/MemoryDedupStats.js +30 -1
- package/dist/resources/MemoryFeed.js +545 -50
- package/dist/resources/MemoryGrant.js +21 -1
- package/dist/resources/MemoryMaintenance.js +368 -46
- package/dist/resources/MemoryPurge.js +348 -0
- package/dist/resources/MemoryReflect.js +71 -12
- package/dist/resources/MemoryReindex.js +111 -17
- package/dist/resources/Message.js +16 -5
- package/dist/resources/OAuth.js +342 -48
- package/dist/resources/OAuthClient.js +1 -1
- package/dist/resources/OrgEvent.js +405 -19
- package/dist/resources/OrgEventCatchup.js +7 -0
- package/dist/resources/OrgEventMaintenance.js +48 -10
- package/dist/resources/PairingToken.js +1 -1
- package/dist/resources/Presence.js +166 -51
- package/dist/resources/PromoteMemoryCandidate.js +24 -7
- package/dist/resources/RecordUsage.js +2 -4
- package/dist/resources/Relationship.js +23 -0
- package/dist/resources/SemanticSearch.js +63 -32
- package/dist/resources/Soul.js +191 -76
- package/dist/resources/SoulFeed.js +2 -1
- package/dist/resources/TeamDirectory.js +35 -0
- package/dist/resources/WorkspaceLatest.js +4 -0
- package/dist/resources/WorkspaceState.js +21 -1
- package/dist/resources/XAA.js +207 -63
- package/dist/resources/a2a-stream.js +313 -0
- package/dist/resources/a2a-url.js +4 -5
- package/dist/resources/agent-admin.js +10 -1
- package/dist/resources/agent-auth.js +138 -83
- package/dist/resources/agent-read-position-lib.js +4 -1
- package/dist/resources/agent-status-guard.js +9 -7
- package/dist/resources/auth-middleware.js +534 -171
- package/dist/resources/authority-field-guard.js +9 -11
- package/dist/resources/auto-promote-lib.js +8 -5
- package/dist/resources/basic-auth-header.js +21 -0
- package/dist/resources/bm25-index-service.js +4 -5
- package/dist/resources/dedup-cluster.js +6 -1
- package/dist/resources/ed25519-auth.js +1 -1
- package/dist/resources/embedding-space-guard.js +366 -72
- package/dist/resources/embeddings-provider.js +25 -0
- package/dist/resources/engine-version-stamp-boot.js +53 -0
- package/dist/resources/federation-classify.js +161 -0
- package/dist/resources/federation-crypto.js +5 -5
- package/dist/resources/federation-retry-lib.js +60 -0
- package/dist/resources/grant-visibility.js +135 -0
- package/dist/resources/harper-routing.js +83 -0
- package/dist/resources/health.js +163 -22
- package/dist/resources/host-pointer/registry.js +29 -0
- package/dist/resources/host-pointer-adapter.js +1 -0
- package/dist/resources/host-source-citation.js +49 -0
- package/dist/resources/host-source-visibility.js +7 -6
- package/dist/resources/in-process.js +24 -22
- package/dist/resources/instance-create-lock.js +17 -0
- package/dist/resources/instance-identity.js +23 -0
- package/dist/resources/instruction-version-record.js +587 -0
- package/dist/resources/internal-authority.js +13 -0
- package/dist/resources/key-lock.js +3 -3
- package/dist/resources/mcp-handler.js +141 -19
- package/dist/resources/mcp-oauth-env-guard.js +36 -0
- package/dist/resources/mcp-oauth-flag.js +12 -14
- package/dist/resources/mcp-oauth.js +450 -56
- package/dist/resources/mcp-tool-arguments.js +4 -6
- package/dist/resources/mcp-tools.js +187 -40
- package/dist/resources/memory-bootstrap-lib.js +5 -15
- package/dist/resources/memory-declared-attributes.js +4 -1
- package/dist/resources/memory-deletion-history.js +55 -0
- package/dist/resources/memory-durability.js +54 -0
- package/dist/resources/memory-embed-hash.js +144 -0
- package/dist/resources/memory-embedding-value.js +8 -0
- package/dist/resources/memory-host-source.js +32 -7
- package/dist/resources/memory-id-guard.js +75 -0
- package/dist/resources/memory-redaction.js +236 -0
- package/dist/resources/memory-reflect-lib.js +1 -1
- package/dist/resources/memory-supplied-vector.js +72 -0
- package/dist/resources/memory-write-lock.js +489 -0
- package/dist/resources/memory-write-response.js +139 -0
- package/dist/resources/memory-write-transaction.js +243 -0
- package/dist/resources/migration-boot.js +17 -12
- package/dist/resources/migrations/boot-progress.js +25 -0
- package/dist/resources/migrations/data-dir.js +90 -19
- package/dist/resources/migrations/dir-safety.js +61 -3
- package/dist/resources/migrations/embedding-stamp.js +462 -82
- package/dist/resources/migrations/export.js +1 -0
- package/dist/resources/migrations/graph-heal.js +27 -27
- package/dist/resources/migrations/ledger.js +5 -2
- package/dist/resources/migrations/lock.js +870 -77
- package/dist/resources/migrations/progress.js +71 -10
- package/dist/resources/migrations/runner.js +212 -18
- package/dist/resources/migrations/snapshot.js +1 -0
- package/dist/resources/migrations/source-fields.js +5 -5
- package/dist/resources/migrations/state.js +36 -1
- package/dist/resources/migrations/status.js +2 -13
- package/dist/resources/migrations/synthetic-test-migration.js +81 -12
- package/dist/resources/migrations/types.js +26 -1
- package/dist/resources/migrations/visibility-backfill.js +113 -72
- package/dist/resources/oauth-discovery.js +0 -5
- package/dist/resources/object-body-guard.js +40 -0
- package/dist/resources/org-event-created-at.js +133 -0
- package/dist/resources/org-event-reserved.js +92 -0
- package/dist/resources/org-event-write-fault.js +19 -0
- package/dist/resources/originator-instance.js +39 -7
- package/dist/resources/owner-delete-recheck.js +78 -0
- package/dist/resources/owner-field-guard.js +39 -5
- package/dist/resources/owner-scoped-write-policy.js +256 -0
- package/dist/resources/owner-scoped-writes.js +89 -0
- package/dist/resources/path-id-rewrite.js +76 -0
- package/dist/resources/presence-internal.js +5 -5
- package/dist/resources/presence-receipt.js +236 -0
- package/dist/resources/promotion-binding.js +43 -0
- package/dist/resources/promotion-stamp.js +143 -17
- package/dist/resources/protocol-context.js +189 -0
- package/dist/resources/record-owner-guard.js +74 -26
- package/dist/resources/record-type-kit.js +2 -4
- package/dist/resources/record-types.js +1 -1
- package/dist/resources/relay-ops.js +78 -6
- package/dist/resources/replay-store.js +96 -19
- package/dist/resources/request-target.js +163 -0
- package/dist/resources/request-transaction.js +46 -1
- package/dist/resources/search-readiness.js +4 -1
- package/dist/resources/seed-ids.js +9 -0
- package/dist/resources/seed-reservation.js +116 -0
- package/dist/resources/semantic-retrieval-core.js +27 -15
- package/dist/resources/server-row-validation.js +71 -0
- package/dist/resources/skill-manifest.js +24 -14
- package/dist/resources/skill-subject.js +53 -0
- package/dist/resources/skill-version-write.js +789 -0
- package/dist/resources/skill-write-fault.js +20 -0
- package/dist/resources/skill-write-policy.js +68 -0
- package/dist/resources/skill-write.js +67 -7
- package/dist/resources/soul-write-policy.js +26 -7
- package/dist/resources/table-helpers.js +10 -7
- package/dist/resources/table-subscription-policy.js +518 -85
- package/dist/resources/table-subscriptions.js +20 -7
- package/dist/resources/team-directory.js +248 -0
- package/dist/resources/tool-descriptors/index.js +69 -8
- package/dist/resources/txn-pause-point.js +235 -0
- package/dist/resources/usage-recording.js +186 -70
- package/dist/resources/write-back.js +383 -0
- package/dist/resources/write-journal-context.js +5 -0
- package/dist/resources/write-journal.js +289 -0
- package/dist/src/engine-version-contract.js +1 -0
- package/dist/src/keystore.js +72 -0
- package/dist/src/lib/agent-home-fields.js +132 -0
- package/dist/src/lib/agent-id-rule.js +88 -0
- package/dist/src/lib/agent-key-register.js +80 -0
- package/dist/src/lib/atomic-write.js +256 -0
- package/dist/src/lib/credential-status-rule.js +78 -0
- package/dist/src/lib/expired-by-agent.js +37 -0
- package/dist/src/lib/federation-retry-row.js +101 -0
- package/dist/src/lib/flair-agent-role.js +4 -0
- package/dist/src/lib/idp-mapping-rule.js +81 -0
- package/dist/src/lib/instance-identity-row.js +20 -0
- package/dist/src/lib/instruction-event-contract.js +17 -0
- package/dist/src/lib/mcp-oauth-env-core.js +133 -0
- package/dist/src/lib/memory-attributes.js +4 -0
- package/dist/src/lib/memory-id-policy.js +46 -0
- package/dist/src/lib/open-live-row.js +20 -0
- package/dist/src/lib/principal-status.js +29 -0
- package/dist/src/lib/proto-safe-record.js +42 -0
- package/dist/src/lib/reembed-server-support.js +66 -0
- package/dist/src/lib/scheduler-platform.js +10 -6
- package/dist/src/lib/soul-scope-fields.js +26 -0
- package/dist/src/lib/systemd-agent-id.js +38 -0
- package/dist/src/rem/promote-policy.js +3 -3
- package/dist/src/rem/scheduler.js +21 -4
- package/docs/access-control.md +164 -54
- package/docs/api-reference.md +165 -32
- package/docs/auth.md +46 -30
- package/docs/bridges.md +11 -0
- package/docs/claude-code.md +37 -7
- package/docs/deploying-on-fabric.md +178 -0
- package/docs/deployment.md +19 -0
- package/docs/embedding-in-a-harper-app.md +17 -15
- package/docs/entity-vocabulary.md +3 -6
- package/docs/federation.md +61 -3
- package/docs/hosted-on-fabric.md +43 -36
- package/docs/integrations.md +14 -14
- package/docs/mcp-clients.md +12 -7
- package/docs/n8n.md +17 -11
- package/docs/notes/mcp-agent-auth-consumer.md +16 -13
- package/docs/notes/mcp-oauth-model2.md +40 -11
- package/docs/openclaw.md +1 -1
- package/docs/quickstart-fabric.md +4 -4
- package/docs/quickstart.md +12 -4
- package/docs/releasing.md +25 -19
- package/docs/rem.md +32 -3
- package/docs/secrets-and-keys.md +21 -4
- package/docs/standalone-local.md +30 -2
- package/docs/supply-chain-policy.md +34 -16
- package/docs/the-team.md +2 -2
- package/docs/upgrade.md +46 -6
- package/package.json +24 -12
- package/schemas/agent-key-registration.graphql +22 -0
- package/schemas/agent.graphql +6 -3
- package/schemas/federation.graphql +41 -1
- package/schemas/memory.graphql +91 -7
- package/schemas/oauth.graphql +19 -0
- package/schemas/schema.graphql +2 -0
- package/templates/bin/flair-rem-nightly.sh.tmpl +7 -1
- package/templates/launchd/start-flair-with-admin-pass.sh +188 -10
- package/dist/resources/soul-adk-guard.js +0 -68
package/docs/quickstart.md
CHANGED
|
@@ -49,7 +49,7 @@ First run does six things:
|
|
|
49
49
|
5. Wires every MCP client it detects — Claude Code, Cursor, Codex CLI, Gemini CLI — to `npx -y @tpsdev-ai/flair-mcp`, then smoke-tests it. `--no-mcp` skips this.
|
|
50
50
|
6. Opens a short **soul wizard** so your agent knows who it is.
|
|
51
51
|
|
|
52
|
-
It also
|
|
52
|
+
It also saves the supplied or generated Harper admin password to `~/.flair/admin-pass` (mode 0600). Read the file when a command needs the password, and prefer `--admin-pass-file ~/.flair/admin-pass` over pasting it into a command line.
|
|
53
53
|
|
|
54
54
|
The soul wizard offers a few shapes:
|
|
55
55
|
|
|
@@ -137,6 +137,14 @@ You didn't ask for that, and it isn't a setting you have to remember. Flair deri
|
|
|
137
137
|
| `permanent`, `persistent` | `shared` — a fact or decision worth keeping is worth the team being able to find |
|
|
138
138
|
| `standard`, `ephemeral` — including a bare write with no `--durability` | `private` — working context and scratch state belong to the agent that produced them |
|
|
139
139
|
|
|
140
|
+
Retention, decay and bootstrap ordering by tier:
|
|
141
|
+
|
|
142
|
+
- permanent — routine maintenance never reaps or age-archives it (an expired validTo archives an eligible row; an acquired expiresAt never reaps it); it never decays; bootstrap considers the bootstrapping agent's own permanent memories before recent rows, subject to scope, expiry/closure and the token budget.
|
|
143
|
+
- persistent — routine maintenance never reaps or age-archives it (an expired validTo archives an eligible row; an acquired expiresAt never reaps it).
|
|
144
|
+
- standard — routine maintenance archives it once its validTo passes or, as a session note, after 30 days.
|
|
145
|
+
- ephemeral — routine maintenance reaps it once its TTL (24h by default) passes.
|
|
146
|
+
- No tier adds a flush, fsync, backup or replica acknowledgement: an explicit delete (owner or admin) or a store failure can end any of them.
|
|
147
|
+
|
|
140
148
|
So sharing is a deliberate act, and it takes one flag:
|
|
141
149
|
|
|
142
150
|
```bash
|
|
@@ -146,7 +154,7 @@ flair memory add --agent local --visibility shared \
|
|
|
146
154
|
|
|
147
155
|
`--visibility` takes exactly `private` or `shared` — a value it doesn't recognise is an error, not a guess — and overrides the durability rule in both directions. The `visibility` field in the response is the value the memory actually landed on, so read it rather than assuming.
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
A shared memory passes every agent's base visibility check without a grant; retained closed skills additionally require readable current authority on non-admin by-id and collection reads. That is the shipped model: reads open within one instance, closed at the federation edge. Full picture in [SECURITY.md](../SECURITY.md).
|
|
150
158
|
|
|
151
159
|
## 5. Find it back by meaning
|
|
152
160
|
|
|
@@ -169,7 +177,7 @@ Add `--explain` to see the ranking inputs per hit — the raw score, the composi
|
|
|
169
177
|
|
|
170
178
|
## 6. Give your agent context on boot
|
|
171
179
|
|
|
172
|
-
With MCP wired
|
|
180
|
+
With MCP wired, the recommended session-start tool is `bootstrap`. In Claude Code that appears as `mcp__flair__bootstrap` (Claude Code's namespaced name for the server's `bootstrap` tool). Add this to your `CLAUDE.md`: <!-- docs-freshness-allow: names a file in the reader's project -->
|
|
173
181
|
|
|
174
182
|
```
|
|
175
183
|
At the start of every session, run mcp__flair__bootstrap before responding.
|
|
@@ -194,7 +202,7 @@ Soul entries and relevant memories, in one block sized to a token budget. Paste
|
|
|
194
202
|
| You want to... | Go to |
|
|
195
203
|
|----------------|-------|
|
|
196
204
|
| Add more agents to the same instance | `flair agent add <id>` |
|
|
197
|
-
| Share a memory with your other agents | `flair memory add --visibility shared` — a bare write lands `private`, see [step 4](#who-can-read-it); a shared
|
|
205
|
+
| Share a memory with your other agents | `flair memory add --visibility shared` — a bare write lands `private`, see [step 4](#who-can-read-it); a shared memory passes the instance-wide base visibility check without a grant; non-admin Memory by-id and collection reads of retained closed skills also apply the current-authority check ([auth.md](auth.md)) |
|
|
198
206
|
| Import memories from agentic-stack / Mem0 / etc. | [bridges.md](bridges.md) |
|
|
199
207
|
| Sync memories across machines | [federation.md](federation.md) |
|
|
200
208
|
| Integrate with OpenClaw, Claude Code, Cursor | [README.md#integration](../README.md#integration) |
|
package/docs/releasing.md
CHANGED
|
@@ -30,10 +30,10 @@ There is no "fix the stage in place" — you reject it and re-cut the next patch
|
|
|
30
30
|
latest moves
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
One `vX.Y.Z` tag starts npm staging and the `adk-flair` PyPI workflow.
|
|
34
|
+
PyPI requires the matching `packages/adk-flair/pyproject.toml` version and approval
|
|
35
|
+
in the `adk-flair-publish` environment. `adk-flair-vX.Y.Z` remains available for
|
|
36
|
+
Python-only releases; `workflow_dispatch` remains the manual fallback.
|
|
37
37
|
|
|
38
38
|
## Cutting a release
|
|
39
39
|
|
|
@@ -63,18 +63,18 @@ a bug in the script — add the file to `SOURCE_VERSION_FILES` in
|
|
|
63
63
|
**The changelog is assembled, not hand-promoted.** Entries land during development as one
|
|
64
64
|
file per change under `.changelog/unreleased/` (flair#835 — a shared `[Unreleased]` block
|
|
65
65
|
conflicted on every concurrent PR, and resolving a conflict dismisses approvals). The
|
|
66
|
-
release script
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
`## [Unreleased]`
|
|
77
|
-
`node scripts/changelog-fragments.mjs render`.
|
|
66
|
+
release script invokes `bash scripts/release-promote-changelog.sh "$VERSION"`, which
|
|
67
|
+
passes `--with-dependencies` to `changelog-fragments.mjs promote` and forwards any
|
|
68
|
+
`--allow-no-release-tag` argument.
|
|
69
|
+
The `### Dependencies` section lists `feat`/`fix` commits since the tag selected by
|
|
70
|
+
`git describe` whose recorded author name matches `renovate[bot]` and whose changed
|
|
71
|
+
Git basenames are all `package.json`, `bun.lock`, `bun.lockb`, `package-lock.json`, or
|
|
72
|
+
`npm-shrinkwrap.json`.
|
|
73
|
+
Pass `--allow-no-release-tag` to `release.sh` to permit release PR preparation when
|
|
74
|
+
there is no `v*` tag.
|
|
75
|
+
Promotion refuses when there are neither fragments nor eligible dependency commits,
|
|
76
|
+
or when `## [Unreleased]` contains hand-written entries it would overwrite.
|
|
77
|
+
Preview fragments with `node scripts/changelog-fragments.mjs render`.
|
|
78
78
|
|
|
79
79
|
### Phase 2 — tag the release
|
|
80
80
|
|
|
@@ -100,8 +100,8 @@ git tag v0.11.0 && git push origin v0.11.0
|
|
|
100
100
|
> When the release commit's tree carries
|
|
101
101
|
> `packages/adk-flair/pyproject.toml` whose `[project].version` equals the version
|
|
102
102
|
> being tagged, the auto-tagger ALSO creates `adk-flair-v<version>` from the same
|
|
103
|
-
> commit
|
|
104
|
-
>
|
|
103
|
+
> commit. PyPI runs serialize per version, upload missing artifacts after the guards pass,
|
|
104
|
+
> and verify both filenames and SHA256 digests; lookup errors fail the run.
|
|
105
105
|
>
|
|
106
106
|
> The project version is read with Python's `tomllib` — the SAME reader
|
|
107
107
|
> `.github/workflows/adk-flair-publish.yml` decides with — by handing the file to
|
|
@@ -186,7 +186,7 @@ auto-cuts a [GitHub release](https://github.com/tpsdev-ai/flair/releases) for th
|
|
|
186
186
|
Release notes are a **lede + links** rendering of the matching `## [X.Y.Z]` section
|
|
187
187
|
(`scripts/changelog-release-notes.mjs`): each entry keeps its bold lede, up to three
|
|
188
188
|
issue links, and any `> **Heads-up:**` operator lines. The deep record stays in
|
|
189
|
-
`CHANGELOG.md` and is linked from the footer at that tag. It is idempotent: re-running
|
|
189
|
+
`CHANGELOG.md` and is linked from the footer at that tag. <!-- docs-freshness-allow: the repository's changelog, not a package file --> It is idempotent: re-running
|
|
190
190
|
the workflow or re-pushing the tag updates the existing release rather than failing.
|
|
191
191
|
The GitHub release documents the tagged commit immediately; it does not wait on the
|
|
192
192
|
npm 2FA gate. If the CHANGELOG has no section for the version, this job fails loudly
|
|
@@ -386,6 +386,12 @@ review. Because the release is triggered by a tag push, its deployment policy mu
|
|
|
386
386
|
**`v*` tags** (Settings → Environments → `release` → Deployment branches and tags →
|
|
387
387
|
Selected branches and tags → add tag rule `v*`).
|
|
388
388
|
|
|
389
|
+
### GitHub `adk-flair-publish` environment
|
|
390
|
+
|
|
391
|
+
Repository admin: add the tag rule `v*` under Settings → Environments →
|
|
392
|
+
`adk-flair-publish` → Deployment branches and tags → Selected branches and tags.
|
|
393
|
+
Keep `adk-flair-v*` and the required reviewer. No tag-creation ruleset change is needed.
|
|
394
|
+
|
|
389
395
|
### Required status checks (ruleset)
|
|
390
396
|
|
|
391
397
|
Add **`First-publish preflight`** to the main branch ruleset's required status
|
package/docs/rem.md
CHANGED
|
@@ -52,13 +52,19 @@ Selects which `models.generative.<logicalName>` entry a REM call uses. Unset →
|
|
|
52
52
|
|
|
53
53
|
`flair rem nightly enable` installs a platform-native timer (launchd / systemd) **on the host it runs on**. In a multi-node or Fabric deploy, enabling it on every node would run the cycle N times and scatter N sets of pre-cycle snapshots. The v1 rule: **exactly one node gets the timer** — pick it deliberately, the same way you'd pick a cron owner for any single-writer job. This is a v1 constraint, not a permanent one; see #709 for the roadmap toward a coordinated multi-node story.
|
|
54
54
|
|
|
55
|
-
Snapshot locality follows from this: a nightly cycle's pre-run snapshot (`~/.flair/snapshots/<agent>/`) lands on **the node that ran that cycle** — `flair rem restore <date>` and `flair rem snapshot list` only see local snapshots. If you move which node owns the timer, snapshot history doesn't move with it. Live replay (`flair rem restore <date> --apply`) rewrites Soul with operator credentials (`--admin-pass` / `--admin-pass-file`); an agent key is refused. Leftover MemoryCandidate rows for that agent are deleted first so their claim text cannot block Soul restore.
|
|
55
|
+
Snapshot locality follows from this: a nightly cycle's pre-run snapshot (`~/.flair/snapshots/<agent>/`) lands on **the node that ran that cycle** — `flair rem restore <date>` and `flair rem snapshot list` only see local snapshots. If you move which node owns the timer, snapshot history doesn't move with it. Live replay (`flair rem restore <date> --apply` without `--dry-run`) rewrites Soul with operator credentials (`--admin-pass` / `--admin-pass-file`); an agent key is refused. Every Memory, Soul and MemoryCandidate read, delete and write it sends carries the admin credential it resolved, so it needs no local `~/.flair/admin-pass` when a flag supplies one. An `--apply --dry-run` to a non-loopback target without `--admin-pass` or `--admin-pass-file` resolves credentials signed-only and sends no Basic credential; `FLAIR_ADMIN_PASS` and the local admin-password file are read only for a loopback target. Leftover MemoryCandidate rows for that agent are deleted first so their claim text cannot block Soul restore. Live replay writes to the resolved base URL (`FLAIR_URL`'s scheme, port and path, or the local instance when it is unset) and lists those candidates through `GET /AdminMemoryCandidates/{agentId}` on that same endpoint; a dry run without an admin password does not list them. A live replay goes on only with a complete listing, read page by page (`after` set to the last id of the page before) until a page answers `hasMore: false`: a listing it cannot read completely (for example a malformed reply, a page that cannot move the cursor, a repeated id or a failed request such as `candidate_id_unusable`, which the route answers rather than leave out a row it reads without a usable id) is refused before any target-row delete or write. Flair server 0.63.0 adds that admin-only route: a live replay whose candidate request the target answers with HTTP 404 is refused with that version named; restore does not fall back to an operations endpoint. Restore's REST calls do not follow redirects.
|
|
56
56
|
|
|
57
57
|
## Interactive vs nightly
|
|
58
58
|
|
|
59
59
|
- **Interactive (`flair rem rapid`):** one bounded, synchronous distillation call — gather cap 50 memories, bounded output tokens, seconds not minutes. Executes by default, staging candidates and printing a summary; `--prompt-only` returns the reflection prompt instead, for the bring-your-own-model handoff. A cold generative backend (first Ollama model load) is warmed outside Harper's request transaction so execute fails as the documented 502/503, not HTTP 422 from the 30s open-transaction ceiling.
|
|
60
60
|
- **Nightly (`flair rem nightly enable` / `run-once`):** fully detached — the scheduler runs the full cycle (snapshot → maintenance → distillation), candidates land as pending rows, and an audit row lands in `~/.flair/logs/rem-nightly.jsonl`. The operator reviews in the morning via `flair rem candidates`.
|
|
61
61
|
|
|
62
|
+
### Nightly admin credential
|
|
63
|
+
|
|
64
|
+
`flair rem nightly enable` bakes the absolute path of the admin-password file into the scheduler shim (`~/.flair/admin-pass` by default; override with `--admin-pass-file`). `run-once` reads the password from that file at run time; the value is never stored in the shim, exported into the environment, or passed in argv. The instance-wide dedup-cluster step calls an admin-gated route, so the file must exist and be owner-only (no group or world permission bits; `flair init` writes mode 0600). When the shim names a file that is missing, empty, or group-/world-readable, the run fails at startup before any cycle work with the dedup step NOT RUN, names the path and the remedy, and exits nonzero on every path, including a paused cycle and a dry run. An existing install picks up the new shim by re-running `flair rem nightly enable`; until then the previously installed shim stays in place.
|
|
65
|
+
|
|
66
|
+
The pending-candidate count `run-once` prints (`Pending:`) uses the same credential through the operations API. When that query fails, the line reads `Pending: unknown (<reason>)`, the failure is listed under `Errors:`, and the run exits nonzero. With no admin credential, when the cycle reaches the candidate-count step, the line reads `Pending: unknown (no admin credential for the operations API)`.
|
|
67
|
+
|
|
62
68
|
### Safety bounds (a large backlog must not take the instance down)
|
|
63
69
|
|
|
64
70
|
A first run over thousands of unreflected memories used to hold the Harper main thread long enough that `/Health` and search timed out. Nightly distillation is now bounded:
|
|
@@ -75,7 +81,7 @@ Either path, the review loop is the same: `flair rem candidates` lists pending r
|
|
|
75
81
|
|
|
76
82
|
adk-flair collapses every `(app, user)` into **one** Flair agentId, separating users only by a per-user tag `adk:<app>:<user>`. Distilling such an agentId with the default `scope:"recent"` would mix every user's sessions into shared claims — cross-user bleed. The nightly cycle therefore detects the agent's active `adk:<app>:<user>` tags (from the memories it already loads for the snapshot, with a recency cutoff that skips idle users and is scoped to the agent's own records) and runs distillation **once per tag** under `scope:"tagged"`, so each user's candidates come only from that user's own sessions. Agents with no `adk:` tags distill agentId-wide exactly as before.
|
|
77
83
|
|
|
78
|
-
Memory promotion runs through `POST /PromoteMemoryCandidate` with `candidateId` and a nonempty `rationale`. The server reads the candidate and its lineage, writes the persistent memory through the normal safety/provenance path, and stamps `promotionStatus`, `promotedAt` and `
|
|
84
|
+
Memory promotion runs through `POST /PromoteMemoryCandidate` with `candidateId` and a nonempty `rationale`. The server reads the candidate and its lineage, writes the persistent memory through the normal safety/provenance path, and stamps `promotionStatus`, `promotedAt`, `promotedBy` and `promotionContentHash` (a server-only SHA-256 of the stored, post-redaction content at stamping time). Successful stamps bind newly created memories. Legacy verdicts without a matching binding are suppressed by binding-checked readers; review creates a new memory rather than binding the legacy row. When the automatic stamp reports failure, the candidate stays pending and the sweep reports `stamp_refused`. Direct Memory writes cannot set these workflow fields, including administrator REST writes; a content-changing write clears them. Full-row updates may echo unchanged stamps; omitted stamps are preserved. Creating a successor with `memory_update(preserveHistory=true)` leaves the verdict on the predecessor; the new content starts without an approval stamp. Non-admin reviewers are attributed to their authenticated identity; only administrators may name another reviewer. `flair rem promote --to memory` uses this endpoint and requires an updated server; it does not fall back to direct verdict writes.
|
|
79
85
|
|
|
80
86
|
A candidate distilled under a tag records that tag in its `scopeTag` field. `flair rem promote` reads `scopeTag` as the authoritative per-user lineage tag and propagates it onto the promoted memory — so the promoted claim stays in that user's retrieval scope even if the source episodes are later archived or deleted. The single-node timer rule above is unchanged; the per-tag loop runs inside the one cycle on the one node. The non-thinking-model requirement (above) still holds — the per-tag path calls the same `models.generate()` route.
|
|
81
87
|
|
|
@@ -88,10 +94,33 @@ For ADK agents, the nightly cycle **auto-promotes** these `scopeTag`-bearing can
|
|
|
88
94
|
- **Content-safety, strict.** The claim is scanned for prompt injection and refused on a flag regardless of `FLAIR_CONTENT_SAFETY` — an unattended write does not fall back to warn-and-tag.
|
|
89
95
|
- **Non-impersonating reviewer.** The promoted memory and its candidate record `machine:adk-auto-promote`, never a value mistakable for a human or agent reviewer.
|
|
90
96
|
|
|
91
|
-
Anything ineligible (no scope tag, flagged content
|
|
97
|
+
Anything ineligible (no scope tag, flagged content) is left pending for the human `rem promote` path. The step is bounded per cycle and non-fatal. The per-call `limit` caps the eligible candidates the sweep attempts a memory write for, whatever the attempt's outcome (rejected or thrown attempts included), plus those it takes an earlier recorded memory for (below); the rest stay pending for a later cycle. `flair rem nightly run-once` reports the count auto-promoted. **Non-ADK candidates never auto-promote** — the human review gate below is unchanged for them.
|
|
98
|
+
|
|
99
|
+
The sweep writes and stamps the promoted memory, then marks the candidate `promoted`; it does not mark a candidate promoted before its memory is stamped. (A concurrent deletion of that memory is still possible.) When the candidate update throws, the memory is already written and stamped, and the throw does not say whether the update committed, so the sweep reads the candidate back. `POST /AutoPromoteCandidates` answers `{ agentId, promoted, skipped, incomplete, unconfirmed, count, considered }`:
|
|
100
|
+
|
|
101
|
+
- `promoted`: the memory id of each candidate whose promoted update this call wrote without a throw, or that the read-back found promoted on this memory. `count` is its length.
|
|
102
|
+
- `skipped`: `{ id, reason }` for each candidate the call left pending for a reason it names, for example `no_adk_scope_tag`, `content_safety:…`, `memory_write_error`, `stamp_refused` or `recorded_row_changed`.
|
|
103
|
+
- `incomplete`: `{ memoryId, candidateId, error }` for each promotion whose memory was written and stamped but whose candidate update threw, when the read-back then found the candidate `pending`.
|
|
104
|
+
- `unconfirmed`: `{ memoryId, candidateId, error, readBack }` for the same throw when the read-back failed, or found the candidate neither `pending` nor promoted on this memory: the promotion on this memory was not confirmed. `readBack` says what the read found.
|
|
105
|
+
- `considered`: the number of pending candidates the call examined.
|
|
106
|
+
|
|
107
|
+
The read-back establishes only the candidate's state at that moment (`pending`, or `promoted` on this memory with this reviewer), not whether this call's update is the write that produced it. Neither `incomplete` nor `unconfirmed` entries count in `promoted` or `count`; their memory write attempts do count toward the `limit`.
|
|
108
|
+
|
|
109
|
+
A later sweep re-reads a candidate that is still pending. It can use the memory recorded on the candidate (`promotedRowId`, `promotedRowInstanceToken`) only when that identity is present on the candidate. The sweep records it before the stamp; when the identity is absent (for example, the recording threw before it committed), the next sweep attempts a fresh write instead. The recorded memory must still be the one the sweep wrote (same id and incarnation token, same owner, content equal to the claim, the sweep's visibility, durability and tags, not archived). When it also carries the sweep's own approval — `promotionStatus` `approved`, `promotedBy` `machine:adk-auto-promote`, a `promotionContentHash` that matches its content, and a `promotedAt` — the sweep adopts it. It takes the memory's write lock, re-checks all of this on a fresh read, and, still holding the lock, marks the candidate `promoted` with `decidedAt` set to the memory's `promotedAt`. It writes no other memory and reports that memory id under `promoted` (or, if that update throws, under the read-back's outcome). An owner edit that changes the memory's content (or otherwise makes it fail these checks) and lands before the lock leaves the candidate pending (`recorded_row_changed`). One that waits for the lock lands after the candidate update. When that update is reported promoted, a content change clears the approval the same way it does on any promoted memory; an edit that changes no content need not. Memory's dedup gate only reports a near-duplicate, so this check is what prevents the second row. When the recorded memory does not qualify at the sweep's first read (for example, a different verdict, edited content, or archived), the sweep attempts a fresh write and stamp, either of which can fail or be refused. The approval check trusts Flair's resource write paths, where verdict fields are server-written; the admin operations API writes rows directly and can change them. `flair rem nightly run-once` prints the incomplete and unconfirmed counts on its `Auto-promoted:` line.
|
|
92
110
|
|
|
93
111
|
## Memory retention and deletion
|
|
94
112
|
|
|
95
113
|
Durability is owner-controlled, including `permanent`: owners may create, change, archive and delete their own memories at every tier. Administrators may delete any owner’s memory. The permanent tier controls retention and bootstrap priority; it does not prevent an explicit owner deletion.
|
|
96
114
|
|
|
115
|
+
What each tier actually guarantees:
|
|
116
|
+
|
|
117
|
+
- permanent — routine maintenance never reaps or age-archives it (an expired validTo archives an eligible row; an acquired expiresAt never reaps it); it never decays; bootstrap considers the bootstrapping agent's own permanent memories before recent rows, subject to scope, expiry/closure and the token budget.
|
|
118
|
+
- persistent — routine maintenance never reaps or age-archives it (an expired validTo archives an eligible row; an acquired expiresAt never reaps it).
|
|
119
|
+
- standard — routine maintenance archives it once its validTo passes or, as a session note, after 30 days.
|
|
120
|
+
- ephemeral — routine maintenance reaps it once its TTL (24h by default) passes.
|
|
121
|
+
|
|
122
|
+
Maintenance runs are scoped: an agent's own run covers that agent's rows; an admin run that omits `agentId` is fleet-wide and expires or archives eligible rows of every agent; one that names an `agentId` covers that agent. An admin `agentId` must match the agent-id rule (`^[a-zA-Z0-9_-]{1,64}$`), so an agent whose stored id is outside the rule cannot be named in an admin-scoped run. That 400 names the rule and the remedy: run that agent's own authenticated non-admin maintenance, which reaches its rows, when the stored id can authenticate (the signed TPS-Ed25519 header cannot carry a colon or whitespace); for an id the header cannot represent, run fleet-wide maintenance, which reaches that agent's rows and also expires and archives other agents' eligible rows.
|
|
123
|
+
|
|
124
|
+
- No tier adds a flush, fsync, backup or replica acknowledgement: an explicit delete (owner or admin) or a store failure can end any of them.
|
|
125
|
+
|
|
97
126
|
Soul is operator-authored identity, not a promotion target for learned candidates. `flair rem promote --to soul` is refused for stored candidate text even with operator credentials; promote learned claims to Memory instead.
|
package/docs/secrets-and-keys.md
CHANGED
|
@@ -14,11 +14,11 @@ Agents sign every request to Flair with this key. Flair refuses unsigned request
|
|
|
14
14
|
**This is the only secret material Flair manages.** Lose the key file and the agent is locked out (`flair agent rotate-key <id>` to issue a new pair).
|
|
15
15
|
|
|
16
16
|
## Flair admin password (Harper instance)
|
|
17
|
-
-
|
|
17
|
+
- Fresh local `flair init` writes the supplied or generated admin password to `~/.flair/admin-pass` (mode `0o600`).
|
|
18
18
|
- The `--admin-pass-file <path>` option allows reading the password from a file (for pre-staged secrets).
|
|
19
19
|
- The `--admin-pass <pass>` option is deprecated due to shell history exposure; use `--admin-pass-file` or environment variables instead. A warning is printed when this option is used.
|
|
20
20
|
- Environment variables `FLAIR_ADMIN_PASS` and `HDB_ADMIN_PASSWORD` are also supported.
|
|
21
|
-
- After the first start, Harper's persisted user hash is the source of truth. `HDB_ADMIN_PASSWORD` will not rotate it.
|
|
21
|
+
- After the first start, Harper's persisted user hash is the source of truth. `HDB_ADMIN_PASSWORD` will not rotate it. Without `--reset-admin-pass`, supplied credentials are refused when no instance is running and an admin-pass file or persisted admin user exists, except that `--skip-start` can reuse an identical securely read credential.
|
|
22
22
|
## What Flair does *not* own: API keys, tokens, third-party credentials
|
|
23
23
|
|
|
24
24
|
Things that are NOT Flair's job:
|
|
@@ -144,6 +144,23 @@ Hermes uses `~/.hermes/.env` for provider API keys (managed by `hermes auth`). T
|
|
|
144
144
|
- **Don't check it into git.** `.gitignore` should already exclude `~/.flair/keys/`; if you're ever tempted to share keys for "convenience," rotate first (`flair agent rotate-key <id>`).
|
|
145
145
|
- **Backup separately**, encrypted. The `flair backup` command excludes private keys by default. Roll your own backup of `~/.flair/keys/` via age-encrypted archive if you want offsite recovery.
|
|
146
146
|
|
|
147
|
+
## Key cleanup
|
|
148
|
+
|
|
149
|
+
`flair keys prune` classifies every `.key` file in the key directory and, with
|
|
150
|
+
`--apply`, moves prunable keys into `<keysDir>/.pruned/<date>/`; keys with
|
|
151
|
+
refused sidecars stay in place.
|
|
152
|
+
It never deletes a file itself. A move can still replace an entry that a
|
|
153
|
+
concurrent writer creates at the destination before the move lands: the selected
|
|
154
|
+
archive name, or, when a failed key move rolls its sidecar back, the sidecar's
|
|
155
|
+
original path.
|
|
156
|
+
|
|
157
|
+
- Agent signing keys whose seed parses are prunable when the agent is not
|
|
158
|
+
registered on the targeted instance, except node-shaped files without `.pub`.
|
|
159
|
+
- Node-shaped files (`flair_<hex8>.key` without `.pub`) stay report-only.
|
|
160
|
+
Minting attempts to record a sidecar; sidecar-write failure leaves them report-only.
|
|
161
|
+
|
|
162
|
+
Unreadable reference rows leave node-shaped files unidentified.
|
|
163
|
+
|
|
147
164
|
## What about a `flair secret` CLI?
|
|
148
165
|
|
|
149
166
|
Considered, deferred. Flair could ship a thin wrapper around the OS keyring (`flair secret get/set/list`) — but the OS primitives already work and are universally trusted. Adding a Flair-shaped wrapper would mean we own the bug surface for marginal ergonomic gain. Better path: document the OS primitives well (this page) and stay focused on identity + memory.
|
|
@@ -163,7 +180,7 @@ If you find yourself wanting one anyway, your agent can call `security find-gene
|
|
|
163
180
|
|
|
164
181
|
Writes are scoped per `agentId` and isolation is enforced **server-side** by Ed25519 signature verification — not by client convention. An attacker with another agent's key can write memories as that agent, but cannot forge writes under *your* agent's identity without *your* key.
|
|
165
182
|
|
|
166
|
-
Reads are a different, and intentionally more open, story: within one Flair instance (one org),
|
|
183
|
+
Reads are a different, and intentionally more open, story: within one Flair instance (one org), any verified agent — not just an attacker with a stolen key — passes the base visibility check for another agent's non-private memory; non-admin by-id and collection reads of retained closed skills additionally require readable current authority. That's the shipped access model (open-within-org read; see [SECURITY.md](../SECURITY.md)), not a consequence of key compromise. A key leak's actual *incremental* exposure is narrower than "read your agent's memories": it's (1) the ability to write under that agent's identity, and (2) the ability to read that agent's `visibility: private` memories, which stay owner-only under normal operation. Non-private memories pass the org-wide base visibility check, while non-admin Memory by-id and collection reads of retained closed skills remain subject to current authority.
|
|
167
184
|
|
|
168
185
|
The hard boundary in this model is the **federation edge** — a separate Flair instance / org. That's a different threat model from password-based or API-key-based memory services where a leaked key gives access to the full namespace across every trust boundary, not just one org.
|
|
169
186
|
|
|
@@ -171,4 +188,4 @@ The hard boundary in this model is the **federation edge** — a separate Flair
|
|
|
171
188
|
|
|
172
189
|
- [`docs/auth.md`](auth.md) — full auth scheme and signature format
|
|
173
190
|
- [`docs/mcp-clients.md`](mcp-clients.md) — wiring the flair-mcp server into Claude Code / Gemini CLI / Codex CLI
|
|
174
|
-
- [`packages/hermes-flair/README.md`](
|
|
191
|
+
- [`packages/hermes-flair/README.md`](https://github.com/tpsdev-ai/flair/blob/main/packages/hermes-flair/README.md) — Hermes-specific plugin auth notes
|
package/docs/standalone-local.md
CHANGED
|
@@ -45,6 +45,7 @@ flair init --agent mybot # name the agent (--agent-id also works)
|
|
|
45
45
|
flair init --client claude-code # wire one specific MCP client
|
|
46
46
|
flair init --no-mcp # instance + agent only, skip MCP wiring
|
|
47
47
|
flair init --skip-smoke # skip the MCP smoke test
|
|
48
|
+
flair init --skip-start # do not start Harper; with --agent, defer registration
|
|
48
49
|
flair init --port 8000 # use a non-default port
|
|
49
50
|
```
|
|
50
51
|
|
|
@@ -109,6 +110,8 @@ httpBind: 127.0.0.1 # HTTP bind host; 0.0.0.0 widens (must include IPv4 loopb
|
|
|
109
110
|
| `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). |
|
|
110
111
|
| `FLAIR_HYBRID_RETRIEVAL` | Hybrid BM25 + vector retrieval (default on). | Set `false` to revert to HNSW-only. |
|
|
111
112
|
| `FLAIR_MODELS_DIR` | Directory the embedding GGUF is loaded from. | When the model lives outside `<data-dir>/models`. |
|
|
113
|
+
| `FLAIR_REQUEST_TIMEOUT_MS` | Whole-request deadline for REST calls through the CLI's shared REST sender (`authedRequest`), in milliseconds: an integer from `1` to `3600000`, default `300000` (5 minutes). It covers the request and the response body read. The four REM work routes listed under `FLAIR_REM_REQUEST_TIMEOUT_MS` resolve that variable instead, and any request that passes its own explicit deadline — those routes or a command's own — is validated and returned before this variable is read. On expiry a GET or HEAD fails; every other method through that sender raises an outcome-unknown error and is not retried, and `flair rem restore` does not write that table and record id again in the same run. An empty or whitespace-only value is unset. | When a legitimate request needs longer than the default. A value outside the range, or a non-integer, is refused for the requests that resolve this variable. |
|
|
114
|
+
| `FLAIR_REM_REQUEST_TIMEOUT_MS` | Whole-request deadline for the REM work routes `POST /MemoryMaintenance`, `POST /ReflectMemories`, `POST /MemoryDedupStats` and `POST /AutoPromoteCandidates`, in milliseconds: an integer from `1` to `3600000`, default `1800000` (30 minutes). It overrides `FLAIR_REQUEST_TIMEOUT_MS` for those routes and is read only for them; every other request through the shared REST sender that passes no explicit deadline resolves `FLAIR_REQUEST_TIMEOUT_MS`, else the shared default. An empty or whitespace-only value is unset. | When a REM work route legitimately needs longer than 30 minutes. A value outside the range, or a non-integer, is refused for those routes before the request is sent. |
|
|
112
115
|
|
|
113
116
|
---
|
|
114
117
|
|
|
@@ -204,15 +207,40 @@ See [upgrade.md](upgrade.md) for the full walkthrough including re-embedding, ro
|
|
|
204
207
|
## Backup & restore
|
|
205
208
|
|
|
206
209
|
```bash
|
|
207
|
-
# Backup all data (agents, memories, souls)
|
|
210
|
+
# Backup all data (agents, memories, souls). Writes the archive and, beside it,
|
|
211
|
+
# flair-backup-YYYYMMDD.json.sha256
|
|
208
212
|
flair backup --output ~/flair-backup-$(date +%Y%m%d).json
|
|
209
213
|
|
|
210
|
-
# Restore
|
|
214
|
+
# Restore an archive (its .sha256 sidecar sits beside it, unless the archive is approved on this host; see below)
|
|
211
215
|
flair restore ~/flair-backup-20260405.json
|
|
212
216
|
```
|
|
213
217
|
|
|
214
218
|
Always backup before upgrades. `flair backup` excludes private keys.
|
|
215
219
|
|
|
220
|
+
Restore writes each archived Agent row through the Agent resource's administrator PUT, so the PUT's field rules apply: the target's stored `createdAt`, `publicKey`, `originatorInstanceId` and federation fields are kept, `updatedAt` is set by the server, and `role` and `admin` are reconciled (an archived row with `role: "agent"` and `admin: true` is stored as an admin, with `role: "admin"`). Restore's read-back of an Agent row currently verifies its id only, so a field the PUT set differently from the archive is not reported. An archived Agent row whose agent does not exist on the target is refused (HTTP 404, `agent_put_requires_existing`), so restore reports it as failed and exits non-zero; a full restore into a fresh instance needs a creation route for agents ([flair#2703](https://github.com/tpsdev-ai/flair/issues/2703)). Soul and Memory rows are still written, and restore reports a mismatch in the fields it verifies for them (the selected fields in `src/lib/restore-verify.ts`; server-managed fields such as `provenance` and `updatedAt` are excluded). Archived promotion verdicts are not restored either: restore reports a Memory row that carries one as failed (HTTP 403) unless the stored row already carries the same verdict.
|
|
221
|
+
|
|
222
|
+
`flair backup` writes two files: the archive and `<archive>.sha256`, the SHA-256 of the archive's exact bytes in `sha256sum` format (from the archive's directory, `shasum -a 256 -c <archive>.sha256` or GNU `sha256sum -c <archive>.sha256` checks it; for a file name containing a carriage return, use GNU `sha256sum`). Keep and move the two files together. `flair restore` verifies the pair before it sends any request, `--dry-run` included. It refuses an archive whose sidecar does not match, and an archive with no sidecar unless that archive is approved on this host (below). The sidecar detects a damaged, truncated or mismatched file; it does not prove who wrote the archive.
|
|
223
|
+
|
|
224
|
+
### Restoring an archive written before digest sidecars
|
|
225
|
+
|
|
226
|
+
An archive with no `.sha256` sidecar is restored only after the operator approves its exact bytes on the host that restores it:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# 1. Print the archive's SHA-256. This approves nothing and needs no credentials.
|
|
230
|
+
flair backup-approval legacy-admit ~/flair-backup-20250101.json
|
|
231
|
+
|
|
232
|
+
# 2. Compare that digest with a record you trust, then approve exactly those bytes.
|
|
233
|
+
flair backup-approval legacy-admit ~/flair-backup-20250101.json \
|
|
234
|
+
--confirm-digest 3f5c...e1a9 --admin-pass-file ~/.flair/admin-pass
|
|
235
|
+
|
|
236
|
+
# 3. Restore it.
|
|
237
|
+
flair restore ~/flair-backup-20250101.json
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Approving, a confirmed legacy admission (with `--confirm-digest`) and revoking need operator credentials: the admin password, which the command checks as a super_user against this host's running Flair. It finds the operations port from `--ops-port`, `FLAIR_OPS_PORT`, the local config, or the HTTP port minus one. Approvals live in `~/.flair/approved-archives/`, which must be owned by you: its directories mode `0700` and its record and archive files mode `0600` (a private temp file left by an interrupted approval is ignored; any other entry is refused before the store creates anything). The store keeps a copy of each approved archive under its SHA-256 and a record of when and by whom it was approved. No REST route can approve, revoke, list or read it. `flair backup-approval list` shows the approvals and checks each stored copy; `flair backup-approval revoke <sha256>` withdraws one. Restore uses an approval, of either kind, only while it is unrevoked and its stored copy still hashes to the archive's digest, and it restores that stored copy.
|
|
241
|
+
|
|
242
|
+
An approval authorizes those bytes on this host until you revoke it, so restoring an older approved archive deliberately is possible. It does not show where the archive came from, that a past promotion decision in it was right, or that an archive without a sidecar is unchanged since it was written. `flair backup-approval approve <archive>` records an approval for an archive that has its sidecar; `flair restore` does not need one for such an archive.
|
|
243
|
+
|
|
216
244
|
---
|
|
217
245
|
|
|
218
246
|
## Federation
|
|
@@ -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,25 +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
|
-
|
|
36
|
+
Local runs without `--ci` can add to the default allow-list via `FLAIR_DEP_KEEP_CURRENT="pkg1,pkg2,@scope/pkg3"`.
|
|
37
|
+
|
|
38
|
+
#### 1b. Dated exemptions for security pins
|
|
39
|
+
|
|
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.
|
|
41
|
+
|
|
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.
|
|
45
|
+
|
|
46
|
+
A per-pin exemption belongs in this allowlist.
|
|
38
47
|
|
|
39
48
|
### 2. Exact-version pinning for production deps
|
|
40
49
|
|
|
41
|
-
Some `dependencies` entries are exact-pinned (`harper@5.
|
|
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).
|
|
42
51
|
|
|
43
|
-
- `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.
|
|
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.
|
|
44
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.
|
|
45
54
|
|
|
46
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.
|
|
47
|
-
- `bun.lock` is committed and `bun install --frozen-lockfile` is run in CI (`.github/workflows/test.yml`,
|
|
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
|
|
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.
|
|
49
58
|
|
|
50
59
|
### 3. Internal dep version lockstep
|
|
51
60
|
|
|
52
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.
|
|
53
62
|
|
|
54
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.
|
|
55
|
-
- See `notes/dogfood-log.md` for the full incident.
|
|
56
64
|
|
|
57
65
|
### 4. Workspace `bun.lock` is the source of truth
|
|
58
66
|
|
|
@@ -94,15 +102,24 @@ Both mechanisms independently forced a pass (`|| echo` made the shell exit 0, so
|
|
|
94
102
|
| `class` | `no-patch-published`, `vendor-pinned`, or `remediation-available` |
|
|
95
103
|
| `introducedBy` | the dependency edge that pulls it in |
|
|
96
104
|
| `reason` | why it cannot be fixed here, specifically |
|
|
97
|
-
| `added`, `expires` |
|
|
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 |
|
|
98
107
|
| `removeWhen` | the concrete condition that retires the entry |
|
|
99
108
|
|
|
100
|
-
|
|
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.
|
|
101
116
|
|
|
102
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.
|
|
103
118
|
|
|
104
119
|
Run it locally with `node scripts/audit-gate.mjs --explain`.
|
|
105
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
|
+
|
|
106
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.
|
|
107
124
|
|
|
108
125
|
---
|
|
@@ -113,7 +130,7 @@ Run it locally with `node scripts/audit-gate.mjs --explain`.
|
|
|
113
130
|
|
|
114
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)
|
|
115
132
|
|
|
116
|
-
Renovate is configured
|
|
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.
|
|
117
134
|
|
|
118
135
|
### `scripts/check-workspace-deps.mjs` (already shipped, PR #368)
|
|
119
136
|
|
|
@@ -121,7 +138,9 @@ Fails any PR where a workspace package declares an internal `@tpsdev-ai/*` dep a
|
|
|
121
138
|
|
|
122
139
|
### `scripts/check-dep-ages.mjs` (this PR)
|
|
123
140
|
|
|
124
|
-
Fails
|
|
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.
|
|
125
144
|
|
|
126
145
|
Configurable:
|
|
127
146
|
|
|
@@ -152,10 +171,10 @@ Mirrors the CI test-unit gates locally so issues are caught at `git commit` time
|
|
|
152
171
|
|
|
153
172
|
Runs three checks before each commit:
|
|
154
173
|
- `check-workspace-deps.mjs` — workspace internal-dep version lockstep
|
|
155
|
-
- `check-dep-ages.mjs` — supply-chain bake-time (≥7 days for external
|
|
156
|
-
- `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 -->
|
|
157
176
|
|
|
158
|
-
|
|
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`.
|
|
159
178
|
|
|
160
179
|
---
|
|
161
180
|
|
|
@@ -195,7 +214,7 @@ Add `packageRules` only for your own exceptions. The preset carries no `@tpsdev-
|
|
|
195
214
|
|
|
196
215
|
## Exceptions and incident response
|
|
197
216
|
|
|
198
|
-
- **
|
|
217
|
+
- **Exempt an otherwise checked fresh security pin:** add a dated entry to `.github/dep-age-allowlist.json` naming the advisory (§1b). It is reviewed on the PR and expires on its own. Don't bypass silently.
|
|
199
218
|
- **Confirmed upstream compromise affecting Flair:** rotate any affected credential, revert the offending dep version, ship a patch release, file a public advisory at `github.com/tpsdev-ai/flair/security/advisories`. Notify Nathan immediately; don't act unilaterally.
|
|
200
219
|
- **Suspected (not confirmed) compromise:** open an issue with the evidence; treat it as P0 in our backlog until disproven.
|
|
201
220
|
|
|
@@ -203,7 +222,6 @@ Add `packageRules` only for your own exceptions. The preset carries no `@tpsdev-
|
|
|
203
222
|
|
|
204
223
|
## See also
|
|
205
224
|
|
|
206
|
-
- `notes/dogfood-log.md` — internal incidents that have shaped this policy
|
|
207
225
|
- `scripts/check-workspace-deps.mjs` — the workspace-internal dep consistency gate
|
|
208
226
|
- `scripts/check-dep-ages.mjs` — the bake-time dep guard
|
|
209
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,
|
|
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
|
|
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
|
|