deepstrike 0.2.3__tar.gz → 0.2.5__tar.gz

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 (161) hide show
  1. {deepstrike-0.2.3 → deepstrike-0.2.5}/Cargo.lock +5 -5
  2. {deepstrike-0.2.3 → deepstrike-0.2.5}/Cargo.toml +3 -3
  3. deepstrike-0.2.5/PKG-INFO +649 -0
  4. deepstrike-0.2.5/README.md +635 -0
  5. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/compression.rs +15 -12
  6. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/config.rs +49 -0
  7. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/dashboard.rs +7 -3
  8. deepstrike-0.2.5/crates/deepstrike-core/src/context/llm_summarizer.rs +240 -0
  9. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/manager.rs +115 -5
  10. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/mod.rs +1 -0
  11. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/pressure.rs +0 -4
  12. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/lib.rs +15 -1
  13. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/trace_analyzer.rs +1 -1
  14. deepstrike-0.2.5/crates/deepstrike-core/src/mm/handle.rs +325 -0
  15. deepstrike-0.2.5/crates/deepstrike-core/src/mm/memory.rs +375 -0
  16. deepstrike-0.2.5/crates/deepstrike-core/src/mm/mod.rs +129 -0
  17. deepstrike-0.2.5/crates/deepstrike-core/src/proc/mod.rs +215 -0
  18. deepstrike-0.2.5/crates/deepstrike-core/src/runtime/event_log.rs +161 -0
  19. deepstrike-0.2.5/crates/deepstrike-core/src/runtime/kernel.rs +1609 -0
  20. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/runtime/mod.rs +9 -0
  21. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/runtime/repair.rs +42 -5
  22. deepstrike-0.2.5/crates/deepstrike-core/src/runtime/replay.rs +276 -0
  23. deepstrike-0.2.5/crates/deepstrike-core/src/runtime/session.rs +447 -0
  24. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/milestone.rs +146 -0
  25. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/mod.rs +10 -0
  26. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/policy.rs +55 -0
  27. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/rollback.rs +67 -0
  28. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/state_machine.rs +1685 -0
  29. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/state_machine_tests.rs +1046 -0
  30. deepstrike-0.2.5/crates/deepstrike-core/src/scheduler/tcb.rs +376 -0
  31. deepstrike-0.2.5/crates/deepstrike-core/src/syscall/mod.rs +164 -0
  32. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/capability.rs +22 -0
  33. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-py/src/lib.rs +1 -1
  34. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/__init__.py +7 -4
  35. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/collaboration/modes.py +2 -8
  36. deepstrike-0.2.5/deepstrike/governance.py +119 -0
  37. deepstrike-0.2.5/deepstrike/memory/agent.py +33 -0
  38. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/__init__.py +4 -1
  39. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/stream.py +18 -0
  40. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/__init__.py +12 -0
  41. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/execution_plane.py +69 -43
  42. deepstrike-0.2.5/deepstrike/runtime/kernel_event_log.py +233 -0
  43. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/kernel_step.py +13 -0
  44. deepstrike-0.2.5/deepstrike/runtime/large_result_spool.py +65 -0
  45. deepstrike-0.2.5/deepstrike/runtime/os_profile.py +61 -0
  46. deepstrike-0.2.5/deepstrike/runtime/os_snapshot.py +128 -0
  47. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/runner.py +455 -110
  48. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/session_log.py +191 -7
  49. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/sub_agent_orchestrator.py +26 -11
  50. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/types/__init__.py +2 -2
  51. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/types/agent.py +4 -2
  52. {deepstrike-0.2.3 → deepstrike-0.2.5}/pyproject.toml +1 -1
  53. deepstrike-0.2.3/PKG-INFO +0 -360
  54. deepstrike-0.2.3/README.md +0 -346
  55. deepstrike-0.2.3/crates/deepstrike-core/src/runtime/kernel.rs +0 -674
  56. deepstrike-0.2.3/crates/deepstrike-core/src/runtime/session.rs +0 -191
  57. deepstrike-0.2.3/crates/deepstrike-core/src/scheduler/mod.rs +0 -2
  58. deepstrike-0.2.3/crates/deepstrike-core/src/scheduler/policy.rs +0 -32
  59. deepstrike-0.2.3/crates/deepstrike-core/src/scheduler/state_machine.rs +0 -1527
  60. deepstrike-0.2.3/deepstrike/governance.py +0 -62
  61. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/Cargo.toml +0 -0
  62. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/partitions.rs +0 -0
  63. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/renderer.rs +0 -0
  64. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/renewal.rs +0 -0
  65. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/sections.rs +0 -0
  66. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/skill_catalog.rs +0 -0
  67. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/snapshot.rs +0 -0
  68. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/summarizer.rs +0 -0
  69. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/task_state.rs +0 -0
  70. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/text.rs +0 -0
  71. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/context/token_engine.rs +0 -0
  72. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/audit.rs +0 -0
  73. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/constraint.rs +0 -0
  74. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/mod.rs +0 -0
  75. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/permission.rs +0 -0
  76. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/pipeline.rs +0 -0
  77. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/rate_limit.rs +0 -0
  78. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/sandbox.rs +0 -0
  79. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/tool_decision.rs +0 -0
  80. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/governance/veto.rs +0 -0
  81. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/harness/eval_pipeline.rs +0 -0
  82. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/harness/mod.rs +0 -0
  83. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/curator.rs +0 -0
  84. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/durable.rs +0 -0
  85. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/extractor.rs +0 -0
  86. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/idle_pipeline.rs +0 -0
  87. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/mod.rs +0 -0
  88. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/runtime.rs +0 -0
  89. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/semantic.rs +0 -0
  90. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/session.rs +0 -0
  91. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/synthesis.rs +0 -0
  92. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/memory/working.rs +0 -0
  93. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/orchestration/executor.rs +0 -0
  94. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/orchestration/gen_eval.rs +0 -0
  95. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/orchestration/mod.rs +0 -0
  96. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/orchestration/planner.rs +0 -0
  97. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/orchestration/task_graph.rs +0 -0
  98. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/signals/attention.rs +0 -0
  99. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/signals/mod.rs +0 -0
  100. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/signals/queue.rs +0 -0
  101. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/signals/router.rs +0 -0
  102. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/agent.rs +0 -0
  103. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/contract.rs +0 -0
  104. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/error.rs +0 -0
  105. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/message.rs +0 -0
  106. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/milestone.rs +0 -0
  107. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/mod.rs +0 -0
  108. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/model.rs +0 -0
  109. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/policy.rs +0 -0
  110. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/result.rs +0 -0
  111. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/signal.rs +0 -0
  112. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/skill.rs +0 -0
  113. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-core/src/types/task.rs +0 -0
  114. {deepstrike-0.2.3 → deepstrike-0.2.5}/crates/deepstrike-py/Cargo.toml +0 -0
  115. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/collaboration/__init__.py +0 -0
  116. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/collaboration/contract.py +0 -0
  117. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/collaboration/handoff.py +0 -0
  118. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/collaboration/harness.py +0 -0
  119. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/collaboration/pool.py +0 -0
  120. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/harness/__init__.py +0 -0
  121. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/harness/harness.py +0 -0
  122. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/kernel/__init__.py +0 -0
  123. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/knowledge/__init__.py +0 -0
  124. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/knowledge/source.py +0 -0
  125. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/memory/__init__.py +0 -0
  126. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/memory/protocols.py +0 -0
  127. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/memory/working.py +0 -0
  128. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/anthropic.py +0 -0
  129. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/base.py +0 -0
  130. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/deepseek.py +0 -0
  131. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/gemini.py +0 -0
  132. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/glm.py +0 -0
  133. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/kimi.py +0 -0
  134. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/minimax.py +0 -0
  135. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/ollama.py +0 -0
  136. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/openai.py +0 -0
  137. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/qwen.py +0 -0
  138. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/providers/replay.py +0 -0
  139. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/archive.py +0 -0
  140. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/credential_vault.py +0 -0
  141. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/filtered_plane.py +0 -0
  142. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/mcp_proxy_plane.py +0 -0
  143. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/process_sandbox_plane.py +0 -0
  144. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/provider_replay.py +0 -0
  145. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/remote_vpc_plane.py +0 -0
  146. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/replay_sanitize.py +0 -0
  147. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/runtime/session_repair.py +0 -0
  148. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/safety/__init__.py +0 -0
  149. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/safety/permissions.py +0 -0
  150. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/signals/__init__.py +0 -0
  151. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/signals/gateway.py +0 -0
  152. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/signals/scheduled.py +0 -0
  153. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/signals/types.py +0 -0
  154. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/skills/__init__.py +0 -0
  155. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/skills/registry.py +0 -0
  156. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/skills/watcher.py +0 -0
  157. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/tools/__init__.py +0 -0
  158. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/tools/builtin/__init__.py +0 -0
  159. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/tools/builtin/read_file.py +0 -0
  160. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/tools/execution.py +0 -0
  161. {deepstrike-0.2.3 → deepstrike-0.2.5}/deepstrike/tools/registry.py +0 -0
@@ -194,7 +194,7 @@ dependencies = [
194
194
 
195
195
  [[package]]
196
196
  name = "deepstrike-core"
197
- version = "0.2.3"
197
+ version = "0.2.5"
198
198
  dependencies = [
199
199
  "compact_str",
200
200
  "pretty_assertions",
@@ -206,7 +206,7 @@ dependencies = [
206
206
 
207
207
  [[package]]
208
208
  name = "deepstrike-node"
209
- version = "0.2.3"
209
+ version = "0.2.5"
210
210
  dependencies = [
211
211
  "compact_str",
212
212
  "deepstrike-core",
@@ -218,7 +218,7 @@ dependencies = [
218
218
 
219
219
  [[package]]
220
220
  name = "deepstrike-py"
221
- version = "0.2.3"
221
+ version = "0.2.5"
222
222
  dependencies = [
223
223
  "compact_str",
224
224
  "deepstrike-core",
@@ -229,7 +229,7 @@ dependencies = [
229
229
 
230
230
  [[package]]
231
231
  name = "deepstrike-sdk"
232
- version = "0.2.3"
232
+ version = "0.2.5"
233
233
  dependencies = [
234
234
  "async-stream",
235
235
  "async-trait",
@@ -263,7 +263,7 @@ dependencies = [
263
263
 
264
264
  [[package]]
265
265
  name = "deepstrike-wasm"
266
- version = "0.2.3"
266
+ version = "0.2.5"
267
267
  dependencies = [
268
268
  "compact_str",
269
269
  "deepstrike-core",
@@ -3,13 +3,13 @@ resolver = "2"
3
3
  members = ["crates/deepstrike-core", "crates/deepstrike-py"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.2.3"
6
+ version = "0.2.5"
7
7
  edition = "2024"
8
8
  license = "MIT"
9
- repository = "https://github.com/anthropics/deepstrike"
9
+ repository = "https://github.com/kongusen/deepstrike"
10
10
 
11
11
  [workspace.dependencies]
12
- deepstrike-core = { path = "crates/deepstrike-core", version = "0.2.3" }
12
+ deepstrike-core = { path = "crates/deepstrike-core", version = "0.2.5" }
13
13
  notify = "6"
14
14
  serde = { version = "1", features = ["derive"] }
15
15
  serde_json = "1"
@@ -0,0 +1,649 @@
1
+ Metadata-Version: 2.4
2
+ Name: deepstrike
3
+ Version: 0.2.5
4
+ Requires-Dist: httpx>=0.27
5
+ Requires-Dist: pyyaml>=6.0
6
+ Requires-Dist: anyio>=4.0
7
+ Requires-Dist: anthropic>=0.40
8
+ Requires-Dist: openai>=1.0
9
+ Requires-Dist: google-genai>=1.0
10
+ Requires-Dist: dashscope>=1.20
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
13
+
14
+ # DeepStrike Python SDK
15
+
16
+ Runtime framework built on a Rust kernel. The kernel owns loop control, context compression, governance, signal routing, and memory paging — the SDK owns all I/O (LLM calls, tool execution, disk, long-term memory).
17
+
18
+ Python is a first-class SDK for the **Agent OS native profile**: declarative governance and in-kernel signal routing are enabled by default on every run.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ pip install deepstrike
24
+ ```
25
+
26
+ Requires Python 3.10+. The Rust kernel is distributed as a pre-built wheel (`deepstrike._kernel`).
27
+
28
+ When developing against a local kernel build, rebuild the extension from the repo root:
29
+
30
+ ```bash
31
+ maturin develop --manifest-path crates/deepstrike-py/Cargo.toml
32
+ ```
33
+
34
+ ---
35
+
36
+ ## Quick start
37
+
38
+ ```python
39
+ import asyncio
40
+ from deepstrike import (
41
+ FileSessionLog,
42
+ InMemorySessionLog,
43
+ LocalExecutionPlane,
44
+ OpenAIProvider,
45
+ RuntimeOptions,
46
+ RuntimeRunner,
47
+ collect_text,
48
+ tool,
49
+ )
50
+
51
+ @tool
52
+ async def add(x: int, y: int) -> str:
53
+ """Add two numbers."""
54
+ return str(x + y)
55
+
56
+ plane = LocalExecutionPlane().register(add)
57
+ runner = RuntimeRunner(RuntimeOptions(
58
+ provider=OpenAIProvider(api_key="sk-...", model="gpt-5-mini"),
59
+ session_log=FileSessionLog(".deepstrike/sessions"),
60
+ execution_plane=plane,
61
+ max_tokens=4096,
62
+ ))
63
+
64
+ asyncio.run(collect_text(runner.run(
65
+ session_id="math-1",
66
+ goal="What is 17 + 28?",
67
+ )))
68
+ # => "45"
69
+ ```
70
+
71
+ Same-session continuity is explicit via `session_id`:
72
+
73
+ ```python
74
+ await collect_text(runner.run(session_id="chat-1", goal="My name is Ada."))
75
+ reply = await collect_text(runner.run(session_id="chat-1", goal="What is my name?"))
76
+ ```
77
+
78
+ Use `InMemorySessionLog` for process-local sessions or `FileSessionLog` when replay should survive restarts. `wake(session_id)` resumes from the event log without inserting a duplicate `run_started` event.
79
+
80
+ Streaming:
81
+
82
+ ```python
83
+ from deepstrike.providers.stream import TextDelta, ToolCallEvent, DoneEvent
84
+
85
+ async for event in runner.run(session_id="readme-1", goal="Summarize README.md"):
86
+ if isinstance(event, TextDelta):
87
+ print(event.delta, end="", flush=True)
88
+ elif isinstance(event, ToolCallEvent):
89
+ print(f"\n[→ {event.name}]")
90
+ elif isinstance(event, DoneEvent):
91
+ print(f"\ndone in {event.iterations} turns ({event.status})")
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Architecture
97
+
98
+ ```text
99
+ ┌─────────────────────────────────────────────────────────┐
100
+ │ RuntimeRunner (Layer 1.5) │
101
+ │ LLMProvider · ExecutionPlane · SessionLog · DreamStore │
102
+ └───────────────────────────┬─────────────────────────────┘
103
+ │ step(JSON event) ↔ actions / observations
104
+ ┌───────────────────────────▼─────────────────────────────┐
105
+ │ deepstrike._kernel KernelRuntime │
106
+ │ P1 Syscall · P2 Sched · P3 MM · Proc · IPC │
107
+ └─────────────────────────────────────────────────────────┘
108
+ ```
109
+
110
+ The runner drives a single loop:
111
+
112
+ 1. Kernel returns an **action** — `call_provider`, `execute_tool`, `evaluate_milestone`, or `done`.
113
+ 2. SDK executes the action (stream LLM, run tools, call milestone verifier).
114
+ 3. SDK feeds the result back as a kernel **event** (`provider_result`, `tool_results`, …).
115
+ 4. Kernel **observations** (compression, page-out, spool, signals, …) are drained into `SessionLog`.
116
+
117
+ Kernel session events carry an optional `category` tag (`syscall` · `sched` · `mm` · `proc` · `ipc`) for diagnostics and OS snapshot rebuilds.
118
+
119
+ ### What Agent OS gives you
120
+
121
+ The mechanisms above are not internal refactors — they change what you can build without custom runner code:
122
+
123
+ **Kernel-mediated runtime (M0–M4)**
124
+ Tool calls, spawns, compression, and signals pass through one kernel gate with an explicit lifecycle (Ready / Running / Blocked / Suspended). You implement I/O; the kernel decides *when* and *whether*. Node, Python, and Rust share the same decision path, so `wake(session_id)` and cross-language tooling see consistent behavior.
125
+
126
+ **Longer, sturdier sessions (Layer-1 spool + semantic page-out)**
127
+ Oversized tool results (> 50 KB) stay in context as a preview plus a `.spool/` reference — the model reads the full payload on demand via ordinary file tools. When pressure triggers semantic eviction, the SDK summarizes archived content into `DreamStore` and satisfies `page_in_requested` on the way back in. Long tasks survive token pressure instead of failing mid-run.
128
+
129
+ **Safety and governance by default (OS native profile)**
130
+ Every run loads declarative `governance_policy` (deny / ask_user / rate-limit / param rules) and in-kernel signal routing (`attention_policy`, default queue 64). Dangerous tools, external interrupts, and approval flows are policy — not ad-hoc checks in your handlers.
131
+
132
+ **Long-term memory as syscalls (Phase-7)**
133
+ `write_memory` and `query_memory` run outside the main tool loop: kernel validation before `DreamStore.commit`, search → `select_memories` → `memory_retrieval_result` on query. Failed writes emit `memory_validation_failed` for audit; good memory is durable without polluting history.
134
+
135
+ **Multi-agent and multi-signal orchestration**
136
+ Sub-agents register in the kernel process table (`agent_process_changed`); parent runs suspend explicitly until `sub_agent_completed`. Signals get disposition (Interrupt / Queue / Observe / Dropped) in-kernel, so gateways, cron, and heartbeats compose with the main loop instead of racing it.
137
+
138
+ **Observable like an OS log**
139
+ Spool, page-out, signals, processes, budgets, and memory events land in `SessionLog` with categories. Rebuild an OS snapshot (`page_out_count`, `spool_count`, `process_by_agent`, memory counters) from one event stream — replay still strips audit events when reconstructing LLM messages.
140
+
141
+ | You need… | Use… |
142
+ |---|---|
143
+ | Policy before tools run | `governance_policy` (default: allow-all native profile) |
144
+ | External interrupts | `signal_source` + in-kernel `attention_policy` |
145
+ | Huge tool output | Automatic Layer-1 spool; optional custom `result_spool` |
146
+ | Durable recall across runs | `DreamStore` + semantic `page_out` via `dream_summarizer` |
147
+ | Programmatic memory I/O | `runner.write_memory()` / `runner.query_memory()` |
148
+ | Debug / compliance | `SessionLog` events + OS snapshot helpers |
149
+
150
+ ---
151
+
152
+ ## Providers
153
+
154
+ | Class | Backend | Notes |
155
+ |-------|---------|-------|
156
+ | `OpenAIProvider` | OpenAI API | SSE tool-call accumulation |
157
+ | `AnthropicProvider` | Anthropic API | Native SSE, `ThinkingDelta` support |
158
+ | `QwenProvider` | DashScope | `enable_thinking` via extensions |
159
+ | `DeepSeekProvider` | DeepSeek API | Reasoner models strip tools automatically |
160
+ | `MiniMaxProvider` | MiniMax API | M1 reasoning via `expose_reasoning` |
161
+ | `OllamaProvider` | Local Ollama | `http://localhost:11434` default |
162
+ | `KimiProvider` | Moonshot API | |
163
+
164
+ All providers accept `RetryConfig` for exponential backoff and share a `CircuitBreaker`.
165
+
166
+ `extensions` are forwarded to the provider while SDK-owned structural fields remain protected.
167
+
168
+ ---
169
+
170
+ ## Context model (four slots)
171
+
172
+ The kernel renders context as four LLM API slots — only **history** is compressed.
173
+
174
+ | Slot | Source | Role |
175
+ |------|--------|------|
176
+ | `system_stable` | system partition | Identity, rules — never changes within a run |
177
+ | `system_knowledge` | knowledge partition | Preloaded memory, skill defs — low frequency |
178
+ | `turns[0]` | `task_state` + signals | Goal, plan, progress, compression log, runtime signals |
179
+ | `turns[1..N]` | history | Conversation transcript |
180
+
181
+ ```python
182
+ runner = RuntimeRunner(RuntimeOptions(
183
+ initial_memory=["User prefers chartreuse."], # → Slot 2
184
+ system_prompt="You are a helpful assistant.", # → Slot 1
185
+ # ...
186
+ ))
187
+ ```
188
+
189
+ - `memory(query)` / `knowledge(query)` meta-tool results → **history** (tool results)
190
+ - Inbound signals are routed by the in-kernel attention policy and rendered into **Slot 3**
191
+
192
+ Full reference: [docs/concepts/context-slots-compression.md](../docs/concepts/context-slots-compression.md)
193
+
194
+ ---
195
+
196
+ ## Runtime options
197
+
198
+ ```python
199
+ from deepstrike import (
200
+ DEFAULT_NATIVE_GOVERNANCE_POLICY,
201
+ DEFAULT_SANDBOX_POLICY,
202
+ validate_declarative_policy,
203
+ AgentIdentity,
204
+ AgentRunSpec,
205
+ )
206
+ from deepstrike.runtime import DEFAULT_NATIVE_ATTENTION_POLICY
207
+ from deepstrike.governance import GovernancePolicy, GovernancePolicyRule
208
+
209
+ runner = RuntimeRunner(RuntimeOptions(
210
+ provider=provider,
211
+ session_log=FileSessionLog(".deepstrike/sessions"),
212
+ execution_plane=plane,
213
+
214
+ # Scheduler budget
215
+ max_tokens=128_000,
216
+ max_turns=25,
217
+ timeout_ms=60_000,
218
+
219
+ # Agent OS native profile (defaults shown)
220
+ governance_policy=DEFAULT_NATIVE_GOVERNANCE_POLICY,
221
+ attention_policy=DEFAULT_NATIVE_ATTENTION_POLICY, # SignalRouter queue size 64
222
+
223
+ # Host I/O
224
+ extensions={"temperature": 0.1},
225
+ skill_dir="./skills",
226
+ knowledge_source=my_ks,
227
+ signal_source=gw,
228
+ dream_store=my_store,
229
+ agent_id="my-agent",
230
+ initial_memory=["..."],
231
+
232
+ # Memory paging & compression (SDK-side I/O)
233
+ compression_store=archive_store,
234
+ dream_provider=dream_llm,
235
+ dream_summarizer=my_dream_summarizer, # semantic page_out → DreamStore
236
+
237
+ # Sub-agents & milestones
238
+ run_spec=AgentRunSpec(
239
+ identity=AgentIdentity(agent_id="my-agent", session_id="session-1"),
240
+ role="orchestrator",
241
+ goal="...", # overridden by run() goal on start_run
242
+ ),
243
+ milestone_contract=my_contract,
244
+ milestone_policy="require_verifier",
245
+ on_milestone_evaluate=my_verifier,
246
+ sub_agent_harness=SubAgentHarnessConfig(eval_provider=eval_provider, max_attempts=3),
247
+
248
+ # Governance UX (AskUser path)
249
+ on_permission_request=lambda req: {"approved": True, "responder": "user"},
250
+ ))
251
+ ```
252
+
253
+ | Option | Purpose |
254
+ |--------|---------|
255
+ | `governance_policy` | Declarative deny / ask_user / rate-limit / param rules loaded into the kernel before `start_run` |
256
+ | `attention_policy` | In-kernel signal router queue size (default 64) |
257
+ | `on_permission_request` | Resolves `tool_gated` + `suspended` → kernel `resume` with approved/denied call IDs |
258
+ | `compression_store` | Writes archived messages on `compressed` observations |
259
+ | `dream_summarizer` | Summarizes `page_out { tier_hint: "semantic" }` into `DreamStore` during a run |
260
+ | `dream_provider` | Separate LLM for `dream()` idle consolidation (falls back to `provider`) |
261
+ | `result_spool` | Custom large-result spool (default: `.spool/` under cwd) |
262
+
263
+ Validate policies before starting a run:
264
+
265
+ ```python
266
+ result = validate_declarative_policy(
267
+ gov_policy=DEFAULT_SANDBOX_POLICY,
268
+ attention_policy=DEFAULT_NATIVE_ATTENTION_POLICY,
269
+ )
270
+ assert result["valid"], result["errors"]
271
+ ```
272
+
273
+ Rebuild an OS diagnostics snapshot from session events:
274
+
275
+ ```python
276
+ from deepstrike.runtime.os_snapshot import rebuild_os_snapshot_from_session_events
277
+
278
+ events = [e.event for e in await session_log.read(session_id)]
279
+ snap = rebuild_os_snapshot_from_session_events(events)
280
+ # snap["page_out_count"], snap["spool_count"], snap["signals"], …
281
+ ```
282
+
283
+ ---
284
+
285
+ ## Large result spool (Layer 1)
286
+
287
+ When a single tool result exceeds **50 KB**, the kernel keeps a short preview in context and emits `large_result_spooled`. The SDK writes the full payload to `.spool/` under the process cwd and logs `spool_ref` in the session.
288
+
289
+ `LocalExecutionPlane` transparently resolves read-tool arguments that point at `.spool/` paths:
290
+
291
+ ```python
292
+ # Kernel context shows a preview + spool reference.
293
+ # LLM calls read_file(path=".spool/abc123…") → full content returned.
294
+ ```
295
+
296
+ No configuration is required. Pass a custom `result_spool` on `RuntimeOptions` to change the directory (see `tests/test_semantic_page_out_dream.py` and spool-related tests).
297
+
298
+ ---
299
+
300
+ ## Tools
301
+
302
+ ```python
303
+ from deepstrike import tool, read_file
304
+
305
+ plane.register(tool(name="search", description="Search.", parameters=schema)(my_fn))
306
+ plane.register(read_file) # built-in: read files (also resolves .spool/ refs)
307
+ plane.unregister("search")
308
+ ```
309
+
310
+ Execution planes:
311
+
312
+ | Plane | Use case |
313
+ |-------|----------|
314
+ | `LocalExecutionPlane` | In-process tools (default) |
315
+ | `FilteredExecutionPlane` | Capability-filtered sub-agent tools |
316
+ | `ProcessSandboxPlane` | OS subprocess isolation |
317
+ | `McpProxyPlane` | MCP server tools |
318
+ | `RemoteVpcPlane` | Remote execution |
319
+
320
+ Mount capabilities on an active run:
321
+
322
+ ```python
323
+ runner.mount_tool(schema)
324
+ runner.mount_skill("summarize", "Summarize text")
325
+ runner.unmount_capability("tool", "search")
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Skills
331
+
332
+ Set `skill_dir` — the kernel auto-injects a `skill` meta-tool, and the LLM loads skills by name on demand.
333
+
334
+ ```python
335
+ runner = RuntimeRunner(RuntimeOptions(
336
+ provider=provider,
337
+ session_log=InMemorySessionLog(),
338
+ execution_plane=plane,
339
+ max_tokens=4096,
340
+ skill_dir="./skills",
341
+ ))
342
+ ```
343
+
344
+ ```markdown
345
+ ---
346
+ name: summarize
347
+ description: Summarize text into 2-3 concise bullet points
348
+ when_to_use: When you need to condense long text
349
+ effort: 1
350
+ ---
351
+ 1. Identify the 2-3 most important points
352
+ 2. Express each as a concise bullet
353
+ ```
354
+
355
+ ---
356
+
357
+ ## Knowledge
358
+
359
+ Implement `KnowledgeSource` — the kernel injects a `knowledge` meta-tool. Runtime retrieval results land in **history** as tool results. Use `initial_memory` for durable preload into Slot 2.
360
+
361
+ Before tool execution the kernel may emit `page_in_requested`; the SDK satisfies it from `DreamStore`, `KnowledgeSource`, and a local semantic page-out cache, then feeds `page_in` back to the kernel.
362
+
363
+ ```python
364
+ from deepstrike import KnowledgeSource
365
+
366
+ class VectorSearch(KnowledgeSource):
367
+ async def init(self) -> None:
368
+ await vector_db.connect()
369
+
370
+ async def retrieve(self, query: str, top_k: int = 5) -> list[str]:
371
+ return await vector_db.search(query, top_k)
372
+
373
+ runner = RuntimeRunner(RuntimeOptions(
374
+ provider=provider,
375
+ session_log=InMemorySessionLog(),
376
+ execution_plane=plane,
377
+ knowledge_source=VectorSearch(),
378
+ ))
379
+ ```
380
+
381
+ ---
382
+
383
+ ## Memory
384
+
385
+ ### WorkingMemory (SDK-side scratch pad)
386
+
387
+ `WorkingMemory` is an SDK helper — not the kernel working partition. Kernel task state renders into Slot 3 (`turns[0]`).
388
+
389
+ ```python
390
+ from deepstrike import WorkingMemory
391
+
392
+ mem = WorkingMemory()
393
+ mem.set("step", 1)
394
+ mem.get("step") # 1
395
+ mem.clear()
396
+ ```
397
+
398
+ ### DreamStore (long-term memory)
399
+
400
+ ```python
401
+ from deepstrike import DreamStore
402
+
403
+ class MyStore(DreamStore):
404
+ async def load_sessions(self, agent_id): ...
405
+ async def load_memories(self, agent_id): ...
406
+ async def commit(self, agent_id, result, existing): ...
407
+ async def search(self, agent_id, query, top_k): ...
408
+ async def save_session(self, data): ...
409
+
410
+ runner = RuntimeRunner(RuntimeOptions(
411
+ provider=provider,
412
+ session_log=InMemorySessionLog(),
413
+ execution_plane=plane,
414
+ dream_store=MyStore(),
415
+ agent_id="my-agent", # enables memory meta-tool + semantic page-out archival
416
+ ))
417
+ ```
418
+
419
+ Three memory paths:
420
+
421
+ | Path | When | What happens |
422
+ |------|------|--------------|
423
+ | In-session `memory(query)` | LLM calls meta-tool | `DreamStore.search()` → history tool result |
424
+ | `initial_memory` | Run start | Injected into Slot 2 (`system_knowledge`) |
425
+ | Semantic `page_out` | Kernel evicts with `tier_hint: "semantic"` | SDK summarizes via `dream_summarizer` / `dream_provider` → `DreamStore.commit()` |
426
+ | `dream(agent_id)` | Explicit idle call | `IdlePipeline` batch-consolidates past sessions |
427
+
428
+ ```python
429
+ import time
430
+ from deepstrike.providers.stream import DoneEvent
431
+
432
+ async for event in runner.dream("my-agent", now_ms=int(time.time() * 1000)):
433
+ if isinstance(event, DoneEvent):
434
+ print(event.dream_result)
435
+ ```
436
+
437
+ Custom semantic summarizer:
438
+
439
+ ```python
440
+ async def dream_summarizer(archived, ctx):
441
+ return f"Long-term summary for action={ctx.get('action')}"
442
+
443
+ runner = RuntimeRunner(RuntimeOptions(
444
+ # ...
445
+ dream_store=MyStore(),
446
+ agent_id="my-agent",
447
+ dream_summarizer=dream_summarizer,
448
+ ))
449
+ ```
450
+
451
+ ### Phase-7 memory syscalls (`write_memory` / `query_memory`)
452
+
453
+ ```python
454
+ await runner.write_memory({
455
+ "metadata": {
456
+ "name": "prefers-small-tests",
457
+ "description": "User prefers focused unit tests",
458
+ "kind": "feedback",
459
+ "created_at": 1,
460
+ "updated_at": 1,
461
+ },
462
+ "content": "User prefers focused unit tests for SDK behavior.",
463
+ }, session_id="my-session")
464
+
465
+ hits = await runner.query_memory({
466
+ "current_context": "Need testing preferences",
467
+ "active_tools": [],
468
+ "already_surfaced": [],
469
+ "top_k": 5,
470
+ }, session_id="my-session")
471
+ ```
472
+
473
+ Session events: `memory_written`, `memory_queried`, `memory_validation_failed`, `memory_retrieval_result`.
474
+
475
+ ---
476
+
477
+ ## Governance
478
+
479
+ ### In-kernel declarative policy (preferred)
480
+
481
+ Every run loads `governance_policy` into the kernel via `load_governance_policy`:
482
+
483
+ ```python
484
+ from deepstrike import DEFAULT_SANDBOX_POLICY
485
+ from deepstrike.governance import GovernancePolicy, GovernancePolicyRule, GovernanceRateLimit
486
+
487
+ policy = GovernancePolicy(
488
+ rules=[
489
+ GovernancePolicyRule(pattern="read_file", action="allow"),
490
+ GovernancePolicyRule(pattern="write_file", action="ask_user"),
491
+ GovernancePolicyRule(pattern="*", action="deny"),
492
+ ],
493
+ rate_limits=[GovernanceRateLimit(tool="api_call", max_calls=10, window_ms=60_000)],
494
+ )
495
+
496
+ runner = RuntimeRunner(RuntimeOptions(
497
+ provider=provider,
498
+ session_log=InMemorySessionLog(),
499
+ execution_plane=plane,
500
+ governance_policy=policy,
501
+ on_permission_request=lambda req: {"approved": True, "responder": "cli"},
502
+ ))
503
+ ```
504
+
505
+ - `deny` → tool rejected with `tool_denied`
506
+ - `ask_user` → `tool_gated` + `suspended`; resolve via `on_permission_request`, then kernel `resume`
507
+
508
+ Default when omitted: allow-all (`DEFAULT_NATIVE_GOVERNANCE_POLICY`).
509
+
510
+ ### Standalone Governance class
511
+
512
+ `Governance` wraps the native governance evaluator for SDK-side use (tests, custom gates). It is **not** wired automatically into `RuntimeRunner` — use `governance_policy` for run-time enforcement.
513
+
514
+ ```python
515
+ from deepstrike import Governance
516
+
517
+ gov = Governance("allow")
518
+ gov.add_permission_rule("danger.*", "deny")
519
+ gov.block_tool("rm_rf")
520
+ gov.evaluate("read_file", '{"path":"x"}')
521
+ ```
522
+
523
+ ### SDK PermissionManager
524
+
525
+ `PermissionManager` is a separate SDK-side permission layer for apps that manage their own approval UX outside the kernel loop.
526
+
527
+ ```python
528
+ from deepstrike import PermissionManager, PermissionMode
529
+
530
+ pm = PermissionManager(PermissionMode.DEFAULT)
531
+ pm.grant("fs", "read")
532
+ pm.evaluate("fs", "read")
533
+ ```
534
+
535
+ ---
536
+
537
+ ## Signals
538
+
539
+ Inbound signals are routed by the in-kernel attention policy (default queue size 64):
540
+
541
+ | Urgency | Typical disposition |
542
+ |---------|-------------------|
543
+ | `critical` / `high` | `interrupt_now` — may yield a new `call_provider` action |
544
+ | `normal` / `low` | `queue` — buffered; no action until dequeued |
545
+ | queue full | `dropped` |
546
+
547
+ ```python
548
+ from deepstrike import SignalGateway, ScheduledPrompt, RuntimeSignal
549
+ from deepstrike.runtime import DEFAULT_NATIVE_ATTENTION_POLICY
550
+
551
+ gw = SignalGateway()
552
+ gw.schedule(ScheduledPrompt(goal="standup", run_at_ms=target_time))
553
+ gw.ingest(RuntimeSignal(kind="alert", payload={}, urgency="normal"))
554
+
555
+ runner = RuntimeRunner(RuntimeOptions(
556
+ provider=provider,
557
+ session_log=InMemorySessionLog(),
558
+ execution_plane=plane,
559
+ signal_source=gw,
560
+ attention_policy=DEFAULT_NATIVE_ATTENTION_POLICY,
561
+ ))
562
+
563
+ runner.interrupt() # cooperative abort → kernel timeout path
564
+ gw.destroy()
565
+ ```
566
+
567
+ Each routed signal produces a `signal_disposed` session event (`category: "ipc"`).
568
+
569
+ ---
570
+
571
+ ## Sub-agents
572
+
573
+ Spawn isolated child agents through the kernel process table:
574
+
575
+ ```python
576
+ from deepstrike import AgentRunSpec, AgentIdentity
577
+ from deepstrike.providers.stream import DoneEvent
578
+
579
+ async for event in runner.spawn_sub_agent(AgentRunSpec(
580
+ identity=AgentIdentity(agent_id="researcher-1", session_id="child-session"),
581
+ role="explore",
582
+ goal="Find three sources on topic X",
583
+ isolation="worktree",
584
+ )):
585
+ if isinstance(event, DoneEvent):
586
+ print(event.status)
587
+ ```
588
+
589
+ Requires an active parent run (`run()` / `wake()` in progress). The kernel emits `agent_process_changed`; the default `SubAgentOrchestrator` runs the child with a filtered execution plane and feeds `sub_agent_completed` back.
590
+
591
+ ---
592
+
593
+ ## Harness (evaluation framework)
594
+
595
+ ```python
596
+ from deepstrike import (
597
+ SinglePassHarness, EvalLoopHarness, HarnessLoop, HarnessRequest,
598
+ SubAgentHarnessConfig, QualityGate,
599
+ )
600
+
601
+ outcome = await SinglePassHarness(runner).run(HarnessRequest(goal="Say hello"))
602
+
603
+ class ContainsHello(QualityGate):
604
+ async def evaluate(self, request, outcome) -> bool:
605
+ return "hello" in outcome.result.lower()
606
+
607
+ outcome = await EvalLoopHarness(runner, gate=ContainsHello(), max_attempts=3).run(req)
608
+
609
+ loop = HarnessLoop(runner, eval_provider=eval_provider, max_attempts=3, skill_dir="./skills")
610
+
611
+ runner = RuntimeRunner(RuntimeOptions(
612
+ provider=provider,
613
+ session_log=InMemorySessionLog(),
614
+ execution_plane=plane,
615
+ sub_agent_harness=SubAgentHarnessConfig(eval_provider=eval_provider, max_attempts=3),
616
+ ))
617
+ async for event in loop.run_streaming(HarnessRequest(goal="Write a haiku")):
618
+ if event.type == "done":
619
+ print(event.verdict.passed, event.verdict.feedback)
620
+ ```
621
+
622
+ ---
623
+
624
+ ## Stream events
625
+
626
+ Import from `deepstrike.providers.stream`:
627
+
628
+ | Class | Key fields |
629
+ |-------|------------|
630
+ | `TextDelta` | `delta` |
631
+ | `ThinkingDelta` | `delta` |
632
+ | `ToolCallEvent` | `id`, `name`, `arguments` |
633
+ | `ToolDeltaEvent` | `call_id`, `name`, `delta`, `chunk?` |
634
+ | `ToolSuspendEvent` | `call_id`, `name`, `suspension_id`, `payload?` |
635
+ | `ToolResultEvent` | `call_id`, `content`, `is_error` |
636
+ | `PermissionRequestEvent` | `tool_name`, `reason` |
637
+ | `DoneEvent` | `iterations`, `total_tokens`, `status` |
638
+ | `ErrorEvent` | `message` |
639
+
640
+ `status`: `completed` · `max_turns` · `token_budget` · `timeout` · `user_abort` · `error` · `milestone_pending`
641
+
642
+ ---
643
+
644
+ ## Further reading
645
+
646
+ - [SDK OS parity matrix](../docs/sdk-os-parity.md)
647
+ - [Kernel ABI reference](../docs/reference/kernel-abi.md)
648
+ - [Context slots & compression](../docs/concepts/context-slots-compression.md)
649
+