nextloop 0.5.0rc2__tar.gz → 0.6.0__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 (136) hide show
  1. {nextloop-0.5.0rc2/src/nextloop.egg-info → nextloop-0.6.0}/PKG-INFO +29 -13
  2. {nextloop-0.5.0rc2 → nextloop-0.6.0}/README.md +27 -12
  3. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/adr/0003-python-and-centralized-contracts.md +1 -1
  4. nextloop-0.6.0/docs/adr/0004-event-compatibility.md +27 -0
  5. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/adr/0005-pending-input.md +2 -1
  6. nextloop-0.6.0/docs/adr/0006-operation-id.md +24 -0
  7. nextloop-0.6.0/docs/adr/0007-approval.md +25 -0
  8. nextloop-0.6.0/docs/architecture/development-plan.md +71 -0
  9. nextloop-0.6.0/docs/architecture/discussion-roadmap.md +50 -0
  10. nextloop-0.6.0/docs/architecture/feature-worklist.md +34 -0
  11. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/architecture/requirements.md +4 -4
  12. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/design/agent-loop.md +38 -28
  13. nextloop-0.6.0/docs/design/architecture.md +69 -0
  14. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/design/harness.md +8 -2
  15. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/design/loop-interface.md +20 -8
  16. nextloop-0.6.0/docs/design/verification-matrix.md +109 -0
  17. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/workers/python_worker.py +8 -0
  18. {nextloop-0.5.0rc2 → nextloop-0.6.0}/pyproject.toml +2 -1
  19. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/__init__.py +6 -0
  20. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/memory.py +12 -2
  21. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/observing.py +3 -0
  22. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/sqlite.py +18 -5
  23. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/cli.py +1 -0
  24. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/contracts.py +64 -3
  25. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/driver.py +57 -16
  26. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/__init__.py +2 -0
  27. nextloop-0.6.0/src/nextloop/events/approval.py +145 -0
  28. nextloop-0.6.0/src/nextloop/events/input.py +29 -0
  29. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/outcome.py +47 -1
  30. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/project.py +57 -2
  31. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/repair.py +55 -5
  32. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/response.py +8 -2
  33. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/trace.py +10 -1
  34. nextloop-0.6.0/src/nextloop/events/upcast.py +47 -0
  35. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/batch.py +24 -3
  36. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/mcp.py +13 -1
  37. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/stdio.py +14 -1
  38. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/stdio_transport.py +20 -6
  39. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/tools.py +7 -3
  40. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/harness.py +12 -0
  41. nextloop-0.6.0/src/nextloop/loop.py +758 -0
  42. nextloop-0.6.0/src/nextloop/testing.py +308 -0
  43. {nextloop-0.5.0rc2 → nextloop-0.6.0/src/nextloop.egg-info}/PKG-INFO +29 -13
  44. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop.egg-info/SOURCES.txt +17 -0
  45. nextloop-0.6.0/tests/test_approval.py +398 -0
  46. nextloop-0.6.0/tests/test_approval_regressions.py +304 -0
  47. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_cli.py +8 -1
  48. nextloop-0.6.0/tests/test_compaction_lineage.py +75 -0
  49. nextloop-0.6.0/tests/test_fault_injection.py +131 -0
  50. nextloop-0.6.0/tests/test_fault_matrix.py +247 -0
  51. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_harness.py +1 -1
  52. nextloop-0.6.0/tests/test_import_contract.py +207 -0
  53. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_mcp.py +25 -2
  54. nextloop-0.6.0/tests/test_operations.py +330 -0
  55. nextloop-0.6.0/tests/test_pending_inputs.py +290 -0
  56. nextloop-0.6.0/tests/test_projection_parity.py +17 -0
  57. nextloop-0.6.0/tests/test_retry_regressions.py +148 -0
  58. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_skills.py +1 -1
  59. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_stdio.py +12 -1
  60. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_store_contract.py +16 -1
  61. nextloop-0.6.0/tests/test_upcasting.py +162 -0
  62. nextloop-0.5.0rc2/docs/architecture/development-plan.md +0 -47
  63. nextloop-0.5.0rc2/docs/architecture/discussion-roadmap.md +0 -53
  64. nextloop-0.5.0rc2/docs/architecture/feature-worklist.md +0 -30
  65. nextloop-0.5.0rc2/docs/design/verification-matrix.md +0 -93
  66. nextloop-0.5.0rc2/src/nextloop/loop.py +0 -194
  67. nextloop-0.5.0rc2/src/nextloop/testing.py +0 -107
  68. nextloop-0.5.0rc2/tests/test_pending_inputs.py +0 -135
  69. {nextloop-0.5.0rc2 → nextloop-0.6.0}/LICENSE +0 -0
  70. {nextloop-0.5.0rc2 → nextloop-0.6.0}/MANIFEST.in +0 -0
  71. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/adr/0001-embeddable-agent-loop.md +0 -0
  72. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/adr/0002-dsh-aligned-agent-loop.md +0 -0
  73. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/architecture/agent-loop-capability-review.md +0 -0
  74. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/design/context-builder.md +0 -0
  75. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/design/react-protocol.md +0 -0
  76. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/design/skills.md +0 -0
  77. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-02-dsh-primary-sources.md +0 -0
  78. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-02-loop-evidence-notes.md +0 -0
  79. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-03-hermes-turn-control.md +0 -0
  80. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-03-tool-batch-failures.md +0 -0
  81. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-03-tool-call-validation.md +0 -0
  82. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-03-yomi-turn-control.md +0 -0
  83. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-06-open-source-agent-loops.md +0 -0
  84. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-06-react-tool-event-recovery.md +0 -0
  85. {nextloop-0.5.0rc2 → nextloop-0.6.0}/docs/research/2026-11-10-nextloop-optimization-review.md +0 -0
  86. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/basic.py +0 -0
  87. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/harness-skills/echo/SKILL.md +0 -0
  88. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/harness.toml +0 -0
  89. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/live_smoke.py +0 -0
  90. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/python_tools.py +0 -0
  91. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/skills/coding/SKILL.md +0 -0
  92. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/skills_demo.py +0 -0
  93. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/workers/cpp_worker.cpp +0 -0
  94. {nextloop-0.5.0rc2 → nextloop-0.6.0}/examples/workers/rust_worker.rs +0 -0
  95. {nextloop-0.5.0rc2 → nextloop-0.6.0}/setup.cfg +0 -0
  96. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/__init__.py +0 -0
  97. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/_sse.py +0 -0
  98. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/anthropic.py +0 -0
  99. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/adapters/openai.py +0 -0
  100. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/events/pending.py +0 -0
  101. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/__init__.py +0 -0
  102. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/cancellation.py +0 -0
  103. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/cleanup.py +0 -0
  104. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/composite.py +0 -0
  105. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/model.py +0 -0
  106. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/preview.py +0 -0
  107. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/execute/result_read.py +0 -0
  108. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/py.typed +0 -0
  109. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop/skills.py +0 -0
  110. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop.egg-info/dependency_links.txt +0 -0
  111. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop.egg-info/entry_points.txt +0 -0
  112. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop.egg-info/requires.txt +0 -0
  113. {nextloop-0.5.0rc2 → nextloop-0.6.0}/src/nextloop.egg-info/top_level.txt +0 -0
  114. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_aggregate_close.py +0 -0
  115. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_budgets.py +0 -0
  116. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_complexity_regressions.py +0 -0
  117. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_correctness_regressions.py +0 -0
  118. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_events.py +0 -0
  119. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_failures.py +0 -0
  120. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_harness_injection.py +0 -0
  121. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_loop.py +0 -0
  122. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_mcp_hardening.py +0 -0
  123. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_observability.py +0 -0
  124. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_observability_close_deadline.py +0 -0
  125. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_preview.py +0 -0
  126. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_provider_terminal.py +0 -0
  127. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_providers.py +0 -0
  128. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_result_budget_regressions.py +0 -0
  129. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_result_policies.py +0 -0
  130. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_review_regressions.py +0 -0
  131. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_stdio_cleanup.py +0 -0
  132. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_stdio_frames.py +0 -0
  133. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_stdio_safety.py +0 -0
  134. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_stores.py +0 -0
  135. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_surface_snapshot.py +0 -0
  136. {nextloop-0.5.0rc2 → nextloop-0.6.0}/tests/test_worker_conformance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nextloop
3
- Version: 0.5.0rc2
3
+ Version: 0.6.0
4
4
  Summary: An embeddable AgentLoop with explicit event, tool, recovery, and delivery semantics
5
5
  Author-email: 12bitsD <bis12@163.com>
6
6
  License-Expression: MIT
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
13
14
  Classifier: Typing :: Typed
14
15
  Requires-Python: >=3.11
15
16
  Description-Content-Type: text/markdown
@@ -34,12 +35,12 @@ nextloop is an embeddable Python AgentLoop for developers who want to build thei
34
35
 
35
36
  **Your agent, your rules. No magic, no black box.**
36
37
 
37
- Current version: **0.5.0rc2**.
38
+ Current version: **0.6.0**.
38
39
 
39
40
  ## Install
40
41
 
41
42
  ```bash
42
- python -m pip install nextloop==0.5.0rc2
43
+ python -m pip install nextloop==0.6.0
43
44
  ```
44
45
 
45
46
  For local development:
@@ -88,6 +89,10 @@ AgentLoop.steer(session_id, content, *, input_id=None) -> bool
88
89
  AgentLoop.cancel(session_id, cause="user_stop") -> bool
89
90
  AgentLoop.recover(session_id, store, delivery) -> RecoveryOutcome
90
91
  AgentLoop.pending_inputs(session_id, store) -> tuple[PendingInput, ...]
92
+ AgentLoop.resume(context, *, decisions=None, reject_all=False, new_input=None) -> TurnOutcome
93
+ AgentLoop.retry_operation(context, operation_id) -> TurnOutcome
94
+ AgentLoop.resource_locks(session_id, store) -> frozenset[str]
95
+ AgentLoop.release_resource(session_id, store, resource, *, actor, evidence) -> bool
91
96
  ```
92
97
 
93
98
  Core adapter seams are `EventStore`, `ModelProvider`, `ToolRuntime`, and `DeliveryOwner`. Additional extension points include `PreviewSink`, Exporters, Skills, and stdio/MCP workers. Context projection and Compaction are built in and configured through `LoopConfig`.
@@ -96,14 +101,16 @@ Core adapter seams are `EventStore`, `ModelProvider`, `ToolRuntime`, and `Delive
96
101
 
97
102
  | Area | Guarantee | Not a guarantee |
98
103
  |---|---|---|
99
- | Accepted input | Accepted inputs are projected from the log by `input_id` and can be queried with `AgentLoop.pending_inputs`. | Automatic deduplication when callers retry with a different or missing ID. |
104
+ | Accepted input | Accepted inputs are projected from the log by `input_id` and can be queried with `AgentLoop.pending_inputs`. Explicit IDs are non-empty; identical retries deduplicate, conflicting content is rejected without consuming the original. | Automatic deduplication when callers retry with a different or missing ID. |
100
105
  | Delivery | Delivery is at least once; DeliveryOwner must deduplicate by stable `final_message_id`. | Exactly-once delivery or delivery without an idempotent owner. |
101
- | Tool execution | The library never automatically replays an already dispatched Tool. | No duplicate external effect when a model reissues a call or a Tool is not idempotent. |
102
- | Resource locks | Unresolved uncertain results block later calls sharing declared resources. | Global idempotency across different resources or Tools without resource declarations. |
106
+ | Tool execution | The library never automatically replays an already dispatched Tool. Explicit reconciliation is limited to READ_ONLY and IDEMPOTENT operations. | No duplicate external effect when a model reissues a call or a Tool is not idempotent. |
107
+ | Resource locks | Unresolved uncertain results retain declared resources; otherwise NON_IDEMPOTENT uses the Tool name. Successful reconciliation releases all locks associated with the operation. | Global idempotency across different resources or operations, or safe concurrent execution of NON_IDEMPOTENT calls. |
108
+ | Approval | Any approval-required item suspends the whole batch before dispatch. Resume requires explicit decisions, binds original IDs/arguments, and rechecks expiry and prior dispatch inside the Session lock. | Automatic approval, execution before a durable grant, or replay after dispatch without recovery. |
109
+ | Event compatibility | Schema 1.0 is upcast only during reads; original payload bytes are preserved for idempotent append. | Reading schema 1.1 with 0.5.0 or earlier, or accepting unknown future schemas. |
103
110
  | Recovery | Recovery writes crash closers; the caller starts a new Turn with projected prior messages and Pending Input. | In-place replay of the interrupted Turn or automatic execution of uncertain calls. |
104
111
  | Preview | Preview is transient and cannot execute partial Tool arguments. | Preview as a durable EventStore fact or a substitute for committed Delivery. |
105
112
  | Observability | Committed Events are authoritative and can be replayed for history. | The current in-memory Exporter queue as a durable outbox. |
106
- | MCP | stdio lifecycle, paginated static catalogs, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
113
+ | MCP | stdio lifecycle, paginated static catalogs, operation metadata, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
107
114
 
108
115
  `Harness.load("harness.toml")` assembles those adapters without changing the Loop. Use `await harness.check()` for offline validation and `await harness.run("input")` for a model-backed Turn. See [Harness and extension interface](docs/design/harness.md) for the strict TOML schema, stdio protocol, lifecycle rules, and CLI.
109
116
 
@@ -202,33 +209,41 @@ src/nextloop/
202
209
  events/ # pure projection, response/outcome folds, crash repair
203
210
  execute/ # model retries, Tool registration, batch scheduling
204
211
  adapters/ # SQLite, memory, OpenAI, Anthropic
212
+ testing.py # Store conformance and deterministic fault injection
205
213
  ```
206
214
 
207
215
  `events/` performs no I/O. `execute/` owns side effects and classified failures. `driver.py` only composes them.
208
216
 
209
217
  ## Verification
210
218
 
211
- The release-candidate checks cover:
219
+ The release checks cover:
212
220
 
213
221
  - text, Tool, multi-Step, mixed, empty, truncated, and malformed responses;
214
222
  - whole-batch rejection and parallel/exclusive scheduling with deterministic gates;
215
223
  - steer/final ordering, cancellation, WorkingContext, and Compaction;
216
224
  - protocol exhaustion, exact-byte retry, and partial-output failure;
225
+ - every append point on Memory and SQLite, before and after commit, with recovery and no-replay assertions;
226
+ - Tool/Delivery side-effect failures, writer takeover, late results, parallel partial completion, and repeated recovery;
227
+ - public Store conformance plus deliberately broken Store rejection;
217
228
  - resource-lock recovery, conflict prevention, and explicit release;
218
229
  - real subprocess exits during Tool execution and final delivery, followed by SQLite recovery;
219
230
  - recorded OpenAI and Anthropic SSE streams;
220
231
  - 12 live Kimi scenarios across both protocols, real Tool usage, parallel execution, recovery, steer, cancellation, Compaction, and WorkingContext;
221
232
  - live DeepSeek text + Preview + usage and real Tool Call + Delivery smoke;
222
- - 215 offline tests, `ruff`, `mypy`, wheel/sdist builds, `twine check`, and clean wheel installation.
233
+ - a 10,505-event benchmark with cross-Store, incremental, and required-content parity;
234
+ - 341 offline tests, `ruff`, `mypy`, wheel/sdist builds, `twine check`, and clean wheel installation.
223
235
 
224
236
  Current limits:
225
237
 
226
238
  - nika integration is separate acceptance work.
227
- - Concurrent writers across multiple processes fail closed; they are not coordinated.
228
- - Large-asset lifecycle, backup, and GC are not part of this release candidate.
239
+ - Concurrent writers across multiple processes fail closed; they are not coordinated by time-based leases.
240
+ - Large-asset lifecycle, backup, and GC are not part of this release.
241
+ - Official OpenAI and Anthropic API acceptance remains a 1.0 hard gate; recorded streams and DeepSeek do not substitute for it.
229
242
 
230
243
  ## Documents
231
244
 
245
+ - [Architecture and import contract](docs/design/architecture.md)
246
+ - [Domain glossary](CONTEXT.md)
232
247
  - [AgentLoop design](docs/design/agent-loop.md)
233
248
  - [Public interface](docs/design/loop-interface.md)
234
249
  - [Harness and extension interface](docs/design/harness.md)
@@ -236,11 +251,12 @@ Current limits:
236
251
  - [Directory-based SkillRegistry](docs/design/skills.md)
237
252
  - [Verification matrix](docs/design/verification-matrix.md)
238
253
  - [Development plan](docs/architecture/development-plan.md)
254
+ - [Contributing](CONTRIBUTING.md) and [Security](SECURITY.md)
239
255
  - [Changelog](CHANGELOG.md)
240
- - [ADR-0002](docs/adr/0002-dsh-aligned-agent-loop.md), [ADR-0003](docs/adr/0003-python-and-centralized-contracts.md), and [ADR-0005 Pending Input](docs/adr/0005-pending-input.md)
256
+ - [ADR-0002](docs/adr/0002-dsh-aligned-agent-loop.md), [ADR-0003](docs/adr/0003-python-and-centralized-contracts.md), [ADR-0004 Event compatibility](docs/adr/0004-event-compatibility.md), [ADR-0005 Pending Input](docs/adr/0005-pending-input.md), [ADR-0006 Operation identity](docs/adr/0006-operation-id.md), and [ADR-0007 Approval](docs/adr/0007-approval.md)
241
257
 
242
258
  ## Release
243
259
 
244
- CI covers Python 3.11, 3.12, and 3.13. A `v*` tag runs the release workflow, which verifies the package, publishes wheel and sdist to PyPI through Trusted Publishing, and creates a GitHub Release.
260
+ CI covers Python 3.11, 3.12, 3.13, and 3.14. A `v*` tag runs the release workflow, which verifies the package and benchmark, publishes wheel and sdist to PyPI through Trusted Publishing, and creates a GitHub Release.
245
261
 
246
262
  This is a public repository. Do not commit credentials, private trajectories, internal endpoints, or personal data.
@@ -6,12 +6,12 @@ nextloop is an embeddable Python AgentLoop for developers who want to build thei
6
6
 
7
7
  **Your agent, your rules. No magic, no black box.**
8
8
 
9
- Current version: **0.5.0rc2**.
9
+ Current version: **0.6.0**.
10
10
 
11
11
  ## Install
12
12
 
13
13
  ```bash
14
- python -m pip install nextloop==0.5.0rc2
14
+ python -m pip install nextloop==0.6.0
15
15
  ```
16
16
 
17
17
  For local development:
@@ -60,6 +60,10 @@ AgentLoop.steer(session_id, content, *, input_id=None) -> bool
60
60
  AgentLoop.cancel(session_id, cause="user_stop") -> bool
61
61
  AgentLoop.recover(session_id, store, delivery) -> RecoveryOutcome
62
62
  AgentLoop.pending_inputs(session_id, store) -> tuple[PendingInput, ...]
63
+ AgentLoop.resume(context, *, decisions=None, reject_all=False, new_input=None) -> TurnOutcome
64
+ AgentLoop.retry_operation(context, operation_id) -> TurnOutcome
65
+ AgentLoop.resource_locks(session_id, store) -> frozenset[str]
66
+ AgentLoop.release_resource(session_id, store, resource, *, actor, evidence) -> bool
63
67
  ```
64
68
 
65
69
  Core adapter seams are `EventStore`, `ModelProvider`, `ToolRuntime`, and `DeliveryOwner`. Additional extension points include `PreviewSink`, Exporters, Skills, and stdio/MCP workers. Context projection and Compaction are built in and configured through `LoopConfig`.
@@ -68,14 +72,16 @@ Core adapter seams are `EventStore`, `ModelProvider`, `ToolRuntime`, and `Delive
68
72
 
69
73
  | Area | Guarantee | Not a guarantee |
70
74
  |---|---|---|
71
- | Accepted input | Accepted inputs are projected from the log by `input_id` and can be queried with `AgentLoop.pending_inputs`. | Automatic deduplication when callers retry with a different or missing ID. |
75
+ | Accepted input | Accepted inputs are projected from the log by `input_id` and can be queried with `AgentLoop.pending_inputs`. Explicit IDs are non-empty; identical retries deduplicate, conflicting content is rejected without consuming the original. | Automatic deduplication when callers retry with a different or missing ID. |
72
76
  | Delivery | Delivery is at least once; DeliveryOwner must deduplicate by stable `final_message_id`. | Exactly-once delivery or delivery without an idempotent owner. |
73
- | Tool execution | The library never automatically replays an already dispatched Tool. | No duplicate external effect when a model reissues a call or a Tool is not idempotent. |
74
- | Resource locks | Unresolved uncertain results block later calls sharing declared resources. | Global idempotency across different resources or Tools without resource declarations. |
77
+ | Tool execution | The library never automatically replays an already dispatched Tool. Explicit reconciliation is limited to READ_ONLY and IDEMPOTENT operations. | No duplicate external effect when a model reissues a call or a Tool is not idempotent. |
78
+ | Resource locks | Unresolved uncertain results retain declared resources; otherwise NON_IDEMPOTENT uses the Tool name. Successful reconciliation releases all locks associated with the operation. | Global idempotency across different resources or operations, or safe concurrent execution of NON_IDEMPOTENT calls. |
79
+ | Approval | Any approval-required item suspends the whole batch before dispatch. Resume requires explicit decisions, binds original IDs/arguments, and rechecks expiry and prior dispatch inside the Session lock. | Automatic approval, execution before a durable grant, or replay after dispatch without recovery. |
80
+ | Event compatibility | Schema 1.0 is upcast only during reads; original payload bytes are preserved for idempotent append. | Reading schema 1.1 with 0.5.0 or earlier, or accepting unknown future schemas. |
75
81
  | Recovery | Recovery writes crash closers; the caller starts a new Turn with projected prior messages and Pending Input. | In-place replay of the interrupted Turn or automatic execution of uncertain calls. |
76
82
  | Preview | Preview is transient and cannot execute partial Tool arguments. | Preview as a durable EventStore fact or a substitute for committed Delivery. |
77
83
  | Observability | Committed Events are authoritative and can be replayed for history. | The current in-memory Exporter queue as a durable outbox. |
78
- | MCP | stdio lifecycle, paginated static catalogs, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
84
+ | MCP | stdio lifecycle, paginated static catalogs, operation metadata, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
79
85
 
80
86
  `Harness.load("harness.toml")` assembles those adapters without changing the Loop. Use `await harness.check()` for offline validation and `await harness.run("input")` for a model-backed Turn. See [Harness and extension interface](docs/design/harness.md) for the strict TOML schema, stdio protocol, lifecycle rules, and CLI.
81
87
 
@@ -174,33 +180,41 @@ src/nextloop/
174
180
  events/ # pure projection, response/outcome folds, crash repair
175
181
  execute/ # model retries, Tool registration, batch scheduling
176
182
  adapters/ # SQLite, memory, OpenAI, Anthropic
183
+ testing.py # Store conformance and deterministic fault injection
177
184
  ```
178
185
 
179
186
  `events/` performs no I/O. `execute/` owns side effects and classified failures. `driver.py` only composes them.
180
187
 
181
188
  ## Verification
182
189
 
183
- The release-candidate checks cover:
190
+ The release checks cover:
184
191
 
185
192
  - text, Tool, multi-Step, mixed, empty, truncated, and malformed responses;
186
193
  - whole-batch rejection and parallel/exclusive scheduling with deterministic gates;
187
194
  - steer/final ordering, cancellation, WorkingContext, and Compaction;
188
195
  - protocol exhaustion, exact-byte retry, and partial-output failure;
196
+ - every append point on Memory and SQLite, before and after commit, with recovery and no-replay assertions;
197
+ - Tool/Delivery side-effect failures, writer takeover, late results, parallel partial completion, and repeated recovery;
198
+ - public Store conformance plus deliberately broken Store rejection;
189
199
  - resource-lock recovery, conflict prevention, and explicit release;
190
200
  - real subprocess exits during Tool execution and final delivery, followed by SQLite recovery;
191
201
  - recorded OpenAI and Anthropic SSE streams;
192
202
  - 12 live Kimi scenarios across both protocols, real Tool usage, parallel execution, recovery, steer, cancellation, Compaction, and WorkingContext;
193
203
  - live DeepSeek text + Preview + usage and real Tool Call + Delivery smoke;
194
- - 215 offline tests, `ruff`, `mypy`, wheel/sdist builds, `twine check`, and clean wheel installation.
204
+ - a 10,505-event benchmark with cross-Store, incremental, and required-content parity;
205
+ - 341 offline tests, `ruff`, `mypy`, wheel/sdist builds, `twine check`, and clean wheel installation.
195
206
 
196
207
  Current limits:
197
208
 
198
209
  - nika integration is separate acceptance work.
199
- - Concurrent writers across multiple processes fail closed; they are not coordinated.
200
- - Large-asset lifecycle, backup, and GC are not part of this release candidate.
210
+ - Concurrent writers across multiple processes fail closed; they are not coordinated by time-based leases.
211
+ - Large-asset lifecycle, backup, and GC are not part of this release.
212
+ - Official OpenAI and Anthropic API acceptance remains a 1.0 hard gate; recorded streams and DeepSeek do not substitute for it.
201
213
 
202
214
  ## Documents
203
215
 
216
+ - [Architecture and import contract](docs/design/architecture.md)
217
+ - [Domain glossary](CONTEXT.md)
204
218
  - [AgentLoop design](docs/design/agent-loop.md)
205
219
  - [Public interface](docs/design/loop-interface.md)
206
220
  - [Harness and extension interface](docs/design/harness.md)
@@ -208,11 +222,12 @@ Current limits:
208
222
  - [Directory-based SkillRegistry](docs/design/skills.md)
209
223
  - [Verification matrix](docs/design/verification-matrix.md)
210
224
  - [Development plan](docs/architecture/development-plan.md)
225
+ - [Contributing](CONTRIBUTING.md) and [Security](SECURITY.md)
211
226
  - [Changelog](CHANGELOG.md)
212
- - [ADR-0002](docs/adr/0002-dsh-aligned-agent-loop.md), [ADR-0003](docs/adr/0003-python-and-centralized-contracts.md), and [ADR-0005 Pending Input](docs/adr/0005-pending-input.md)
227
+ - [ADR-0002](docs/adr/0002-dsh-aligned-agent-loop.md), [ADR-0003](docs/adr/0003-python-and-centralized-contracts.md), [ADR-0004 Event compatibility](docs/adr/0004-event-compatibility.md), [ADR-0005 Pending Input](docs/adr/0005-pending-input.md), [ADR-0006 Operation identity](docs/adr/0006-operation-id.md), and [ADR-0007 Approval](docs/adr/0007-approval.md)
213
228
 
214
229
  ## Release
215
230
 
216
- CI covers Python 3.11, 3.12, and 3.13. A `v*` tag runs the release workflow, which verifies the package, publishes wheel and sdist to PyPI through Trusted Publishing, and creates a GitHub Release.
231
+ CI covers Python 3.11, 3.12, 3.13, and 3.14. A `v*` tag runs the release workflow, which verifies the package and benchmark, publishes wheel and sdist to PyPI through Trusted Publishing, and creates a GitHub Release.
217
232
 
218
233
  This is a public repository. Do not commit credentials, private trajectories, internal endpoints, or personal data.
@@ -8,7 +8,7 @@
8
8
 
9
9
  ### Language and dependencies
10
10
 
11
- - Python 3.11+ with native `asyncio`; CI covers 3.11, 3.12, and 3.13.
11
+ - Python 3.11+ with native `asyncio`; CI covers 3.11, 3.12, 3.13, and 3.14.
12
12
  - Standard-library `dataclasses`, `typing`, and `sqlite3`.
13
13
  - `httpx` for Provider HTTP/SSE and `jsonschema` for Tool argument validation.
14
14
  - `pytest` and `pytest-asyncio` for tests; `ruff` and `mypy` for static checks.
@@ -0,0 +1,27 @@
1
+ # ADR-0004: Event compatibility and read-only upcasting
2
+
3
+ Status: accepted
4
+
5
+ ## Context
6
+
7
+ nextloop 0.5.0 writes Event schema 1.0. The 0.6 operation identity, approval, and Compaction lineage work adds payload fields without changing the Event envelope. Compatibility must not rewrite history, silently accept a future schema, or compare upcast payloads as if they were original bytes.
8
+
9
+ ## Decision
10
+
11
+ New Events are written as schema 1.1. Stores accept 1.0 history and upcast it only while loading. Unknown schema versions fail closed with `InvariantViolation`; older readers that only understand 1.0 therefore cannot read a 1.1 Session.
12
+
13
+ - Upcasting is a pure, deterministic, idempotent function. No Store UPDATE or rewrite is part of loading.
14
+ - The original stored payload and event ID remain authoritative for idempotent append comparison. Comparing a draft with an upcast representation is not equivalent to comparing original bytes and is rejected when they differ.
15
+ - A schema-1.0 TOOL_CALL without `operation_id` receives a deterministic ID derived from `session_id`, `turn`, `step`, and `call_id`. The same coordinates in ASSISTANT_MESSAGE Tool Calls receive the same ID; identical call IDs in different Steps receive different IDs.
16
+ - A schema-1.0 COMPACTION without lineage receives `source_seqs=None`. No exact source range is fabricated.
17
+ - Projection, Trace, and Recovery consume upcast Events; idempotent append uses the stored, non-upcast representation.
18
+ - The reserved single-key payload `{"_nextloop_erased": True}` denotes erased content for future retention work. Reusing that event ID raises `PayloadErasedError` without comparing payload content. No content hash is retained for low-entropy PII, and event-level erasure itself is outside 0.6.
19
+ - Every released schema has a real Store fixture produced by that release. The 1.0 fixture contains normal multi-Step Tool Calls with a repeated call ID, Compaction, and an interrupted Tool Call. New readers must preserve raw fixture bytes while loading and upcasting.
20
+
21
+ ## Consequences
22
+
23
+ - Old 1.0 logs remain readable without a migration write or downtime.
24
+ - New 1.1 logs are intentionally not readable by 0.5.0 and earlier.
25
+ - Read-time compatibility does not weaken append idempotency or future-version checks.
26
+ - Operation identity for legacy calls is deterministic and coordinate-scoped. New operation IDs introduced in 0.6 are persisted facts, not regenerated during recovery.
27
+ - Payload erasure has a fail-closed identity rule without prematurely implementing deletion or retaining PII hashes.
@@ -13,13 +13,14 @@ The event log is the sole source of truth. The actor inbox is only a wake-up sig
13
13
  - Scan INPUT_ACCEPTED and USER_MESSAGE in seq order and match them by `input_id`.
14
14
  - Accepted inputs without a corresponding USER_MESSAGE are Pending Input.
15
15
  - Compute Pending Input at the start of each Turn. Recovery never writes the actor inbox.
16
+ - A new Turn commits recovered Pending as USER_MESSAGE at its first Step boundary. This consumption fact is required; injecting Pending only into a Provider request would leave it pending forever.
16
17
  - Pending historical inputs appear before the new Turn's initial_input. Inputs accepted during approval suspension appear only after the corresponding Tool results.
17
18
  - Inputs from cancelled or budget-terminated Turns carry into the next Turn by default.
18
19
  - Active execution also uses the log's consumption state, so an input present in both the log and actor inbox is injected once.
19
20
  - Pending is queryable with `input_id`, original seq, original Turn, and content. No cleanup event is introduced in this version.
20
21
  - `recover()` may be called repeatedly without duplicating Pending. A crash between recover and run has the same projection.
21
22
 
22
- `input_id` is the idempotency boundary. A caller retrying initial input or steer must supply the same `input_id`, or query Pending before retrying. An absent or automatically generated ID does not provide cross-crash deduplication.
23
+ `input_id` is the idempotency boundary. A caller retrying initial input or steer must supply the same `input_id`, or query Pending before retrying. An absent or automatically generated ID does not provide cross-crash deduplication. Explicit IDs must be non-empty. The same ID with identical content is a no-op retry; the same ID with different content is rejected before a new INPUT_ACCEPTED is committed, so the original Pending content is preserved.
23
24
 
24
25
  No cleanup event is introduced. Pending remains visible until the caller consumes it or the protocol later defines an explicit discard fact.
25
26
 
@@ -0,0 +1,24 @@
1
+ # ADR-0006: Operation identity and Tool effects
2
+
3
+ Status: accepted
4
+
5
+ ## Context
6
+
7
+ A model can issue the same Tool Call again after an uncertain result. Without a persisted logical operation identity and an explicit effect declaration, the runtime cannot distinguish a new intent from a safe same-operation reconciliation.
8
+
9
+ ## Decision
10
+
11
+ - Every admitted assistant Tool Intent receives a new `operation_id` when ASSISTANT_MESSAGE is committed. TOOL_CALL, ToolContext, Tool Result, Trace, recovery, MCP, and stdio preserve that same ID. A new model intent receives a new ID even when `call_id`, Tool name, and arguments repeat.
12
+ - `ToolEffect = READ_ONLY | IDEMPOTENT | NON_IDEMPOTENT`; the default is NON_IDEMPOTENT. IDEMPOTENT means repeated or concurrent execution with the same operation ID has the same external effect as one execution.
13
+ - Declared `resources` continue to control normal conflict checks. A separate `uncertain_resources` projection is used only after uncertain execution: explicit resources win; otherwise NON_IDEMPOTENT uses the Tool name. This default does not serialize normal parallel scheduling.
14
+ - `AgentLoop.resource_locks(session_id, store)` and `release_resource(...)` expose log-derived lock state. Release writes an Event with actor and caller evidence rather than mutating a side table.
15
+ - `AgentLoop.retry_operation(context, operation_id)` is an explicit new Turn. Only READ_ONLY and IDEMPOTENT operations are eligible; NON_IDEMPOTENT is rejected. The caller accepts that the original hanging operation may still run concurrently.
16
+ - Reconciliation executes the original Tool and arguments with the original operation ID. It emits a Reconciliation Result notification linked to the original coordinate, never a second Tool Result at that coordinate. Success releases corresponding locks; another uncertain result retains them. The library never automatically retries.
17
+ - Harness TOML `effect` is explicit configuration. `nextloop check` reports a migration warning when it is absent. MCP annotations are untrusted hints and do not choose the effect.
18
+
19
+ ## Consequences
20
+
21
+ - Default uncertainty becomes visible for side-effecting Tools that declare no resources; this is an intentional breaking change.
22
+ - Explicit resource-based parallelism is unchanged.
23
+ - Reconciliation is auditable and does not rewrite old history or create ambiguous duplicate Results.
24
+ - Caller-provided idempotency is a semantic contract, not a hint the library can verify.
@@ -0,0 +1,25 @@
1
+ # ADR-0007: Approval suspension and cross-Turn resume
2
+
3
+ Status: accepted
4
+
5
+ ## Context
6
+
7
+ TOOL_CALL is a dispatch-boundary fact, not a Tool Intent. Approval must be decided before side effects and must survive crashes without changing original operation identity or arguments.
8
+
9
+ ## Decision
10
+
11
+ - `ApprovalPolicy(version, predicate=None, expires_after_seconds=None)` is a ToolSpec declaration. A missing policy needs no approval; a missing predicate always requires it; a predicate is a pure argument callback.
12
+ - If any call in a validated batch requires approval, Tool Intent and APPROVAL_REQUESTED commit atomically and the entire batch waits before its first TOOL_CALL. The request binds operation IDs, canonical arguments, policy versions, Event schema, and optional expiry.
13
+ - The waiting Turn ends with `approval_pending`. A crash closer must not turn undispatched approval intents into Skipped Results. New `run()` input and `steer()` are rejected while suspended; `cancel()` writes cancellation and invalidates the approval.
14
+ - `resume()` uses a new Turn and tail-conditional append. Decisions bind operation IDs. Any rejection or expiry rejects the whole batch; all approvals preserve the original parallel/exclusive order.
15
+ - APPROVAL_GRANTED commits before dispatch. A crash after permission but before TOOL_CALL can be resumed without another side effect. TOOL_CALL after permission follows ordinary uncertain recovery.
16
+ - Results physically append in the resume Turn and carry `origin_turn/origin_step`. Projection, Trace, and Recovery pair them to the original Tool Intent without rewriting the original coordinate.
17
+ - Rejected calls produce Skipped Results in the resume Turn, followed by new input. `resume(reject_all=True, new_input=...)` is the exit path.
18
+ - Expiry is evaluated lazily at resume, never by a background timer. Resume uses fresh Turn budgets and deadlines. Concurrent resume is serialized by the Session actor and revalidated against the log.
19
+
20
+ ## Consequences
21
+
22
+ - Approval cannot produce side effects before a durable permission fact.
23
+ - Permission and dispatch are separate crash windows with explicit recovery behavior.
24
+ - Original IDs and arguments survive across Turns; model projection sees Results before new Pending input.
25
+ - Approval waiting time is not Tool execution time.
@@ -0,0 +1,71 @@
1
+ # nextloop development and verification plan
2
+
3
+ Current stage: **0.6.0 release verification**. `0.5.0` is published; later milestones are not claimed as implemented.
4
+
5
+ ## Delivery order
6
+
7
+ ```text
8
+ 0.5.0rc2: Pending Input recovery and guarantee documentation
9
+ → 0.5.0: fault matrix, Store conformance, 10k benchmark, Python 3.14, import contract
10
+ → 0.6: upcasting, operation_id, approval/resume, Compaction source ranges
11
+ → 0.7: opt-in owner leases and persistent Pending behavior
12
+ → 0.8: caller-driven durable Outbox and OTel ID mapping
13
+ → 0.9: reentrant whole-Session deletion and tombstones
14
+ → 1.0: all hard gates and official OpenAI/Anthropic acceptance
15
+ ```
16
+
17
+ Each stage requires an independent Standards / Spec / Risk review, complete regression gates, and a separate release. A design or ADR is not accepted evidence until its fault scenarios pass.
18
+
19
+ ## 0.5.0 — falsification and frozen integration paths
20
+
21
+ - `nextloop.testing` provides Store, ToolRuntime, and DeliveryOwner fault injection, including after-side-effect and after-commit failures.
22
+ - The standard Tool + steer + final scenario traverses every append point on Memory and SQLite, before and after commit, and verifies seq, Pending, resource locks, Delivery, and no Tool replay.
23
+ - Explicit scenarios cover writer takeover before dispatch, late Tool results, parallel partial completion, Compaction, and repeated recovery.
24
+ - `check_event_store()` accepts both built-in Stores and rejects unchecked writers, duplicate event IDs, and incorrect Surface implementations.
25
+ - A 10,505-event benchmark checks Memory/SQLite Conversation Projection parity and incremental/whole-history Trace parity while reporting timings.
26
+ - CI covers Python 3.11, 3.12, 3.13, and 3.14.
27
+ - Existing root re-exports and core/extras module paths are frozen without a physical package split.
28
+
29
+ See [Architecture and import contract](../design/architecture.md), [Verification matrix](../design/verification-matrix.md), and [CONTRIBUTING](../../CONTRIBUTING.md).
30
+
31
+ ## 0.6 — explicit operation and approval semantics
32
+
33
+ - Versioned, read-only Event upcasting with real historical fixtures and fail-fast unknown versions.
34
+ - `operation_id` is created and persisted with Tool Intent; new model intent receives a new ID.
35
+ - `ToolEffect = READ_ONLY | IDEMPOTENT | NON_IDEMPOTENT`, defaulting to NON_IDEMPOTENT. Default Tool-name locking applies only to unresolved uncertain outcomes and is an explicit breaking change.
36
+ - Explicit same-ID reconciliation is allowed only for READ_ONLY and IDEMPOTENT operations. It creates a Reconciliation Result notification, never a second Tool Result at the original coordinate.
37
+ - Approval distinguishes Tool Intent from dispatch, binds canonical arguments and policy versions, and uses conditional append. Approval precedes side effects; resume uses original IDs and arguments in a new Turn.
38
+ - Compaction records source seq ranges and cannot split a Tool Intent from its result.
39
+
40
+ ## 0.7 — opt-in writer leases
41
+
42
+ - `owner_id` remains optional; existing `attach_writer` behavior stays unchanged when leases are not configured.
43
+ - Same-owner restart can take over immediately. Different owners wait for expiry or explicit forced takeover.
44
+ - Store time determines expiry; heartbeat renewal is independent. Every actual dispatch retains a writer/lease check.
45
+ - SQLite promises same-host multi-process behavior only. Late results from stale writers are discarded and remain uncertain.
46
+ - Existing `steer() -> bool` remains compatible; `steer_result()` adds explicit rejection reasons.
47
+
48
+ ## 0.8 — durable, caller-driven Outbox
49
+
50
+ - Export state and cursors live outside the Event log and do not consume writer epochs.
51
+ - `export_pending(session_id=None)` is caller-driven and can enumerate Sessions with unexported closed Turns without starting recovery.
52
+ - Watermarks advance only after durable Export acknowledgement. Bounded retries record auditable gaps rather than blocking forever or pretending success.
53
+ - Trace replay uses stable OTel 128-bit trace IDs and 64-bit span IDs. No OTel Exporter implementation is included in this milestone.
54
+
55
+ ## 0.9 — whole-Session deletion
56
+
57
+ - Deletion first commits a deleting tombstone and fences writers, then deletes primary and derived local state. Interrupted deletion is reentrant.
58
+ - A Session-ID-only tombstone prevents recreation. Event-level erasure and external blob reference counting are excluded.
59
+ - SQLite verification scans DB, WAL, SHM, and rollback-journal bytes with synthetic canaries. Third-party exports and user backups are not covered.
60
+
61
+ ## 1.0 hard gates
62
+
63
+ - All Store, ToolRuntime, DeliveryOwner, negative-conformance, takeover, and recovery scenarios pass.
64
+ - The 10k benchmark and parity checks pass.
65
+ - Python 3.14 CI passes.
66
+ - Official OpenAI and Anthropic API acceptance passes. Missing official credentials blocks 1.0; DeepSeek is not a substitute.
67
+ - Documentation, ADRs, migration notes, guarantee tables, and actual behavior agree.
68
+
69
+ ## Explicit non-goals through 1.0
70
+
71
+ No streaming `async for` API, OTel Exporter implementation, remote MCP/OAuth, additional Providers, `@tool` decorator, agent-as-Tool framework, Postgres implementation, physical core/extras split, automatic replay, in-place same-Turn resume, event-level erasure, or external blob lifecycle.
@@ -0,0 +1,50 @@
1
+ # nextloop discussion and delivery roadmap
2
+
3
+ Purpose: preserve the accepted direction and remaining decision boundaries without duplicating nika's product roadmap.
4
+
5
+ Current entry: **0.5.0 falsification and integration-contract closure**. The executable implementation plan is [development-plan.md](development-plan.md).
6
+
7
+ ## Fixed guardrails
8
+
9
+ - One embeddable Loop, not a service or multi-agent framework.
10
+ - Append-only Trajectory is authoritative; Conversation and Traces are derived.
11
+ - Whole-batch validation precedes every Tool side effect.
12
+ - TOOL_CALL precedes dispatch, and a writer check follows that commit immediately before execution.
13
+ - Unknown effects stop new dispatch and are never automatically replayed.
14
+ - Every exit has one finalization path; committed finals recover by Delivery only.
15
+ - Pending Input is derived from the Event log; in-memory inboxes do not become a second authority.
16
+ - Provider connection configuration stays outside Trajectory.
17
+ - No Feishu, Wiki, concrete product Tools, or Proactive product policy in nextloop.
18
+
19
+ ## Topic closure
20
+
21
+ | Topic | Accepted direction | Current state |
22
+ |---|---|---|
23
+ | Execution and ReAct | Turn/Step driver, bounded correction, ordered steer, common finalization | Implemented; normal and terminal behavior covered |
24
+ | Model and Context | Frozen in-memory requests, external Provider configuration, append-only projection, Compaction | Implemented; recorded Adapter contracts and separately identified live smoke |
25
+ | Tool contracts | Admission, parallel/exclusive scheduling, ordered Observations, explicit uncertainty | Implemented; full append and side-effect fault scenarios covered |
26
+ | Durable state | Atomic conditional append, idempotency, writer fencing, crash closers | Implemented for single-process fencing; timed leases remain 0.7 |
27
+ | Pending Input | Log projection by `input_id` and Step-boundary consumption | Implemented; cross-process steering reasons remain 0.7 |
28
+ | Observability | Committed-event Trace projection with failure isolation | Implemented; persistent Outbox remains 0.8 |
29
+ | Schema evolution | Read-only upcasting and versioned real fixtures | 0.6, not currently claimed |
30
+ | Operation identity and approval | Persistent `operation_id`, effect declarations, approved new-Turn resume | 0.6, not currently claimed |
31
+ | Retention | Reentrant whole-Session deletion with tombstones | 0.9, not currently claimed |
32
+ | Consumer integration | Public versioned Adapters; nika is a consumer, not a dependency | Separate acceptance |
33
+ | Release | Python 3.11–3.14, frozen imports, fault matrix, benchmark, official API gates | 0.5 verifies engineering; official OpenAI/Anthropic acceptance blocks 1.0 |
34
+
35
+ ## Decision order
36
+
37
+ 1. Falsify current guarantees before freezing them.
38
+ 2. Add operation identity and approval before changing writer ownership.
39
+ 3. Add leases before promising coordinated multi-process behavior.
40
+ 4. Add persistent export acknowledgement before calling Traces durable.
41
+ 5. Add tombstones before promising deletion.
42
+ 6. Require official Provider evidence before 1.0.
43
+
44
+ The [verification matrix](../design/verification-matrix.md) is the executable checklist. Documentation alone never marks a requirement implemented.
45
+
46
+ ## Integration links
47
+
48
+ - [nika](https://github.com/12bitsD/nika) independently owns personal-agent behavior, Feishu, AgentWiki, Skills, Prompts, deployment, and Proactive behavior.
49
+ - [ADR-0002](../adr/0002-dsh-aligned-agent-loop.md) records the DSH-aligned decision and deltas.
50
+ - [Open-source evaluation](../research/2026-11-06-open-source-agent-loops.md) preserves the earlier candidate comparison.
@@ -0,0 +1,34 @@
1
+ # nextloop feature worklist
2
+
3
+ Purpose: distinguish implemented capabilities from remaining work. Executable evidence is owned by the [verification matrix](../design/verification-matrix.md).
4
+
5
+ ## Implemented in the current 0.6 line
6
+
7
+ | Feature | Implementation | Evidence |
8
+ |---|---|---|
9
+ | Turn/Step driver | 4D coordinates, append-only Events, thin orchestration | Text, Tool, multi-Step, cancellation, final-order, and budget tests |
10
+ | Response protocol | Bounded correction, terminal failures, exact-byte retry | Empty, truncated, malformed, exhaustion, retry, and partial-output tests |
11
+ | Tool scheduling | Whole-batch Schema validation, bounded parallel calls, exclusive barriers | Zero-side-effect rejection, concurrency gates, ordering, and truncation tests |
12
+ | Recovery | Crash closers, explicit uncertainty, resource locks, delivery-only retry | Every-append fault matrix, real process exits, takeover, late-result, and repeated-recovery tests |
13
+ | Pending Input | Log projection by `input_id`, query API, Step-boundary consumption | Accepted/not-consumed windows, duplicate recovery, retry, cancellation, and next-Turn tests |
14
+ | Context | Append-only projection, WorkingContext, Compaction, result preview/page/full | Projection parity, compaction, UTF-8 paging, read-back, and capacity tests |
15
+ | EventStore | Memory and SQLite, atomic conditional append, idempotency, writer checks | Public conformance plus deliberately broken Store rejection |
16
+ | Event compatibility | Read-only 1.0→1.1 upcasting, raw append comparison | Real 1.0/1.1 SQLite fixtures and unknown-schema negative paths |
17
+ | Operation identity | operation_id, ToolEffect, resource locks, explicit Reconciliation | End-to-end propagation, dynamic locks, repeated/concurrent retry, and no-replay evidence |
18
+ | Approval | Atomic Intent/request, new-Turn resume, origin pairing, lazy expiry | Zero pre-grant dispatch, crash windows, concurrent resume, rejection, cancellation, and fresh budgets |
19
+ | Providers | OpenAI-compatible and Anthropic streaming adapters | Recorded protocol streams plus separately identified live-provider smoke |
20
+ | Observability | Model/Tool/Turn Trace DTOs, async Exporters, history | Live/history parity, failure isolation, bounded close, and 10k incremental parity |
21
+ | Integrations | Harness, directory Skills, stdio workers, MCP stdio | Offline diagnostics, subprocess conformance, lifecycle, and clean-wheel examples |
22
+ | Release contract | Frozen root/module re-exports, Python 3.11–3.14 CI | Import snapshot, complete gates, wheel/sdist, and clean-install checks |
23
+
24
+ ## Remaining work
25
+
26
+ | Feature | Target and boundary |
27
+ |---|---|
28
+ | Time-based writer leases | 0.7; opt-in owner identity, heartbeat, expiry, and takeover |
29
+ | Durable Outbox | 0.8; caller-driven export, persistent acknowledgement, auditable gaps |
30
+ | Whole-Session deletion | 0.9; tombstones and local derived-state cleanup |
31
+ | Official OpenAI/Anthropic acceptance | 1.0 hard gate; recorded streams and DeepSeek do not substitute |
32
+ | nika product integration | Separate consumer acceptance; no Feishu/Wiki dependency enters nextloop |
33
+ | Large external-asset lifecycle | Not claimed; current large Tool Results remain in the EventStore |
34
+ | Remote MCP/OAuth and more Providers | Explicitly outside the 1.0 plan |
@@ -17,11 +17,11 @@ This map records reusable execution requirements and verification ownership. No
17
17
  | L11 | Make Tool implementations replaceable behind one contract | [ToolRuntime](../design/loop-interface.md#toolruntime) | **Generic design closed.** Consumer Schemas, resources, cancellation, unknown and assets conformance |
18
18
  | L12 | Keep one append-only event authority and derive Conversation | [Event model](../design/agent-loop.md#8-event-model-and-transaction-groups) | **Design closed.** Field schema, seq, idempotency, lease/fence, transactions and malformed history |
19
19
  | L13 | Recover from every commit window without replaying side effects | [Recovery](../design/agent-loop.md#9-recovery-and-delivery) | **Design closed.** Process-exit matrix, stale leases and persistent resource tests |
20
- | L14 | Preserve large outputs and their references | [Content access](../design/context-builder.md#content-access-and-task-performance) | **Open implementation.** Asset identity, preview, retrieval, retention, backup and GC |
20
+ | L14 | Preserve large outputs and their references | [Content access](../design/context-builder.md#content-access-and-task-performance) | **Partially implemented.** Durable full Tool Results, bounded preview/page projections, and read-back are verified; backup, GC, and external-asset lifecycle remain open |
21
21
  | L15 | Retry delivery without rerunning model or Tools | [DeliveryOwner](../design/loop-interface.md#deliveryowner) | **Design closed.** `final_message_id`, delivery_unknown, durable handoff and writer-release tests |
22
- | L16 | Prove consumer independence through public Adapters | [Loop interface](../design/loop-interface.md) | **Open.** Fake and nika Adapters pass the same suite with no Feishu/Wiki dependency |
23
- | L18 | Load third-party instruction Skills from directories on demand | [SkillRegistry](../design/skills.md) | **Implemented for 0.2.0rc1.** Metadata discovery, current-body loading, duplicate/dependency/version errors, and `skill_view` tests |
24
- | L17 | Package and release only after protocol verification | [Development plan](development-plan.md), [ADR-0003](../adr/0003-python-and-centralized-contracts.md) | **0.2.0rc1 implemented.** Tests, static checks, wheel/sdist and clean-install verification pass; CI publication and consumer smoke remain separate |
22
+ | L16 | Prove consumer independence through public Adapters | [Loop interface](../design/loop-interface.md) | **Open.** Fake Adapters and public Store conformance are implemented; nika consumer acceptance remains separate |
23
+ | L18 | Load third-party instruction Skills from directories on demand | [SkillRegistry](../design/skills.md) | **Implemented.** Metadata discovery, current-body loading, duplicate/dependency/version errors, and `skill_view` tests |
24
+ | L17 | Package and release only after protocol verification | [Development plan](development-plan.md), [ADR-0003](../adr/0003-python-and-centralized-contracts.md) | **0.6.0 implemented and verified.** The complete fault matrix, benchmark, Python 3.14, import contract, upcasting, operation, approval, and clean package gates pass; publication and later milestones remain separate |
25
25
 
26
26
  ## Independence rule
27
27