blun-king-cli 9.1.536 → 9.1.561

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 (129) hide show
  1. package/LIESMICH.txt +13 -869
  2. package/README.md +41 -833
  3. package/bin/assistant-message-offload-policy.cjs +3 -1
  4. package/bin/compaction-transaction-policy.cjs +122 -0
  5. package/bin/context-performance-policy.cjs +2 -5
  6. package/bin/context-pressure-policy.cjs +20 -0
  7. package/bin/cron-run-output.cjs +45 -0
  8. package/bin/cron-run-store.cjs +145 -0
  9. package/bin/default-model-output-budget-policy.cjs +28 -0
  10. package/bin/durable-task-resume-policy.cjs +130 -0
  11. package/bin/durable-task-resume-runtime.cjs +117 -0
  12. package/bin/durable-task-resume-store.cjs +88 -0
  13. package/bin/editable-tool-approval-policy.cjs +540 -0
  14. package/bin/editable-tool-approval-runtime.cjs +99 -0
  15. package/bin/file-observation-policy.cjs +133 -0
  16. package/bin/html-to-research-markdown.cjs +146 -0
  17. package/bin/launcher-runtime.js +0 -1
  18. package/bin/micro-compaction-policy.cjs +64 -0
  19. package/bin/mnemo-connect-heartbeat.cjs +1 -3
  20. package/bin/programmatic-tool-runtime.mjs +330 -4
  21. package/bin/read-continuation-policy.cjs +36 -5
  22. package/bin/retry-checkpoint-policy.cjs +13 -0
  23. package/bin/scoped-cron-run-policy.cjs +358 -0
  24. package/bin/session-checkpoint-policy.cjs +25 -0
  25. package/bin/startup-preferences.cjs +4 -3
  26. package/bin/structured-agent-swarm-output.cjs +325 -0
  27. package/bin/subagent-context-fork-policy.cjs +155 -0
  28. package/bin/subagent-skill-policy.cjs +204 -0
  29. package/bin/telegram-approval-relay.cjs +2 -1
  30. package/bin/tool-file-persistence.cjs +141 -0
  31. package/bin/tool-result-offload-policy.cjs +25 -33
  32. package/bin/turn-thinking-policy.cjs +2 -26
  33. package/bin/update-notice.js +30 -18
  34. package/bin/user-message-offload-policy.cjs +3 -1
  35. package/blun.mjs +1564 -640
  36. package/codebase-index/README.md +12 -0
  37. package/codebase-index/codebase_index.py +129 -18
  38. package/package.json +23 -58
  39. package/telegram-plugin/bin/telegram-mnemo-capture.cjs +1 -3
  40. package/telegram-plugin/bin/telegram-typing-keepalive.cjs +89 -0
  41. package/telegram-plugin/dist/bridge.mjs +8 -1
  42. package/CHANGELOG.md +0 -321
  43. package/agent-spine-plugin/CHANGELOG.md +0 -406
  44. package/agent-spine-plugin/CONTRIBUTING.md +0 -52
  45. package/agent-spine-plugin/README.md +0 -344
  46. package/agent-spine-plugin/SECURITY.md +0 -47
  47. package/agent-spine-plugin/docs/acceptance.md +0 -61
  48. package/agent-spine-plugin/docs/architecture.md +0 -183
  49. package/agent-spine-plugin/docs/attention.md +0 -121
  50. package/agent-spine-plugin/docs/automatic-continuity.md +0 -79
  51. package/agent-spine-plugin/docs/channel-runtime.md +0 -92
  52. package/agent-spine-plugin/docs/coordination.md +0 -138
  53. package/agent-spine-plugin/docs/feed-transport.md +0 -99
  54. package/agent-spine-plugin/docs/gateway-runtime.md +0 -116
  55. package/agent-spine-plugin/docs/harness-reference.md +0 -45
  56. package/agent-spine-plugin/docs/host-integration.md +0 -129
  57. package/agent-spine-plugin/docs/https-transport.md +0 -116
  58. package/agent-spine-plugin/docs/learning.md +0 -133
  59. package/agent-spine-plugin/docs/object-transport.md +0 -93
  60. package/agent-spine-plugin/docs/peer-transport.md +0 -88
  61. package/agent-spine-plugin/docs/preflight-recall.md +0 -69
  62. package/agent-spine-plugin/docs/preservation-contract.md +0 -53
  63. package/agent-spine-plugin/docs/quality-gates.md +0 -50
  64. package/agent-spine-plugin/docs/relationships.md +0 -73
  65. package/agent-spine-plugin/docs/releasing.md +0 -83
  66. package/agent-spine-plugin/docs/roadmap.md +0 -307
  67. package/agent-spine-plugin/docs/selfstarter.md +0 -88
  68. package/agent-spine-plugin/docs/session-briefing.md +0 -74
  69. package/agent-spine-plugin/docs/shared-memory.md +0 -259
  70. package/agent-spine-plugin/docs/source-roots.md +0 -86
  71. package/agent-spine-plugin/docs/sqlite-transport.md +0 -76
  72. package/agent-spine-plugin/scripts/check-hosts.js +0 -195
  73. package/agent-spine-plugin/scripts/check-install.js +0 -569
  74. package/agent-spine-plugin/scripts/check-syntax.js +0 -29
  75. package/agent-spine-plugin/scripts/github-actions.js +0 -11
  76. package/agent-spine-plugin/scripts/release-check.js +0 -128
  77. package/agent-spine-plugin/scripts/run-acceptance.js +0 -19
  78. package/agent-spine-plugin/scripts/run-checks.js +0 -46
  79. package/agent-spine-plugin/scripts/run-tests-hermetic.js +0 -73
  80. package/agent-spine-plugin/spine-example/1-identity.md +0 -12
  81. package/agent-spine-plugin/spine-example/2-voice.md +0 -6
  82. package/agent-spine-plugin/spine-example/3-conduct.md +0 -8
  83. package/agent-spine-plugin/spine-example/4-history.md +0 -4
  84. package/bin/empty-response-retry-policy.cjs +0 -29
  85. package/bin/fredrik-glm-provider.cjs +0 -256
  86. package/bin/package-regression-policy.cjs +0 -77
  87. package/fredrik-glm-profile.toml.example +0 -26
  88. package/release-planned-removals.json +0 -15
  89. package/scripts/check-active-profile-plugin-startup.js +0 -36
  90. package/scripts/check-active-work-steer-regression.js +0 -46
  91. package/scripts/check-approval-observability-regression.js +0 -111
  92. package/scripts/check-approval-queue-shortcuts-regression.js +0 -65
  93. package/scripts/check-bundled-agent-spine-regression.js +0 -48
  94. package/scripts/check-codebase-search-packaging-regression.js +0 -92
  95. package/scripts/check-copy-command-regression.js +0 -74
  96. package/scripts/check-current-turn-read-pin-mutation-regression.js +0 -72
  97. package/scripts/check-current-turn-read-pin-regression.js +0 -94
  98. package/scripts/check-deepseek-native-max-regression.js +0 -49
  99. package/scripts/check-empty-response-effort-downgrade-regression.js +0 -48
  100. package/scripts/check-fredrik-glm-mutation-regression.js +0 -18
  101. package/scripts/check-fredrik-glm-regression.js +0 -169
  102. package/scripts/check-historical-tool-result-preview-regression.js +0 -77
  103. package/scripts/check-history-pressure-offload-regression.js +0 -77
  104. package/scripts/check-mcp-startup-wait-budget.js +0 -48
  105. package/scripts/check-package-regression.js +0 -38
  106. package/scripts/check-plugin-startup-regression.js +0 -53
  107. package/scripts/check-programmatic-context-isolation-regression.js +0 -193
  108. package/scripts/check-programmatic-tool-regression.js +0 -294
  109. package/scripts/check-queue-controls-regression.js +0 -189
  110. package/scripts/check-release-metadata.js +0 -103
  111. package/scripts/check-reload-agent-spine-regression.js +0 -76
  112. package/scripts/check-resume-replay-regression.js +0 -102
  113. package/scripts/check-session-cancel-regression.js +0 -43
  114. package/scripts/check-session-picker-resume-metrics-regression.js +0 -97
  115. package/scripts/check-session-start-hook-context-regression.js +0 -228
  116. package/scripts/check-shell-terminal-isolation-regression.js +0 -81
  117. package/scripts/check-slash-escape-regression.js +0 -89
  118. package/scripts/check-startup-swarm-command-regression.js +0 -24
  119. package/scripts/check-structured-subagent-output-regression.js +0 -331
  120. package/scripts/check-telegram-bridge-watchdog.js +0 -60
  121. package/scripts/check-telegram-direct-work-resume-regression.js +0 -53
  122. package/scripts/check-telegram-loop-exactly-once-regression.js +0 -71
  123. package/scripts/check-todo-loop-regression.js +0 -78
  124. package/scripts/check-todo-progress-regression.js +0 -416
  125. package/scripts/check-todo-recovery-catalog-regression.js +0 -50
  126. package/scripts/check-tool-schema-capacity-regression.js +0 -40
  127. package/scripts/programmatic-tool-runtime.test.mjs +0 -365
  128. package/scripts/structured-subagent-output.test.cjs +0 -170
  129. /package/{scripts → bin}/fix-node-pty-perms.js +0 -0
@@ -1,99 +0,0 @@
1
- # Signed mutable feed transport
2
-
3
- AgentSpine can discover successive immutable HTTPS snapshots through one signed, compare-and-swap feed. The feed is provider-neutral and deliberately narrow: it is a bounded hash-chain window of snapshot references, not a remote database, command queue, permission source, or replacement for local review.
4
-
5
- ```mermaid
6
- sequenceDiagram
7
- participant P as Local publisher
8
- participant O as Immutable objects
9
- participant F as Mutable feed
10
- participant R as Local receiver
11
- P->>O: Create snapshot object<br/>If-None-Match: *
12
- P->>F: GET signed chain + strong ETag
13
- P->>P: Append entry and sign entire window
14
- P->>F: PUT new chain<br/>If-Match: previous ETag
15
- F-->>P: 200/204 or 412 conflict
16
- P->>F: Verify exact read-back
17
- R->>F: GET signed chain + strong ETag
18
- R->>R: Verify trusted key, chain and local receipt
19
- R->>O: GET content-addressed snapshot
20
- R->>R: Verify snapshot and import to quarantine
21
- R->>R: Persist new receipt with prior receipt in history
22
- ```
23
-
24
- ## Publish
25
-
26
- The directory adapter must already be authenticated, and the named signer must remain stable for the lifetime of one feed:
27
-
28
- ```bash
29
- export AGENTSPINE_FEED_TOKEN='deployment-supplied-value'
30
-
31
- agentspine share-feed-publish /srv/agent-memory/team-alpha \
32
- --root /path/to/publisher-project \
33
- --base https://memory.example.org/agentspine/team-alpha \
34
- --feed feed:team-alpha \
35
- --signer signer:team-alpha \
36
- --id snapshot:team-alpha-2026-08-28-01 \
37
- --token-env AGENTSPINE_FEED_TOKEN \
38
- --confirm-local-share
39
- ```
40
-
41
- Publication first creates and verifies the immutable object. It then reads the current feed, appends one entry, signs the entire retained window, updates using the previous strong ETag, and verifies an exact read-back. A `412` is a normal concurrency conflict: no retry is hidden, and the caller must fetch the winning feed before deciding whether to publish another snapshot.
42
-
43
- The stable feed URL is derived from the SHA-256 digest of `feedId`:
44
-
45
- ```text
46
- https://memory.example.org/agentspine/team-alpha/feeds/{sha256(feedId)}.json
47
- ```
48
-
49
- ## Pull
50
-
51
- The receiver explicitly trusts the publisher's exported Ed25519 identity before pulling:
52
-
53
- ```bash
54
- agentspine share-feed-pull \
55
- --root /path/to/receiver-project \
56
- --base https://memory.example.org/agentspine/team-alpha \
57
- --feed feed:team-alpha \
58
- --token-env AGENTSPINE_FEED_TOKEN
59
- ```
60
-
61
- The first observation may join an established feed at its current tip. Every later pull must prove continuity from the locally stored receipt. A lower sequence is a rollback. A different entry at an observed sequence is equivocation. A newer feed whose bounded window no longer contains the observed tip is a continuity gap and fails closed instead of silently skipping history.
62
-
63
- The feed retains at most 256 references. Receivers that may remain offline for more than 255 publications should poll less sparsely or begin a new explicitly trusted feed after operator review. Feed signer rotation also requires a new `feedId`; this avoids treating a same-name key as the old identity.
64
-
65
- `share-feed-state` shows local receipts and retained prior receipts. There is intentionally no automatic reset command. Removing or replacing rollback protection is an operator decision outside the agent-controlled CLI workflow.
66
-
67
- ## Server contract
68
-
69
- For a new feed, the service must atomically create the resource:
70
-
71
- ```http
72
- PUT /agentspine/team-alpha/feeds/{feed-id-sha256}.json
73
- Content-Type: application/vnd.agentspine.feed+json
74
- If-None-Match: *
75
- ```
76
-
77
- It returns `201` or `204`, then serves the exact document with a strong ETag. Updates require:
78
-
79
- ```http
80
- PUT /agentspine/team-alpha/feeds/{feed-id-sha256}.json
81
- Content-Type: application/vnd.agentspine.feed+json
82
- If-Match: "the-etag-returned-by-the-last-get"
83
- ```
84
-
85
- The service returns `200` or `204` only when that exact ETag still matches. It returns `412` without changing the feed after a competing update. Weak ETags are rejected because they cannot protect byte-exact compare-and-swap semantics. Responses are uncompressed JSON, no larger than 256 KiB, and redirects are never followed.
86
-
87
- The object endpoints continue to implement the create-only contract in [immutable HTTPS objects](object-transport.md). A production service should independently authenticate writers, verify request sizes and preconditions atomically, rate-limit access, and avoid logging bearer values or feed bodies.
88
-
89
- ## Security and authority boundary
90
-
91
- - TLS, vetted and pinned DNS, SSRF protection, strict timeouts, no redirects, exact limits, and environment-only bearer tokens apply to both feed reads and writes.
92
- - Every network write requires explicit local owner confirmation. Private-network access requires the same confirmation plus an explicit opt-in.
93
- - The signed feed authenticates one configured origin and detects history changes. It does not approve any referenced claim.
94
- - The referenced snapshot is independently digest-checked and signature-checked, then imported through the existing quarantine. A second local user review remains mandatory before context use.
95
- - Feed receipts and their history live outside the scanned project and are checked by the ten-gate audit. Corrupt state is never overwritten automatically.
96
- - Feed payloads, receipts, snapshots, bearer authentication, signatures, and remote service responses always remain `context-only`. They cannot grant permissions, delegation, production access, spending rights, or policy exceptions.
97
- - Feed publication, pulling, endpoint selection, tokens, and receipt mutation are absent from MCP and hooks.
98
-
99
- Existing `AGENTS.md`, `CLAUDE.md`, `SOUL.md`, `MEMORY.md`, and other discovered Markdown files are never transported or modified by this layer.
@@ -1,116 +0,0 @@
1
- # Durable gateway worker
2
-
3
- AgentSpine `0.8.0` includes an optional long-running worker that closes the gap between a channel message and an actual Claude Code or Codex run. While the worker is running, it polls configured Telegram accounts, authenticates every accepted update against an exact local channel binding, starts one leased agent lane, and delivers one idempotent reply to the original chat, topic, and message.
4
-
5
- The worker is not exposed through MCP and is never started by remembered text. Its policy defaults to disabled; the owner enables it once with `agentspine gateway-control /path/to/project --enabled true --confirm-local-gateway`. An operating-system service manager may then supervise it after the owner configures its environment and command line.
6
-
7
- ## Automatic persona roster
8
-
9
- Set `AGENTSPINE_PERSONA_ROSTER_FILE` or pass `--persona-roster` to the worker. The path must be absolute, point to a regular non-symlink JSON file outside the agent project, and remain below 1 MiB. The file uses this envelope:
10
-
11
- ```json
12
- {
13
- "schema": "agentspine.persona-roster/v1",
14
- "revision": 1,
15
- "observedAt": "2032-01-01T00:00:00.000Z",
16
- "bindings": [
17
- {
18
- "id": "persona-binding:franz",
19
- "authenticator": "host-manifest",
20
- "issuer": "host:local",
21
- "tenantId": "tenant:blun",
22
- "host": "codex",
23
- "profileId": "profile:franz",
24
- "subjectId": "subject:franz",
25
- "kind": "agent",
26
- "displayName": "Franz",
27
- "sourceBinding": ".codex/agents/franz.md",
28
- "groupId": "group:engineering"
29
- }
30
- ]
31
- }
32
- ```
33
-
34
- Every tick synchronizes authenticated identities before any work is reconciled. New bindings append `join` events; renames retain the stable persona ID; omitted members in the same explicit roster scope become `left`; `"deactivated": true` records a distinct deactivation; reappearance appends `rejoin`. A binding may describe a `person`, `agent`, or `bot`; equal display names never merge identities. Names, Markdown, memory, and chat text cannot create identity or rights. Existing source files are never changed.
35
-
36
- Version `0.10.1` reconciles the authenticated roster into the relationship graph on every sync, including an otherwise unchanged replay. An exact `groupId` creates a missing group-scoped, context-only group entity; a conflicting non-group or private group fails visibly. Missing persona entities and membership edges are recreated, stale memberships are removed, and left or deactivated personas remain in append-only identity history but disappear from current relationship context. Reconciliation reports whether the roster changed separately from graph repair, so a previously partial installation can self-heal instead of remaining a permanent duplicate.
37
-
38
- When a hook supplies the same exact `groupId`, `relationship_context` and `session_briefing` include current visible co-members reached through authenticated `member-of` edges. They do not infer friendships, merge names, cross tenants, expose another group, or turn membership into delegation. A direct session without an exact group scope does not receive group-private peers. Relationship reads bypass project discovery, abort the graph read after a five-second local deadline, and return a visible `degraded` status instead of aborting the turn or waiting indefinitely.
39
-
40
- The same approved envelope may contain `nativeDiscovery` scopes. AgentSpine then checks only the officially documented direct agent-manifest directories: Claude Code `~/.claude/agents/` or `<project>/.claude/agents/`, and Codex `~/.codex/agents/` or `<project>/.codex/agents/`. `CLAUDE_CONFIG_DIR` and `CODEX_HOME` replace only their matching user scope. Each scope fixes issuer, tenant, profile, agent/bot kind, and optional group; those authenticated scope fields plus the exact source binding form the stable identity. The manifest contributes only its declared display name and an exact source descriptor; its instructions remain host-native context. Direct regular `.md` or `.toml` files are bounded to 128 entries and 256 KiB each; symlinks and files exchanged during a read fail closed. No other home or project directory is enumerated. See the official [Claude Code custom subagent locations](https://code.claude.com/docs/en/sub-agents) and [Codex custom agent locations](https://developers.openai.com/codex/agent-configuration/subagents).
41
-
42
- ```json
43
- {
44
- "nativeDiscovery": [
45
- {
46
- "id": "native:claude:user",
47
- "host": "claude",
48
- "scope": "user",
49
- "issuer": "host:local",
50
- "tenantId": "tenant:blun",
51
- "profileId": "profile:franz",
52
- "kind": "agent",
53
- "groupId": "group:engineering"
54
- }
55
- ]
56
- }
57
- ```
58
-
59
- A one-shot manual validation is available through:
60
-
61
- ```bash
62
- agentspine persona-sync /path/to/project \
63
- --roster /absolute/path/to/roster.json \
64
- --confirm-local-persona
65
-
66
- agentspine personas /path/to/project --json
67
- agentspine relationships group:engineering --group group:engineering --json
68
- ```
69
-
70
- ## Telegram and host runner
71
-
72
- An active Telegram channel binding needs `receive` and `reply`, an ingress HMAC environment variable, and an outbound Bot API token environment variable. The worker polls only accounts present in current bindings. Unknown chats, topics, senders, and non-text updates do not enter the queue.
73
-
74
- `AGENTSPINE_HOST_RUNNER` must be an absolute locally approved executable path. AgentSpine invokes it with no shell and a minimized environment. One bounded JSON request arrives on stdin. For channel work it contains the exact host, profile, project root, agent scope, session key, and `agent_spine_channel_event` reference needed to start the native lifecycle hook. The message text itself is loaded by that hook from the authenticated channel state.
75
-
76
- When the runner starts the selected stock CLI, it maps that request to the child process environment: `AGENTSPINE_GATEWAY_CONTEXT=agentspine.gateway-start/v1`, `AGENTSPINE_ENTITY_ID`, `AGENTSPINE_PROJECT_ID`, optional `AGENTSPINE_GROUP_ID`, plus `AGENTSPINE_CHANNEL_EVENT_ID` and `AGENTSPINE_CHANNEL_PROVIDER`. The native `SessionStart` payload does not need proprietary fields; the trusted AgentSpine hook reads this exact environment bridge and then leases the referenced event. The runner must not pass provider tokens or the ingress HMAC secret to the host process.
77
-
78
- The runner returns one bounded JSON result:
79
-
80
- ```json
81
- {
82
- "text": "Die geprüfte Antwort.",
83
- "checkpoint": { "step": "verified" },
84
- "completed": true
85
- }
86
- ```
87
-
88
- Start one diagnostic tick:
89
-
90
- ```bash
91
- agentspine gateway-control /path/to/project \
92
- --enabled true --confirm-local-gateway
93
-
94
- AGENTSPINE_TELEGRAM_TOKEN='…' \
95
- AGENTSPINE_TELEGRAM_INGRESS_SECRET='at-least-32-bytes…' \
96
- AGENTSPINE_HOST_RUNNER='/absolute/path/to/approved-runner' \
97
- agentspine-worker --root /path/to/project \
98
- --persona-roster /absolute/path/to/roster.json --once
99
- ```
100
-
101
- Remove `--once` under a service manager for continuous operation. AgentSpine does not silently install a daemon, persist provider tokens, or approve Codex/Claude executable hooks. Codex still requires the current hook definition to be visible and trusted in `/hooks`.
102
-
103
- ## Goals, attention, and recovery
104
-
105
- An agent without a queued message or an owner-assigned goal reports `idle/needs-goal`. `goal-assign` creates one exact focused goal for an active authenticated agent. Promise, resolved-blocker, deadline, assignment, follow-up, and direct-message wakes share bounded per-agent lanes. Each effect rechecks current policy, identity, group, route, and kill-switch state.
106
-
107
- Queue leases expire safely, retries are bounded, and the worker wakes on relevant desired-state files or a capped timer without watching its own runtime writes. Prepared and demonstrably effect-free failed deliveries resume after restart. A revoked reply capability or exhausted no-effect retry budget becomes `dead-letter`; ambiguous sends become `delivery-unknown` and are never automatically replayed. Already delivered outbox entries are never sent twice. Checkpoints reject secrets and authority-shaped content. The ten-gate audit replays persona events, gateway history, receipts, lanes, queue IDs, delivery IDs, independent health heartbeats, and current authority markers.
108
-
109
- The worker can be stopped locally at any time:
110
-
111
- ```bash
112
- agentspine gateway-control /path/to/project \
113
- --kill-switch true --confirm-local-gateway
114
- ```
115
-
116
- Memory, learning, relationships, persona files, goals, and model output cannot grant channel, tool, process, or execution permission.
@@ -1,45 +0,0 @@
1
- # Harness reference study
2
-
3
- This architecture input was reviewed on 2026-08-29 against primary sources only. No upstream code, brand material, or persona text is included in AgentSpine.
4
-
5
- ## Reviewed snapshots
6
-
7
- - OpenClaw `2026.8.1`, commit [`fb7822e1`](https://github.com/openclaw/openclaw/commit/fb7822e1d3333c9417131fa3514000a6a17e6dbd): [multi-agent routing](https://docs.openclaw.ai/concepts/multi-agent), [Gateway protocol](https://docs.openclaw.ai/gateway/protocol), and [cron jobs](https://docs.openclaw.ai/automation/cron-jobs).
8
- - NousResearch Hermes Agent `0.20.6`, commit [`1c5ee581`](https://github.com/NousResearch/hermes-agent/commit/1c5ee5815fe5a3913530ba9d803b5b60bc633766): [cron guide](https://hermes-agent.nousresearch.com/docs/user-guide/features/cron), [messaging overview](https://hermes-agent.nousresearch.com/docs/user-guide/messaging), and [Telegram guide](https://hermes-agent.nousresearch.com/docs/user-guide/messaging/telegram).
9
-
10
- ## Architecture comparison
11
-
12
- | Pattern | Übernehmen | An AgentSpine anpassen | Bewusst nicht übernehmen |
13
- |---|---|---|---|
14
- | Long-lived local gateway | Durable event ownership, health, wake-up, and recovery outside conversational turns | Optional provider-neutral worker; it does not replace the model host or tool registry | No silent network listener, hidden installation, or MCP administration |
15
- | Agent isolation | Per-agent lane, state, session key, and exact channel-account binding | Separate tenant, profile, project, group, chat, and thread in every route | No fallback from one agent's private session, credentials, or memory into another |
16
- | Scheduler | Persistent desired state, startup reconciliation, targeted event wake, and independent ticker health | Goals and obligations enter one bounded priority queue; timer is capped and has no busy loop | No prompt-created cron authority and no model-controlled scheduler policy |
17
- | Isolated scheduled run | Fresh bounded host run with a terminal result and durable checkpoint | Return only the safe result/checkpoint to the responsible main context | No global transcript import and no private cross-session history mixing |
18
- | Telegram | Stable numeric identities, explicit binding, origin-preserving replies, allowlist-style ingress | HMAC-normalized `agentspine.channel-event/v1`, exact tenant/account/chat/thread/sender/agent scope | No name-based identity, inferred recipient, broad bot token access, or send capability from text |
19
- | Persona and voice | Per-agent persona source and stable named-bot separation | Authenticated roster metadata plus a bounded context-only `voiceBrief` | No persona file copying, invented feelings, dependency language, or authority from `SOUL.md` |
20
- | Delivery | Idempotent outbox, receipts, retry, and terminal failure | Ambiguous sends become `delivery-unknown` and require reconciliation rather than replay | No claim of mathematical exactly-once transport; the guarantee is at-most-one automatic external effect |
21
-
22
- ## AgentSpine contracts derived from the study
23
-
24
- 1. `agentspine.channel-event/v1` is immutable and binds provider, tenant, account, chat, thread, sender, agent, project, group, privacy, reply target, and observed time.
25
- 2. The optional worker owns typed inbound, run, lifecycle, health, scheduler, and delivery transitions in external private state.
26
- 3. Per-agent lanes serialize work; another agent, tenant, profile, project, group, chat, or thread cannot claim the lease.
27
- 4. Reconciliation expires abandoned leases, detects ambiguous delivery, re-enqueues only demonstrably effect-free failures, and preserves terminal receipts.
28
- 5. Gateway, adapter, scheduler, queue, worker lease, and host runtime have separate health fields. A live process alone is not healthy.
29
- 6. Goals require an authenticated local owner assignment and contain one success criterion, next safe step, deadline, checkpoint, heartbeat, blocker, and history.
30
- 7. Memory, Markdown, persona, relationship, task text, prior output, and MCP never satisfy identity, execution, route, or send policy.
31
-
32
- ## Regression classes
33
-
34
- The local tests cover the public failure classes as contracts rather than copying their implementations:
35
-
36
- - A scheduled result that is delivered but never checkpointed cannot become terminal; run completion persists before delivery preparation.
37
- - A stopped scheduler cannot hide behind a running gateway because health gates are independent and audited.
38
- - Restart reconciliation converts an in-flight ambiguous send to `delivery-unknown`; it never floods Telegram by replaying it.
39
- - Every run has a bounded host timeout and one of the terminal or retryable queue states; no final-tool-call ghost remains leased forever.
40
- - Lease expiry and startup reconciliation close ghost lane rows and allow only safe work to resume.
41
- - Duplicate provider updates, parallel workers, and repeated delivery calls converge on one event, one lane, one outbox key, and at most one automatic external send.
42
-
43
- ## Stronger boundaries retained
44
-
45
- AgentSpine keeps no global full transcript, exposes no channel, goal, wake, worker, kill-switch, secret, or send administration through MCP, and does not broaden tools from persona or team membership. Host and local policy stores remain physically separate from context state. Explicit host trust and local owner confirmation remain unavoidable security decisions.
@@ -1,129 +0,0 @@
1
- # Host integration
2
-
3
- AgentSpine uses native plugin surfaces instead of asking users to paste a large system prompt into every project.
4
-
5
- ## Claude Code
6
-
7
- | Component | Path | Purpose |
8
- |---|---|---|
9
- | Manifest | `.claude-plugin/plugin.json` | Package identity and version |
10
- | Marketplace | `.claude-plugin/marketplace.json` | GitHub installation and updates |
11
- | Skill | `skills/agent-spine/SKILL.md` | Context rules and preservation invariants |
12
- | MCP | `.mcp.json` | Read-only source tools plus external overlay workflows |
13
- | Hooks | `hooks/hooks.json` | Automatic briefing, attention, protected-source guard, and rights-bound checkpoints |
14
-
15
- Install from GitHub:
16
-
17
- ```bash
18
- claude plugin marketplace add Maykbiletti/AgentSpine
19
- claude plugin install agent-spine@agent-spine
20
- ```
21
-
22
- Use `claude plugin validate .` in a checkout to validate the manifest and marketplace. Claude Code asks the user to approve executable plugin components according to its trust model.
23
-
24
- The Claude manifest explicitly references `./.mcp.json`. The hook bundle remains at Claude Code's native auto-discovery path `hooks/hooks.json`; it is deliberately not registered a second time through the manifest. Codex keeps its host-specific adapter in `hooks/codex.json`, while `.codex-plugin/plugin.json` omits the unsupported `hooks` field and passes the official plugin validator. Version `0.11.4` replaces the `0.11.2` plugin cache identity. The hook definitions contain only portable documented fields; `hooks/version.json` carries the separately validated bundle release and preflight contract. The repository checks resolve installed-root variables, perform a real MCP `initialize` handshake, validate exactly one native hook command per event, and exercise staged clean install, previous-version cache rejection, upgrade, host-native source resolution, indexed and lazy Claude memory, automatic multilingual briefing, pre-answer recall, authenticated persona graph reconciliation, attention, exact job start, tool checkpoint, new-session resume, purge, and uninstall preservation:
25
-
26
- ```bash
27
- npm run host:check
28
- npm run host:install-check
29
- npm run acceptance
30
- ```
31
-
32
- ### Claude MCP troubleshooting
33
-
34
- If the plugin is listed but `agent-spine` is missing from `/mcp`, update the marketplace cache and reinstall before starting a new session:
35
-
36
- ```bash
37
- claude plugin marketplace update agent-spine
38
- claude plugin uninstall agent-spine@agent-spine
39
- claude plugin install agent-spine@agent-spine
40
- claude plugin list
41
- claude mcp list
42
- ```
43
-
44
- Open `/mcp` in the new interactive session and approve or reconnect `agent-spine`. `Pending approval` means discovery succeeded but Claude Code still needs the user's trust decision. A missing entry after reinstall should be diagnosed from `claude plugin validate .`, `npm run host:check`, and Claude Code's plugin diagnostics; AgentSpine does not write to Claude's user configuration or silently approve itself.
45
-
46
- ## Codex
47
-
48
- | Component | Path | Purpose |
49
- |---|---|---|
50
- | Manifest | `.codex-plugin/plugin.json` | Package identity plus explicit skill and MCP registration |
51
- | Skill | `skills/agent-spine/SKILL.md` | Context rules and preservation invariants |
52
- | MCP | Manifest `mcpServers` | Read-only source tools plus external overlay workflows |
53
- | Hooks | `hooks/codex.json` | Manifest-selected lifecycle guardrails |
54
-
55
- Open `/plugins` in Codex CLI after configuring a marketplace that contains AgentSpine, then start a new session. Codex presents a startup review when a new or changed hook definition needs trust; there is no `/hooks` slash command. Codex records trust against the exact hook-definition hash, so an installed, updated, or previously untrusted bundle is skipped until that current definition is reviewed and trusted. This follows the official [Codex hooks trust and plugin discovery contract](https://developers.openai.com/codex/hooks).
56
-
57
- Codex loads `hooks/codex.json` through the explicit plugin-manifest entry. It contains only Codex-documented lifecycle events; Claude Code's additional `InstructionsLoaded` event remains confined to `hooks/hooks.json`. Both files deliberately contain only the documented top-level `description` and `hooks` fields. Cache identity remains in `.codex-plugin/plugin.json`, while Codex records hook trust against the current definition hash. The Codex hook and MCP registrations use the host-native `PLUGIN_ROOT` expansion.
58
-
59
- Verify the live host in a newly started Codex CLI session:
60
-
61
- ```text
62
- /plugins
63
- Trust all and continue
64
- ```
65
-
66
- `npm run host:check` proves manifest shape, package containment, and a real MCP handshake. `npm run host:install-check` stages the installed bundle and executes its hook entrypoint with native event JSON. Neither command can manufacture Codex's user-controlled trust receipt; only the startup review in the actual host proves that final boundary.
67
-
68
- ## BLUN King
69
-
70
- | Component | Path | Purpose |
71
- |---|---|---|
72
- | Manifest | `blun.plugin.json` | Native BLUN plugin identity plus skill, MCP, and lifecycle-hook registration |
73
- | Skill | `skills/agent-spine/SKILL.md` | Context rules and preservation invariants |
74
- | MCP | Manifest `mcpServers` | Read-only source tools plus external overlay workflows |
75
- | Hooks | Manifest `hooks` | Automatic briefing, attention, protected-source guard, and checkpoints |
76
-
77
- Install the local checkout from Fredrik's TUI:
78
-
79
- ```text
80
- /plugins install C:\path\to\AgentSpine
81
- ```
82
-
83
- BLUN asks the user to trust a third-party plugin before installation because its MCP server and hooks execute local code. Accept that visible install decision, then use `/reload` or `/new`; BLUN has no separate `/hooks` command. The BLUN adapter maps its isolated `BLUN_HOME` to AgentSpine's Codex-compatible `AGENTS.md` source hierarchy, so user state remains under the BLUN app home instead of leaking into `.codex` or a scanned project.
84
-
85
- ## Direct MCP use
86
-
87
- Any MCP client that supports stdio can launch:
88
-
89
- ```json
90
- {
91
- "mcpServers": {
92
- "agent-spine": {
93
- "command": "agentspine-mcp"
94
- }
95
- }
96
- }
97
- ```
98
-
99
- The server implements `initialize`, `ping`, `tools/list`, and `tools/call`. It has no network dependency and exposes no source-file, delegation-policy, signer, trust, or shared-adapter administration tool. Overlay tools write only private AgentSpine context state outside the scanned project. Explicit delegation grants, key generation and rotation, trust changes, adapter connections, publication, HTTPS snapshot export, object upload or pulls, SQLite paths or operations, import review, and destructive sharing operations remain on the local CLI surface. MCP can only read already reviewed `shared_context`; its authentication summary contains no signature or public-key material. `session_briefing` is a read-only aggregator over these already constrained read paths and cannot widen them.
100
-
101
- Verify either installation against a synthetic or real project without changing its Markdown:
102
-
103
- ```bash
104
- agentspine doctor --json
105
- npm run host:check
106
- agentspine audit /path/to/project --json
107
- ```
108
-
109
- The audit exits non-zero when a required gate fails, making it suitable for installation smoke tests and CI.
110
-
111
- Use `agentspine doctor --host claude|codex --cwd /active/project --json` or `agentspine source-status --host claude|codex --cwd /active/project --json` to see the checked scope counts and a concrete empty/fail-closed reason. The lifecycle adapter never substitutes the installation directory for the active host hierarchy. Details and official host references are in [host-native source roots](source-roots.md).
112
-
113
- The provider-neutral lifecycle adapter covers `SessionStart` (including resume and compact starts), `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `PreCompact`, `PostCompact`, `Stop`, and `SubagentStop`. Claude Code additionally registers its documented `InstructionsLoaded` observability event; Codex does not. `UserPromptSubmit` is the blocking boundary. Before a prompt can proceed, `agentspine.preflight/v2` loads complete mandatory host instructions, confirmed Must-Remember entries and every locally required retrieval provider, then consumes one exact-turn receipt. Start and compaction boundaries retain the scoped `session_briefing`; no model-side MCP selection is required. Full behavior and the documented command-hook timeout limitation are in [pre-answer recall gate](preflight-recall.md).
114
-
115
- When an exact locally registered job is waiting, `SessionStart` acquires its lease and injects its real checkpoint automatically. Subsequent tool and stop hooks resolve that job from the native host session; the model does not need to repeat a job envelope. `PreToolUse` first retains the protected-source guard, then rechecks the current execution grant, assignment, scope, capability, lease, and workspace. `PostToolUse` checkpoints exactly one matching result. A new session resumes only after the same checks. Grant and job administration remain local CLI operations and are absent from MCP. No hook creates permissions.
116
-
117
- Identity and audience come from explicit hook scope fields or the locally configured default direct-person/project scope. Group content requires an exact group ID and never enters automatic learning. Missing scope produces no inferred identity; corrupt state returns a visible `failedClosed` packet and must never be reported as successful recall.
118
-
119
- Hook stdin is JSON-only and limited to 64 KiB. State transitions use external atomic files and locks. Hook stdout contains only host protocol JSON; diagnostics are bounded to stderr by the host process. Hooks do not expose transport, key, trust, database, network, message, payment, production, delegation, or policy administration.
120
-
121
- The first executable-component trust approval remains mandatory. AgentSpine cannot approve itself. After approval and the one-time continuity opt-in, no per-session enablement or voluntary tool call is required.
122
-
123
- ## Optional gateway worker
124
-
125
- The package also registers exactly one `agentspine-worker` entrypoint. It is separate from MCP and lifecycle hooks. When an owner runs it under a service manager, it synchronizes the configured authenticated persona roster, polls current Telegram bindings, prepares exact Claude/Codex start data, invokes only the absolute executable in `AGENTSPINE_HOST_RUNNER` without a shell, and returns one idempotent reply to the bound origin.
126
-
127
- The host runner is responsible for starting the selected host with the supplied scope and `agent_spine_channel_event` fields. Codex still refuses the injected context until the current hook hash has been reviewed in `/hooks`; the worker cannot bypass or manufacture that trust. Setup and the stdin/stdout contract are documented in [durable gateway worker](gateway-runtime.md).
128
-
129
- The visible acceptance runner invokes the same production lifecycle adapter with new synthetic people, separated groups, Swedish and Spanish prompts, restarts, compaction, correction, rollback, purge, current-rights checks, and durable checkpoints. It prints one reproducible receipt per gate and proves `mcpCalls: 0`. See [visible cross-host acceptance](acceptance.md).
@@ -1,116 +0,0 @@
1
- # HTTPS snapshot transport
2
-
3
- AgentSpine can carry a signed directory exchange across ordinary HTTPS without depending on a particular cloud, database, or agent vendor. The basic workflow is deliberately static: AgentSpine creates one immutable JSON snapshot, an operator publishes that file through existing infrastructure, and receivers pull it into the normal local quarantine. For direct create-only uploads, use the separate [immutable HTTPS object transport](object-transport.md).
4
-
5
- ```mermaid
6
- sequenceDiagram
7
- participant P as Publisher CLI
8
- participant F as Signed directory adapter
9
- participant H as Operator-controlled HTTPS
10
- participant R as Receiver CLI
11
- participant Q as Local quarantine
12
- P->>F: validate signed manifest + every event
13
- P->>P: create immutable snapshot outside project
14
- P-->>H: operator publishes JSON file
15
- R->>H: pinned-DNS HTTPS GET
16
- H-->>R: bounded JSON, no redirect/compression
17
- R->>R: validate snapshot digest + all Ed25519 envelopes
18
- R->>Q: pending imports only
19
- Q-->>R: second explicit local review still required
20
- ```
21
-
22
- The web server never becomes an authority source. A TLS connection protects bytes in transit. The snapshot digest detects truncation or bundle mutation. The existing Ed25519 envelopes authenticate the configured manifest and event keys. The receiving project's trust store decides which keys are recognized. None of those checks approves a claim, grants a permission, or bypasses review.
23
-
24
- ## Publish a snapshot
25
-
26
- Snapshots require a signed directory adapter. First create the signer, trust distribution, adapter, and events as described in [shared memory adapters](shared-memory.md). Then export:
27
-
28
- ```bash
29
- agentspine share-snapshot-export /srv/agent-memory/team-alpha \
30
- --root /path/to/publisher-project \
31
- --out /srv/static/agent-memory/team-alpha-2026-08-28.json \
32
- --id snapshot:team-alpha-2026-08-28 \
33
- --confirm-local-share
34
- ```
35
-
36
- The output must be outside the scanned project and must not already exist. AgentSpine writes it with owner-only mode on POSIX systems. Updating a feed means exporting a new file or atomically changing a server-side alias outside this static workflow. `share-https-publish` can create immutable remote objects, but AgentSpine still has no remote overwrite, delete, listing, or mutable alias command.
37
-
38
- Serve the exact file over HTTPS with:
39
-
40
- - a certificate accepted by the local Node.js trust store;
41
- - `Content-Type: application/json`;
42
- - no content compression;
43
- - no redirect at the configured URL;
44
- - access logs and retention appropriate for the snapshot's metadata sensitivity.
45
-
46
- Snapshots contain shared claims, group IDs, timestamps, public signing identities, and signatures. They contain no private learning, source Markdown, evidence text, tasks, delegation policy, credentials, attention state, or relationship profiles. TLS does not encrypt a snapshot stored on the server; secure storage and server access remain deployment responsibilities.
47
-
48
- ## Pull a public endpoint
49
-
50
- Trust every expected event signer in the receiving project first, then run:
51
-
52
- ```bash
53
- agentspine share-https-pull \
54
- https://memory.example.org/team-alpha-2026-08-28.json \
55
- --root /path/to/receiving-project
56
-
57
- agentspine share-inbox /path/to/receiving-project --status pending --json
58
- ```
59
-
60
- The pull validates the entire response before writing local sharing state. All imports remain `pending` and invisible to `shared_context` until the receiving user accepts each item through `share-review --confirmed-by-user`.
61
-
62
- For an endpoint protected by a bearer token, provide only the environment variable name:
63
-
64
- ```bash
65
- export AGENTSPINE_SNAPSHOT_TOKEN='deployment-supplied-value'
66
- agentspine share-https-pull \
67
- https://memory.example.org/private/team-alpha.json \
68
- --token-env AGENTSPINE_SNAPSHOT_TOKEN \
69
- --root /path/to/receiving-project
70
- ```
71
-
72
- Tokens are read at request time. They are not accepted in URLs, command arguments, snapshots, local sharing state, hook context, MCP results, or command output. Shell history, process environment access, and server logs are still operating-system concerns.
73
-
74
- ## Private networks
75
-
76
- Public mode rejects loopback, private, link-local, carrier-grade NAT, multicast, reserved, and documentation address ranges. Every DNS answer is checked and the HTTPS connection is pinned to one vetted answer, preventing a second unvalidated lookup from rebinding the request. Mixed public/private answer sets fail closed.
77
-
78
- Self-hosted private endpoints require both flags:
79
-
80
- ```bash
81
- agentspine share-https-pull \
82
- https://memory.internal.example/team-alpha.json \
83
- --allow-private-network \
84
- --confirm-local-share \
85
- --root /path/to/receiving-project
86
- ```
87
-
88
- The confirmation is a local integration attestation, not permission derived from memory or an agent. TLS certificate verification remains enabled for private networks.
89
-
90
- ## Network safety limits
91
-
92
- The reference client:
93
-
94
- - accepts one explicit `https://` JSON resource with no embedded credentials, query, or fragment;
95
- - performs one `GET`, disables connection pooling, pins validated DNS, and follows no redirects;
96
- - rejects non-JSON media types and compressed responses;
97
- - defaults to a 10-second timeout, configurable only from 1 to 30 seconds;
98
- - caps the response and validated snapshot at 21 MiB and the event set at 2,000;
99
- - rejects unknown fields, duplicate IDs, collisions, metadata mismatches, invalid bundle digests, unsigned documents, bad signatures, and untrusted keys before quarantine mutation;
100
- - deletes its temporary materialization after every success or failure;
101
- - exposes no HTTPS export or pull operation through MCP.
102
-
103
- The static client intentionally does not execute remote instructions, enumerate endpoints, accept remote redirects, refresh tokens, upload data, or implement a hosted control plane. Writable object, local SQLite, and peer transports are separate modules and preserve the same local validation and review boundary; hosted database adapters remain extension work.
104
-
105
- ## Snapshot schema
106
-
107
- `agentspine.https-snapshot/v1` has exact top-level fields:
108
-
109
- - stable snapshot, scope, and adapter IDs;
110
- - generation timestamp;
111
- - one signed `agentspine.directory-adapter/v1` manifest envelope;
112
- - up to 2,000 signed `agentspine.shared-event/v1` event envelopes;
113
- - `authority: context-only`;
114
- - canonical SHA-256 digest over the complete snapshot body.
115
-
116
- Snapshot integrity is packaging evidence, not source identity. Manifest and event signatures are verified independently, and every event signer needs explicit local trust.