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.
Files changed (117) 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/context-performance-policy.cjs +2 -5
  5. package/bin/context-pressure-policy.cjs +20 -0
  6. package/bin/cron-run-output.cjs +45 -0
  7. package/bin/cron-run-store.cjs +145 -0
  8. package/bin/durable-task-resume-policy.cjs +130 -0
  9. package/bin/durable-task-resume-runtime.cjs +117 -0
  10. package/bin/durable-task-resume-store.cjs +88 -0
  11. package/bin/editable-tool-approval-policy.cjs +540 -0
  12. package/bin/editable-tool-approval-runtime.cjs +99 -0
  13. package/bin/html-to-research-markdown.cjs +146 -0
  14. package/bin/programmatic-tool-runtime.mjs +330 -4
  15. package/bin/read-continuation-policy.cjs +36 -5
  16. package/bin/scoped-cron-run-policy.cjs +358 -0
  17. package/bin/startup-preferences.cjs +3 -3
  18. package/bin/structured-agent-swarm-output.cjs +325 -0
  19. package/bin/subagent-context-fork-policy.cjs +155 -0
  20. package/bin/subagent-skill-policy.cjs +204 -0
  21. package/bin/telegram-approval-relay.cjs +2 -1
  22. package/bin/tool-result-offload-policy.cjs +14 -1
  23. package/bin/update-notice.js +14 -18
  24. package/bin/user-message-offload-policy.cjs +3 -1
  25. package/blun.mjs +1089 -477
  26. package/codebase-index/README.md +12 -0
  27. package/codebase-index/codebase_index.py +129 -18
  28. package/package.json +23 -58
  29. package/telegram-plugin/bin/telegram-typing-keepalive.cjs +89 -0
  30. package/telegram-plugin/dist/bridge.mjs +8 -1
  31. package/CHANGELOG.md +0 -321
  32. package/agent-spine-plugin/CHANGELOG.md +0 -406
  33. package/agent-spine-plugin/CONTRIBUTING.md +0 -52
  34. package/agent-spine-plugin/README.md +0 -344
  35. package/agent-spine-plugin/SECURITY.md +0 -47
  36. package/agent-spine-plugin/docs/acceptance.md +0 -61
  37. package/agent-spine-plugin/docs/architecture.md +0 -183
  38. package/agent-spine-plugin/docs/attention.md +0 -121
  39. package/agent-spine-plugin/docs/automatic-continuity.md +0 -79
  40. package/agent-spine-plugin/docs/channel-runtime.md +0 -92
  41. package/agent-spine-plugin/docs/coordination.md +0 -138
  42. package/agent-spine-plugin/docs/feed-transport.md +0 -99
  43. package/agent-spine-plugin/docs/gateway-runtime.md +0 -116
  44. package/agent-spine-plugin/docs/harness-reference.md +0 -45
  45. package/agent-spine-plugin/docs/host-integration.md +0 -129
  46. package/agent-spine-plugin/docs/https-transport.md +0 -116
  47. package/agent-spine-plugin/docs/learning.md +0 -133
  48. package/agent-spine-plugin/docs/object-transport.md +0 -93
  49. package/agent-spine-plugin/docs/peer-transport.md +0 -88
  50. package/agent-spine-plugin/docs/preflight-recall.md +0 -69
  51. package/agent-spine-plugin/docs/preservation-contract.md +0 -53
  52. package/agent-spine-plugin/docs/quality-gates.md +0 -50
  53. package/agent-spine-plugin/docs/relationships.md +0 -73
  54. package/agent-spine-plugin/docs/releasing.md +0 -83
  55. package/agent-spine-plugin/docs/roadmap.md +0 -307
  56. package/agent-spine-plugin/docs/selfstarter.md +0 -88
  57. package/agent-spine-plugin/docs/session-briefing.md +0 -74
  58. package/agent-spine-plugin/docs/shared-memory.md +0 -259
  59. package/agent-spine-plugin/docs/source-roots.md +0 -86
  60. package/agent-spine-plugin/docs/sqlite-transport.md +0 -76
  61. package/agent-spine-plugin/scripts/check-hosts.js +0 -195
  62. package/agent-spine-plugin/scripts/check-install.js +0 -569
  63. package/agent-spine-plugin/scripts/check-syntax.js +0 -29
  64. package/agent-spine-plugin/scripts/github-actions.js +0 -11
  65. package/agent-spine-plugin/scripts/release-check.js +0 -128
  66. package/agent-spine-plugin/scripts/run-acceptance.js +0 -19
  67. package/agent-spine-plugin/scripts/run-checks.js +0 -46
  68. package/agent-spine-plugin/scripts/run-tests-hermetic.js +0 -73
  69. package/agent-spine-plugin/spine-example/1-identity.md +0 -12
  70. package/agent-spine-plugin/spine-example/2-voice.md +0 -6
  71. package/agent-spine-plugin/spine-example/3-conduct.md +0 -8
  72. package/agent-spine-plugin/spine-example/4-history.md +0 -4
  73. package/bin/fredrik-glm-provider.cjs +0 -256
  74. package/bin/package-regression-policy.cjs +0 -77
  75. package/fredrik-glm-profile.toml.example +0 -26
  76. package/release-planned-removals.json +0 -15
  77. package/scripts/check-active-profile-plugin-startup.js +0 -36
  78. package/scripts/check-active-work-steer-regression.js +0 -46
  79. package/scripts/check-approval-observability-regression.js +0 -111
  80. package/scripts/check-approval-queue-shortcuts-regression.js +0 -65
  81. package/scripts/check-bundled-agent-spine-regression.js +0 -48
  82. package/scripts/check-codebase-search-packaging-regression.js +0 -92
  83. package/scripts/check-copy-command-regression.js +0 -74
  84. package/scripts/check-current-turn-read-pin-mutation-regression.js +0 -72
  85. package/scripts/check-current-turn-read-pin-regression.js +0 -94
  86. package/scripts/check-deepseek-native-max-regression.js +0 -49
  87. package/scripts/check-empty-response-effort-downgrade-regression.js +0 -48
  88. package/scripts/check-fredrik-glm-mutation-regression.js +0 -18
  89. package/scripts/check-fredrik-glm-regression.js +0 -169
  90. package/scripts/check-historical-tool-result-preview-regression.js +0 -77
  91. package/scripts/check-history-pressure-offload-regression.js +0 -77
  92. package/scripts/check-mcp-startup-wait-budget.js +0 -48
  93. package/scripts/check-package-regression.js +0 -38
  94. package/scripts/check-plugin-startup-regression.js +0 -53
  95. package/scripts/check-programmatic-context-isolation-regression.js +0 -193
  96. package/scripts/check-programmatic-tool-regression.js +0 -294
  97. package/scripts/check-queue-controls-regression.js +0 -189
  98. package/scripts/check-release-metadata.js +0 -103
  99. package/scripts/check-reload-agent-spine-regression.js +0 -76
  100. package/scripts/check-resume-replay-regression.js +0 -102
  101. package/scripts/check-session-cancel-regression.js +0 -43
  102. package/scripts/check-session-picker-resume-metrics-regression.js +0 -97
  103. package/scripts/check-session-start-hook-context-regression.js +0 -228
  104. package/scripts/check-shell-terminal-isolation-regression.js +0 -81
  105. package/scripts/check-slash-escape-regression.js +0 -89
  106. package/scripts/check-startup-swarm-command-regression.js +0 -24
  107. package/scripts/check-structured-subagent-output-regression.js +0 -331
  108. package/scripts/check-telegram-bridge-watchdog.js +0 -60
  109. package/scripts/check-telegram-direct-work-resume-regression.js +0 -53
  110. package/scripts/check-telegram-loop-exactly-once-regression.js +0 -71
  111. package/scripts/check-todo-loop-regression.js +0 -78
  112. package/scripts/check-todo-progress-regression.js +0 -416
  113. package/scripts/check-todo-recovery-catalog-regression.js +0 -50
  114. package/scripts/check-tool-schema-capacity-regression.js +0 -40
  115. package/scripts/programmatic-tool-runtime.test.mjs +0 -365
  116. package/scripts/structured-subagent-output.test.cjs +0 -170
  117. /package/{scripts → bin}/fix-node-pty-perms.js +0 -0
@@ -1,183 +0,0 @@
1
- # Architecture
2
-
3
- AgentSpine is a read-only overlay around existing agent context. It separates discovery, provenance, selection, delivery, and future learning so that no convenience layer becomes an accidental authority system.
4
-
5
- ## Runtime topology
6
-
7
- ```mermaid
8
- flowchart TB
9
- subgraph Sources["Existing local sources"]
10
- C["Constitution"]
11
- S["Soul"]
12
- M["Memory + references"]
13
- end
14
- subgraph Core["AgentSpine core"]
15
- D["Discovery + SHA-256"]
16
- R["Host-aware resolver"]
17
- G["Context-only graph + attention + learning + continuity + tasks + shared quarantine"]
18
- B["Scoped byte-budgeted session briefing"]
19
- H["Provider-neutral native lifecycle adapter"]
20
- P["Separate default-deny delegation policy"]
21
- E["Exact local execution policy"]
22
- J["Leased job + atomic checkpoint"]
23
- A["Visible receipt-bound acceptance"]
24
- end
25
- subgraph Hosts["Agent hosts"]
26
- X["Codex"]
27
- L["Claude Code"]
28
- end
29
- C --> D
30
- S --> D
31
- M --> D
32
- D --> R
33
- G --> B
34
- P --> G
35
- E --> J
36
- J --> H
37
- R --> B
38
- B --> H
39
- H --> A
40
- H --> X
41
- H --> L
42
- ```
43
-
44
- Source files are never copied into a canonical replacement. The catalog contains metadata and provenance. Claude project memory uses `MEMORY.md` as its only live index, opens only directly indexed relevant files through race-safe handles, and reuses integrity-checked snapshots from private external state when file identity is unchanged.
45
-
46
- ## Context resolution
47
-
48
- ```mermaid
49
- sequenceDiagram
50
- participant H as Host
51
- participant A as AgentSpine
52
- participant F as Local files
53
- H->>A: resolve_context(root, cwd, host)
54
- A->>F: discover read-only
55
- F-->>A: paths, links, bytes
56
- A->>A: apply native hierarchy
57
- A->>A: follow explicit links
58
- A-->>H: ordered sources + budget map
59
- H->>A: read_document(range)
60
- A-->>H: exact content + SHA-256
61
- ```
62
-
63
- Selection is intentionally conservative. Native host files are selected according to directory scope. Filename and folder classifications are only initial hints. Agents interpret the actual content and can add reasoned, confidence-scored annotations and links to a separate overlay graph. Explicit Markdown links and agent-created graph edges are followed without rewriting their source. Unrelated documents remain cataloged but do not consume context.
64
-
65
- ## Session assembly
66
-
67
- ```mermaid
68
- sequenceDiagram
69
- participant H as Host
70
- participant B as Session briefing
71
- participant C as Constrained context readers
72
- H->>B: host + entity/group/project/task + maxBytes
73
- B->>C: native sources, relationships, tasks, accepted learning, reviewed sharing
74
- B->>C: attention with focus active by default
75
- C-->>B: independently privacy-filtered records
76
- B->>B: scope, deduplicate, prioritize, atomic fit
77
- B-->>H: compact JSON at or below maxBytes
78
- ```
79
-
80
- The briefing layer does not query raw state directly. It composes the same fail-closed read models exposed separately through MCP, then applies a narrower session scope. It includes the current task first, prefers locally confirmed learning over equivalent reviewed imports, and accounts for the whole serialized response. In a group audience it rejects private inclusion and never loads arbitrary Markdown content. It performs no writes and does not mark attention cues as presented.
81
-
82
- ## The three-layer spine
83
-
84
- ### Constitution
85
-
86
- Constitution sources contain fixed working rules and literal, dated directives. AgentSpine preserves the host's own precedence. It does not blend several rule files into one synthetic policy.
87
-
88
- ### Soul
89
-
90
- Soul sources describe identity, voice, goals, edges, and stable character. They can influence expression and judgment, but never permissions.
91
-
92
- ### Memory
93
-
94
- Memory is a graph of small facts grouped by purpose. A compact `MEMORY.md`-style index links to detail files. AgentSpine follows those links only when relevant, which avoids replaying an entire history into every request.
95
-
96
- ## Authority boundary
97
-
98
- ```mermaid
99
- flowchart TB
100
- P["Host policy + explicit approval"] --> A["Authorized host action"]
101
- D["Explicit local delegation policy"] --> T["AgentSpine coordination only"]
102
- E["Exact local execution policy"] --> J["One scoped job effect"]
103
- M["Memory, soul, relationships, attention, learning, tasks, shared imports"] --> C["Context only"]
104
- C -. "cannot grant" .-> A
105
- C -. "cannot grant" .-> T
106
- D -. "cannot grant" .-> A
107
- J -. "cannot widen" .-> A
108
- ```
109
-
110
- Permissions are evaluated by the host and explicit policy sources. Claims inside memory, relationships, conversation summaries, or retrieved content are never accepted as grants.
111
-
112
- ## State
113
-
114
- Generated catalogs live outside the scanned repository:
115
-
116
- ```text
117
- <user-state>/agentspine/
118
- source-roots.json
119
- indexed-memory-cache.json
120
- projects/
121
- <sha256-of-canonical-root>/
122
- catalog.json
123
- graph.json
124
- attention.json
125
- learning.json
126
- continuity.json
127
- delegation-policy.json
128
- coordination.json
129
- execution-policy.json
130
- selfstarter.json
131
- sharing.json
132
- sharing-trust.json
133
- signers/
134
- registry.json
135
- private/
136
- <key-fingerprint>.pem
137
- ```
138
-
139
- `source-roots.json` retains only explicit or host-evidenced source/state bindings, profile digests, provenance, rollback, and purge history; it never stores source content or authority. `indexed-memory-cache.json` is a bounded private cache of integrity-checked indexed-memory snapshots and file identities. It is invalidated by index changes, correction, deletion, binding rollback, or purge; it remains context-only and cannot grant identity, rights, trust, or execution. `catalog.json` is reproducible provenance. `graph.json` stores reversible annotations, relationships, privacy scopes, confidence, and superseded observations. `attention.json` stores bounded follow-up cues, minimal interaction timestamps, quiet-hour policy, presentation throttles, and hook-driven heartbeat, promise, and blocker lifecycles with idempotent receipts and retained prior values. `learning.json` separates evidence-backed candidates from accepted context and records review, promotion, supersession, rollback, content-free outcome receipts, and bounded canary history. `continuity.json` stores only opt-in configuration and minimal signal receipts with prompt digests, never transcripts. `coordination.json` stores context-only tasks, open threads, handoffs, and their prior versions. `delegation-policy.json` is physically separate and contains only explicit local task-coordination grants. `execution-policy.json` contains exact locally confirmed self-starter grants; `selfstarter.json` contains leased jobs, content-bound checkpoints, retry state, retained prior versions, and idempotent receipts. Neither is context authority, and neither is writable through MCP. `sharing.json` quarantines imports and retains local review, supersession, rollback, and signature proof. `sharing-trust.json` is a project-local allowlist of public signing keys; the installation-wide signer registry keeps private keys separate. Policy, trust, keys, and adapter administration are not writable through MCP. All are private user state. This gives uninstall a simple, auditable property: removing AgentSpine state cannot remove or alter original agent files.
140
-
141
- Task mutations read and validate policy while holding the policy lock, then write coordination state under a second lock. This lock order prevents a policy revocation from racing a new assignment. Invalid or malformed policy and coordination state fails closed and is never automatically overwritten.
142
-
143
- Self-starter mutations use the same fixed ordering: execution policy first, then job state. A host session holds at most one expiring job lease. `PreToolUse` records one pending effect only after the current exact grant and content-bound workspace digest pass; `PostToolUse` advances the checkpoint once. A crash can resume only when the workspace still equals the pending effect's pre-write digest. See [rights-bound self-starter](selfstarter.md).
144
-
145
- ## Acceptance boundary
146
-
147
- The visible acceptance runner is an observer of the production lifecycle adapter, not a parallel implementation. It creates only synthetic project and state directories, invokes Claude Code and Codex event equivalents directly, and emits receipt-bound results after the same scope, privacy, authority, lease, checkpoint, purge, and audit checks pass. No MCP tool is selected. The runner deletes its temporary state and never treats a receipt as host trust or execution authority. See [visible cross-host acceptance](acceptance.md).
148
-
149
- ## Transport boundary
150
-
151
- ```mermaid
152
- flowchart LR
153
- D["Signed directory exchange"] --> S["Immutable HTTPS snapshot"]
154
- S --> P["Create-only content-addressed PUT"]
155
- P --> H["Operator-controlled HTTPS object"]
156
- H --> F["Signed ETag feed + local continuity receipt"]
157
- H --> P2["Live challenge-response over owner-selected stdio carrier"]
158
- D --> DB["Append-only local SQLite revisions"]
159
- DB --> V
160
- S --> H
161
- H --> V["TLS + DNS + size + schema + signature validation"]
162
- V --> Q["Local pending quarantine"]
163
- Q --> R["Second local review"]
164
- R --> C["Context-only shared memory"]
165
- H -. "never grants" .-> A["Host or delegation authority"]
166
- ```
167
-
168
- HTTPS snapshots are temporary transport artifacts, not canonical memory. The object publisher derives an immutable URL from the snapshot digest, requires create-only semantics, and verifies a hardened read-back. A signed feed may reference successive immutable objects through an ETag compare-and-swap pointer and a bounded digest chain. Receivers keep an external receipt so rollback, equivocation, signer replacement, and continuity gaps fail closed. The pull client materializes a validated snapshot in an operating-system temporary directory, invokes the same signed directory importer, and deletes the temporary files on success or failure. Endpoint configuration and bearer values are not written to AgentSpine state.
169
-
170
- A peer pull uses the same snapshot validator and quarantine importer without introducing an AgentSpine network listener. The receiver spawns one explicitly selected carrier with the shell disabled, sends a fresh random challenge, and accepts one signed bounded response. The live-response key must match both local trust and the snapshot-manifest key. AgentSpine does not persist the carrier command or protocol frames, and transport success remains context-only.
171
-
172
- The optional SQLite transport stores complete validated signed snapshots in an external local file. One immutable manifest binding anchors the adapter identity; append-only revisions form a digest chain and an atomic head advances in the same `BEGIN IMMEDIATE` transaction. Reads validate the exact application schema, database integrity, every retained snapshot, the full chain, and the head before reusing the signed quarantine importer. Database paths and administration remain CLI-only and outside the scanned project.
173
-
174
- ## Extension points
175
-
176
- Future modules plug in behind the core boundary:
177
-
178
- - hosted database transports implementing the provider-neutral signed-envelope and shared-event contracts;
179
- - additional host resolvers.
180
-
181
- Each extension consumes read-only provenance and emits separate state. None receives permission authority.
182
-
183
- The reference directory, static HTTPS snapshot, immutable HTTPS object, signed feed, and one-shot peer adapters are optional external transports, not canonical storage. They export only owner-selected accepted learning, while a receiving installation keeps every import outside active context until a second local review. In signed mode, Ed25519 proves that an envelope matches a locally trusted public key; it does not make the payload authoritative. See [shared memory adapters](shared-memory.md), [HTTPS snapshots](https-transport.md), [immutable HTTPS objects](object-transport.md), [signed mutable feeds](feed-transport.md), and [peer transport](peer-transport.md).
@@ -1,121 +0,0 @@
1
- # Sparse attention
2
-
3
- AgentSpine attention helps an agent notice a small number of relevant follow-ups without turning relationships into surveillance or interruption. Version `0.3.0` also connects minimal heartbeat, promise, and blocker events to the installed Claude Code and Codex lifecycle hooks. It operates entirely in local external state and never sends a message, assigns a task, or invokes another tool.
4
-
5
- ## What becomes a cue
6
-
7
- | Kind | Example purpose | Base ranking |
8
- |---|---|---:|
9
- | `unanswered-question` | A question still needs a response | Highest |
10
- | `promise` | A promised hand-off or follow-up is due | High |
11
- | `meaningful-change` | A material change may deserve acknowledgement | Medium |
12
- | `check-in` | A natural, non-urgent check-in may be useful | Low |
13
-
14
- The relationship graph can also suggest a check-in when a known person or agent connected by a team relation has no recent activity timestamp. AgentSpine records only that an interaction happened, not its conversation text.
15
-
16
- ```mermaid
17
- flowchart TB
18
- S["Open cues + relationship silence"] --> P["Privacy and due-time filter"]
19
- H["Native hook lifecycle events"] --> E["Exact actor · group · project · task scope"]
20
- E --> P
21
- P --> G["Focus · quiet hours · throttle"]
22
- G --> R["Sparse ranked suggestions"]
23
- R --> H["Host decides whether to surface"]
24
- ```
25
-
26
- ## Hard restraints
27
-
28
- 1. A cue is always `context-only`; it cannot grant permissions or delegation authority.
29
- 2. `focusActive` suppresses unrelated cues. Only an active blocker, due promise, or stale heartbeat for the exact current task may remain visible.
30
- 3. Quiet hours suppress every cue, including overnight ranges.
31
- 4. Private cues and cues for private entities require `includePrivate: true`.
32
- 5. Group cues require a known group entity and an exact matching `groupId` audience; entity-specific cues also require a visible `member-of` edge.
33
- 6. `maxItems` limits a result to a small set; the default is three.
34
- 7. `minIntervalHours` prevents a surfaced cue from repeating too soon.
35
- 8. Lifecycle hooks inject the actual byte-budgeted, privacy-filtered briefing. Event summaries appear only for the exact actor, group, project, and task audience.
36
- 9. No network, messaging, notification, or scheduling action occurs automatically.
37
-
38
- ## Native lifecycle events
39
-
40
- The provider-neutral adapter writes three event kinds without waiting for the model to select an MCP tool:
41
-
42
- | Kind | Created or transitioned at | Active presentation |
43
- |---|---|---|
44
- | `heartbeat` | `PostToolUse`, then `Stop` or `SubagentStop` | Only after the configured stale interval and only for the exact current task |
45
- | `promise` | A direct opted-in prompt or a minimal host event envelope | While open and due |
46
- | `blocker` | A direct opted-in prompt or a minimal host event envelope | While open |
47
-
48
- Every event has a stable ID, immutable scope, privacy, status, occurrence count, hook name, host, timestamp, receipt ID, and SHA-256 provenance digest. Re-delivery of the same host receipt is idempotent; automatic heartbeats within the same minute and scope share one receipt to prevent tool-heavy sessions from flooding history. A status change preserves the prior value in append-only history. The stored record contains no prompt, transcript, tool arguments, tool output, credential, or permission claim.
49
-
50
- Prompt-derived promises and blockers require the existing local continuity opt-in. They are accepted only for a known person or agent, known project, and existing task. Group-conversation content, secrets, identity claims, and authority or access claims are rejected. Heartbeats are operational lifecycle receipts rather than learned preferences and require the same exact known scope.
51
-
52
- ## CLI walkthrough
53
-
54
- Create a shared promise, inspect it, and mark it presented only when it reaches the user:
55
-
56
- ```bash
57
- agentspine attention-add signal:handoff \
58
- --kind promise \
59
- --summary "Review the synthetic hand-off." \
60
- --privacy shared \
61
- --due 2027-01-15T09:00:00Z
62
-
63
- agentspine attention . --mark-presented --json
64
- agentspine attention-resolve signal:handoff --status completed
65
- ```
66
-
67
- Record minimal interaction recency for an existing relationship entity:
68
-
69
- ```bash
70
- agentspine attention-touch agent:builder --kind interaction --privacy private
71
- ```
72
-
73
- For group-scoped state, create or discover the group entity first and pass the same ID while writing and reading:
74
-
75
- ```bash
76
- agentspine attention-add signal:group-check \
77
- --kind check-in \
78
- --summary "Ask whether the group needs anything else." \
79
- --privacy group \
80
- --group group:alpha
81
-
82
- agentspine attention . --group group:alpha --mark-presented --json
83
- ```
84
-
85
- Configure a sparse policy. Hours are interpreted using the explicit UTC offset, avoiding hidden locale assumptions:
86
-
87
- ```bash
88
- agentspine attention-config . \
89
- --max-items 2 \
90
- --min-interval-hours 48 \
91
- --silence-days 21 \
92
- --heartbeat-stale-minutes 30 \
93
- --quiet-start 22 \
94
- --quiet-end 7 \
95
- --utc-offset 120
96
- ```
97
-
98
- Disable attention without deleting its state:
99
-
100
- ```bash
101
- agentspine attention-config . --enabled false
102
- ```
103
-
104
- Delete one cue and its retained attention history, or purge all attention data associated with an entity:
105
-
106
- ```bash
107
- agentspine attention-delete signal:handoff
108
- agentspine attention-events . --include-history --json
109
- agentspine attention-event-delete event:blocker:alpha
110
- agentspine attention-purge agent:builder
111
- ```
112
-
113
- ## History and deletion
114
-
115
- Updating or resolving a cue or lifecycle event first retains its previous value in private attention history. This preserves how relevance changed without rewriting source Markdown. Permanent event deletion removes the active event, its receipts, retained versions, and presentation timestamp. Entity purge additionally removes matching events, receipts, activity timestamps, and relationship-silence presentation state.
116
-
117
- ## Concurrency and limits
118
-
119
- Attention mutations use an external per-project lock and atomic file replacement so concurrent local agents do not silently overwrite one another. A stale lock is recoverable after 15 seconds. State is capped at 5 MiB; reaching the limit stops new writes instead of discarding old observations.
120
-
121
- The attention layer does not infer emotion, wellbeing, crisis, relationship status, or personal life facts. Those require conversation-appropriate judgment and separate safety behavior; silence alone is never evidence that something is wrong.
@@ -1,79 +0,0 @@
1
- # Automatic continuity
2
-
3
- AgentSpine `0.8.0` connects the portal-neutral memory, briefing, attention, and exactly authorized job-checkpoint layers to installed Claude Code and Codex lifecycle hooks. Host-native source-root resolution keeps user continuity available across repositories while indexed lazy memory keeps project, group, task, and private state exact. The result is real host context, durable scoped attention state, and an optional rights-bound resume path at lifecycle boundaries—not a counter or a suggestion that the model should call an MCP tool later.
4
-
5
- ## One-time setup
6
-
7
- The host first asks the user to trust the executable plugin components. AgentSpine cannot and must not approve itself. Conversation learning then needs one separate local privacy opt-in:
8
-
9
- ```bash
10
- agentspine entity person:me --kind person --name "Me" --privacy shared
11
- agentspine continuity-config /path/to/project \
12
- --enabled true \
13
- --entity person:me \
14
- --confirm-local-opt-in
15
- ```
16
-
17
- The selected identity must already exist in the relationship graph. A direct session may use this default. A bridge serving multiple people or groups must pass exact `entity_id`, `group_id`, `project_id`, and `task_id` scope values in each native hook payload; AgentSpine does not merge identities by name.
18
-
19
- ## Lifecycle
20
-
21
- ```mermaid
22
- sequenceDiagram
23
- participant H as Claude Code or Codex
24
- participant L as Lifecycle adapter
25
- participant S as External AgentSpine state
26
- participant M as Model context
27
- H->>L: SessionStart / Resume / PostCompact
28
- L->>S: scan + privacy-scoped reads
29
- S-->>L: accepted sources, relationships, learning, tasks, sharing, attention
30
- L->>L: current request > stops > task > rules > older context
31
- L-->>M: complete byte-budgeted session_briefing
32
- H->>L: UserPromptSubmit
33
- L->>S: optional minimal safe learning + promise/blocker event
34
- L-->>M: refreshed scoped briefing
35
- H->>L: PostToolUse / Stop / SubagentStop
36
- L->>S: idempotent heartbeat or explicit status transition
37
- ```
38
-
39
- The model does not need to call `scan`, `context`, or `session_briefing`. Those tools remain available for explicit inspection only.
40
-
41
- ## What can be learned automatically
42
-
43
- Only direct, high-confidence, locally opted-in signals are eligible. An explicit style request, no-go, or correction is itself a user confirmation; project facts and references require the configured number of distinct observations (two by default):
44
-
45
- - response style and preferences;
46
- - explicit no-gos and corrections;
47
- - project facts;
48
- - references.
49
-
50
- Each retained signal has a stable digest, exact subject/project scope, time, kind, confidence, directness, provenance receipt, deduplication key, and context-only authority. The full prompt is never stored. Repeated hook delivery is idempotent. Accepted records use the existing learning history, rollback, and purge paths.
51
-
52
- The following are always rejected from automatic acceptance:
53
-
54
- - secrets, credentials, tokens, or access material;
55
- - sensitive personal facts;
56
- - identity merging or alias claims;
57
- - any private group or private-chat content;
58
- - rights, roles, delegation, approval, tool, file, network, database, production, payment, or policy claims.
59
-
60
- Conversation, memory, Markdown, relationships, signatures, and learned context can never create host or AgentSpine coordination rights.
61
-
62
- ## Failure and deletion
63
-
64
- Corrupt continuity or dependent state yields a visible `failedClosed` hook packet. The adapter says recall was not loaded and continues under current host rules; it never fabricates a successful briefing.
65
-
66
- ```bash
67
- agentspine continuity-status /path/to/project --json
68
- agentspine continuity-config /path/to/project --enabled false
69
- agentspine continuity-purge person:me --root /path/to/project --confirm-local-purge
70
- agentspine audit /path/to/project --json
71
- ```
72
-
73
- Generated state remains in the operating system's private user-state directory. `SOUL.md`, `AGENTS.md`, `CLAUDE.md`, and every other existing Markdown source remain byte-for-byte unchanged during learning, rollback, purge, upgrade, and uninstall.
74
-
75
- Existing opted-in user continuity can be made repository-independent only through the explicit, reversible `source-bind --scope state-user` flow. No state is blindly copied between root hashes. See [host-native source roots](source-roots.md).
76
-
77
- ## Deliberate boundary
78
-
79
- Promises, blockers, and heartbeats persist through automatic lifecycle events with exact actor, group, project, and task scope. A waiting job can start or resume only through the separate rights-bound self-starter and only while a current exact local host/owner grant passes again before every effect. Learning, attention, and briefing content never satisfy that grant. The full path is reproducible through the [visible cross-host acceptance](acceptance.md).
@@ -1,92 +0,0 @@
1
- # Authenticated channel wake runtime
2
-
3
- AgentSpine can accept one authenticated provider event, bind it to one exact agent lane, and inject it through the installed Claude Code or Codex `SessionStart` hook. This closes the failure mode where a Telegram or another portal message exists but the selected agent starts without the message, recipient, chat, thread, project, or group context.
4
-
5
- The runtime is provider-neutral. The optional `agentspine-worker` supplies the reference gateway for Telegram: polling, exact host-run handoff, and origin-bound delivery. AgentSpine owns the durable scope, authentication, replay protection, lease, and host-context handoff. It does not open a network port and does not infer a route from message text.
6
-
7
- ```mermaid
8
- flowchart TB
9
- P["Provider adapter"] --> I["Authenticated ingress"]
10
- I --> Q["Durable exact-scope queue"]
11
- Q --> H["Claude or Codex SessionStart"]
12
- H --> B["Channel event + voice brief"]
13
- B --> R["Provider adapter reply"]
14
- ```
15
-
16
- ## Exact binding
17
-
18
- A binding is created only through the local CLI and only with `--confirm-local-channel`:
19
-
20
- ```bash
21
- agentspine channel-bind channel-binding:franz \
22
- --provider telegram \
23
- --tenant tenant:blun \
24
- --account bot:franz \
25
- --chat chat:team \
26
- --thread topic:engineering \
27
- --senders user:mayk \
28
- --agent agent:franz \
29
- --project project:blun \
30
- --group group:engineering \
31
- --session agent:franz:telegram:engineering \
32
- --secret-env AGENTSPINE_TELEGRAM_INGRESS_SECRET \
33
- --outbound-secret-env AGENTSPINE_TELEGRAM_TOKEN \
34
- --capabilities receive,reply \
35
- --confirm-local-channel
36
- ```
37
-
38
- Provider, tenant, account, chat, optional thread, sender, agent, project, optional group, and session are exact stable IDs. Wildcards are rejected. An exact group binding additionally requires a visible `member-of` edge between the selected agent and that group. A second active binding cannot claim the same route.
39
-
40
- The binding stores only environment-variable names. The HMAC key and optional outbound provider token remain in the adapter environment; the HMAC key must contain at least 32 bytes. Policy administration is absent from MCP, hooks, memory, learning, relationships, and prompt content.
41
-
42
- ## Ingress contract
43
-
44
- The adapter normalizes an incoming provider update to `agentspine.channel-event/v1`:
45
-
46
- ```json
47
- {
48
- "schema": "agentspine.channel-event/v1",
49
- "eventId": "telegram:update:1001",
50
- "provider": "telegram",
51
- "tenantId": "tenant:blun",
52
- "accountId": "bot:franz",
53
- "chatId": "chat:team",
54
- "threadId": "topic:engineering",
55
- "senderId": "user:mayk",
56
- "replyTo": "telegram:message:900",
57
- "observedAt": "2032-01-01T00:00:01.000Z",
58
- "privacy": "group",
59
- "text": "Bitte prüfe den aktuellen Auftrag."
60
- }
61
- ```
62
-
63
- It computes `HMAC-SHA256` over `channelEventSigningPayload(event)` and supplies the signature as `sha256=<64 lowercase hex characters>`. AgentSpine verifies the exact route, allowed sender, receive capability, signature, schema, size, and secret filter before writing anything. The signature and key are never persisted.
64
-
65
- Repeated delivery of the same event ID and payload is idempotent. Reuse of an event ID with different bytes or a different binding fails closed. State lives in the external per-project AgentSpine directory and uses one multi-process lock plus atomic replacement.
66
-
67
- ## Wake and lease
68
-
69
- After successful ingress, the adapter starts the exact host lane and includes only this reference in the native start payload:
70
-
71
- ```json
72
- {
73
- "agent_spine_channel_event": {
74
- "event_id": "telegram:update:1001",
75
- "provider": "telegram"
76
- }
77
- }
78
- ```
79
-
80
- The start must also carry the exact agent, project, optional group, and host session IDs. The lifecycle hook atomically leases the event to that host session and injects its authenticated message and route alongside the normal session briefing. Competing workers cannot lease the same event. An expired lease becomes pending again with retained history and a receipt.
81
-
82
- Completion requires the exact current worker lease and a still-active binding. Revocation immediately rejects new ingress and cancels every pending or leased event for that binding. Current objects, retained versions, payload digests, and receipts are replayed by the audit; malformed or forged state disables the runtime.
83
-
84
- ## Voice bridge
85
-
86
- Every session briefing also contains a bounded `agentspine.voice-brief/v1`. It draws only from the exact visible entity, persona-layer source descriptors, accepted preferences, corrections, no-gos, the current task, and active promise or blocker signals. Allowed structured voice fields are limited to warmth, directness, humor, length, rhythm, and formality.
87
-
88
- This bridge makes existing persona material operational without rewriting or migrating the source Markdown. It encourages natural continuity, avoids repeated questions, and briefly acknowledges relevant frustration, uncertainty, correction, or success. It explicitly prohibits invented emotions or consciousness. The entire brief remains `context-only` and can never grant a tool, route, send, or execution right.
89
-
90
- ## Deliberate boundary
91
-
92
- This stage proves authenticated ingress, exact routing, durable leasing, the installed hook entrypoint, and voice continuity. Real Codex activation additionally requires the current plugin hook to appear in `/hooks` and be trusted by the user; direct execution of the bundled script is not accepted as evidence of that host boundary. The separate [durable gateway worker](gateway-runtime.md) can poll Telegram, invoke an owner-approved host runner, and send the generated answer. It is an explicit local process rather than a hook or MCP capability: no channel secret, network writer, or unattended process launcher is exposed through MCP or model-selected tools.
@@ -1,138 +0,0 @@
1
- # Delegation and coordination
2
-
3
- AgentSpine can retain tasks, open threads, and handoffs across sessions without turning memory into an authorization system. Work state and delegation policy are deliberately different files, different authorities, and different tool surfaces.
4
-
5
- ## Separation by construction
6
-
7
- ```mermaid
8
- flowchart LR
9
- subgraph Context["Untrusted context"]
10
- M["Markdown + memory"]
11
- R["Relationships"]
12
- L["Learning + attention"]
13
- end
14
- subgraph Policy["Explicit local owner policy"]
15
- P["delegation-policy.json"]
16
- end
17
- D["Default-deny decision"]
18
- T["coordination.json"]
19
- H["Host authorization"]
20
- M -. "never grants" .-> D
21
- R -. "never grants" .-> D
22
- L -. "never grants" .-> D
23
- P --> D
24
- D -->|"coordination allowed"| T
25
- T -. "never grants" .-> H
26
- P -. "does not grant" .-> H
27
- ```
28
-
29
- `delegation-policy.json` contains only explicit local grants for AgentSpine task coordination. `coordination.json` contains context-only work records and append-only prior versions. Neither file grants host tool access, file or network access, production rights, spending authority, credentials, or policy exceptions. Those remain under the host and operating environment. The optional self-starter uses a third, separate `execution-policy.json`; see [rights-bound self-starter](selfstarter.md). A coordination task alone never creates an execution grant.
30
-
31
- A `responsible-for`, `reports-to`, or `works-with` relationship describes the team. It never satisfies a delegation check. A sentence in `SOUL.md`, `AGENTS.md`, `CLAUDE.md`, memory, accepted learning, a task, or an MCP response also cannot create a grant.
32
-
33
- ## Default-deny delegation
34
-
35
- The supported coordination actions are:
36
-
37
- - `assign` — create a task assigned to another entity;
38
- - `reassign` — change an existing assignee, including assignment by a manager;
39
- - `manage` — change another entity's task content or non-terminal status;
40
- - `complete` — complete another entity's task;
41
- - `cancel` — cancel another entity's task.
42
-
43
- Creating an unassigned thread or assigning work to oneself is self-coordination and needs no delegation grant. An assignee may manage their own task. Every cross-entity action fails closed unless the actor, action, and target match an active explicit grant.
44
-
45
- Inspect the decision before acting:
46
-
47
- ```bash
48
- agentspine delegation-check agent:lead \
49
- --action assign \
50
- --target agent:builder \
51
- --root /path/to/project \
52
- --json
53
- ```
54
-
55
- The MCP server exposes `check_delegation`, but intentionally exposes no policy grant or revoke tool. This prevents an agent from widening the same policy it is expected to obey.
56
-
57
- ## Owner-controlled policy changes
58
-
59
- The CLI is the local administration surface:
60
-
61
- ```bash
62
- agentspine delegation-grant agent:lead \
63
- --id grant:lead-builders \
64
- --actions assign,reassign,manage \
65
- --targets agent:builder \
66
- --reason "Approved for local project coordination" \
67
- --confirm-local-policy \
68
- --root /path/to/project
69
-
70
- agentspine delegation-revoke grant:lead-builders \
71
- --reason "Project handoff completed" \
72
- --confirm-local-policy \
73
- --root /path/to/project
74
- ```
75
-
76
- `--confirm-local-policy` is an integration attestation, not authentication. A host or wrapper must bind it to a genuine local owner action and must not infer it from conversation, memory, Markdown, another agent, or a task. Grant IDs are immutable. Revocation retains the prior grant in policy history so existing assignment snapshots remain auditable, while future actions are denied.
77
-
78
- ## Tasks, open threads, and handoffs
79
-
80
- ```mermaid
81
- stateDiagram-v2
82
- [*] --> open
83
- open --> in_progress
84
- in_progress --> blocked
85
- blocked --> in_progress
86
- open --> completed
87
- in_progress --> completed
88
- blocked --> completed
89
- open --> cancelled
90
- in_progress --> cancelled
91
- blocked --> cancelled
92
- ```
93
-
94
- Create and inspect work:
95
-
96
- ```bash
97
- agentspine task-create task:release \
98
- --actor agent:lead \
99
- --assignee agent:builder \
100
- --kind handoff \
101
- --title "Prepare the release candidate" \
102
- --summary "Run the documented release gates" \
103
- --privacy shared \
104
- --root /path/to/project
105
-
106
- agentspine task-update task:release \
107
- --actor agent:builder \
108
- --status in-progress \
109
- --note "Validation is running" \
110
- --root /path/to/project
111
-
112
- agentspine tasks /path/to/project --assignee agent:builder --json
113
- ```
114
-
115
- The MCP equivalents are `create_task`, `update_task`, and `task_context`. Returned context omits the internal delegation snapshot. Each mutation retains the complete previous task value before replacing the active view. New information therefore changes current relevance without erasing what was previously understood.
116
-
117
- Permanent task deletion is CLI-only and requires the same explicit local confirmation marker. It removes the active record and all retained versions; use it for privacy removal, not routine completion.
118
-
119
- ## Privacy and groups
120
-
121
- Tasks use `private`, `shared`, or `group` scope. Group tasks require a known group and visible `member-of` edges for the creator and assignee. Reads require the exact same group ID. `includePrivate` cannot bypass a missing or different group audience.
122
-
123
- Lifecycle hooks have no private or group audience. They inject only the number and kinds of open shared coordination records—never titles, summaries, notes, assignees, or delegation policy. The agent must explicitly request relevant context.
124
-
125
- ## Integrity and concurrency
126
-
127
- Both state files are private external project state, capped at 5 MiB, written with restrictive file mode and atomic replacement. Cross-process locks serialize policy changes and task mutations. A task mutation holds the policy read lock until its coordination write completes, so revocation cannot race an assignment into existence.
128
-
129
- All decision and mutation paths validate current state before use. Unknown entities, secrets, forged provenance, invalid assignment snapshots, malformed JSON, or inconsistent policy cause a fail-closed error. Damaged files are reported by `agentspine audit` and are never overwritten automatically.
130
-
131
- ## Deliberate limits
132
-
133
- - AgentSpine coordinates records without execution authority. The optional self-starter is the sole narrow exception and requires a separate current exact execution grant for every lifecycle effect.
134
- - It does not send Telegram, email, chat, or notification messages.
135
- - It does not authenticate the human operating a shell.
136
- - It does not synchronize policy or tasks across machines.
137
- - It does not treat organizational relationships as an access-control list.
138
- - It does not replace host approvals, operating-system permissions, or an external policy engine.