nextloop 0.8.0__tar.gz → 1.0.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.
- {nextloop-0.8.0/src/nextloop.egg-info → nextloop-1.0.0}/PKG-INFO +10 -8
- {nextloop-0.8.0 → nextloop-1.0.0}/README.md +8 -6
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0009-outbox.md +1 -1
- nextloop-1.0.0/docs/adr/0010-session-deletion.md +28 -0
- nextloop-1.0.0/docs/adr/0011-live-provider-acceptance.md +18 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/architecture/development-plan.md +3 -3
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/architecture/discussion-roadmap.md +4 -4
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/architecture/feature-worklist.md +4 -4
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/architecture/requirements.md +1 -1
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/architecture.md +2 -2
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/harness.md +6 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/loop-interface.md +6 -3
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/verification-matrix.md +28 -4
- {nextloop-0.8.0 → nextloop-1.0.0}/pyproject.toml +2 -2
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/__init__.py +2 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/_sqlite.py +12 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/memory.py +20 -1
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/observing.py +79 -36
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/outbox.py +38 -19
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/sqlite.py +96 -10
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/contracts.py +6 -1
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/trace.py +3 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/testing.py +21 -0
- {nextloop-0.8.0 → nextloop-1.0.0/src/nextloop.egg-info}/PKG-INFO +10 -8
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop.egg-info/SOURCES.txt +3 -0
- nextloop-1.0.0/tests/test_deletion.py +326 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_harness.py +1 -1
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_import_contract.py +1 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_skills.py +2 -2
- {nextloop-0.8.0 → nextloop-1.0.0}/LICENSE +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/MANIFEST.in +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0001-embeddable-agent-loop.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0002-dsh-aligned-agent-loop.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0003-python-and-centralized-contracts.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0004-event-compatibility.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0005-pending-input.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0006-operation-id.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0007-approval.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/adr/0008-lease.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/architecture/agent-loop-capability-review.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/agent-loop.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/context-builder.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/react-protocol.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/design/skills.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-02-dsh-primary-sources.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-02-loop-evidence-notes.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-03-hermes-turn-control.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-03-tool-batch-failures.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-03-tool-call-validation.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-03-yomi-turn-control.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-06-open-source-agent-loops.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-06-react-tool-event-recovery.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/docs/research/2026-11-10-nextloop-optimization-review.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/basic.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/harness-skills/echo/SKILL.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/harness.toml +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/live_smoke.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/python_tools.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/skills/coding/SKILL.md +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/skills_demo.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/workers/cpp_worker.cpp +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/workers/python_worker.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/examples/workers/rust_worker.rs +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/setup.cfg +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/__init__.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/_sse.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/anthropic.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/adapters/openai.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/cli.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/driver.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/__init__.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/approval.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/input.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/outcome.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/pending.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/project.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/repair.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/response.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/trace_ids.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/events/upcast.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/__init__.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/batch.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/cancellation.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/cleanup.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/composite.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/mcp.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/model.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/preview.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/result_read.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/stdio.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/stdio_transport.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/execute/tools.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/harness.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/loop.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/py.typed +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop/skills.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop.egg-info/dependency_links.txt +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop.egg-info/entry_points.txt +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop.egg-info/requires.txt +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/src/nextloop.egg-info/top_level.txt +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_aggregate_close.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_approval.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_approval_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_budgets.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_cli.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_compaction_lineage.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_complexity_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_correctness_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_events.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_failures.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_fault_injection.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_fault_matrix.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_harness_injection.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_lease.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_loop.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_mcp.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_mcp_hardening.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_observability.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_observability_close_deadline.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_operations.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_outbox.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_outbox_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_pending_inputs.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_preview.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_projection_parity.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_provider_terminal.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_providers.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_result_budget_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_result_policies.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_retry_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_review_regressions.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_stdio.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_stdio_cleanup.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_stdio_frames.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_stdio_safety.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_store_contract.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_stores.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_surface_snapshot.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_upcasting.py +0 -0
- {nextloop-0.8.0 → nextloop-1.0.0}/tests/test_worker_conformance.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nextloop
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.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
|
|
7
7
|
Project-URL: Repository, https://github.com/12bitsD/nextloop
|
|
8
|
-
Classifier: Development Status ::
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -35,12 +35,12 @@ nextloop is an embeddable Python AgentLoop for developers who want to build thei
|
|
|
35
35
|
|
|
36
36
|
**Your agent, your rules. No magic, no black box.**
|
|
37
37
|
|
|
38
|
-
Current version: **0.
|
|
38
|
+
Current version: **1.0.0**.
|
|
39
39
|
|
|
40
40
|
## Install
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
python -m pip install nextloop==0.
|
|
43
|
+
python -m pip install nextloop==1.0.0
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
For local development:
|
|
@@ -112,6 +112,7 @@ Core adapter seams are `EventStore`, `ModelProvider`, `ToolRuntime`, and `Delive
|
|
|
112
112
|
| 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. |
|
|
113
113
|
| Preview | Preview is transient and cannot execute partial Tool arguments. | Preview as a durable EventStore fact or a substitute for committed Delivery. |
|
|
114
114
|
| Observability | Committed Events are authoritative. The live queue is best-effort; `SQLiteOutbox` durably replays closed Turns with cursors, bounded attempts, gaps, and owner-token locks. | Exactly-once export, exporting active Turns, or cleanup of third-party exported copies. |
|
|
115
|
+
| Session deletion | Idempotent deleting/deleted tombstones fence writers and reads; local Events, Trace state, and Outbox rows are removed, with SQLite secure-delete/checkpoint/VACUUM byte cleanup. | Event-level erasure, external Tool rollback, or deletion of caller copies, third-party exports, backups, and external assets. |
|
|
115
116
|
| MCP | stdio lifecycle, paginated static catalogs, operation metadata, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
|
|
116
117
|
|
|
117
118
|
`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.
|
|
@@ -244,15 +245,16 @@ The release checks cover:
|
|
|
244
245
|
- 12 live Kimi scenarios across both protocols, real Tool usage, parallel execution, recovery, steer, cancellation, Compaction, and WorkingContext;
|
|
245
246
|
- live DeepSeek text + Preview + usage and real Tool Call + Delivery smoke;
|
|
246
247
|
- durable Outbox ack/crash windows, replay identity, bounded retries/gaps, lock heartbeat/takeover, and concurrent schema migration;
|
|
248
|
+
- reentrant Session deletion, stale-writer/read fencing, queue isolation, Outbox anti-resurrection, and raw SQLite content-canary scans;
|
|
247
249
|
- a 10,505-event benchmark with cross-Store, incremental, and required-content parity;
|
|
248
|
-
-
|
|
250
|
+
- 384 offline tests, `ruff`, `mypy`, wheel/sdist builds, `twine check`, and clean wheel installation.
|
|
249
251
|
|
|
250
252
|
Current limits:
|
|
251
253
|
|
|
252
254
|
- nika integration is separate acceptance work.
|
|
253
255
|
- Writer leases coordinate same-host processes only; distributed locks and exactly-once export are not provided.
|
|
254
|
-
-
|
|
255
|
-
- Official OpenAI and Anthropic API acceptance
|
|
256
|
+
- Event-level erasure, external-asset lifecycle, backup/GC, and deletion of third-party copies are not part of this release.
|
|
257
|
+
- DeepSeek is the accepted live Provider gate under ADR-0011. Official OpenAI and Anthropic API acceptance is not claimed; their recorded Adapter streams are separate evidence.
|
|
256
258
|
|
|
257
259
|
## Documents
|
|
258
260
|
|
|
@@ -267,7 +269,7 @@ Current limits:
|
|
|
267
269
|
- [Development plan](docs/architecture/development-plan.md)
|
|
268
270
|
- [Contributing](CONTRIBUTING.md) and [Security](SECURITY.md)
|
|
269
271
|
- [Changelog](CHANGELOG.md)
|
|
270
|
-
- [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), [ADR-0007 Approval](docs/adr/0007-approval.md), [ADR-0008 Owner leases](docs/adr/0008-lease.md),
|
|
272
|
+
- [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), [ADR-0007 Approval](docs/adr/0007-approval.md), [ADR-0008 Owner leases](docs/adr/0008-lease.md), [ADR-0009 Durable Outbox](docs/adr/0009-outbox.md), [ADR-0010 Session deletion](docs/adr/0010-session-deletion.md), and [ADR-0011 Live Provider acceptance](docs/adr/0011-live-provider-acceptance.md)
|
|
271
273
|
|
|
272
274
|
## Release
|
|
273
275
|
|
|
@@ -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.
|
|
9
|
+
Current version: **1.0.0**.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
python -m pip install nextloop==0.
|
|
14
|
+
python -m pip install nextloop==1.0.0
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
For local development:
|
|
@@ -83,6 +83,7 @@ Core adapter seams are `EventStore`, `ModelProvider`, `ToolRuntime`, and `Delive
|
|
|
83
83
|
| 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. |
|
|
84
84
|
| Preview | Preview is transient and cannot execute partial Tool arguments. | Preview as a durable EventStore fact or a substitute for committed Delivery. |
|
|
85
85
|
| Observability | Committed Events are authoritative. The live queue is best-effort; `SQLiteOutbox` durably replays closed Turns with cursors, bounded attempts, gaps, and owner-token locks. | Exactly-once export, exporting active Turns, or cleanup of third-party exported copies. |
|
|
86
|
+
| Session deletion | Idempotent deleting/deleted tombstones fence writers and reads; local Events, Trace state, and Outbox rows are removed, with SQLite secure-delete/checkpoint/VACUUM byte cleanup. | Event-level erasure, external Tool rollback, or deletion of caller copies, third-party exports, backups, and external assets. |
|
|
86
87
|
| MCP | stdio lifecycle, paginated static catalogs, operation metadata, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
|
|
87
88
|
|
|
88
89
|
`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.
|
|
@@ -215,15 +216,16 @@ The release checks cover:
|
|
|
215
216
|
- 12 live Kimi scenarios across both protocols, real Tool usage, parallel execution, recovery, steer, cancellation, Compaction, and WorkingContext;
|
|
216
217
|
- live DeepSeek text + Preview + usage and real Tool Call + Delivery smoke;
|
|
217
218
|
- durable Outbox ack/crash windows, replay identity, bounded retries/gaps, lock heartbeat/takeover, and concurrent schema migration;
|
|
219
|
+
- reentrant Session deletion, stale-writer/read fencing, queue isolation, Outbox anti-resurrection, and raw SQLite content-canary scans;
|
|
218
220
|
- a 10,505-event benchmark with cross-Store, incremental, and required-content parity;
|
|
219
|
-
-
|
|
221
|
+
- 384 offline tests, `ruff`, `mypy`, wheel/sdist builds, `twine check`, and clean wheel installation.
|
|
220
222
|
|
|
221
223
|
Current limits:
|
|
222
224
|
|
|
223
225
|
- nika integration is separate acceptance work.
|
|
224
226
|
- Writer leases coordinate same-host processes only; distributed locks and exactly-once export are not provided.
|
|
225
|
-
-
|
|
226
|
-
- Official OpenAI and Anthropic API acceptance
|
|
227
|
+
- Event-level erasure, external-asset lifecycle, backup/GC, and deletion of third-party copies are not part of this release.
|
|
228
|
+
- DeepSeek is the accepted live Provider gate under ADR-0011. Official OpenAI and Anthropic API acceptance is not claimed; their recorded Adapter streams are separate evidence.
|
|
227
229
|
|
|
228
230
|
## Documents
|
|
229
231
|
|
|
@@ -238,7 +240,7 @@ Current limits:
|
|
|
238
240
|
- [Development plan](docs/architecture/development-plan.md)
|
|
239
241
|
- [Contributing](CONTRIBUTING.md) and [Security](SECURITY.md)
|
|
240
242
|
- [Changelog](CHANGELOG.md)
|
|
241
|
-
- [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), [ADR-0007 Approval](docs/adr/0007-approval.md), [ADR-0008 Owner leases](docs/adr/0008-lease.md),
|
|
243
|
+
- [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), [ADR-0007 Approval](docs/adr/0007-approval.md), [ADR-0008 Owner leases](docs/adr/0008-lease.md), [ADR-0009 Durable Outbox](docs/adr/0009-outbox.md), [ADR-0010 Session deletion](docs/adr/0010-session-deletion.md), and [ADR-0011 Live Provider acceptance](docs/adr/0011-live-provider-acceptance.md)
|
|
242
244
|
|
|
243
245
|
## Release
|
|
244
246
|
|
|
@@ -21,7 +21,7 @@ The existing Exporter queue is in memory and can lose traces on crash. A durable
|
|
|
21
21
|
|
|
22
22
|
Implementations and decorators must add or delegate `session_ids() -> Sequence[str]`, returning all Sessions with committed Events in stable order. Without this method, caller-driven export cannot enumerate unexported Sessions after restart. No writer ownership or lease behavior is required.
|
|
23
23
|
|
|
24
|
-
`export_timeout_seconds` bounds each cooperative Exporter call. A timeout follows the same attempt/gap path as other failures; cancelling a Python thread does not forcibly stop its code, and an asynchronous Exporter that suppresses cancellation can delay cleanup. Late side effects remain possible and are not reported as successful acknowledgement. Asynchronous Exporters must respond to cancellation; arbitrary user code is not hard-isolated by the timeout. `delete_session(session_id)` removes only Outbox cursor, attempts, gaps, and locks
|
|
24
|
+
`export_timeout_seconds` bounds each cooperative Exporter call. A timeout follows the same attempt/gap path as other failures; cancelling a Python thread does not forcibly stop its code, and an asynchronous Exporter that suppresses cancellation can delay cleanup. Late side effects remain possible and are not reported as successful acknowledgement. Asynchronous Exporters must respond to cancellation; arbitrary user code is not hard-isolated by the timeout. `delete_session(session_id)` removes only Outbox cursor, attempts, gaps, and locks, with the same SQLite physical cleanup used for Events. Whole-Session Event deletion is specified by ADR-0010. Outbox attempts, cursor advances, and gaps validate the current owner token in their write transaction so deleted state cannot be resurrected by an old export.
|
|
25
25
|
|
|
26
26
|
## Consequences
|
|
27
27
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ADR-0010: Reentrant whole-Session deletion
|
|
2
|
+
|
|
3
|
+
Status: accepted
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
Event history, writer leases, Trace projection state, live Exporter queues, and Outbox cursors can all retain Session-derived data. Deleting only Event rows neither fences stale writers nor removes local derived copies. Whole-Session deletion is required; event-level erasure remains outside this milestone.
|
|
8
|
+
|
|
9
|
+
## Decision
|
|
10
|
+
|
|
11
|
+
- `EventStore.delete_session(session_id)` is idempotent and uses a Session-ID-only tombstone with `deleting` and `deleted` states. The first transaction commits `deleting`, increments any existing writer epoch, and removes lease ownership. The second removes Events and writer state and commits `deleted`.
|
|
12
|
+
- A tombstone in either state fails closed for attach, append, writer checks/renewal, surface reads, and recovery reads. Tombstoned Sessions are excluded from `session_ids()` and cannot be recreated through the EventStore API.
|
|
13
|
+
- InMemoryEventStore applies the same tombstone and cache-removal semantics without claiming physical destruction of caller-owned copies or Python runtime history.
|
|
14
|
+
- SQLite creates the tombstone table lazily on first deletion, preserving read-only historical fixture bytes. Surface and recovery reads use one consistent snapshot for tombstone validation and Event selection.
|
|
15
|
+
- SQLite enables `secure_delete` before row deletion. After logical deletion it checkpoints and truncates the WAL, vacuums the database, and checkpoints again. A busy checkpoint or failed physical cleanup surfaces an error; repeating deletion retries cleanup while the tombstone continues to fail closed.
|
|
16
|
+
- ObservingEventStore serializes append/export activity with deletion. It removes TraceProjector state, queued records for the deleted Session, and seed markers, and suppresses a record already fetched by the worker. No deleted-Session Trace is newly exported after deletion returns.
|
|
17
|
+
- SQLiteOutbox.delete_session remains the owner of Outbox cursor, attempts, gaps, and locks and applies the same SQLite physical cleanup. Every attempt, cursor, and gap write validates the current owner token in its write transaction, so an in-flight export cannot recreate deleted rows. Whole-Session retention calls both idempotent APIs; no cross-database transaction is claimed.
|
|
18
|
+
- Tests inject deleting/deleted intermediate states and cleanup crashes, verify stale-writer and read rejection, preserve an unrelated Session, and scan DB, WAL, SHM, and rollback-journal bytes for synthetic content canaries.
|
|
19
|
+
|
|
20
|
+
## Boundaries
|
|
21
|
+
|
|
22
|
+
Deletion does not roll back an already dispatched external Tool effect. Callers must quiesce active Loops and Exporters when they require physical destruction without late side effects. Caller-owned Event/Trace copies, third-party exports, backups, offline replicas, external assets, and event-level erasure are outside this guarantee.
|
|
23
|
+
|
|
24
|
+
## Consequences
|
|
25
|
+
|
|
26
|
+
- A crash at any point leaves either a fail-closed deleting/deleted tombstone or a completed deletion; repeating both Store-specific cleanup APIs resumes the remaining work.
|
|
27
|
+
- Only the Session ID and deletion state remain in the EventStore. No Event payload or Compaction summary is retained in the tombstone.
|
|
28
|
+
- Third-party EventStores and decorators must implement or delegate `delete_session()` and preserve fail-closed tombstone behavior to satisfy the updated public contract.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ADR-0011: Live Provider acceptance for 1.0
|
|
2
|
+
|
|
3
|
+
Status: accepted
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
The earlier plan required official OpenAI and Anthropic API credentials for 1.0. Those credentials are unavailable. The maintainer explicitly selected DeepSeek as the live Provider acceptance target instead. Recorded OpenAI and Anthropic SSE tests already cover their Adapter protocol behavior but are not official API acceptance.
|
|
8
|
+
|
|
9
|
+
## Decision
|
|
10
|
+
|
|
11
|
+
- DeepSeek live text, Tool Calling, Preview, usage, Delivery, Outbox export, and Session deletion scenarios form the 1.0 live Provider gate.
|
|
12
|
+
- All existing Store, ToolRuntime, DeliveryOwner, recovery, fault-injection, import, benchmark, Python 3.11–3.14, package, and clean-install gates remain mandatory.
|
|
13
|
+
- Recorded OpenAI and Anthropic streams remain Adapter evidence. Official OpenAI and Anthropic API acceptance is not claimed and is not a 1.0 blocker under this decision.
|
|
14
|
+
- Future official Provider acceptance can be added as separate evidence without changing the 1.0 runtime contracts.
|
|
15
|
+
|
|
16
|
+
## Consequences
|
|
17
|
+
|
|
18
|
+
Version 1.0.0 freezes the tested public runtime contracts without asserting that every built-in Provider has been exercised against its official hosted API. The release evidence names the actual live Provider and does not generalize DeepSeek results to other hosted services.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nextloop development and verification plan
|
|
2
2
|
|
|
3
|
-
Current stage: **0.
|
|
3
|
+
Current stage: **1.0.0 release verification**. `0.9.0` is published; the maintainer-selected DeepSeek live gate is defined by ADR-0011.
|
|
4
4
|
|
|
5
5
|
## Delivery order
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ Current stage: **0.8.0 release verification**. `0.7.0` is published; later miles
|
|
|
11
11
|
→ 0.7: opt-in owner leases and persistent Pending behavior
|
|
12
12
|
→ 0.8: caller-driven durable Outbox and OTel ID mapping
|
|
13
13
|
→ 0.9: reentrant whole-Session deletion and tombstones
|
|
14
|
-
→ 1.0: all hard gates and
|
|
14
|
+
→ 1.0: all hard gates and maintainer-selected DeepSeek live acceptance
|
|
15
15
|
```
|
|
16
16
|
|
|
17
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.
|
|
@@ -64,7 +64,7 @@ See [Architecture and import contract](../design/architecture.md), [Verification
|
|
|
64
64
|
- All Store, ToolRuntime, DeliveryOwner, negative-conformance, takeover, and recovery scenarios pass.
|
|
65
65
|
- The 10k benchmark and parity checks pass.
|
|
66
66
|
- Python 3.14 CI passes.
|
|
67
|
-
- Official OpenAI and Anthropic API acceptance
|
|
67
|
+
- DeepSeek live text, Tool Calling, Preview, usage, Delivery, Outbox, and deletion scenarios pass under ADR-0011. Official OpenAI and Anthropic hosted API acceptance is not claimed and is no longer a 1.0 blocker.
|
|
68
68
|
- Documentation, ADRs, migration notes, guarantee tables, and actual behavior agree.
|
|
69
69
|
|
|
70
70
|
## Explicit non-goals through 1.0
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Purpose: preserve the accepted direction and remaining decision boundaries without duplicating nika's product roadmap.
|
|
4
4
|
|
|
5
|
-
Current entry: **0.
|
|
5
|
+
Current entry: **1.0.0 verified contracts and release closure**. The executable implementation plan is [development-plan.md](development-plan.md).
|
|
6
6
|
|
|
7
7
|
## Fixed guardrails
|
|
8
8
|
|
|
@@ -28,9 +28,9 @@ Current entry: **0.8.0 durable Outbox and release closure**. The executable impl
|
|
|
28
28
|
| Observability | Committed-event Trace projection with failure isolation | Implemented with caller-driven durable Outbox, acknowledgement cursors, and export gaps |
|
|
29
29
|
| Schema evolution | Read-only upcasting and versioned real fixtures | Implemented for Event schema 1.0→1.1 |
|
|
30
30
|
| Operation identity and approval | Persistent `operation_id`, effect declarations, approved new-Turn resume | Implemented with explicit reconciliation and approval recovery evidence |
|
|
31
|
-
| Retention | Reentrant whole-Session deletion with tombstones |
|
|
31
|
+
| Retention | Reentrant whole-Session deletion with tombstones | Implemented for local Event/Trace/Outbox state; third-party copies and external assets excluded |
|
|
32
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,
|
|
33
|
+
| Release | Python 3.11–3.14, frozen imports, fault matrix, benchmark, live Provider gate | DeepSeek live acceptance selected by ADR-0011; official OpenAI/Anthropic APIs are not claimed |
|
|
34
34
|
|
|
35
35
|
## Decision order
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ Current entry: **0.8.0 durable Outbox and release closure**. The executable impl
|
|
|
39
39
|
3. Add leases before promising coordinated multi-process behavior.
|
|
40
40
|
4. Add persistent export acknowledgement before calling Traces durable.
|
|
41
41
|
5. Add tombstones before promising deletion.
|
|
42
|
-
6.
|
|
42
|
+
6. Use the maintainer-selected DeepSeek live evidence for 1.0; keep official Provider evidence as a separate future check.
|
|
43
43
|
|
|
44
44
|
The [verification matrix](../design/verification-matrix.md) is the executable checklist. Documentation alone never marks a requirement implemented.
|
|
45
45
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Purpose: distinguish implemented capabilities from remaining work. Executable evidence is owned by the [verification matrix](../design/verification-matrix.md).
|
|
4
4
|
|
|
5
|
-
## Implemented in the current 0
|
|
5
|
+
## Implemented in the current 1.0 line
|
|
6
6
|
|
|
7
7
|
| Feature | Implementation | Evidence |
|
|
8
8
|
|---|---|---|
|
|
@@ -19,7 +19,8 @@ Purpose: distinguish implemented capabilities from remaining work. Executable ev
|
|
|
19
19
|
| Approval | Atomic Intent/request, new-Turn resume, origin pairing, lazy expiry | Zero pre-grant dispatch, crash windows, concurrent resume, rejection, cancellation, and fresh budgets |
|
|
20
20
|
| Providers | OpenAI-compatible and Anthropic streaming adapters | Recorded protocol streams plus separately identified live-provider smoke |
|
|
21
21
|
| Observability | Model/Tool/Turn Trace DTOs, async Exporters, history | Live/history parity, failure isolation, bounded close, and 10k incremental parity |
|
|
22
|
-
| Durable Outbox | Caller-driven replay, persistent cursor/attempts/gaps, owner-token locks and heartbeat | Ack/crash windows, retry exhaustion, lock ownership/timeout/migration,
|
|
22
|
+
| Durable Outbox | Caller-driven replay, persistent cursor/attempts/gaps, owner-token locks and heartbeat | Ack/crash windows, retry exhaustion, lock ownership/timeout/migration, closed-Turn filtering, and no resurrection after deletion |
|
|
23
|
+
| Session deletion | Reentrant deleting/deleted tombstones, writer fencing, local Trace/Outbox cleanup, SQLite byte purge | Crash/interruption windows, stale writers, read snapshots, queue isolation, raw DB/WAL/SHM/journal canaries |
|
|
23
24
|
| Integrations | Harness, directory Skills, stdio workers, MCP stdio | Offline diagnostics, subprocess conformance, lifecycle, and clean-wheel examples |
|
|
24
25
|
| Release contract | Frozen root/module re-exports, Python 3.11–3.14 CI | Import snapshot, complete gates, wheel/sdist, and clean-install checks |
|
|
25
26
|
|
|
@@ -27,8 +28,7 @@ Purpose: distinguish implemented capabilities from remaining work. Executable ev
|
|
|
27
28
|
|
|
28
29
|
| Feature | Target and boundary |
|
|
29
30
|
|---|---|
|
|
30
|
-
|
|
|
31
|
-
| Official OpenAI/Anthropic acceptance | 1.0 hard gate; recorded streams and DeepSeek do not substitute |
|
|
31
|
+
| Official OpenAI/Anthropic acceptance | Not claimed; recorded Adapter streams only. DeepSeek is the accepted 1.0 live gate under ADR-0011 |
|
|
32
32
|
| nika product integration | Separate consumer acceptance; no Feishu/Wiki dependency enters nextloop |
|
|
33
33
|
| Large external-asset lifecycle | Not claimed; current large Tool Results remain in the EventStore |
|
|
34
34
|
| Remote MCP/OAuth and more Providers | Explicitly outside the 1.0 plan |
|
|
@@ -21,7 +21,7 @@ This map records reusable execution requirements and verification ownership. No
|
|
|
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
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
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.
|
|
24
|
+
| L17 | Package and release only after protocol verification | [Development plan](development-plan.md), [ADR-0003](../adr/0003-python-and-centralized-contracts.md) | **1.0.0 implemented; release verification in progress.** Fault matrix, benchmark, Python 3.14, import contract, upcasting, operation, approval, owner lease, durable Outbox, whole-Session deletion, DeepSeek live scenarios, and package gates are required; official OpenAI/Anthropic acceptance is not claimed under ADR-0011 |
|
|
25
25
|
|
|
26
26
|
## Independence rule
|
|
27
27
|
|
|
@@ -32,7 +32,7 @@ The Loop coordinates execution; the Store owns ordering and writer fencing. `eve
|
|
|
32
32
|
- Pending Input is derived from INPUT_ACCEPTED and USER_MESSAGE by `input_id`. A later Step boundary commits its consumption; the in-memory inbox is only a wake-up signal.
|
|
33
33
|
- Trace records are projections of committed Events. Export failures cannot change Turn outcomes.
|
|
34
34
|
|
|
35
|
-
Owner leases are optional. Same-owner restarts take over immediately; different owners require expiry or explicit force. Heartbeat renewal is independent of appends, and the Store clock decides expiry. SQLite promises same-host multi-process contention only, not distributed coordination. Durable Trace export is implemented by the caller-driven `SQLiteOutbox
|
|
35
|
+
Owner leases are optional. Same-owner restarts take over immediately; different owners require expiry or explicit force. Heartbeat renewal is independent of appends, and the Store clock decides expiry. SQLite promises same-host multi-process contention only, not distributed coordination. Durable Trace export is implemented by the caller-driven `SQLiteOutbox`. Reentrant whole-Session deletion uses fail-closed tombstones, local Trace/Outbox cleanup, and SQLite byte purging; third-party exports and external assets remain outside that guarantee.
|
|
36
36
|
|
|
37
37
|
## Complexity boundaries
|
|
38
38
|
|
|
@@ -50,7 +50,7 @@ The benchmark checks Memory/SQLite Conversation Projection parity, Model/Tool Tr
|
|
|
50
50
|
|
|
51
51
|
## Frozen import contract
|
|
52
52
|
|
|
53
|
-
The root `nextloop` package keeps its existing convenience re-exports. `tests/test_import_contract.py` snapshots all
|
|
53
|
+
The root `nextloop` package keeps its existing convenience re-exports. `tests/test_import_contract.py` snapshots all 101 names and rejects accidental additions, removals, and duplicate entries.
|
|
54
54
|
|
|
55
55
|
Core integration paths:
|
|
56
56
|
|
|
@@ -153,6 +153,12 @@ Each successful Exporter return advances an independent durable cursor. A crash
|
|
|
153
153
|
|
|
154
154
|
Concurrent exporters use per-Session owner-token locks. A heartbeat renews only during `export_pending()` at one-third of `lock_timeout_seconds`; stale locks can be reclaimed after a crash. `export_timeout_seconds` bounds cooperative calls, but a timed-out synchronous Exporter thread can still produce late side effects. An asynchronous Exporter that suppresses cancellation can delay cleanup and must be made cancellation-aware by the caller. Neither case is a successful acknowledgement or hard isolation of user code. Delivery is therefore at least once, not exactly once, and exporters should deduplicate using the stable OTel `trace_id` and `span_id` emitted by `StdoutExporter`.
|
|
155
155
|
|
|
156
|
+
### Whole-Session deletion
|
|
157
|
+
|
|
158
|
+
Call `await store.delete_session(session_id)` for Event state and `outbox.delete_session(session_id)` for its separately owned export state. Both are idempotent; repeat both after interruption. EventStore deletion leaves only a deleting/deleted Session-ID tombstone and rejects subsequent reads, writes, and writer ownership operations with `SessionDeletedError`.
|
|
159
|
+
|
|
160
|
+
ObservingEventStore also clears projected and queued Trace records without blocking normal Turns on slow Exporters. Outbox write transactions verify their owner token so an in-flight export cannot recreate deleted state. SQLite uses `secure_delete`, WAL checkpoints, and VACUUM for local byte cleanup. Physical cleanup errors are explicit and safe to retry; already dispatched external effects, caller-owned copies, third-party exports, backups, and external assets are outside the deletion guarantee.
|
|
161
|
+
|
|
156
162
|
## MCP stdio
|
|
157
163
|
|
|
158
164
|
`driver = "mcp"` starts a standard MCP `2025-06-18` stdio server. The adapter performs initialize, the initialized notification, and paginated `tools/list` until the cursor is exhausted, then keeps a static catalog for the process lifetime. Remote annotations do not grant parallel execution, resources, or approval privileges.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Loop interface and ownership
|
|
2
2
|
|
|
3
|
-
Status: **v1.1 implemented for 0.
|
|
3
|
+
Status: **v1.1 implemented for 1.0.0**, with public contracts in `src/nextloop/contracts.py`.
|
|
4
4
|
|
|
5
5
|
## Independence and version dependency
|
|
6
6
|
|
|
@@ -40,17 +40,20 @@ Context assembly and Compaction are built-in mechanisms configured through `Loop
|
|
|
40
40
|
|
|
41
41
|
### 1. EventStore
|
|
42
42
|
|
|
43
|
-
- `session_ids() -> Sequence[str]` — stable enumeration of Sessions with committed Events for caller-driven Outbox export.
|
|
43
|
+
- `session_ids() -> Sequence[str]` — stable enumeration of non-tombstoned Sessions with committed Events for caller-driven Outbox export.
|
|
44
|
+
- `delete_session(session_id) -> None` — idempotently fences the Session and removes its local Event state; tombstoned reads and writes raise `SessionDeletedError`.
|
|
44
45
|
- `attach_writer(session_id) -> (writer_epoch, last_seq, last_turn)`
|
|
45
46
|
- `check_writer(session_id, writer_epoch) -> None` — rejects a stale writer immediately before Tool dispatch.
|
|
46
47
|
- `append(session_id, writer_epoch, expected_seq, events) -> Sequence[Event]` — validates epoch/seq and inserts atomically; identical retries are idempotent.
|
|
47
48
|
- `load_surface(session_id) -> Sequence[Event]` — returns model-visible Events from the latest `SurfaceOp.EPOCH` watermark plus INPUT_ACCEPTED and protocol correction facts.
|
|
48
49
|
- `load_recovery(session_id) -> Sequence[Event]` — full ordered history for deterministic crash repair and Pending projection.
|
|
49
50
|
|
|
50
|
-
Third-party implementations must pass `nextloop.testing.check_event_store()`. Writer epochs alone are not time-based leases. Optional `owner_id` and `lease_seconds` add same-host owner/expiry checks, heartbeat renewal, and takeover; they do not provide distributed coordination. Decorators must delegate `session_ids()` so caller-driven Outbox export can enumerate committed Sessions.
|
|
51
|
+
Third-party implementations must pass `nextloop.testing.check_event_store()`. Writer epochs alone are not time-based leases. Optional `owner_id` and `lease_seconds` add same-host owner/expiry checks, heartbeat renewal, and takeover; they do not provide distributed coordination. Decorators must delegate `session_ids()` so caller-driven Outbox export can enumerate committed Sessions and `delete_session()` so retention cannot bypass tombstones or derived-state cleanup.
|
|
51
52
|
|
|
52
53
|
**Migration from 0.5.0rc2 and earlier:** every EventStore implementation must add `check_writer(session_id, writer_epoch)`. It must read the currently committed epoch and raise `InvariantViolation("Stale writer_epoch")` when the supplied epoch is not current. Decorators must delegate this check to their wrapped Store. No default no-op is provided because it would reopen the post-TOOL_CALL stale-dispatch window.
|
|
53
54
|
|
|
55
|
+
**Migration from 0.8:** every EventStore implementation must add idempotent `delete_session(session_id)`, with fail-closed tombstones for reads and writer operations. Decorators must delegate deletion and clear their own derived Session state. Built-in SQLite Stores create tombstone schema lazily on first deletion, so opening historical fixtures for read-only upcasting does not rewrite their bytes. Whole-Session retention must also call `SQLiteOutbox.delete_session()`; no cross-database transaction is implied.
|
|
56
|
+
|
|
54
57
|
Initial input and explicit steer IDs must be non-empty. Reusing an ID with identical content is an idempotent retry; reusing it with different content raises `InvariantViolation` before a new INPUT_ACCEPTED is committed, preserving the original Pending input.
|
|
55
58
|
|
|
56
59
|
### 2. ModelProvider
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AgentLoop verification matrix
|
|
2
2
|
|
|
3
|
-
Status: 0.
|
|
3
|
+
Status: 1.0.0 release gate. A claim is closed only by the executable evidence named here; test count alone is not evidence.
|
|
4
4
|
|
|
5
5
|
## Evidence rules
|
|
6
6
|
|
|
@@ -77,7 +77,7 @@ Conversation Projection is bounded by the returned Surface and serialized messag
|
|
|
77
77
|
|
|
78
78
|
## Public contracts and packaging
|
|
79
79
|
|
|
80
|
-
- `tests/test_import_contract.py` freezes all
|
|
80
|
+
- `tests/test_import_contract.py` freezes all 101 root re-exports and the complete `__all__` of `events`, `adapters`, `execute`, and `testing`, plus explicit supported names on other integration modules.
|
|
81
81
|
- `tests/test_store_contract.py` is the third-party Store conformance entrypoint.
|
|
82
82
|
- Python 3.11, 3.12, 3.13, and 3.14 run CI. Local clean Python 3.11 and 3.14 environments also run the full suite and benchmark before 0.6.0 publication.
|
|
83
83
|
- `ruff`, format check, strict mypy, wheel/sdist build, Twine, clean wheel installation, examples, and CLI diagnostics are required gates.
|
|
@@ -132,10 +132,34 @@ The 0.6 review closed non-boolean grants, lock-delay expiry, duplicate dispatch,
|
|
|
132
132
|
| Session cleanup is bounded to Outbox state | Cursor, attempts, gaps, and locks are removed without deleting Events or changing writer epochs |
|
|
133
133
|
| Approval waiting is not Tool execution | Tool duration excludes approval delay; Turn duration remains separate |
|
|
134
134
|
|
|
135
|
+
## 0.9 whole-Session deletion evidence
|
|
136
|
+
|
|
137
|
+
| Claim | Closing evidence |
|
|
138
|
+
|---|---|
|
|
139
|
+
| Deletion is reentrant and cannot recreate a Session | Memory/SQLite repeated deletion, persistent deleting/deleted tombstones, attach/append/writer rejection |
|
|
140
|
+
| Tombstoned reads fail closed | Surface/recovery/renew/has_writer rejection and reopen; consistent read snapshots never turn deleted history into a valid empty Session |
|
|
141
|
+
| Unrelated Sessions survive | A retained Session remains readable and enumerable after another Session is deleted |
|
|
142
|
+
| Local derived data is removed | TraceProjector state, queued live records, Outbox cursor/attempts/gaps/locks, Events, Compaction, and writer/lease state |
|
|
143
|
+
| Old exports cannot resurrect Outbox state | Success, retry, and max-attempt exporters paused across deletion; transactional owner checks leave all four tables empty |
|
|
144
|
+
| SQLite content bytes are purged | Synthetic Event/Compaction/Outbox canaries absent from DB, WAL, SHM, and rollback-journal scans in WAL and DELETE modes |
|
|
145
|
+
| Cleanup crashes remain resumable | Post-logical-delete crash persists deleted tombstone and a later call completes byte cleanup |
|
|
146
|
+
| Historical fixtures remain read-only | Real 1.0/1.1 SQLite fixture bytes remain unchanged; tombstone schema is created lazily on deletion |
|
|
147
|
+
| Live export does not block the Loop | Existing slow-Exporter and bounded-close regressions plus deletion-specific activity/export lock coverage |
|
|
148
|
+
|
|
149
|
+
## 1.0 live Provider and release evidence
|
|
150
|
+
|
|
151
|
+
| Claim | Closing evidence |
|
|
152
|
+
|---|---|
|
|
153
|
+
| DeepSeek text Turn works end to end | One-step committed Turn, 16 Preview events, input/output usage, and committed Delivery |
|
|
154
|
+
| DeepSeek Tool Turn works end to end | Two Steps, one actual read Tool Call, 22 Preview events, usage, and final Delivery |
|
|
155
|
+
| Live traces remain durable and deletable | Four Outbox exports followed by EventStore/Outbox deletion, SessionDeletedError, and zero watermark |
|
|
156
|
+
| Runtime contracts remain frozen | 101 root exports and core/extras import snapshots pass without runtime-code changes from 0.9 |
|
|
157
|
+
| Release evidence is not overclaimed | ADR-0011 selects DeepSeek; official OpenAI/Anthropic hosted API acceptance is explicitly not claimed |
|
|
158
|
+
|
|
135
159
|
## Review and external evidence
|
|
136
160
|
|
|
137
161
|
Standards, Spec, and Risk reviews run independently. Original counterexamples must become regressions, and fixes receive incremental review. The 0.5.0 review closed stale dispatch, Pending consumption, ID conflicts, Compaction identity, export-contract gaps, wrapper duplication, and erased-content test oracles.
|
|
138
162
|
|
|
139
|
-
Recorded OpenAI and Anthropic SSE scenarios are Adapter evidence, not official API acceptance. Twelve live Kimi scenarios and live DeepSeek text/Preview/usage and Tool/Delivery smoke are separately identified. Official OpenAI and Anthropic API acceptance
|
|
163
|
+
Recorded OpenAI and Anthropic SSE scenarios are Adapter evidence, not official API acceptance. Twelve live Kimi scenarios and live DeepSeek text/Preview/usage and Tool/Delivery smoke are separately identified. Under ADR-0011, the maintainer-selected DeepSeek text, Tool, Preview, usage, Delivery, Outbox, and deletion scenarios close the 1.0 live Provider gate. Official OpenAI and Anthropic API acceptance is not claimed.
|
|
140
164
|
|
|
141
|
-
Current non-guarantees: distributed writer coordination, exactly-once export,
|
|
165
|
+
Current non-guarantees: distributed writer coordination, exactly-once export, deletion of third-party copies or backups, remote MCP/OAuth, event-level erasure, and external large-asset lifecycle.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nextloop"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "1.0.0"
|
|
8
8
|
description = "An embeddable AgentLoop with explicit event, tool, recovery, and delivery semantics"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -12,7 +12,7 @@ license = "MIT"
|
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
13
|
authors = [{name = "12bitsD", email = "bis12@163.com"}]
|
|
14
14
|
classifiers = [
|
|
15
|
-
"Development Status ::
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
16
|
"Programming Language :: Python :: 3",
|
|
17
17
|
"Programming Language :: Python :: 3.11",
|
|
18
18
|
"Programming Language :: Python :: 3.12",
|
|
@@ -45,6 +45,7 @@ from .contracts import (
|
|
|
45
45
|
ProviderConfig,
|
|
46
46
|
ProviderError,
|
|
47
47
|
RecoveryOutcome,
|
|
48
|
+
SessionDeletedError,
|
|
48
49
|
SkillConfig,
|
|
49
50
|
SkillDocument,
|
|
50
51
|
SkillError,
|
|
@@ -147,6 +148,7 @@ __all__ = [
|
|
|
147
148
|
"RecoveryOutcome",
|
|
148
149
|
"SQLiteEventStore",
|
|
149
150
|
"SQLiteOutbox",
|
|
151
|
+
"SessionDeletedError",
|
|
150
152
|
"SkillConfig",
|
|
151
153
|
"SkillDocument",
|
|
152
154
|
"SkillError",
|
|
@@ -17,3 +17,15 @@ def execute_with_busy_retry(connection: sqlite3.Connection, statement: str) -> N
|
|
|
17
17
|
if time.monotonic() >= deadline:
|
|
18
18
|
raise
|
|
19
19
|
time.sleep(0.01)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def purge_deleted_bytes(connection: sqlite3.Connection) -> None:
|
|
23
|
+
_checkpoint(connection)
|
|
24
|
+
connection.execute("VACUUM")
|
|
25
|
+
_checkpoint(connection)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _checkpoint(connection: sqlite3.Connection) -> None:
|
|
29
|
+
row = connection.execute("PRAGMA wal_checkpoint(TRUNCATE)").fetchone()
|
|
30
|
+
if row is not None and int(row[0]) != 0:
|
|
31
|
+
raise sqlite3.OperationalError("SQLite WAL checkpoint is busy")
|
|
@@ -13,6 +13,7 @@ from ..contracts import (
|
|
|
13
13
|
InvariantViolation,
|
|
14
14
|
NewEvent,
|
|
15
15
|
PayloadErasedError,
|
|
16
|
+
SessionDeletedError,
|
|
16
17
|
SurfaceOp,
|
|
17
18
|
WriterLeaseError,
|
|
18
19
|
utc_now,
|
|
@@ -42,6 +43,7 @@ class InMemoryEventStore:
|
|
|
42
43
|
self._events: dict[str, list[Event]] = defaultdict(list)
|
|
43
44
|
self._epochs: dict[str, int] = defaultdict(int)
|
|
44
45
|
self._leases: dict[str, _Lease] = {}
|
|
46
|
+
self._deleted: set[str] = set()
|
|
45
47
|
self._lock = asyncio.Lock()
|
|
46
48
|
self._owner_id = owner_id
|
|
47
49
|
self.lease_seconds = lease_seconds if owner_id is not None else None
|
|
@@ -49,10 +51,22 @@ class InMemoryEventStore:
|
|
|
49
51
|
|
|
50
52
|
async def session_ids(self) -> Sequence[str]:
|
|
51
53
|
async with self._lock:
|
|
52
|
-
return tuple(sorted(self._events))
|
|
54
|
+
return tuple(sorted(set(self._events) - self._deleted))
|
|
55
|
+
|
|
56
|
+
async def delete_session(self, session_id: str) -> None:
|
|
57
|
+
async with self._lock:
|
|
58
|
+
self._deleted.add(session_id)
|
|
59
|
+
self._events.pop(session_id, None)
|
|
60
|
+
self._epochs.pop(session_id, None)
|
|
61
|
+
self._leases.pop(session_id, None)
|
|
62
|
+
|
|
63
|
+
def _ensure_active(self, session_id: str) -> None:
|
|
64
|
+
if session_id in self._deleted:
|
|
65
|
+
raise SessionDeletedError(f"Session is deleted: {session_id}")
|
|
53
66
|
|
|
54
67
|
async def attach_writer(self, session_id: str, *, force: bool = False) -> tuple[int, int, int]:
|
|
55
68
|
async with self._lock:
|
|
69
|
+
self._ensure_active(session_id)
|
|
56
70
|
if self.lease_seconds is not None:
|
|
57
71
|
lease = self._leases.get(session_id)
|
|
58
72
|
if (
|
|
@@ -73,6 +87,7 @@ class InMemoryEventStore:
|
|
|
73
87
|
return self._epochs[session_id], len(events), last_turn
|
|
74
88
|
|
|
75
89
|
def _check_writer_locked(self, session_id: str, writer_epoch: int) -> None:
|
|
90
|
+
self._ensure_active(session_id)
|
|
76
91
|
if self.lease_seconds is None:
|
|
77
92
|
if self._epochs[session_id] != writer_epoch:
|
|
78
93
|
raise InvariantViolation("Stale writer_epoch")
|
|
@@ -93,12 +108,14 @@ class InMemoryEventStore:
|
|
|
93
108
|
async def renew_writer(self, session_id: str, writer_epoch: int) -> None:
|
|
94
109
|
async with self._lock:
|
|
95
110
|
if self.lease_seconds is None:
|
|
111
|
+
self._ensure_active(session_id)
|
|
96
112
|
raise InvariantViolation("Writer leases are not configured")
|
|
97
113
|
self._check_writer_locked(session_id, writer_epoch)
|
|
98
114
|
self._leases[session_id].expires_at = self._clock() + self.lease_seconds
|
|
99
115
|
|
|
100
116
|
async def has_writer(self, session_id: str) -> bool:
|
|
101
117
|
async with self._lock:
|
|
118
|
+
self._ensure_active(session_id)
|
|
102
119
|
if self.lease_seconds is None:
|
|
103
120
|
return False
|
|
104
121
|
try:
|
|
@@ -145,6 +162,7 @@ class InMemoryEventStore:
|
|
|
145
162
|
|
|
146
163
|
async def load_surface(self, session_id: str) -> Sequence[Event]:
|
|
147
164
|
async with self._lock:
|
|
165
|
+
self._ensure_active(session_id)
|
|
148
166
|
events = self._events[session_id]
|
|
149
167
|
epoch_seq = max(
|
|
150
168
|
(event.seq for event in events if event.surface_op == SurfaceOp.EPOCH),
|
|
@@ -162,6 +180,7 @@ class InMemoryEventStore:
|
|
|
162
180
|
|
|
163
181
|
async def load_recovery(self, session_id: str) -> Sequence[Event]:
|
|
164
182
|
async with self._lock:
|
|
183
|
+
self._ensure_active(session_id)
|
|
165
184
|
return tuple(upcast_event(copy.deepcopy(event)) for event in self._events[session_id])
|
|
166
185
|
|
|
167
186
|
@staticmethod
|