blun-king-cli 9.1.536 → 9.1.550
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/LIESMICH.txt +13 -869
- package/README.md +41 -833
- package/bin/assistant-message-offload-policy.cjs +3 -1
- package/bin/context-performance-policy.cjs +2 -5
- package/bin/context-pressure-policy.cjs +20 -0
- package/bin/cron-run-output.cjs +45 -0
- package/bin/cron-run-store.cjs +145 -0
- package/bin/durable-task-resume-policy.cjs +130 -0
- package/bin/durable-task-resume-runtime.cjs +117 -0
- package/bin/durable-task-resume-store.cjs +88 -0
- package/bin/editable-tool-approval-policy.cjs +540 -0
- package/bin/editable-tool-approval-runtime.cjs +99 -0
- package/bin/html-to-research-markdown.cjs +146 -0
- package/bin/programmatic-tool-runtime.mjs +330 -4
- package/bin/read-continuation-policy.cjs +36 -5
- package/bin/scoped-cron-run-policy.cjs +358 -0
- package/bin/startup-preferences.cjs +3 -3
- package/bin/structured-agent-swarm-output.cjs +325 -0
- package/bin/subagent-context-fork-policy.cjs +155 -0
- package/bin/subagent-skill-policy.cjs +204 -0
- package/bin/telegram-approval-relay.cjs +2 -1
- package/bin/tool-result-offload-policy.cjs +14 -1
- package/bin/update-notice.js +14 -18
- package/bin/user-message-offload-policy.cjs +3 -1
- package/blun.mjs +1089 -477
- package/codebase-index/README.md +12 -0
- package/codebase-index/codebase_index.py +129 -18
- package/package.json +23 -58
- package/telegram-plugin/bin/telegram-typing-keepalive.cjs +89 -0
- package/telegram-plugin/dist/bridge.mjs +8 -1
- package/CHANGELOG.md +0 -321
- package/agent-spine-plugin/CHANGELOG.md +0 -406
- package/agent-spine-plugin/CONTRIBUTING.md +0 -52
- package/agent-spine-plugin/README.md +0 -344
- package/agent-spine-plugin/SECURITY.md +0 -47
- package/agent-spine-plugin/docs/acceptance.md +0 -61
- package/agent-spine-plugin/docs/architecture.md +0 -183
- package/agent-spine-plugin/docs/attention.md +0 -121
- package/agent-spine-plugin/docs/automatic-continuity.md +0 -79
- package/agent-spine-plugin/docs/channel-runtime.md +0 -92
- package/agent-spine-plugin/docs/coordination.md +0 -138
- package/agent-spine-plugin/docs/feed-transport.md +0 -99
- package/agent-spine-plugin/docs/gateway-runtime.md +0 -116
- package/agent-spine-plugin/docs/harness-reference.md +0 -45
- package/agent-spine-plugin/docs/host-integration.md +0 -129
- package/agent-spine-plugin/docs/https-transport.md +0 -116
- package/agent-spine-plugin/docs/learning.md +0 -133
- package/agent-spine-plugin/docs/object-transport.md +0 -93
- package/agent-spine-plugin/docs/peer-transport.md +0 -88
- package/agent-spine-plugin/docs/preflight-recall.md +0 -69
- package/agent-spine-plugin/docs/preservation-contract.md +0 -53
- package/agent-spine-plugin/docs/quality-gates.md +0 -50
- package/agent-spine-plugin/docs/relationships.md +0 -73
- package/agent-spine-plugin/docs/releasing.md +0 -83
- package/agent-spine-plugin/docs/roadmap.md +0 -307
- package/agent-spine-plugin/docs/selfstarter.md +0 -88
- package/agent-spine-plugin/docs/session-briefing.md +0 -74
- package/agent-spine-plugin/docs/shared-memory.md +0 -259
- package/agent-spine-plugin/docs/source-roots.md +0 -86
- package/agent-spine-plugin/docs/sqlite-transport.md +0 -76
- package/agent-spine-plugin/scripts/check-hosts.js +0 -195
- package/agent-spine-plugin/scripts/check-install.js +0 -569
- package/agent-spine-plugin/scripts/check-syntax.js +0 -29
- package/agent-spine-plugin/scripts/github-actions.js +0 -11
- package/agent-spine-plugin/scripts/release-check.js +0 -128
- package/agent-spine-plugin/scripts/run-acceptance.js +0 -19
- package/agent-spine-plugin/scripts/run-checks.js +0 -46
- package/agent-spine-plugin/scripts/run-tests-hermetic.js +0 -73
- package/agent-spine-plugin/spine-example/1-identity.md +0 -12
- package/agent-spine-plugin/spine-example/2-voice.md +0 -6
- package/agent-spine-plugin/spine-example/3-conduct.md +0 -8
- package/agent-spine-plugin/spine-example/4-history.md +0 -4
- package/bin/fredrik-glm-provider.cjs +0 -256
- package/bin/package-regression-policy.cjs +0 -77
- package/fredrik-glm-profile.toml.example +0 -26
- package/release-planned-removals.json +0 -15
- package/scripts/check-active-profile-plugin-startup.js +0 -36
- package/scripts/check-active-work-steer-regression.js +0 -46
- package/scripts/check-approval-observability-regression.js +0 -111
- package/scripts/check-approval-queue-shortcuts-regression.js +0 -65
- package/scripts/check-bundled-agent-spine-regression.js +0 -48
- package/scripts/check-codebase-search-packaging-regression.js +0 -92
- package/scripts/check-copy-command-regression.js +0 -74
- package/scripts/check-current-turn-read-pin-mutation-regression.js +0 -72
- package/scripts/check-current-turn-read-pin-regression.js +0 -94
- package/scripts/check-deepseek-native-max-regression.js +0 -49
- package/scripts/check-empty-response-effort-downgrade-regression.js +0 -48
- package/scripts/check-fredrik-glm-mutation-regression.js +0 -18
- package/scripts/check-fredrik-glm-regression.js +0 -169
- package/scripts/check-historical-tool-result-preview-regression.js +0 -77
- package/scripts/check-history-pressure-offload-regression.js +0 -77
- package/scripts/check-mcp-startup-wait-budget.js +0 -48
- package/scripts/check-package-regression.js +0 -38
- package/scripts/check-plugin-startup-regression.js +0 -53
- package/scripts/check-programmatic-context-isolation-regression.js +0 -193
- package/scripts/check-programmatic-tool-regression.js +0 -294
- package/scripts/check-queue-controls-regression.js +0 -189
- package/scripts/check-release-metadata.js +0 -103
- package/scripts/check-reload-agent-spine-regression.js +0 -76
- package/scripts/check-resume-replay-regression.js +0 -102
- package/scripts/check-session-cancel-regression.js +0 -43
- package/scripts/check-session-picker-resume-metrics-regression.js +0 -97
- package/scripts/check-session-start-hook-context-regression.js +0 -228
- package/scripts/check-shell-terminal-isolation-regression.js +0 -81
- package/scripts/check-slash-escape-regression.js +0 -89
- package/scripts/check-startup-swarm-command-regression.js +0 -24
- package/scripts/check-structured-subagent-output-regression.js +0 -331
- package/scripts/check-telegram-bridge-watchdog.js +0 -60
- package/scripts/check-telegram-direct-work-resume-regression.js +0 -53
- package/scripts/check-telegram-loop-exactly-once-regression.js +0 -71
- package/scripts/check-todo-loop-regression.js +0 -78
- package/scripts/check-todo-progress-regression.js +0 -416
- package/scripts/check-todo-recovery-catalog-regression.js +0 -50
- package/scripts/check-tool-schema-capacity-regression.js +0 -40
- package/scripts/programmatic-tool-runtime.test.mjs +0 -365
- package/scripts/structured-subagent-output.test.cjs +0 -170
- /package/{scripts → bin}/fix-node-pty-perms.js +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# Safe learning
|
|
2
|
-
|
|
3
|
-
AgentSpine separates an observation from a fact that may enter future context. An agent can propose a candidate and append evidence, but the candidate remains invisible to `learning_context` until it passes an explicit review or the narrowly scoped, default-off automatic policy. Version 0.11 adds an outcome-bound path for low-risk behavior: a lesson is useful only when fixed, externally measured tasks improve after a limited canary application.
|
|
4
|
-
|
|
5
|
-
```mermaid
|
|
6
|
-
flowchart LR
|
|
7
|
-
O["Observation"] --> C["Candidate"]
|
|
8
|
-
C --> E["Append-only evidence"]
|
|
9
|
-
E --> R{"Review gate"}
|
|
10
|
-
R -->|"explicit user confirmation"| A["Accepted context"]
|
|
11
|
-
R -->|"reject"| X["Rejected history"]
|
|
12
|
-
R -->|"opt-in fact policy"| A
|
|
13
|
-
E --> M["Independent before receipts"]
|
|
14
|
-
M --> K["Scoped canary"]
|
|
15
|
-
K --> N["Independent after receipts"]
|
|
16
|
-
N -->|"measured improvement"| A
|
|
17
|
-
N -->|"regression or blocking defect"| B["Automatic rollback"]
|
|
18
|
-
A --> S["Supersede without erasing"]
|
|
19
|
-
S --> B["Rollback restores prior fact"]
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Candidate kinds
|
|
23
|
-
|
|
24
|
-
| Kind | Normal review path | Automatic eligibility |
|
|
25
|
-
|---|---|---|
|
|
26
|
-
| `preference` | Explicit confirmation | Never |
|
|
27
|
-
| `no-go` | Explicit confirmation | Never |
|
|
28
|
-
| `goal` | Explicit confirmation | Never |
|
|
29
|
-
| `correction` | Explicit confirmation | Never |
|
|
30
|
-
| `personal-fact` | Explicit confirmation | Never |
|
|
31
|
-
| `project-fact` | Explicit confirmation | Opt-in, evidence-gated |
|
|
32
|
-
| `reference` | Explicit confirmation | Opt-in, evidence-gated |
|
|
33
|
-
| `behavior` | Explicit confirmation | Opt-in, outcome-gated canary |
|
|
34
|
-
|
|
35
|
-
Every candidate and evidence record carries `authority: context-only`. Accepted learning can improve relevance and consistency, but it cannot grant permissions, delegation, production access, spending rights, policy exceptions, or instructions to act.
|
|
36
|
-
|
|
37
|
-
## Evidence and provenance
|
|
38
|
-
|
|
39
|
-
Evidence is append-only while a candidate is awaiting review. Supported evidence types are `user-statement`, `document`, `interaction`, and `test`. Document evidence must reference a discovered Markdown source; AgentSpine records that source's SHA-256 at observation time without editing it.
|
|
40
|
-
|
|
41
|
-
Adding evidence stores the previous candidate version in history before recalculating confidence. Distinct evidence IDs or source fingerprints are counted for automatic evaluation. Secret-shaped content is rejected before it reaches learning state.
|
|
42
|
-
|
|
43
|
-
## Explicit review
|
|
44
|
-
|
|
45
|
-
Acceptance requires the `confirmedByUser` marker and a review reason. The marker is an integration attestation, not identity proof: a host adapter should set it only after an actual user gesture or unambiguous user instruction. AgentSpine never infers confirmation from another memory, Markdown sentence, candidate, agent message, or relationship edge.
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
agentspine learn-propose learning:concise \
|
|
49
|
-
--kind preference \
|
|
50
|
-
--claim "The preferred output is concise." \
|
|
51
|
-
--evidence "The user explicitly requested concise output." \
|
|
52
|
-
--privacy private
|
|
53
|
-
|
|
54
|
-
agentspine learn-review learning:concise \
|
|
55
|
-
--decision accept \
|
|
56
|
-
--reason "Explicitly confirmed by the user." \
|
|
57
|
-
--confirmed-by-user
|
|
58
|
-
|
|
59
|
-
agentspine learn-context . --include-private --json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Candidates never appear in learned context before acceptance. Native lifecycle hooks inject only accepted, exactly scoped learning inside the byte-budgeted session briefing. They never inject unreviewed candidates.
|
|
63
|
-
|
|
64
|
-
## Optional automatic promotion
|
|
65
|
-
|
|
66
|
-
Automatic promotion is disabled by default. When deliberately enabled, it applies only to `project-fact` and `reference`, and only when both confidence and distinct-evidence thresholds pass.
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
agentspine learn-config . \
|
|
70
|
-
--auto-promote true \
|
|
71
|
-
--min-confidence 0.9 \
|
|
72
|
-
--min-evidence 2
|
|
73
|
-
|
|
74
|
-
agentspine learn-evaluate . --json
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The accepted record stores the policy thresholds, evidence count, and evaluation time used for that decision. The audit rejects an accepted record with no valid manual-review proof or automatic-promotion snapshot. Personal facts, preferences, goals, corrections, and no-gos are never automatically promoted by this general evaluator.
|
|
78
|
-
|
|
79
|
-
This evaluator is separate from [automatic continuity](automatic-continuity.md). After its own local privacy opt-in, the lifecycle adapter may accept only direct, high-confidence style preferences, no-gos, corrections, project facts, and references with a recorded threshold proof. Personal facts, group conversation content, identity claims, secrets, authority, access, and operational permissions are never eligible. The continuity path is not exposed through MCP.
|
|
80
|
-
|
|
81
|
-
## Measured behavior loop
|
|
82
|
-
|
|
83
|
-
`behavior` candidates use `agentspine.learning-outcome/v1` receipts. A receipt stores no prompt, answer, transcript, credential, or source content. It binds a normalized metric to one exact persona, user, tenant, project, group, task, evaluator, phase, and time. Metric values are normalized to `0..1`; the direction states whether higher or lower is better. Objective measurements, explicit user feedback, and model suggestions remain separate. Model suggestions are retained for diagnosis but never count toward automatic promotion or validation.
|
|
84
|
-
|
|
85
|
-
Before promotion, the candidate needs the configured number of independent, fresh, non-model receipts for the same metric and exact scope, including at least one objective evaluator. It also needs the normal distinct-evidence and confidence thresholds. A conflicting active candidate blocks automatic promotion. Security, safety, identity, authentication, authorization, credential, policy, production, deployment, payment, and access lessons are marked for local review and can never enter this automatic path. Successful evaluation creates a time-limited canary rather than a final unmeasured claim. Only that exact scope receives the canary in its next briefing.
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
agentspine learn-propose learning:check-invariant \
|
|
89
|
-
--kind behavior \
|
|
90
|
-
--claim "Check the fixed invariant before answering." \
|
|
91
|
-
--evidence "Two fixture runs missed the invariant." \
|
|
92
|
-
--privacy shared \
|
|
93
|
-
--persona agent:synthetic --user user:synthetic --tenant tenant:synthetic \
|
|
94
|
-
--project project:synthetic --task task:synthetic
|
|
95
|
-
|
|
96
|
-
agentspine learn-outcome learning:check-invariant \
|
|
97
|
-
--phase before --metric fixed-task-success --direction higher --value 0.40 \
|
|
98
|
-
--measurement objective --evaluator evaluator:test-a \
|
|
99
|
-
--persona agent:synthetic --user user:synthetic --tenant tenant:synthetic \
|
|
100
|
-
--project project:synthetic --task task:synthetic
|
|
101
|
-
|
|
102
|
-
agentspine learn-evaluate . --json
|
|
103
|
-
agentspine learn-status . --json
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
After canary use, the host records `after` receipts for the same metric and scope. Independent receipts meeting `minImprovement` validate the lesson. Any blocking defect rolls it back immediately; a regression beyond `regressionTolerance`, insufficient measured improvement, or expiry before validation also rolls it back. A superseded lesson is restored atomically. No average score can override a blocking defect.
|
|
107
|
-
|
|
108
|
-
Outcome recording and policy changes are local CLI/runtime operations. MCP exposes only the read-only `learning_outcome_status` view for this loop; model-side MCP cannot manufacture outcome evidence. `learning_context` returns only active, unexpired or validated, exact-scope behavior lessons and reports stale canaries as degraded instead of silently projecting them.
|
|
109
|
-
|
|
110
|
-
## Supersession and rollback
|
|
111
|
-
|
|
112
|
-
New information does not overwrite an accepted fact. Propose a new candidate with `--supersedes` and the same kind, subject, and privacy scope. Acceptance marks the prior record `superseded` and retains both versions. Rollback deactivates the replacement and restores the prior accepted record atomically.
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
agentspine learn-propose learning:new-goal \
|
|
116
|
-
--kind goal \
|
|
117
|
-
--claim "The current goal is the new synthetic milestone." \
|
|
118
|
-
--evidence "The user changed the goal." \
|
|
119
|
-
--supersedes learning:old-goal
|
|
120
|
-
|
|
121
|
-
agentspine learn-rollback learning:new-goal \
|
|
122
|
-
--reason "The change was recorded incorrectly."
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Permanent deletion removes one candidate and its learning history. An accepted superseding record must be rolled back before deletion so its predecessor is not stranded.
|
|
126
|
-
|
|
127
|
-
## Privacy and groups
|
|
128
|
-
|
|
129
|
-
Private learning requires an explicit `includePrivate` read. Group learning requires a known group entity, an exact `groupId`, and—when a subject is present—a visible `member-of` edge. `includePrivate` does not bypass a different or missing group audience. Session hooks have no group audience and therefore expose no group learning.
|
|
130
|
-
|
|
131
|
-
## Storage and concurrency
|
|
132
|
-
|
|
133
|
-
`learning.json` lives in the same external per-project state directory as the catalog, graph, and attention state. Mutations use a per-project lock and atomic replacement, so concurrent agents cannot silently discard evidence. State is capped at 5 MiB and original Markdown remains byte-for-byte unchanged.
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Immutable HTTPS object transport
|
|
2
|
-
|
|
3
|
-
AgentSpine can publish a signed snapshot directly to any HTTPS service that implements a tiny create-only object contract. The protocol is provider-neutral: it needs no cloud SDK, account-specific URL format, database driver, or agent vendor.
|
|
4
|
-
|
|
5
|
-
```mermaid
|
|
6
|
-
sequenceDiagram
|
|
7
|
-
participant C as Local owner CLI
|
|
8
|
-
participant D as Signed directory adapter
|
|
9
|
-
participant O as HTTPS object service
|
|
10
|
-
C->>D: validate signed manifest and events
|
|
11
|
-
C->>C: build snapshot and SHA-256 address
|
|
12
|
-
C->>O: PUT /objects/{digest}.json<br/>If-None-Match: *
|
|
13
|
-
alt new object
|
|
14
|
-
O-->>C: 201 or 204
|
|
15
|
-
else object already exists
|
|
16
|
-
O-->>C: 412
|
|
17
|
-
end
|
|
18
|
-
C->>O: GET the exact object URL
|
|
19
|
-
O-->>C: bounded signed JSON snapshot
|
|
20
|
-
C->>C: verify bundle digest and every envelope
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
There is no overwrite, delete, listing, mutable latest pointer, or remote administration operation. A publish counts as successful only after AgentSpine reads the object back through the hardened HTTPS client and verifies the exact snapshot digest plus every nested Ed25519 envelope.
|
|
24
|
-
|
|
25
|
-
## Publish
|
|
26
|
-
|
|
27
|
-
Start with an authenticated directory adapter as described in [shared memory](shared-memory.md), then run:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
export AGENTSPINE_OBJECT_TOKEN='deployment-supplied-value'
|
|
31
|
-
|
|
32
|
-
agentspine share-https-publish /srv/agent-memory/team-alpha \
|
|
33
|
-
--root /path/to/publisher-project \
|
|
34
|
-
--base https://memory.example.org/agentspine/team-alpha \
|
|
35
|
-
--id snapshot:team-alpha-2026-08-28 \
|
|
36
|
-
--token-env AGENTSPINE_OBJECT_TOKEN \
|
|
37
|
-
--confirm-local-share
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
AgentSpine derives the immutable object URL:
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
https://memory.example.org/agentspine/team-alpha/objects/{snapshot-sha256}.json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
The token value is read only from the named environment variable. It is never accepted in the URL, persisted, returned, added to hooks, or exposed through MCP. Publishing always requires the explicit local confirmation flag, including public endpoints.
|
|
47
|
-
|
|
48
|
-
## Server contract
|
|
49
|
-
|
|
50
|
-
The service receives one request:
|
|
51
|
-
|
|
52
|
-
```http
|
|
53
|
-
PUT /agentspine/team-alpha/objects/{64-lowercase-hex-digest}.json
|
|
54
|
-
Content-Type: application/vnd.agentspine.snapshot+json
|
|
55
|
-
Content-Length: {exact bytes}
|
|
56
|
-
If-None-Match: *
|
|
57
|
-
X-AgentSpine-Digest: sha256:{same digest}
|
|
58
|
-
Authorization: Bearer {optional deployment token}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
It must atomically create the resource and return `201` or `204`. If that exact path already exists, it must leave the object untouched and return `412`. AgentSpine deliberately rejects a generic `200` response because it cannot distinguish creation from replacement. The service must then serve the exact bytes at the same URL with the response rules documented in [HTTPS snapshots](https-transport.md).
|
|
62
|
-
|
|
63
|
-
The digest in the path is a routing and integrity aid, not authorization. Servers should independently compute it, enforce create-only semantics, authenticate writers, rate-limit requests, bound body size to 21 MiB, and retain audit logs that do not record bearer values or bodies.
|
|
64
|
-
|
|
65
|
-
## Idempotency and failures
|
|
66
|
-
|
|
67
|
-
- `201` or `204` followed by an exact verified read-back returns `created: true`.
|
|
68
|
-
- `412` followed by the exact verified object is a safe idempotent retry and returns `alreadyExisted: true`.
|
|
69
|
-
- A different, missing, malformed, unsigned, untrusted, or unreadable object fails the operation.
|
|
70
|
-
- Redirects, DNS rebinding to disallowed addresses, TLS errors, oversized responses, compression, ambiguous URLs, timeouts, and unexpected status codes fail closed.
|
|
71
|
-
- A failed upload may have reached the server. Retrying the same snapshot is safe because the object address is immutable and the read-back decides the result.
|
|
72
|
-
|
|
73
|
-
## Private networks
|
|
74
|
-
|
|
75
|
-
Private, loopback, link-local, reserved, multicast, carrier-grade NAT, and documentation ranges are rejected by default. A deliberately internal service needs both flags:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
agentspine share-https-publish /srv/agent-memory/team-alpha \
|
|
79
|
-
--root /path/to/project \
|
|
80
|
-
--base https://memory.internal.example/agentspine/team-alpha \
|
|
81
|
-
--allow-private-network \
|
|
82
|
-
--confirm-local-share
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
The hostname is resolved and every answer is vetted before the socket is pinned to one approved address. TLS verification remains enabled.
|
|
86
|
-
|
|
87
|
-
## Trust boundary
|
|
88
|
-
|
|
89
|
-
Publishing transports only context that already passed the local sharing exporter. It cannot publish source Markdown, evidence text, private learning, relationships, attention, tasks, delegation policy, credentials, or signer private keys. The receiver still uses `share-https-pull`, imports into quarantine, trusts configured public keys, and performs a second local review before any claim reaches context.
|
|
90
|
-
|
|
91
|
-
The object service never becomes an authority provider. Successful upload, bearer authentication, TLS, digests, and valid signatures grant no permissions, delegation, production access, spending rights, or policy exceptions.
|
|
92
|
-
|
|
93
|
-
The transport is intentionally absent from MCP and lifecycle hooks. An agent can use reviewed shared context, but it cannot select an endpoint, read a token, publish, overwrite, or opt into a private network through AgentSpine's agent-controlled surfaces.
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# Challenge-response peer transport
|
|
2
|
-
|
|
3
|
-
AgentSpine can pull a fresh signed snapshot from another installation through any owner-selected executable that provides stdin and stdout. Typical carriers are SSH, container exec, a local process supervisor, or an organization-specific transport wrapper. AgentSpine itself opens no listening socket, selects no network, invokes no shell, and contains no vendor SDK.
|
|
4
|
-
|
|
5
|
-
```mermaid
|
|
6
|
-
sequenceDiagram
|
|
7
|
-
participant O as Receiving owner CLI
|
|
8
|
-
participant C as Chosen carrier process
|
|
9
|
-
participant P as Peer AgentSpine
|
|
10
|
-
O->>O: Generate 256-bit random challenge
|
|
11
|
-
O->>C: Spawn exact executable + argument array<br/>shell disabled, minimal environment
|
|
12
|
-
O->>P: One bounded JSON request on stdin
|
|
13
|
-
P->>P: Build signed immutable snapshot
|
|
14
|
-
P->>P: Bind challenge + snapshot to live Ed25519 signature
|
|
15
|
-
P-->>O: One bounded JSON response on stdout
|
|
16
|
-
O->>O: Verify challenge, outer key, manifest key,<br/>snapshot digest, nested signatures, and local trust
|
|
17
|
-
O->>O: Import claims only into quarantine
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The random challenge proves that the remote peer holding the configured private key answered this request. A captured response cannot be replayed under a later challenge. This authenticates the peer and transport content; it does not make any claim authoritative.
|
|
21
|
-
|
|
22
|
-
## Remote peer
|
|
23
|
-
|
|
24
|
-
The serving side is deliberately one-shot. It reads one request, writes one response, and exits:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
agentspine share-peer-serve /srv/agent-memory/team-alpha \
|
|
28
|
-
--root /srv/agent-project \
|
|
29
|
-
--signer signer:team-alpha \
|
|
30
|
-
--timeout-ms 10000 \
|
|
31
|
-
--confirm-local-share
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The directory must be an authenticated shared-memory adapter. The selected signer must be the same Ed25519 key that signed its manifest. Starting the server requires explicit local owner confirmation; it does not become a background daemon or open a port.
|
|
35
|
-
|
|
36
|
-
## Receiver
|
|
37
|
-
|
|
38
|
-
Trust the peer's exported public identity first. Then provide an exact JSON argument array for the carrier:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
agentspine share-peer-pull \
|
|
42
|
-
--root /path/to/receiver-project \
|
|
43
|
-
--command-json '["ssh","memory.example.org","agentspine","share-peer-serve","/srv/agent-memory/team-alpha","--root","/srv/agent-project","--signer","signer:team-alpha","--confirm-local-share"]' \
|
|
44
|
-
--timeout-ms 10000 \
|
|
45
|
-
--confirm-local-share
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
AgentSpine passes the first array item as the executable and every remaining item as a literal argument with Node's shell option disabled. The carrier itself may have additional semantics: for example, an SSH server commonly invokes a remote login shell. Configure and quote carrier-specific remote commands defensively, or use a fixed server-side wrapper that exposes only `share-peer-serve` with predetermined paths and signer.
|
|
49
|
-
|
|
50
|
-
Both confirmations are intentional. The receiver confirms execution of the chosen local carrier. The peer confirms one export from its selected adapter. Neither confirmation approves imported claims for context.
|
|
51
|
-
|
|
52
|
-
## Wire protocol
|
|
53
|
-
|
|
54
|
-
The receiver sends one newline-terminated `agentspine.peer-request/v1` JSON object containing:
|
|
55
|
-
|
|
56
|
-
- a random request ID;
|
|
57
|
-
- a cryptographically random 32-byte lowercase-hex challenge;
|
|
58
|
-
- the maximum accepted response bytes;
|
|
59
|
-
- `authority: context-only`.
|
|
60
|
-
|
|
61
|
-
The peer returns one newline-terminated Ed25519 `manifest` envelope. Its `agentspine.peer-response/v1` payload binds the exact request ID and challenge to a validated signed snapshot, creation time, digest, and `context-only` authority. The outer live-response signer must equal the snapshot-manifest signer. The receiving project must already trust that exact public key, and the nested snapshot importer independently revalidates the manifest and every event.
|
|
62
|
-
|
|
63
|
-
Requests are limited to 4 KiB. Responses are limited to a receiver-selected value from 1 MiB through 22 MiB, with 22 MiB as the default and the existing snapshot limit still enforced. Only the first complete JSON frame is considered. Timeouts range from one to thirty seconds.
|
|
64
|
-
|
|
65
|
-
## Process boundary
|
|
66
|
-
|
|
67
|
-
Executing any program is a privileged local action. A malicious carrier executable can act with the user's operating-system permissions before AgentSpine sees a response. Use an absolute path or a trusted `PATH`, verify the executable, constrain SSH identities and remote commands, and apply normal operating-system sandboxing where appropriate.
|
|
68
|
-
|
|
69
|
-
AgentSpine reduces accidental exposure by:
|
|
70
|
-
|
|
71
|
-
- requiring explicit local confirmation;
|
|
72
|
-
- never invoking a shell itself;
|
|
73
|
-
- accepting only a bounded JSON array of bounded strings;
|
|
74
|
-
- passing a minimal cross-platform environment containing path, home, temporary-directory, locale, SSH-agent, AgentSpine-state, and platform runtime variables;
|
|
75
|
-
- omitting unrelated environment variables, including application tokens;
|
|
76
|
-
- bounding and discarding stderr rather than returning it as agent context;
|
|
77
|
-
- killing timed-out, noisy, invalid, or completed carrier processes;
|
|
78
|
-
- never persisting the executable, arguments, request, challenge, or response.
|
|
79
|
-
|
|
80
|
-
The SSH agent socket is included so SSH remains usable. Possession of that socket is powerful; operators who do not want agent forwarding should remove it from the invoking environment or use a carrier wrapper with narrower credentials.
|
|
81
|
-
|
|
82
|
-
## Trust and authority boundary
|
|
83
|
-
|
|
84
|
-
Successful challenge-response, process exit, SSH authentication, signatures, and digests create no permissions, delegation, production access, spending rights, or policy exceptions. The received snapshot enters the normal shared-memory quarantine. A second local user review remains mandatory before any imported claim can appear in context.
|
|
85
|
-
|
|
86
|
-
Peer serving, carrier execution, pulls, process arguments, stdin/stdout frames, and signer selection are absent from MCP and lifecycle hooks. Agents may read already reviewed shared context, but they cannot start a peer, select an executable, export data, or approve a received claim through AgentSpine's agent-controlled surfaces.
|
|
87
|
-
|
|
88
|
-
Only explicitly published accepted, non-private shared events enter the snapshot. Existing `AGENTS.md`, `CLAUDE.md`, `SOUL.md`, `MEMORY.md`, and every other discovered Markdown source remain in place and byte-for-byte unchanged.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Pre-answer recall gate
|
|
2
|
-
|
|
3
|
-
AgentSpine 0.9 adds `agentspine.preflight/v2`, a provider-neutral pre-answer contract. On `UserPromptSubmit`, the lifecycle adapter resolves and race-safely rereads the active host instruction hierarchy, loads confirmed Must-Remember context, runs every locally required retrieval provider, creates a short-lived HMAC receipt bound to the exact turn, consumes it once, and only then injects the resulting context. The model does not call MCP for any part of this path.
|
|
4
|
-
|
|
5
|
-
The receipt binds agent and optional persona, user, tenant, host, instruction host, profile, session, project, task, group, working-directory digest, hook delivery, prompt digest, every mandatory instruction file and file identity, the current local policy revision and profile digest, active Must-Remember checksums, provider query status, loaded item IDs and revisions, rejection count, briefing digest, creation time, and expiry. A different prompt, session, scope, working directory, source set, policy, critical-memory revision, hook delivery, or second consumption is rejected. Receipts contain no prompt text, source content, retrieval claims, credentials, or full transcripts.
|
|
6
|
-
|
|
7
|
-
## Host instructions
|
|
8
|
-
|
|
9
|
-
Claude Code uses its resolved user and project `CLAUDE.md` hierarchy. Codex uses the corresponding `AGENTS.override.md`/`AGENTS.md` hierarchy. A generic host must explicitly bind `instruction_host` to `claude` or `codex`; AgentSpine does not guess. The mandatory preflight section contains the complete bytes of every active instruction document. Its standard hard budget is 8 KiB. Claude instructions may use one explicit aggregate overflow up to 16 KiB; the mode, used bytes, overflow and hard limit are bound into the signed exact-turn receipt and revalidated before consumption. Codex and generic instruction hosts remain capped at 8 KiB. An unreadable, replaced, deleted, oversized, out-of-scope, or symlinked mandatory file blocks immediately with a visible bounded diagnostic instead of degrading to a descriptor or waiting silently.
|
|
10
|
-
|
|
11
|
-
Claude Code's `InstructionsLoaded` lifecycle event is registered as an additional observability signal, while `UserPromptSubmit` remains the blocking and injection boundary. Codex uses its own manifest-selected hook set without that unsupported Claude-only event. The preflight does not rely on the model remembering to read a file or call a tool.
|
|
12
|
-
|
|
13
|
-
## Required retrieval providers
|
|
14
|
-
|
|
15
|
-
Retrieval policy is a separate local policy file outside every project. Configure it only through the local CLI:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
agentspine preflight-policy ./dieter-preflight.json --confirm-local-policy
|
|
19
|
-
agentspine preflight-status --json
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The initial reference adapter is `mnemo-command/v1`: an absolute, regular executable receives one `agentspine.retrieval-query/v1` JSON object on stdin and must return one `agentspine.retrieval-result/v1` object on stdout. It may talk to a local or remote Mnemo deployment. Credentials are passed only through environment-variable names explicitly listed in local policy; values never enter repository files, state, context, receipts, logs, or MCP. Required providers must be fail-closed. A successful query with no matches produces status `empty`; a missing invocation, timeout, invalid scope, malformed response, or adapter failure blocks the turn.
|
|
23
|
-
|
|
24
|
-
Example local policy profile:
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"id": "preflight-policy:dieter:claude",
|
|
29
|
-
"agentId": "agent:dieter",
|
|
30
|
-
"host": "claude",
|
|
31
|
-
"profileId": "profile:dieter",
|
|
32
|
-
"tenantId": "tenant:company",
|
|
33
|
-
"enabled": true,
|
|
34
|
-
"providers": [
|
|
35
|
-
{
|
|
36
|
-
"schema": "agentspine.retrieval-provider/v1",
|
|
37
|
-
"id": "mnemo:primary",
|
|
38
|
-
"adapter": "mnemo-command/v1",
|
|
39
|
-
"required": true,
|
|
40
|
-
"failClosed": true,
|
|
41
|
-
"timeoutMs": 5000,
|
|
42
|
-
"command": "/absolute/path/to/mnemo-adapter",
|
|
43
|
-
"args": [],
|
|
44
|
-
"credentialEnv": ["MNEMO_TOKEN"]
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Policy, identity and authorization remain independent. Prompt, Markdown, memory, persona, team metadata and provider output cannot configure a provider, relax fail-closed behavior, grant a capability, or authorize an action.
|
|
51
|
-
|
|
52
|
-
## Must-Remember
|
|
53
|
-
|
|
54
|
-
Conversation wording such as “Merk dir das” may create only a pending candidate. Activation requires a separate explicit local user confirmation:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
agentspine remember-propose --claim "Keine halbfertigen Commits veröffentlichen." --user person:papa --tenant tenant:company --project project:agent-spine
|
|
58
|
-
agentspine remember-confirm remember-candidate:… --confirm-local-user
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Confirmed entries are scoped, checksummed, append-only and versioned. A new version supersedes rather than overwrites; rollback is explicit. Permanent deletion requires `remember-purge … --confirm-local-purge`. Secret-shaped and authority-shaped claims are rejected. Must-Remember remains context-only.
|
|
62
|
-
|
|
63
|
-
## Enforcement modes and host limits
|
|
64
|
-
|
|
65
|
-
`preflight-status` and Doctor distinguish `instructions-only-no-required-provider`, `wrapper-hard-required`, the last provider result (`loaded`, verified `empty`, or failure), a consumed receipt, and a blocked turn with a privacy-safe failure code. Host inventory reports hook trust as unverified until the real host confirms it. The bundled command hook returns the documented blocking status and exit code 2 for controlled failures. Host trust remains a one-time user decision. A prepared turn that aborts before model injection is invalidated and may retry; a consumed delivery remains replay-blocked.
|
|
66
|
-
|
|
67
|
-
Claude Code documents that a command hook killed by the host timeout is fail-open, even though an explicit exit code 2 blocks. Therefore an absolute guarantee against process termination requires the host or TUI to invoke the same preflight contract as a wrapper-hard gate immediately before its model API call. AgentSpine does not mislabel a merely installed command hook as proof against host-enforced timeout. A release is only live-proven after the target host shows fresh consumed receipts across consecutive turns, restart, and compaction.
|
|
68
|
-
|
|
69
|
-
Host hierarchy and lifecycle behavior were checked on 2026-08-30 against the official [Claude Code hook reference](https://code.claude.com/docs/en/hooks) and [Codex AGENTS.md reference](https://developers.openai.com/codex/agent-configuration/agents-md).
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Preservation contract
|
|
2
|
-
|
|
3
|
-
The preservation contract is AgentSpine's primary compatibility promise.
|
|
4
|
-
|
|
5
|
-
## Guaranteed
|
|
6
|
-
|
|
7
|
-
For every discovered source document, AgentSpine records its canonical path, repository-relative path, byte count, modification time, semantic layer, host relevance, explicit links, and SHA-256 digest.
|
|
8
|
-
|
|
9
|
-
The scanner:
|
|
10
|
-
|
|
11
|
-
- opens source Markdown read-only;
|
|
12
|
-
- never renames, moves, merges, normalizes, truncates, or rewrites it;
|
|
13
|
-
- does not follow filesystem symlinks;
|
|
14
|
-
- writes catalogs, graph overlays, attention, learning, delegation policy, coordination, imported sharing state, trust, and private signing keys only to the user state directory;
|
|
15
|
-
- writes an explicitly requested HTTPS snapshot only to a new path outside the scanned project and never uploads or overwrites one;
|
|
16
|
-
- uses an atomic temporary-file replacement for its own catalog;
|
|
17
|
-
- keeps every discovered document visible even when another file has higher precedence.
|
|
18
|
-
|
|
19
|
-
The resolver may omit content from an individual response when its configured byte budget is exhausted. Omission is explicit. The session briefing also measures its complete compact JSON result and includes only whole records; it never shortens source or state values to make them fit. The original remains retrievable through a ranged read with its SHA-256 digest. Ranged reads include both UTF-8 text and base64 bytes so callers can verify exact data even when a boundary splits a multibyte character.
|
|
20
|
-
|
|
21
|
-
Filename and path classification is a hint. An agent may add a context-only overlay annotation, but cannot promote an arbitrary source into the constitution layer. Only filenames understood by the native host adapter are instruction candidates.
|
|
22
|
-
|
|
23
|
-
## Protected sources
|
|
24
|
-
|
|
25
|
-
A source is protected from agent write tools when it is any of the following:
|
|
26
|
-
|
|
27
|
-
- a native host instruction file;
|
|
28
|
-
- a soul or persona file;
|
|
29
|
-
- a memory index or a Markdown file below a memory directory;
|
|
30
|
-
- a Markdown file explicitly linked from a protected source.
|
|
31
|
-
|
|
32
|
-
Protection is a host hook guardrail, not an operating-system security boundary. Users retain full control of their files. Specialized tools that bypass host hooks may also bypass the guardrail.
|
|
33
|
-
|
|
34
|
-
The bundled guard recognizes direct Edit/Write/apply-patch targets and common mutating shell forms that name a protected source. Shell syntax is too broad to prove safe by pattern matching; operating-system permissions, host approvals, and version control remain the hard controls.
|
|
35
|
-
|
|
36
|
-
## Conflicts and precedence
|
|
37
|
-
|
|
38
|
-
AgentSpine does not resolve semantic disagreement by editing content. It exposes every source and follows native host ordering. A higher-precedence source may control the active context, but lower-precedence sources remain cataloged with their original hashes.
|
|
39
|
-
|
|
40
|
-
## Uninstall
|
|
41
|
-
|
|
42
|
-
Uninstall removes the plugin and its generated state only. It never touches scanned projects. Acceptance tests snapshot source bytes before scanning, resolving, session briefing, reading, attention mutation, heartbeat/promise/blocker lifecycle transitions, learning proposal/review/rollback, delegation and task workflows, exact execution-policy registration, hook-driven start/checkpoint/stop/resume, signing, trust, shared adapter publication/import/review, HTTPS snapshot export/import, verifying, and hook execution, then compare the source tree afterward.
|
|
43
|
-
|
|
44
|
-
## Not guaranteed
|
|
45
|
-
|
|
46
|
-
AgentSpine cannot prevent:
|
|
47
|
-
|
|
48
|
-
- direct user edits;
|
|
49
|
-
- writes from programs outside the hooked host;
|
|
50
|
-
- writes from host tool paths that do not participate in lifecycle hooks;
|
|
51
|
-
- changes made while AgentSpine is not running.
|
|
52
|
-
|
|
53
|
-
`agentspine verify` detects those changes relative to the last saved scan. It reports them and never restores files automatically.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Ten quality gates
|
|
2
|
-
|
|
3
|
-
`agentspine audit` is the executable Definition of Done for an installed project. It scans twice, resolves context, validates overlay state, verifies the saved catalog, and compares source hashes. It never repairs or rewrites source Markdown.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
agentspine audit /path/to/project
|
|
7
|
-
agentspine audit /path/to/project --json
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
| Gate | Proof | Failure meaning |
|
|
11
|
-
|---:|---|---|
|
|
12
|
-
| 1 | Supported Node.js runtime and installed host inventory | Runtime is below Node 20, or the MCP/hook set is missing, duplicated, disabled, or stale |
|
|
13
|
-
| 2 | Catalog schema and discovery | Sources could not be represented deterministically |
|
|
14
|
-
| 3 | External generated state | Catalog, graph, attention, learning, delegation policy, coordination, execution policy, job checkpoint, channel, persona, gateway, sharing, trust, or signer state landed inside the scanned project |
|
|
15
|
-
| 4 | Native hierarchy mapping | A recognized host source lacks host mapping |
|
|
16
|
-
| 5 | Markdown link integrity | An indexed local `.md` link has no target |
|
|
17
|
-
| 6 | Conflict visibility | Precedence and competing candidates are surfaced for review |
|
|
18
|
-
| 7 | Authority boundary | Context or shared state claims authority; a delegation, execution, channel, persona, or goal policy lacks explicit local provenance; or a task/job/channel/gateway snapshot has no valid policy binding |
|
|
19
|
-
| 8 | Context privacy | Graph, attention, learning candidate, outcome receipt, canary scope, coordination, self-starter, channel, persona, gateway queue/lane/checkpoint/delivery, sharing, signer, trust, signature, group binding, local-review proof, or safety boundary is invalid |
|
|
20
|
-
| 9 | Context budget | Resolved source bytes or the complete compact session briefing exceed the requested ceiling |
|
|
21
|
-
| 10 | Byte preservation | A source hash changed during the audit or differs from the saved scan |
|
|
22
|
-
|
|
23
|
-
Gate 6 is informational when findings are represented correctly; AgentSpine exposes conflicts rather than pretending to solve them. Every other failed gate makes the command exit non-zero.
|
|
24
|
-
|
|
25
|
-
With `--host claude` or `--host codex`, Gate 2 uses the production source-root resolver instead of recursively scanning the supplied path. It fails when the host profile and active project scopes are empty, conflicting, damaged, or stale, and reports scope counts plus the concrete fail-closed reason. This mode never falls back to scanning the home directory.
|
|
26
|
-
|
|
27
|
-
For Claude project memory, Gate 2 also reports indexed, relevant, loaded, cache-hit, cache-miss, missing, scope-rejected, path-rejected, symlink-rejected, size-rejected, and race-rejected counts. The live hook never enumerates the memory directory. Orphan counting is available only through the explicit offline diagnostic `agentspine doctor --host claude --offline-memory-orphans`; it reads no orphan content and cannot affect recall or authority.
|
|
28
|
-
|
|
29
|
-
## CI and troubleshooting
|
|
30
|
-
|
|
31
|
-
The repository test matrix covers Linux, macOS, and Windows on supported Node.js release lines. Every test file runs once with an empty synthetic host profile and once with a populated synthetic profile, so real `~/.claude`, `~/.codex`, and AgentSpine state cannot change an assertion. Package integrity runs separately. For an integration project, run the JSON form and retain only the audit result—never upload source content, the private graph, attention state, learning state, delegation policy, coordination state, persona roster, gateway state, sharing inbox, or adapter events as CI evidence.
|
|
32
|
-
|
|
33
|
-
Broken links are reported with source and target in the catalog. Competing constitution candidates record either native host precedence or `agent-review-required`. Fix the project only through its normal owner workflow; AgentSpine deliberately has no auto-fix mode.
|
|
34
|
-
|
|
35
|
-
Gate 8 validates attention lifecycle schema, provenance, event and receipt identity, exact group binding, execution-policy/job binding, leases, pending effects, checkpoints, retry state, authenticated channel payload and retained-history digests, persona identity events and receipts, gateway queue IDs, per-agent lanes, focused goals, checkpoints, outbox idempotency and delivery receipts, exact channel routes and senders, the local sharing quarantine, accepted imports, review proof, transport event integrity, trusted public keys, private/public key matches, private-key file safety, and retained signatures. `agentspine audit` does not start or resume jobs, poll Telegram, claim gateway work, deliver a message, or crawl remote URLs. Directory manifests and events are validated with strict file, size, schema, digest, signature, trust, and collision checks whenever used. HTTPS snapshots add endpoint, DNS, TLS, redirect, media-type, compression, response-size, bundle-integrity, and signed-document checks before they enter that same importer. The object-transport suite additionally proves create-only headers, exact body length, status handling, idempotent collision verification, mandatory read-back, secret exclusion, private-network confirmation, and source preservation. CI uses synthetic responses and identities only; it never depends on an external service or secret.
|
|
36
|
-
|
|
37
|
-
The optional SQLite suite runs where `node:sqlite` is available and proves external-path enforcement, signed-manifest binding, strict schema and integrity validation, append-only revision continuity, atomic-head validation, idempotency, tamper rejection, quarantined pull, CLI integration, agent-surface exclusion, and source preservation. Older supported Node.js jobs load the package without activating this optional transport.
|
|
38
|
-
|
|
39
|
-
Gate 9 also assembles a read-only generic `session_briefing`, verifies its reported compact UTF-8 JSON byte count, and confirms it remains inside the configured packet ceiling. Focus is active and private context is excluded during this audit read.
|
|
40
|
-
|
|
41
|
-
## Visible lifecycle acceptance
|
|
42
|
-
|
|
43
|
-
The ten-gate audit validates one installed project's invariants. The complementary `agentspine acceptance` command proves the entire automatic cross-host behavior in an isolated synthetic environment:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
agentspine acceptance
|
|
47
|
-
agentspine acceptance --json
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Its 14 visible gates cover canonical identities, Swedish and Spanish continuity, heartbeat/promise/blocker persistence, Claude restart, Codex compaction, person and group isolation, correction history, rollback, authorized resume, denied foreign effect, durable checkpointing, person purge, source-byte preservation, and the final audit. Every gate prints a deterministic SHA-256 receipt, and the machine report explicitly records zero MCP calls. Fresh-install and upgrade validation run this same acceptance entry point from the staged installed bundle. See [visible cross-host acceptance](acceptance.md).
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Relationships and learning
|
|
2
|
-
|
|
3
|
-
AgentSpine keeps social context in the external overlay graph. It never writes learned facts into `SOUL.md`, `AGENTS.md`, `CLAUDE.md`, memory files, or any other project Markdown.
|
|
4
|
-
|
|
5
|
-
## Data model
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
flowchart TB
|
|
9
|
-
E["Entity · person, agent, group, channel, project"]
|
|
10
|
-
R["Relationship · type, confidence, privacy"]
|
|
11
|
-
H["Superseded observation history"]
|
|
12
|
-
C["Privacy-filtered context"]
|
|
13
|
-
E --> R
|
|
14
|
-
R --> C
|
|
15
|
-
E --> H
|
|
16
|
-
R --> H
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Entities have stable IDs, a kind, optional display name and aliases, attributes, provenance, confidence, and privacy. Relationships connect two known IDs with a typed relation. Name similarity never merges identities.
|
|
20
|
-
|
|
21
|
-
Authenticated persona roster synchronization reconciles active `person`, `agent`, and `bot` identities into this graph. An exact roster `groupId` creates a missing group-scoped entity and an authenticated `member-of` edge. Replaying an unchanged roster repairs missing graph records without rewriting source Markdown or appending duplicate persona events.
|
|
22
|
-
|
|
23
|
-
Supported privacy scopes are:
|
|
24
|
-
|
|
25
|
-
| Scope | Default visibility |
|
|
26
|
-
|---|---|
|
|
27
|
-
| `private` | Returned only when private context is explicitly requested |
|
|
28
|
-
| `shared` | Available to normal relationship-context reads |
|
|
29
|
-
| `group` | Marked for group-specific context selection |
|
|
30
|
-
|
|
31
|
-
Privacy is a context filter, not an access-control system. The host must still authorize who may invoke the tool and see its output.
|
|
32
|
-
|
|
33
|
-
## Learning without erasure
|
|
34
|
-
|
|
35
|
-
An upsert changes the active view. If the same entity, document annotation, or same typed edge already exists, AgentSpine first copies the previous record into append-only `history`. The old observation therefore remains inspectable with its original confidence, reason, and timestamp.
|
|
36
|
-
|
|
37
|
-
```mermaid
|
|
38
|
-
stateDiagram-v2
|
|
39
|
-
[*] --> Observed
|
|
40
|
-
Observed --> Active: first record
|
|
41
|
-
Active --> Historical: newer observation
|
|
42
|
-
Historical --> Active: previous value retained
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
This is supersession in relevance, not deletion or a claim that the newest statement is automatically true. Agents should use evidence, calibrated confidence, and explicit source documents where available.
|
|
46
|
-
|
|
47
|
-
## Authority boundary
|
|
48
|
-
|
|
49
|
-
Every entity, relationship, annotation, and history entry carries `authority: context-only`. Permission-like and credential-like attribute keys are rejected recursively. Responsibilities such as `responsible-for` describe the team; they do not authorize task assignment, tool use, access, delegation, billing, deployment, or data disclosure. Cross-entity task coordination uses the separate default-deny policy described in [delegation and coordination](coordination.md); no relationship edge can satisfy that policy.
|
|
50
|
-
|
|
51
|
-
## CLI example
|
|
52
|
-
|
|
53
|
-
Use synthetic IDs in shared examples and stable application IDs in real systems:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
agentspine entity agent:builder --kind agent --name Builder --privacy shared
|
|
57
|
-
agentspine entity project:site --kind project --name Site --privacy shared
|
|
58
|
-
agentspine relate agent:builder project:site --relation responsible-for --privacy shared
|
|
59
|
-
agentspine relationships agent:builder --json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The MCP tools expose additional attributes, aliases, source-document provenance, confidence, and explicit private reads.
|
|
63
|
-
|
|
64
|
-
With an exact `groupId`, a relationship read returns the requested entity's direct visible edges plus current visible co-members of that group. This is a bounded team neighborhood, not an inferred friendship graph. Another group's members, inactive roster personas and private records remain excluded. Without an exact group audience, group-private peers are not returned.
|
|
65
|
-
|
|
66
|
-
## Limits
|
|
67
|
-
|
|
68
|
-
- The graph is local user state and is not synchronized automatically.
|
|
69
|
-
- Authenticated roster state is synchronized only when an owner-configured roster or native manifest scope is active; chat names never create entities.
|
|
70
|
-
- Relationship reads bypass project discovery, abort the graph read after a five-second local deadline, and return a visible `degraded` status without aborting the turn.
|
|
71
|
-
- A 5 MiB graph ceiling stops unbounded growth instead of discarding history.
|
|
72
|
-
- Attribute-key rejection cannot determine whether innocent-looking prose contains a secret.
|
|
73
|
-
- Group-specific recipient policy and notification delivery are not implemented.
|