blun-king-cli 9.1.486 → 9.1.488

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LIESMICH.txt +26 -7
  2. package/README.md +14 -3
  3. package/agent-spine-plugin/.claude-plugin/marketplace.json +20 -0
  4. package/agent-spine-plugin/.claude-plugin/plugin.json +14 -0
  5. package/agent-spine-plugin/.codex-plugin/plugin.json +34 -0
  6. package/agent-spine-plugin/.mcp.json +8 -0
  7. package/agent-spine-plugin/CHANGELOG.md +277 -0
  8. package/agent-spine-plugin/LICENSE +186 -0
  9. package/agent-spine-plugin/README.md +342 -0
  10. package/agent-spine-plugin/assets/agentspine-banner.svg +32 -0
  11. package/agent-spine-plugin/bin/agentspine-mcp.js +4 -0
  12. package/agent-spine-plugin/bin/agentspine.js +7 -0
  13. package/agent-spine-plugin/blun.plugin.json +33 -0
  14. package/agent-spine-plugin/docs/acceptance.md +61 -0
  15. package/agent-spine-plugin/docs/architecture.md +183 -0
  16. package/agent-spine-plugin/docs/attention.md +121 -0
  17. package/agent-spine-plugin/docs/automatic-continuity.md +79 -0
  18. package/agent-spine-plugin/docs/channel-runtime.md +92 -0
  19. package/agent-spine-plugin/docs/coordination.md +138 -0
  20. package/agent-spine-plugin/docs/feed-transport.md +99 -0
  21. package/agent-spine-plugin/docs/gateway-runtime.md +109 -0
  22. package/agent-spine-plugin/docs/harness-reference.md +45 -0
  23. package/agent-spine-plugin/docs/host-integration.md +129 -0
  24. package/agent-spine-plugin/docs/https-transport.md +116 -0
  25. package/agent-spine-plugin/docs/learning.md +98 -0
  26. package/agent-spine-plugin/docs/object-transport.md +93 -0
  27. package/agent-spine-plugin/docs/peer-transport.md +88 -0
  28. package/agent-spine-plugin/docs/preservation-contract.md +53 -0
  29. package/agent-spine-plugin/docs/quality-gates.md +50 -0
  30. package/agent-spine-plugin/docs/relationships.md +67 -0
  31. package/agent-spine-plugin/docs/releasing.md +83 -0
  32. package/agent-spine-plugin/docs/roadmap.md +307 -0
  33. package/agent-spine-plugin/docs/selfstarter.md +88 -0
  34. package/agent-spine-plugin/docs/session-briefing.md +74 -0
  35. package/agent-spine-plugin/docs/shared-memory.md +259 -0
  36. package/agent-spine-plugin/docs/source-roots.md +86 -0
  37. package/agent-spine-plugin/docs/sqlite-transport.md +76 -0
  38. package/agent-spine-plugin/hooks/hooks.json +95 -0
  39. package/agent-spine-plugin/hooks/version.json +5 -0
  40. package/agent-spine-plugin/package.json +69 -0
  41. package/agent-spine-plugin/scripts/check-hosts.js +193 -0
  42. package/agent-spine-plugin/scripts/check-install.js +551 -0
  43. package/agent-spine-plugin/scripts/check-syntax.js +29 -0
  44. package/agent-spine-plugin/scripts/github-actions.js +11 -0
  45. package/agent-spine-plugin/scripts/release-check.js +127 -0
  46. package/agent-spine-plugin/scripts/run-acceptance.js +19 -0
  47. package/agent-spine-plugin/scripts/run-checks.js +46 -0
  48. package/agent-spine-plugin/scripts/run-tests-hermetic.js +73 -0
  49. package/agent-spine-plugin/skill/SKILL.md +76 -0
  50. package/agent-spine-plugin/skills/agent-spine/SKILL.md +84 -0
  51. package/agent-spine-plugin/spine-example/1-identity.md +12 -0
  52. package/agent-spine-plugin/spine-example/2-voice.md +6 -0
  53. package/agent-spine-plugin/spine-example/3-conduct.md +8 -0
  54. package/agent-spine-plugin/spine-example/4-history.md +4 -0
  55. package/agent-spine-plugin/src/cli.js +950 -0
  56. package/agent-spine-plugin/src/hook.js +646 -0
  57. package/agent-spine-plugin/src/index.js +84 -0
  58. package/agent-spine-plugin/src/lib/acceptance.js +294 -0
  59. package/agent-spine-plugin/src/lib/attention.js +755 -0
  60. package/agent-spine-plugin/src/lib/audit.js +308 -0
  61. package/agent-spine-plugin/src/lib/authentication.js +513 -0
  62. package/agent-spine-plugin/src/lib/briefing.js +305 -0
  63. package/agent-spine-plugin/src/lib/catalog.js +142 -0
  64. package/agent-spine-plugin/src/lib/channel-runtime.js +665 -0
  65. package/agent-spine-plugin/src/lib/context.js +154 -0
  66. package/agent-spine-plugin/src/lib/continuity.js +333 -0
  67. package/agent-spine-plugin/src/lib/coordination.js +577 -0
  68. package/agent-spine-plugin/src/lib/documents.js +199 -0
  69. package/agent-spine-plugin/src/lib/feed-transport.js +497 -0
  70. package/agent-spine-plugin/src/lib/filesystem-retry.js +27 -0
  71. package/agent-spine-plugin/src/lib/gateway-runtime.js +760 -0
  72. package/agent-spine-plugin/src/lib/graph.js +284 -0
  73. package/agent-spine-plugin/src/lib/https-transport.js +392 -0
  74. package/agent-spine-plugin/src/lib/indexed-memory-offline.js +40 -0
  75. package/agent-spine-plugin/src/lib/indexed-memory.js +281 -0
  76. package/agent-spine-plugin/src/lib/learning.js +645 -0
  77. package/agent-spine-plugin/src/lib/object-transport.js +206 -0
  78. package/agent-spine-plugin/src/lib/paths.js +60 -0
  79. package/agent-spine-plugin/src/lib/peer-transport.js +283 -0
  80. package/agent-spine-plugin/src/lib/persona-runtime.js +503 -0
  81. package/agent-spine-plugin/src/lib/runtime.js +13 -0
  82. package/agent-spine-plugin/src/lib/selfstarter.js +819 -0
  83. package/agent-spine-plugin/src/lib/sharing.js +969 -0
  84. package/agent-spine-plugin/src/lib/source-roots.js +451 -0
  85. package/agent-spine-plugin/src/lib/sqlite-transport.js +501 -0
  86. package/agent-spine-plugin/src/lib/telegram-adapter.js +119 -0
  87. package/agent-spine-plugin/src/lib/voice-runtime.js +39 -0
  88. package/agent-spine-plugin/src/mcp.js +526 -0
  89. package/agent-spine-plugin/src/version.js +1 -0
  90. package/agent-spine-plugin/src/worker.js +178 -0
  91. package/bin/identity-context-policy.cjs +51 -1
  92. package/bin/launcher-runtime.js +9 -1
  93. package/bin/plugin-bootstrap.js +68 -27
  94. package/bin/turn-thinking-policy.cjs +5 -4
  95. package/bin/turn-tool-performance-policy.cjs +15 -2
  96. package/blun.mjs +96 -31
  97. package/package.json +2 -1
@@ -0,0 +1,342 @@
1
+ <p align="center">
2
+ <img src="assets/agentspine-banner.svg" alt="AgentSpine — identity that persists, memory that stays grounded" width="100%">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://github.com/Maykbiletti/AgentSpine/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Maykbiletti/AgentSpine/ci.yml?branch=main&amp;style=flat-square&amp;label=CI" alt="CI status"></a>
7
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-22c55e?style=flat-square" alt="Apache-2.0 license"></a>
8
+ <img src="https://img.shields.io/badge/Node.js-%E2%89%A520.9-3c873a?style=flat-square" alt="Node.js 20.9 or newer">
9
+ <img src="https://img.shields.io/badge/sources-read--only-67e8f9?style=flat-square" alt="Source documents are read-only">
10
+ </p>
11
+
12
+ <p align="center">
13
+ A local-first, host-neutral context spine for agents that already have a history.
14
+ </p>
15
+
16
+ AgentSpine discovers the Markdown files an agent already relies on, fingerprints them, preserves the host's native hierarchy, follows explicit links, and serves only the relevant context through a CLI, lifecycle hooks, and MCP.
17
+
18
+ It does **not** replace your agent. It gives existing identity and memory a dependable structure without rewriting a single source byte.
19
+
20
+ ## Why AgentSpine
21
+
22
+ Most agent memory systems begin by asking you to migrate everything into a new database or a new canonical file. AgentSpine begins with a stricter promise:
23
+
24
+ > Your existing `SOUL.md`, `AGENTS.md`, `CLAUDE.md`, `MEMORY.md`, and linked Markdown remain where they are, exactly as they are.
25
+
26
+ That makes AgentSpine suitable for long-lived agents, mixed Claude Code/Codex environments, repositories with nested instruction files, and teams that cannot afford silent identity drift.
27
+
28
+ ## How it fits together
29
+
30
+ ```mermaid
31
+ flowchart TB
32
+ A["Existing Markdown sources"] --> B["Read-only discovery"]
33
+ B --> C["Provenance catalog"]
34
+ C --> D["Host-aware resolver"]
35
+ F["Relationships + attention + safe learning + tasks + reviewed sharing"] --> G["Budgeted session briefing"]
36
+ D --> G
37
+ P["Separate default-deny delegation policy"] --> F
38
+ Y["Exact local execution policy"] --> J["Leased job + atomic checkpoint"] --> G
39
+ W["Authenticated channel event"] --> K["Exact route + durable lease"] --> G
40
+ X["Optional provider-neutral adapter"] --> S["Optional Ed25519 origin check"] --> Q["Local import quarantine"] --> F
41
+ G --> E["Claude Code · Codex · MCP"]
42
+ ```
43
+
44
+ The resolver keeps three concerns separate:
45
+
46
+ | Layer | Purpose | Typical sources | Can grant rights? |
47
+ |---|---|---|---|
48
+ | Constitution | Fixed instructions and dated directives | `CLAUDE.md`, `AGENTS.md`, `RULES.md` | Only the real host policy can |
49
+ | Soul | Stable voice, identity, goals, character | `SOUL.md`, existing persona files | No |
50
+ | Memory | Small linked facts and an index | `MEMORY.md`, `memory/**/*.md` | Never |
51
+
52
+ Other Markdown remains discoverable as reference material. Names and folders provide initial hints only: the agent itself can classify documents and connect them in a reversible overlay graph. A document becomes protected when it is a native instruction, soul, memory source, or is explicitly linked from one.
53
+
54
+ ## Quick start
55
+
56
+ Requires Node.js 20.9 or newer.
57
+
58
+ ```bash
59
+ git clone https://github.com/Maykbiletti/AgentSpine.git
60
+ cd AgentSpine
61
+ npm install
62
+ npm test
63
+ npm link
64
+ ```
65
+
66
+ Then point AgentSpine at any existing project:
67
+
68
+ ```bash
69
+ agentspine scan /path/to/project
70
+ agentspine context /path/to/project --host codex
71
+ agentspine briefing /path/to/project --host codex --max-bytes 16384
72
+ agentspine verify /path/to/project
73
+ agentspine audit /path/to/project
74
+ ```
75
+
76
+ The generated catalog is written to the operating system's user state directory, never into the scanned project. Set `AGENTSPINE_STATE_DIR` if you want a custom location.
77
+
78
+ ## Install for Claude Code
79
+
80
+ Add this repository as a marketplace and install the plugin:
81
+
82
+ ```text
83
+ /plugin marketplace add Maykbiletti/AgentSpine
84
+ /plugin install agent-spine@agent-spine
85
+ ```
86
+
87
+ For local development:
88
+
89
+ ```bash
90
+ claude --plugin-dir .
91
+ ```
92
+
93
+ Claude Code discovers the bundled skill, hooks, and MCP server. Review and trust executable components when the host asks.
94
+ Version `0.8.0` explicitly registers `.mcp.json`, ships one native `hooks/hooks.json`, and invalidates Claude Code's earlier `0.7.0` plugin cache. The unreleased BLUN adapter adds `blun.plugin.json` with native MCP and lifecycle registrations. Fresh-install and upgrade checks prove package containment and entrypoint behavior; actual hook discovery and trust remain host-controlled and must be inspected in the live host. Claude project memory is `MEMORY.md`-indexed, lazy, race-safe, persistently cached outside the project, and independent of unrelated file count; the live path performs no memory-directory enumeration.
95
+
96
+ Verify the installed registration from a checkout with:
97
+
98
+ ```bash
99
+ npm run host:check
100
+ npm run host:install-check
101
+ claude plugin list
102
+ claude mcp list
103
+ ```
104
+
105
+ If AgentSpine is installed but absent from `/mcp`, refresh the cached marketplace copy, reinstall the plugin, start a new Claude Code session, and approve the `agent-spine` server in `/mcp`:
106
+
107
+ ```bash
108
+ claude plugin marketplace update agent-spine
109
+ claude plugin uninstall agent-spine@agent-spine
110
+ claude plugin install agent-spine@agent-spine
111
+ claude mcp list
112
+ ```
113
+
114
+ An unapproved server may appear as `Pending approval`; approval remains a user action and AgentSpine never bypasses Claude Code's trust boundary.
115
+
116
+ After that one host trust decision, enable automatic continuity once for a known local identity:
117
+
118
+ ```bash
119
+ agentspine entity person:me --kind person --name "Me" --privacy shared
120
+ agentspine continuity-config /path/to/project --enabled true --entity person:me --confirm-local-opt-in
121
+ ```
122
+
123
+ From the next prompt onward, installed lifecycle hooks scan and inject the real scoped `session_briefing` at start, resume, prompt submission, and compaction boundaries. The model does not need to choose `scan`, `context`, or `session_briefing`. The opt-in is separate from host trust because learning conversation signals is a user-controlled privacy decision.
124
+
125
+ Source discovery is independent of the installation `cwd`: Claude uses `CLAUDE_CONFIG_DIR` plus the active project and evidenced project-memory binding; Codex uses `CODEX_HOME` plus its native root-to-`cwd` instruction chain. Inspect the result with `agentspine source-status --host claude|codex --cwd /active/project --json`. See [host-native source roots](docs/source-roots.md).
126
+
127
+ ## Install for Codex
128
+
129
+ AgentSpine ships a native `.codex-plugin/plugin.json`. Add the repository to a configured marketplace, open the Codex plugin browser with `/plugins`, install AgentSpine, and start a fresh session. For development, the CLI and MCP server can be used directly:
130
+
131
+ ```bash
132
+ npm link
133
+ agentspine-mcp
134
+ ```
135
+
136
+ See [host integration](docs/host-integration.md) for exact component paths and trust behavior.
137
+
138
+ ## Preservation contract
139
+
140
+ AgentSpine's first release is intentionally narrow and testable:
141
+
142
+ - source Markdown is opened read-only;
143
+ - symlinks are not followed during discovery;
144
+ - generated state is stored outside the project;
145
+ - every source receives a SHA-256 fingerprint, byte size, path, layer, and provenance;
146
+ - native host precedence is retained rather than flattened;
147
+ - broken links and competing candidates are exposed as findings, never auto-resolved;
148
+ - linked files are resolved transitively without loading unrelated Markdown;
149
+ - oversized context stays available through exact ranged reads;
150
+ - agent write tools are blocked from protected sources by lifecycle hooks;
151
+ - uninstalling AgentSpine leaves every source file untouched.
152
+
153
+ Read the full [preservation contract](docs/preservation-contract.md), including threat boundaries and deliberate non-goals.
154
+
155
+ ## CLI
156
+
157
+ | Command | Outcome |
158
+ |---|---|
159
+ | `agentspine scan [root]` | Discover, classify, fingerprint, and save an external catalog |
160
+ | `agentspine context [root] --host …` | Resolve relevant sources in deterministic order |
161
+ | `agentspine briefing [root] …` | Assemble one scoped, privacy-filtered, byte-budgeted session packet |
162
+ | `agentspine read <path>` | Read an indexed source range with SHA-256 provenance |
163
+ | `agentspine verify [root]` | Report added, removed, or byte-changed Markdown |
164
+ | `agentspine link …` | Add an agent-inferred document relationship to the overlay graph |
165
+ | `agentspine annotate …` | Add a reversible semantic classification with confidence |
166
+ | `agentspine entity …` | Add or update a person, agent, group, channel, or project |
167
+ | `agentspine relate …` | Connect two known entities with privacy and confidence |
168
+ | `agentspine relationships …` | Read one privacy-filtered relationship neighborhood |
169
+ | `agentspine attention [root]` | Read sparse due cues after privacy, focus, quiet-hour, and repeat filters |
170
+ | `agentspine attention-add …` | Record an unanswered question, promise, check-in, or meaningful change |
171
+ | `agentspine attention-touch …` | Record only that an entity interaction occurred |
172
+ | `agentspine attention-config …` | Configure limits, quiet hours, silence threshold, or disable attention |
173
+ | `agentspine attention-delete …` | Permanently remove a cue and its retained attention history |
174
+ | `agentspine attention-events …` | Inspect durable heartbeat, promise, and blocker events plus optional history |
175
+ | `agentspine attention-event-delete …` | Permanently remove one lifecycle event, its receipts, history, and presentation state |
176
+ | `agentspine learn-propose …` | Store an evidence-backed candidate outside accepted context |
177
+ | `agentspine learn-evidence …` | Append evidence while retaining the previous candidate version |
178
+ | `agentspine learn-review …` | Explicitly accept or reject a candidate |
179
+ | `agentspine learn-context …` | Read only accepted, privacy-filtered learning |
180
+ | `agentspine learn-evaluate …` | Run the default-off low-risk automatic policy |
181
+ | `agentspine learn-rollback …` | Restore the accepted fact replaced by a learning |
182
+ | `agentspine learn-config …` | Configure auto-promotion thresholds and context limits |
183
+ | `agentspine learn-delete …` | Permanently remove one candidate and its learning history |
184
+ | `agentspine continuity-config …` | Enable, disable, scope, and budget automatic continuity after local opt-in |
185
+ | `agentspine continuity-status …` | Inspect configuration and minimal signal counts without transcript content |
186
+ | `agentspine continuity-purge …` | Permanently remove one identity's automatic signals and learned context |
187
+ | `agentspine source-status …` | Inspect host-native user, project, and memory roots without exposing source contents |
188
+ | `agentspine source-bind …` | Bind existing user-wide continuity after an explicit local confirmation |
189
+ | `agentspine source-rollback …` | Disable one source binding while retaining its append-only audit history |
190
+ | `agentspine source-purge …` | Permanently remove one binding while retaining only its non-reversible digest receipt |
191
+ | `agentspine delegation-check …` | Check explicit actor/action/target coordination policy; default deny |
192
+ | `agentspine delegation-grant …` | Owner-confirmed local CLI grant for task coordination only |
193
+ | `agentspine delegation-revoke …` | Revoke future coordination and retain policy history |
194
+ | `agentspine task-create …` | Create a context-only task, open thread, or handoff |
195
+ | `agentspine task-update …` | Update status, assignee, or details while retaining the prior version |
196
+ | `agentspine tasks …` | Read privacy-filtered current coordination context |
197
+ | `agentspine execution-grant …` | Create one exact local owner-confirmed job grant; never inferred from context |
198
+ | `agentspine execution-revoke …` | Revoke future start, resume, and effects while retaining policy history |
199
+ | `agentspine job-register …` | Register a waiting job with its initial content-bound checkpoint |
200
+ | `agentspine jobs …` | Inspect durable status, retry, blocker, lease, and checkpoint metadata |
201
+ | `agentspine job-cancel …` | Stop a job through an explicit local owner decision |
202
+ | `agentspine job-delete …` | Permanently purge an unleased job, history, and receipts |
203
+ | `agentspine channel-bind …` | Create or replace one exact locally confirmed provider-to-agent route |
204
+ | `agentspine channel-revoke …` | Revoke a route and cancel its pending or leased events |
205
+ | `agentspine channel-policy …` | Inspect local channel bindings without exposing secret values |
206
+ | `agentspine channel-events …` | Inspect the exact-scope durable ingress queue and leases |
207
+ | `agentspine persona-sync …` | Synchronize an explicitly approved external authenticated roster |
208
+ | `agentspine personas …` | Inspect active and historical persona identities and provenance |
209
+ | `agentspine goal-assign …` | Assign one authenticated focused goal to an active agent |
210
+ | `agentspine gateway-control …` | Enable, stop, or kill-switch the local worker under explicit owner control |
211
+ | `agentspine gateway-status …` | Inspect goals, queue, delivery receipts, and independent health gates |
212
+ | `agentspine share-init …` | Initialize an optional provider-neutral directory adapter outside the project |
213
+ | `agentspine share-keygen …` | Create or explicitly rotate a local Ed25519 signing identity |
214
+ | `agentspine share-trust …` | Trust one exported public identity for the current project |
215
+ | `agentspine share-trust-revoke …` | Revoke a trusted key without turning signatures into authority |
216
+ | `agentspine share-publish …` | Publish one explicitly selected accepted, non-private learning |
217
+ | `agentspine share-pull …` | Import immutable events into local quarantine, never active context |
218
+ | `agentspine share-snapshot-export …` | Export one immutable signed snapshot outside the scanned project |
219
+ | `agentspine share-https-publish …` | Create a content-addressed HTTPS object and verify it by read-back |
220
+ | `agentspine share-https-pull …` | Fetch a bounded signed snapshot through hardened HTTPS into quarantine |
221
+ | `agentspine share-feed-publish …` | Append one immutable snapshot to a signed ETag-protected feed |
222
+ | `agentspine share-feed-pull …` | Verify feed continuity and import its latest snapshot into quarantine |
223
+ | `agentspine share-feed-state …` | Inspect local rollback-protection receipts and retained history |
224
+ | `agentspine share-peer-serve …` | Answer one live signed snapshot challenge over stdin/stdout |
225
+ | `agentspine share-peer-pull …` | Pull through an owner-selected executable without invoking a shell |
226
+ | `agentspine share-sqlite-init …` | Bind an external SQLite file to one authenticated adapter |
227
+ | `agentspine share-sqlite-publish …` | Append a verified snapshot and atomically advance its hash-linked head |
228
+ | `agentspine share-sqlite-inspect …` | Validate and inspect the complete local database history |
229
+ | `agentspine share-sqlite-pull …` | Import the latest fully verified database snapshot into quarantine |
230
+ | `agentspine share-inbox …` | Review pending, accepted, rejected, superseded, or rolled-back imports |
231
+ | `agentspine share-review …` | Accept or reject one import through a second local decision |
232
+ | `agentspine share-context …` | Read only locally accepted, privacy-filtered shared memory |
233
+ | `agentspine share-rollback …` | Roll back shared supersession and restore the prior record |
234
+ | `agentspine audit [root]` | Run ten deterministic quality and preservation gates |
235
+ | `agentspine acceptance` | Run the visible synthetic Claude/Codex lifecycle acceptance and print reproducible receipts |
236
+ | `agentspine doctor` | Check runtime and preservation mode |
237
+ | `agentspine mcp` | Start the stdio MCP server |
238
+
239
+ Every command supports `--json` where structured output is useful.
240
+
241
+ The optional SQLite commands use Node.js `node:sqlite` and therefore require Node.js 22.13 or newer; core discovery, CLI, MCP, and the other transports retain the package's declared Node.js support. See the [SQLite transport contract](docs/sqlite-transport.md).
242
+
243
+ ## MCP tools
244
+
245
+ ```mermaid
246
+ flowchart LR
247
+ S["scan"] --> R["resolve_context"]
248
+ R --> B["session_briefing"]
249
+ B --> Q["read_document"]
250
+ Q --> V["verify"]
251
+ E["upsert_entity"] --> L["link_entities"]
252
+ L --> C["relationship_context"]
253
+ ```
254
+
255
+ - `scan` builds the source map.
256
+ - `resolve_context` selects constitution, soul, memory index, and linked facts for the current host and directory.
257
+ - `session_briefing` combines only the relevant native sources, current tasks, relationships, accepted learning, reviewed shared memory, and optional cues within a hard compact-JSON byte budget.
258
+ - `read_document` retrieves exact byte ranges that did not fit the context budget.
259
+ - `verify` proves whether source bytes changed since the last scan.
260
+ - `link_documents` and `annotate_document` let agents build their own semantic map without editing sources.
261
+ - `upsert_entity`, `link_entities`, and `relationship_context` maintain a privacy-scoped social and responsibility map outside the project.
262
+ - `upsert_attention`, `record_activity`, `attention_context`, `resolve_attention`, `configure_attention`, and `delete_attention` provide sparse follow-up suggestions without sending messages or granting authority.
263
+ - `propose_learning`, `add_learning_evidence`, `review_learning`, `learning_context`, `evaluate_learning`, `rollback_learning`, `configure_learning`, and `delete_learning` keep observations separate from accepted context and preserve every relevance change.
264
+ - `check_delegation`, `create_task`, `update_task`, and `task_context` coordinate work under a separate default-deny policy. MCP intentionally has no policy grant, revoke, or permanent task-delete tool.
265
+ - `shared_context` reads only locally reviewed shared memory. MCP intentionally cannot initialize adapters, publish, pull, inspect the pending inbox, review imports, roll back, or delete.
266
+ - `audit` runs the same ten gates available through the CLI.
267
+
268
+ Relationship updates supersede the active view but retain the previous observation in append-only graph history. Permission-like and credential-like attributes are rejected recursively. See [relationships and learning](docs/relationships.md).
269
+
270
+ Attention is deliberately restrained: installed hooks retain minimal heartbeats, promises, and blockers without storing transcripts; each event requires an exact known actor/project/task scope; private and group visibility stays exact; and quiet hours, focus, throttling, lifecycle transitions, deletion, and purge remain enforceable. Events are context only—they send no messages, start no work, and grant no authority. See [attention](docs/attention.md).
271
+
272
+ Safe learning is evidence-first: general candidates remain invisible until reviewed. A separate default-off continuity opt-in can automatically accept only direct, high-confidence style, preference, no-go, correction, project-fact, and reference signals. Sensitive personal facts, secrets, identity merges, private group content, and operational or authority claims are always rejected. See [automatic continuity](docs/automatic-continuity.md) and [safe learning](docs/learning.md).
273
+
274
+ Delegation is intentionally narrower than authority: a relationship such as `responsible-for` never permits assignment. Cross-entity task actions require an explicit local actor/action/target grant, while tasks, open threads, and handoffs remain context-only. See [delegation and coordination](docs/coordination.md).
275
+
276
+ Shared memory is transport-neutral and double-reviewed: only accepted non-private learning may be published, every import enters quarantine, and the receiving installation must confirm it again before it can appear in context. The reference directory adapter works without a cloud account. Signed adapters can be exported as immutable snapshots, published as create-only content-addressed HTTPS objects, discovered through signed ETag-protected feeds with local rollback receipts, or requested live through a challenge-response stdio peer. HTTPS pulling uses pinned DNS, SSRF protection, strict limits, verified read-back, and optional environment-supplied bearer authentication. Peer pulling delegates the carrier to one explicit owner-selected executable without AgentSpine invoking a shell. Digests and Ed25519 envelopes protect transport integrity and configured origins; neither grants authority or approves content. See [shared memory adapters](docs/shared-memory.md), [HTTPS snapshots](docs/https-transport.md), [immutable HTTPS objects](docs/object-transport.md), [signed mutable feeds](docs/feed-transport.md), and [peer transport](docs/peer-transport.md).
277
+
278
+ Session briefing keeps that growing context usable: one scoped read prioritizes the current request, explicit stops, and current task; deduplicates local and shared facts; defaults to focus mode; enforces exact group audiences; and measures the entire compact JSON result against the requested byte ceiling. Native lifecycle hooks now inject this packet automatically instead of asking the model to call MCP. See [session briefing](docs/session-briefing.md).
279
+
280
+ The authenticated channel-wake runtime prevents an incoming provider message from losing its recipient or origin. A locally confirmed binding fixes provider, tenant, account, chat, thread, sender, agent, project, group, and session; HMAC-authenticated events enter one durable leased lane and the installed host hook injects the exact message with its compact voice brief. The optional `agentspine-worker` now supplies the missing gateway responsibilities: automatic external-roster synchronization, Telegram polling, exact host-run requests, bounded checkpoints, crash recovery, and idempotent delivery back to the origin. It runs only when the owner starts or supervises it and remains outside MCP. See [authenticated channel wake](docs/channel-runtime.md), [durable gateway worker](docs/gateway-runtime.md), and the [OpenClaw/Hermes reference study](docs/harness-reference.md).
281
+
282
+ The rights-bound self-starter is a separate execution path. A genuine local owner action must grant one exact actor, job, task, target, project, host, and finite tool-capability set. Installed hooks then acquire one lease, recheck authority before every effect, checkpoint the workspace after every result, and resume only an unchanged checkpoint. Memory, Markdown, relationships, learning, attention, task text, previous approvals, and MCP can never create that grant. See [rights-bound self-starter](docs/selfstarter.md).
283
+
284
+ ## Optional four-layer starter
285
+
286
+ New agents that do not have identity files yet can start with the included [`spine-example/`](spine-example/) template:
287
+
288
+ | Layer | Holds | Expected change rate |
289
+ |---|---|---|
290
+ | Identity | Name, purpose, stable principles | Almost never |
291
+ | Voice | Tone, language, and expression | Rarely |
292
+ | Conduct | Working behavior and verification habits | On explicit feedback |
293
+ | Grown history | Dated experience and corrections | Append-only |
294
+
295
+ The manual [`skill/SKILL.md`](skill/SKILL.md) can scaffold and audit this optional layout. It is only for an agent with no existing spine. AgentSpine never migrates an established agent into the example, and the normal plugin resolver continues to discover and preserve whatever files already exist.
296
+
297
+ ## Design principles
298
+
299
+ 1. **Preserve before learning.** No useful memory feature justifies destroying the history it is meant to protect.
300
+ 2. **Memory is data, never authority.** A remembered sentence cannot create permissions, bypass review, or widen access.
301
+ 3. **Relevance changes; history does not disappear.** New information adjusts confidence and relevance instead of silently overwriting old records.
302
+ 4. **Identity is contextual.** People, agents, groups, and channels receive separate stable identities until an explicit link proves otherwise.
303
+ 5. **Human warmth cannot outrank the task.** Relationship context stays small and yields first when context is tight.
304
+ 6. **Local operation is complete.** Remote or shared-memory adapters are optional extensions, not hidden requirements.
305
+
306
+ ## Project status
307
+
308
+ AgentSpine is in active early development. `v0.8` adds authenticated persona synchronization, a compact voice bridge, an optional durable gateway worker, exact Telegram ingress and delivery, focused goals, per-agent lanes, leases, recovery, and independent health gates. Automatic lifecycle behavior requires the host to discover and trust the current hook definition; a staged direct hook invocation is not treated as proof of that real host decision. Every external effect remains current-rights-bound and default-deny, and existing source Markdown remains immutable.
309
+
310
+ ## Documentation
311
+
312
+ | Goal | Start here |
313
+ |---|---|
314
+ | Understand the system | [Architecture](docs/architecture.md) |
315
+ | Audit non-destructive behavior | [Preservation contract](docs/preservation-contract.md) |
316
+ | Integrate a host | [Claude Code and Codex](docs/host-integration.md) |
317
+ | Bind an authenticated external message | [Authenticated channel wake](docs/channel-runtime.md) |
318
+ | Run automatic roster, goal, and Telegram work | [Durable gateway worker](docs/gateway-runtime.md) |
319
+ | Compare harness design choices | [OpenClaw and Hermes reference study](docs/harness-reference.md) |
320
+ | Reproduce the complete host behavior | [Visible cross-host acceptance](docs/acceptance.md) |
321
+ | Enable automatic continuity | [Automatic continuity](docs/automatic-continuity.md) |
322
+ | Load one compact session packet | [Session briefing](docs/session-briefing.md) |
323
+ | Resume one exactly authorized job | [Rights-bound self-starter](docs/selfstarter.md) |
324
+ | Understand relationships and history | [Relationships](docs/relationships.md) |
325
+ | Configure sparse follow-ups | [Attention](docs/attention.md) |
326
+ | Review evidence-backed observations | [Safe learning](docs/learning.md) |
327
+ | Coordinate agents without memory-based authority | [Delegation and coordination](docs/coordination.md) |
328
+ | Exchange reviewed context between installations | [Shared memory adapters](docs/shared-memory.md) |
329
+ | Publish or pull signed static snapshots | [HTTPS snapshot transport](docs/https-transport.md) |
330
+ | Publish immutable content-addressed objects | [HTTPS object transport](docs/object-transport.md) |
331
+ | Discover successive snapshots safely | [Signed mutable feeds](docs/feed-transport.md) |
332
+ | Pull directly from another installation | [Challenge-response peer transport](docs/peer-transport.md) |
333
+ | Verify or cut a release | [Release process](docs/releasing.md) |
334
+ | Run the Definition of Done | [Ten quality gates](docs/quality-gates.md) |
335
+ | See planned capabilities | [Roadmap](docs/roadmap.md) |
336
+ | Cut a release | [Release process](docs/releasing.md) |
337
+ | Contribute safely | [Contributing](CONTRIBUTING.md) |
338
+ | Report a vulnerability | [Security policy](SECURITY.md) |
339
+
340
+ ## License
341
+
342
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,32 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="360" viewBox="0 0 1200 360" role="img" aria-labelledby="title desc">
2
+ <title id="title">AgentSpine</title>
3
+ <desc id="desc">A layered identity and memory spine for AI agents</desc>
4
+ <defs>
5
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
6
+ <stop stop-color="#07111f"/>
7
+ <stop offset="1" stop-color="#111c35"/>
8
+ </linearGradient>
9
+ <linearGradient id="line" x1="0" y1="0" x2="0" y2="1">
10
+ <stop stop-color="#67e8f9"/>
11
+ <stop offset=".52" stop-color="#8b5cf6"/>
12
+ <stop offset="1" stop-color="#f472b6"/>
13
+ </linearGradient>
14
+ <filter id="glow"><feGaussianBlur stdDeviation="7" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>
15
+ </defs>
16
+ <rect width="1200" height="360" rx="30" fill="url(#bg)"/>
17
+ <g opacity=".13" stroke="#9cc8ff"><path d="M0 64h1200M0 128h1200M0 192h1200M0 256h1200M0 320h1200"/><path d="M96 0v360M192 0v360M288 0v360M384 0v360M480 0v360M576 0v360M672 0v360M768 0v360M864 0v360M960 0v360M1056 0v360"/></g>
18
+ <g transform="translate(116 42)" filter="url(#glow)">
19
+ <path d="M74 14c-26 24-26 48 0 72s26 48 0 72-26 48 0 72 26 48 0 72" fill="none" stroke="url(#line)" stroke-width="12" stroke-linecap="round"/>
20
+ <path d="M74 14c26 24 26 48 0 72s-26 48 0 72 26 48 0 72-26 48 0 72" fill="none" stroke="#eef7ff" stroke-opacity=".68" stroke-width="5" stroke-linecap="round"/>
21
+ <g fill="#07111f" stroke="#baf5ff" stroke-width="4"><circle cx="74" cy="14" r="10"/><circle cx="74" cy="86" r="10"/><circle cx="74" cy="158" r="10"/><circle cx="74" cy="230" r="10"/><circle cx="74" cy="302" r="10"/></g>
22
+ </g>
23
+ <g fill="#f8fbff" font-family="Inter,Segoe UI,Arial,sans-serif">
24
+ <text x="286" y="139" font-size="76" font-weight="750" letter-spacing="-3">AgentSpine</text>
25
+ <text x="290" y="194" font-size="26" fill="#b9c9e5">Identity that persists. Memory that stays grounded.</text>
26
+ <g transform="translate(290 238)" font-size="16" font-weight="600">
27
+ <rect width="150" height="38" rx="19" fill="#67e8f9" fill-opacity=".13" stroke="#67e8f9" stroke-opacity=".5"/><text x="75" y="25" text-anchor="middle" fill="#9af2fb">NON-DESTRUCTIVE</text>
28
+ <rect x="166" width="112" height="38" rx="19" fill="#8b5cf6" fill-opacity=".15" stroke="#a78bfa" stroke-opacity=".55"/><text x="222" y="25" text-anchor="middle" fill="#c4b5fd">LOCAL-FIRST</text>
29
+ <rect x="294" width="136" height="38" rx="19" fill="#f472b6" fill-opacity=".13" stroke="#f9a8d4" stroke-opacity=".5"/><text x="362" y="25" text-anchor="middle" fill="#fbcfe8">HOST-NEUTRAL</text>
30
+ </g>
31
+ </g>
32
+ </svg>
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { startMcpServer } from "../src/mcp.js";
3
+
4
+ startMcpServer();
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { run } from "../src/cli.js";
3
+
4
+ run().catch((error) => {
5
+ process.stderr.write(`AgentSpine: ${error.message}\n`);
6
+ process.exitCode = 1;
7
+ });
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "agent-spine",
3
+ "version": "0.8.0",
4
+ "description": "A non-destructive identity and memory spine for BLUN King agents.",
5
+ "license": "Apache-2.0",
6
+ "author": {
7
+ "name": "Mayk Biletti"
8
+ },
9
+ "skills": "./skills/",
10
+ "mcpServers": {
11
+ "agent-spine": {
12
+ "transport": "stdio",
13
+ "command": "node",
14
+ "args": ["./src/mcp.js"]
15
+ }
16
+ },
17
+ "hooks": [
18
+ { "event": "SessionStart", "command": "node \"./src/hook.js\"", "timeout": 15 },
19
+ { "event": "UserPromptSubmit", "command": "node \"./src/hook.js\"", "timeout": 15 },
20
+ { "event": "PreToolUse", "matcher": "Edit|Write|apply_patch|Bash|exec_command", "command": "node \"./src/hook.js\"", "timeout": 15 },
21
+ { "event": "PostToolUse", "command": "node \"./src/hook.js\"", "timeout": 15 },
22
+ { "event": "PreCompact", "command": "node \"./src/hook.js\"", "timeout": 15 },
23
+ { "event": "PostCompact", "command": "node \"./src/hook.js\"", "timeout": 15 },
24
+ { "event": "Stop", "command": "node \"./src/hook.js\"", "timeout": 15 },
25
+ { "event": "SubagentStop", "command": "node \"./src/hook.js\"", "timeout": 15 }
26
+ ],
27
+ "interface": {
28
+ "displayName": "AgentSpine",
29
+ "shortDescription": "Identity, memory, attention, and resumable context without rewriting source files.",
30
+ "developerName": "Mayk Biletti",
31
+ "websiteURL": "https://github.com/Maykbiletti/AgentSpine"
32
+ }
33
+ }
@@ -0,0 +1,61 @@
1
+ # Visible cross-host acceptance
2
+
3
+ AgentSpine `0.8.0` retains the visible, reproducible 14-gate acceptance scenario for the lifecycle adapter and adds staged installed-entrypoint source-root and indexed-memory scaling smoke tests. They execute the same bundled adapter used by Claude Code and Codex and never select an MCP tool, but they do not substitute for the hosts' own plugin discovery and hook-trust UI.
4
+
5
+ ```bash
6
+ agentspine acceptance
7
+ agentspine acceptance --json
8
+ npm run acceptance
9
+ ```
10
+
11
+ The runner creates a temporary synthetic project and a separate temporary AgentSpine state directory. It uses new fictional identities, groups, projects, tasks, and fixed event times. It neither reads real user context nor stores a conversation transcript. Both temporary directories are removed after success or failure.
12
+
13
+ ## What the run proves
14
+
15
+ ```mermaid
16
+ sequenceDiagram
17
+ participant C as Claude lifecycle
18
+ participant A as AgentSpine hooks
19
+ participant S as External state
20
+ participant X as Codex lifecycle
21
+ C->>A: Swedish prompt and SessionStart
22
+ A->>S: scoped learning, attention, and checkpoint receipts
23
+ S-->>C: exact byte-budgeted briefing
24
+ X->>A: Spanish prompt and PostCompact
25
+ S-->>X: separately scoped briefing
26
+ C->>A: authorized effect, Stop, new SessionStart
27
+ A->>S: current-rights checks and atomic checkpoint
28
+ S-->>C: resume checkpoint
29
+ Note over C,X: zero model-side MCP calls
30
+ ```
31
+
32
+ The human-readable report contains these gates:
33
+
34
+ | Gate | Evidence |
35
+ |---|---|
36
+ | Canonical identities | Freja Åström and Lucía Ortega, their groups, projects, and tasks have separate stable IDs |
37
+ | Multilingual style continuity | Direct Swedish and Spanish style requests are minimally captured after opt-in |
38
+ | Attention lifecycle | Heartbeat, promise, and blocker events retain scope, provenance, and deduplication |
39
+ | Real restart | Claude receives the correct style and promise on a new `SessionStart` |
40
+ | Real compaction boundary | Codex receives the correct Spanish context on `PostCompact` |
41
+ | Person and group isolation | The other person and group cannot see foreign private or group context |
42
+ | Correction and history | A Swedish correction becomes active without replacing prior history |
43
+ | Atomic rollback | Rollback removes the correction and restores the earlier accepted style |
44
+ | Authorized resume | An exact local grant starts and resumes one job on its durable checkpoint |
45
+ | Denied foreign effect | A different actor cannot use the active lease or known task |
46
+ | Durable checkpointing | Effect, result, stop, and resume retain idempotent external receipts |
47
+ | Complete person purge | Later Codex startup cannot recall the purged person's context |
48
+ | Byte preservation | `AGENTS.md`, `CLAUDE.md`, and `SOUL.md` hashes remain identical |
49
+ | Final audit | All ten preservation and safety gates pass |
50
+
51
+ Every line includes a SHA-256 receipt derived from the acceptance schema, gate ID, and bounded evidence. The final digest binds the ordered gate receipts. JSON output uses `agentspine.acceptance/v1` and is suitable for CI without exposing source content.
52
+
53
+ ## Installation proof
54
+
55
+ `npm run host:install-check` stages both a fresh installation and an upgrade from `0.7.0`. Each installed `0.8.0` bundle must contain exactly one MCP server, one hook set, and one worker entrypoint, then pass the complete visible acceptance run with `mcpCalls: 0`. It directly invokes the packaged hook entrypoint from an AgentSpine checkout and a foreign `cwd` with sources only in a custom Claude profile, and repeats the Codex-shaped event path with a custom home, two Git projects, a fallback name, and a nested override. Uninstall removes only staged plugin and generated state; all synthetic source hashes remain unchanged. A real Codex session must separately show the plugin source in `/hooks`, record trust for the current definition hash, and inject the briefing after a new session starts.
56
+
57
+ ## Deliberate trust boundaries
58
+
59
+ The acceptance runner proves software behavior; it does not simulate or bypass host trust. A real Claude Code or Codex installation still asks once before executable plugin components become active. Automatic conversation learning additionally requires the separate local privacy opt-in.
60
+
61
+ The self-starter demonstration uses a synthetic owner-confirmed grant created inside the isolated scenario. In a real installation, execution grants and job registration remain explicit local owner operations. Memory, Markdown, conversation, relationships, attention, signatures, tasks, acceptance receipts, and prior approvals can never create or widen rights.