nextloop 1.0.0__tar.gz → 1.1.0rc1__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-1.1.0rc1/PKG-INFO +195 -0
- nextloop-1.1.0rc1/README.md +166 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0005-pending-input.md +1 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0007-approval.md +1 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/architecture/development-plan.md +1 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/architecture/requirements.md +2 -2
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/architecture.md +3 -3
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/context-builder.md +2 -2
- nextloop-1.1.0rc1/docs/design/guarantees.md +33 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/harness.md +9 -5
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/loop-interface.md +2 -2
- nextloop-1.1.0rc1/docs/tutorial.md +182 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/harness.toml +1 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/pyproject.toml +4 -1
- nextloop-1.1.0rc1/src/nextloop/adapters/_http.py +28 -0
- nextloop-1.1.0rc1/src/nextloop/adapters/_sqlite.py +82 -0
- nextloop-1.1.0rc1/src/nextloop/adapters/_sse.py +47 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/anthropic.py +78 -17
- nextloop-1.1.0rc1/src/nextloop/adapters/capabilities.py +88 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/memory.py +95 -47
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/observing.py +121 -19
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/openai.py +41 -12
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/outbox.py +62 -27
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/sqlite.py +193 -127
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/contracts.py +30 -18
- nextloop-1.1.0rc1/src/nextloop/driver.py +1213 -0
- nextloop-1.1.0rc1/src/nextloop/events/codec.py +155 -0
- nextloop-1.1.0rc1/src/nextloop/events/pending.py +64 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/project.py +64 -81
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/batch.py +8 -6
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/model.py +5 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/preview.py +13 -2
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/result_read.py +3 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/tools.py +9 -1
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/harness.py +98 -26
- nextloop-1.1.0rc1/src/nextloop/loop.py +304 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/testing.py +41 -0
- nextloop-1.1.0rc1/src/nextloop.egg-info/PKG-INFO +195 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop.egg-info/SOURCES.txt +12 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_approval.py +74 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_budgets.py +3 -2
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_events.py +13 -0
- nextloop-1.1.0rc1/tests/test_execution_races.py +87 -0
- nextloop-1.1.0rc1/tests/test_execution_regressions.py +242 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_fault_matrix.py +22 -12
- nextloop-1.1.0rc1/tests/test_finalizer_races.py +235 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_harness.py +1 -3
- nextloop-1.1.0rc1/tests/test_harness_delegation.py +424 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_import_contract.py +7 -13
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_loop.py +39 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_observability.py +2 -2
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_operations.py +82 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_outbox_regressions.py +140 -72
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_pending_inputs.py +179 -60
- nextloop-1.1.0rc1/tests/test_providers.py +359 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_skills.py +1 -11
- nextloop-1.1.0rc1/tests/test_sqlite_safety.py +76 -0
- nextloop-1.1.0rc1/tests/test_store_regressions.py +225 -0
- nextloop-1.1.0rc1/tests/test_validation_cache.py +33 -0
- nextloop-1.0.0/PKG-INFO +0 -278
- nextloop-1.0.0/README.md +0 -249
- nextloop-1.0.0/src/nextloop/adapters/_sqlite.py +0 -31
- nextloop-1.0.0/src/nextloop/adapters/_sse.py +0 -25
- nextloop-1.0.0/src/nextloop/driver.py +0 -658
- nextloop-1.0.0/src/nextloop/events/pending.py +0 -25
- nextloop-1.0.0/src/nextloop/loop.py +0 -819
- nextloop-1.0.0/src/nextloop.egg-info/PKG-INFO +0 -278
- nextloop-1.0.0/tests/test_providers.py +0 -191
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/LICENSE +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/MANIFEST.in +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0001-embeddable-agent-loop.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0002-dsh-aligned-agent-loop.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0003-python-and-centralized-contracts.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0004-event-compatibility.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0006-operation-id.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0008-lease.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0009-outbox.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0010-session-deletion.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/adr/0011-live-provider-acceptance.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/architecture/agent-loop-capability-review.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/architecture/discussion-roadmap.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/architecture/feature-worklist.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/agent-loop.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/react-protocol.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/skills.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/design/verification-matrix.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-02-dsh-primary-sources.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-02-loop-evidence-notes.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-03-hermes-turn-control.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-03-tool-batch-failures.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-03-tool-call-validation.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-03-yomi-turn-control.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-06-open-source-agent-loops.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-06-react-tool-event-recovery.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/docs/research/2026-11-10-nextloop-optimization-review.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/basic.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/harness-skills/echo/SKILL.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/live_smoke.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/python_tools.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/skills/coding/SKILL.md +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/skills_demo.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/workers/cpp_worker.cpp +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/workers/python_worker.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/examples/workers/rust_worker.rs +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/setup.cfg +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/__init__.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/adapters/__init__.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/cli.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/__init__.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/approval.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/input.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/outcome.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/repair.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/response.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/trace.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/trace_ids.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/events/upcast.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/__init__.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/cancellation.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/cleanup.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/composite.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/mcp.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/stdio.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/execute/stdio_transport.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/py.typed +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop/skills.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop.egg-info/dependency_links.txt +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop.egg-info/entry_points.txt +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop.egg-info/requires.txt +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/src/nextloop.egg-info/top_level.txt +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_aggregate_close.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_approval_regressions.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_cli.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_compaction_lineage.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_complexity_regressions.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_correctness_regressions.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_deletion.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_failures.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_fault_injection.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_harness_injection.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_lease.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_mcp.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_mcp_hardening.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_observability_close_deadline.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_outbox.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_preview.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_projection_parity.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_provider_terminal.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_result_budget_regressions.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_result_policies.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_retry_regressions.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_review_regressions.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_stdio.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_stdio_cleanup.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_stdio_frames.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_stdio_safety.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_store_contract.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_stores.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_surface_snapshot.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_upcasting.py +0 -0
- {nextloop-1.0.0 → nextloop-1.1.0rc1}/tests/test_worker_conformance.py +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nextloop
|
|
3
|
+
Version: 1.1.0rc1
|
|
4
|
+
Summary: An embeddable AgentLoop with explicit event, tool, recovery, and delivery semantics
|
|
5
|
+
Author-email: 12bitsD <bis12@163.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/12bitsD/nextloop
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: httpx<1,>=0.27
|
|
19
|
+
Requires-Dist: jsonschema<5,>=4.23
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: build<2,>=1.2; extra == "dev"
|
|
22
|
+
Requires-Dist: mypy<2,>=1.13; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest<10,>=8; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-asyncio<2,>=0.24; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff<1,>=0.8; extra == "dev"
|
|
26
|
+
Requires-Dist: twine<7,>=5; extra == "dev"
|
|
27
|
+
Requires-Dist: types-jsonschema<5,>=4.23; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
<picture>
|
|
33
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/wordmark-dark.svg">
|
|
34
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/wordmark-light.svg">
|
|
35
|
+
<img alt="nextloop — Python agent execution library" src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/wordmark-light.svg" width="800" height="200" fetchpriority="high">
|
|
36
|
+
</picture>
|
|
37
|
+
|
|
38
|
+
<p>
|
|
39
|
+
<a href="https://github.com/12bitsD/nextloop/actions/workflows/ci.yml"><img alt="CI status" src="https://img.shields.io/github/actions/workflow/status/12bitsD/nextloop/ci.yml?branch=main&style=flat-square&label=CI&color=black"></a>
|
|
40
|
+
<a href="https://pypi.org/project/nextloop/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/nextloop?style=flat-square&color=black"></a>
|
|
41
|
+
<a href="https://pypi.org/project/nextloop/"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/nextloop?style=flat-square&color=black"></a>
|
|
42
|
+
<a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-black?style=flat-square"></a>
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<p>
|
|
46
|
+
<a href="docs/tutorial.md">Tutorial</a> ·
|
|
47
|
+
<a href="docs/design/harness.md">Configuration</a> ·
|
|
48
|
+
<a href="docs/design/loop-interface.md">API</a> ·
|
|
49
|
+
<a href="docs/design/guarantees.md">Guarantees</a> ·
|
|
50
|
+
<a href="CONTRIBUTING.md">Contributing</a>
|
|
51
|
+
</p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
nextloop is a Python library for building agent applications. It coordinates model calls and tool execution, and records what happens during each run.
|
|
55
|
+
|
|
56
|
+
These records let you inspect a run and recover after a process crash. During recovery, nextloop does not automatically run a dispatched tool again.
|
|
57
|
+
|
|
58
|
+
Your application provides the model, tools, storage, and delivery method.
|
|
59
|
+
|
|
60
|
+
<div align="center">
|
|
61
|
+
<picture>
|
|
62
|
+
<source media="(max-width: 600px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-compact-dark.svg">
|
|
63
|
+
<source media="(max-width: 600px) and (prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-compact-light.svg">
|
|
64
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-dark.svg">
|
|
65
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-light.svg">
|
|
66
|
+
<img alt="Execution path: input, model, tool, model, and delivery, with each stage recorded in event history" src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-light.svg" width="900" loading="lazy">
|
|
67
|
+
</picture>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
## Quickstart
|
|
71
|
+
|
|
72
|
+
<table role="presentation">
|
|
73
|
+
<tr>
|
|
74
|
+
<td width="50%" valign="top">
|
|
75
|
+
<strong>01 / Install</strong><br>
|
|
76
|
+
Python 3.11 or later is required.
|
|
77
|
+
<pre><code>python -m pip install nextloop</code></pre>
|
|
78
|
+
</td>
|
|
79
|
+
<td width="50%" valign="top">
|
|
80
|
+
<strong>02 / Run the example</strong><br>
|
|
81
|
+
Run from a source checkout. No API key is needed.
|
|
82
|
+
<pre><code>python examples/basic.py</code></pre>
|
|
83
|
+
</td>
|
|
84
|
+
</tr>
|
|
85
|
+
</table>
|
|
86
|
+
|
|
87
|
+
The example prints `hello from nextloop` after completing a two-Step Tool round trip.
|
|
88
|
+
|
|
89
|
+
Follow [Your first AgentLoop](docs/tutorial.md) to build the same model → Tool → model → Delivery run yourself. The tutorial also shows how to connect a hosted model with `Harness` and `harness.toml`.
|
|
90
|
+
|
|
91
|
+
## What nextloop provides
|
|
92
|
+
|
|
93
|
+
<table role="presentation">
|
|
94
|
+
<tr>
|
|
95
|
+
<td width="50%" valign="top">
|
|
96
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/history.svg" width="36" height="36" alt="">
|
|
97
|
+
<br>
|
|
98
|
+
<strong>Execution history</strong><br>
|
|
99
|
+
Record model calls, tool calls, results, and final responses. Query history or export traces.
|
|
100
|
+
</td>
|
|
101
|
+
<td width="50%" valign="top">
|
|
102
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/recovery.svg" width="36" height="36" alt="">
|
|
103
|
+
<br>
|
|
104
|
+
<strong>Crash recovery</strong><br>
|
|
105
|
+
See completed and uncertain operations. Redeliver committed responses without rerunning the model or tools.
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
<tr>
|
|
109
|
+
<td width="50%" valign="top">
|
|
110
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/integration.svg" width="36" height="36" alt="">
|
|
111
|
+
<br>
|
|
112
|
+
<strong>Tool and model integration</strong><br>
|
|
113
|
+
Use Python, MCP, Rust, or C++ tools. OpenAI-compatible and Anthropic providers are included. Custom adapters are supported.
|
|
114
|
+
</td>
|
|
115
|
+
<td width="50%" valign="top">
|
|
116
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/limits.svg" width="36" height="36" alt="">
|
|
117
|
+
<br>
|
|
118
|
+
<strong>Execution limits</strong><br>
|
|
119
|
+
Limit steps, model calls, tool calls, tokens, and running time.
|
|
120
|
+
</td>
|
|
121
|
+
</tr>
|
|
122
|
+
<tr>
|
|
123
|
+
<td width="50%" valign="top">
|
|
124
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/results.svg" width="36" height="36" alt="">
|
|
125
|
+
<br>
|
|
126
|
+
<strong>Large tool results</strong><br>
|
|
127
|
+
Show previews or pages to the model. Keep full results available for later reads.
|
|
128
|
+
</td>
|
|
129
|
+
<td width="50%" valign="top">
|
|
130
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/streaming.svg" width="36" height="36" alt="">
|
|
131
|
+
<br>
|
|
132
|
+
<strong>Streaming previews</strong><br>
|
|
133
|
+
Stream output without executing partial tool calls, changing event history, or replacing the final response.
|
|
134
|
+
</td>
|
|
135
|
+
</tr>
|
|
136
|
+
</table>
|
|
137
|
+
|
|
138
|
+
nextloop does not provide an HTTP service or multi-agent orchestration. Your application controls execution, delivery, and recovery decisions. Harness delegates the complete run, approval-resume, reconciliation, pending-input, resource-lock, recovery, and deletion workflow, while Event logs remain the sole execution authority. Long Turns use pure Conversation Projection with cross-Store parity checks.
|
|
139
|
+
|
|
140
|
+
## Documentation
|
|
141
|
+
|
|
142
|
+
<table role="presentation">
|
|
143
|
+
<tr>
|
|
144
|
+
<td width="30%" valign="top">
|
|
145
|
+
<strong>Get started</strong><br>
|
|
146
|
+
<a href="docs/tutorial.md">Your first AgentLoop</a><br>
|
|
147
|
+
<a href="docs/design/harness.md">Harness configuration</a><br>
|
|
148
|
+
<a href="docs/design/loop-interface.md">Public API and adapters</a>
|
|
149
|
+
</td>
|
|
150
|
+
<td width="40%" valign="top">
|
|
151
|
+
<strong>Understand the runtime</strong><br>
|
|
152
|
+
<a href="docs/design/architecture.md">Architecture</a><br>
|
|
153
|
+
<a href="docs/design/agent-loop.md">AgentLoop design</a><br>
|
|
154
|
+
<a href="docs/design/guarantees.md">Guarantees</a><br>
|
|
155
|
+
<a href="CONTEXT.md">Domain glossary</a><br>
|
|
156
|
+
<a href="docs/adr/">Design decisions</a>
|
|
157
|
+
</td>
|
|
158
|
+
<td width="30%" valign="top">
|
|
159
|
+
<strong>Verify and develop</strong><br>
|
|
160
|
+
<a href="docs/design/verification-matrix.md">Verification matrix</a><br>
|
|
161
|
+
<a href="CONTRIBUTING.md">Contributing</a><br>
|
|
162
|
+
<a href="CHANGELOG.md">Changelog</a><br>
|
|
163
|
+
<a href="SECURITY.md">Security</a>
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
</table>
|
|
167
|
+
|
|
168
|
+
## Release and security
|
|
169
|
+
|
|
170
|
+
<table role="presentation">
|
|
171
|
+
<tr>
|
|
172
|
+
<td valign="top">
|
|
173
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/testing.svg" width="36" height="36" alt="">
|
|
174
|
+
<br>
|
|
175
|
+
<strong>Python support</strong><br>
|
|
176
|
+
CI covers Python 3.11, 3.12, 3.13, and 3.14.
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
<tr>
|
|
180
|
+
<td valign="top">
|
|
181
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/release.svg" width="36" height="36" alt="">
|
|
182
|
+
<br>
|
|
183
|
+
<strong>Tagged releases</strong><br>
|
|
184
|
+
A <code>v*</code> tag verifies the package and benchmark, publishes wheel and sdist to PyPI through Trusted Publishing, and creates a GitHub Release.
|
|
185
|
+
</td>
|
|
186
|
+
</tr>
|
|
187
|
+
<tr>
|
|
188
|
+
<td valign="top">
|
|
189
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/security.svg" width="36" height="36" alt="">
|
|
190
|
+
<br>
|
|
191
|
+
<strong>Public repository</strong><br>
|
|
192
|
+
Do not commit credentials, private trajectories, internal endpoints, or personal data.
|
|
193
|
+
</td>
|
|
194
|
+
</tr>
|
|
195
|
+
</table>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/wordmark-dark.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/wordmark-light.svg">
|
|
6
|
+
<img alt="nextloop — Python agent execution library" src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/wordmark-light.svg" width="800" height="200" fetchpriority="high">
|
|
7
|
+
</picture>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<a href="https://github.com/12bitsD/nextloop/actions/workflows/ci.yml"><img alt="CI status" src="https://img.shields.io/github/actions/workflow/status/12bitsD/nextloop/ci.yml?branch=main&style=flat-square&label=CI&color=black"></a>
|
|
11
|
+
<a href="https://pypi.org/project/nextloop/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/nextloop?style=flat-square&color=black"></a>
|
|
12
|
+
<a href="https://pypi.org/project/nextloop/"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/nextloop?style=flat-square&color=black"></a>
|
|
13
|
+
<a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-black?style=flat-square"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<a href="docs/tutorial.md">Tutorial</a> ·
|
|
18
|
+
<a href="docs/design/harness.md">Configuration</a> ·
|
|
19
|
+
<a href="docs/design/loop-interface.md">API</a> ·
|
|
20
|
+
<a href="docs/design/guarantees.md">Guarantees</a> ·
|
|
21
|
+
<a href="CONTRIBUTING.md">Contributing</a>
|
|
22
|
+
</p>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
nextloop is a Python library for building agent applications. It coordinates model calls and tool execution, and records what happens during each run.
|
|
26
|
+
|
|
27
|
+
These records let you inspect a run and recover after a process crash. During recovery, nextloop does not automatically run a dispatched tool again.
|
|
28
|
+
|
|
29
|
+
Your application provides the model, tools, storage, and delivery method.
|
|
30
|
+
|
|
31
|
+
<div align="center">
|
|
32
|
+
<picture>
|
|
33
|
+
<source media="(max-width: 600px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-compact-dark.svg">
|
|
34
|
+
<source media="(max-width: 600px) and (prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-compact-light.svg">
|
|
35
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-dark.svg">
|
|
36
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-light.svg">
|
|
37
|
+
<img alt="Execution path: input, model, tool, model, and delivery, with each stage recorded in event history" src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/steps-light.svg" width="900" loading="lazy">
|
|
38
|
+
</picture>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
## Quickstart
|
|
42
|
+
|
|
43
|
+
<table role="presentation">
|
|
44
|
+
<tr>
|
|
45
|
+
<td width="50%" valign="top">
|
|
46
|
+
<strong>01 / Install</strong><br>
|
|
47
|
+
Python 3.11 or later is required.
|
|
48
|
+
<pre><code>python -m pip install nextloop</code></pre>
|
|
49
|
+
</td>
|
|
50
|
+
<td width="50%" valign="top">
|
|
51
|
+
<strong>02 / Run the example</strong><br>
|
|
52
|
+
Run from a source checkout. No API key is needed.
|
|
53
|
+
<pre><code>python examples/basic.py</code></pre>
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</table>
|
|
57
|
+
|
|
58
|
+
The example prints `hello from nextloop` after completing a two-Step Tool round trip.
|
|
59
|
+
|
|
60
|
+
Follow [Your first AgentLoop](docs/tutorial.md) to build the same model → Tool → model → Delivery run yourself. The tutorial also shows how to connect a hosted model with `Harness` and `harness.toml`.
|
|
61
|
+
|
|
62
|
+
## What nextloop provides
|
|
63
|
+
|
|
64
|
+
<table role="presentation">
|
|
65
|
+
<tr>
|
|
66
|
+
<td width="50%" valign="top">
|
|
67
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/history.svg" width="36" height="36" alt="">
|
|
68
|
+
<br>
|
|
69
|
+
<strong>Execution history</strong><br>
|
|
70
|
+
Record model calls, tool calls, results, and final responses. Query history or export traces.
|
|
71
|
+
</td>
|
|
72
|
+
<td width="50%" valign="top">
|
|
73
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/recovery.svg" width="36" height="36" alt="">
|
|
74
|
+
<br>
|
|
75
|
+
<strong>Crash recovery</strong><br>
|
|
76
|
+
See completed and uncertain operations. Redeliver committed responses without rerunning the model or tools.
|
|
77
|
+
</td>
|
|
78
|
+
</tr>
|
|
79
|
+
<tr>
|
|
80
|
+
<td width="50%" valign="top">
|
|
81
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/integration.svg" width="36" height="36" alt="">
|
|
82
|
+
<br>
|
|
83
|
+
<strong>Tool and model integration</strong><br>
|
|
84
|
+
Use Python, MCP, Rust, or C++ tools. OpenAI-compatible and Anthropic providers are included. Custom adapters are supported.
|
|
85
|
+
</td>
|
|
86
|
+
<td width="50%" valign="top">
|
|
87
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/limits.svg" width="36" height="36" alt="">
|
|
88
|
+
<br>
|
|
89
|
+
<strong>Execution limits</strong><br>
|
|
90
|
+
Limit steps, model calls, tool calls, tokens, and running time.
|
|
91
|
+
</td>
|
|
92
|
+
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td width="50%" valign="top">
|
|
95
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/results.svg" width="36" height="36" alt="">
|
|
96
|
+
<br>
|
|
97
|
+
<strong>Large tool results</strong><br>
|
|
98
|
+
Show previews or pages to the model. Keep full results available for later reads.
|
|
99
|
+
</td>
|
|
100
|
+
<td width="50%" valign="top">
|
|
101
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/streaming.svg" width="36" height="36" alt="">
|
|
102
|
+
<br>
|
|
103
|
+
<strong>Streaming previews</strong><br>
|
|
104
|
+
Stream output without executing partial tool calls, changing event history, or replacing the final response.
|
|
105
|
+
</td>
|
|
106
|
+
</tr>
|
|
107
|
+
</table>
|
|
108
|
+
|
|
109
|
+
nextloop does not provide an HTTP service or multi-agent orchestration. Your application controls execution, delivery, and recovery decisions. Harness delegates the complete run, approval-resume, reconciliation, pending-input, resource-lock, recovery, and deletion workflow, while Event logs remain the sole execution authority. Long Turns use pure Conversation Projection with cross-Store parity checks.
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
<table role="presentation">
|
|
114
|
+
<tr>
|
|
115
|
+
<td width="30%" valign="top">
|
|
116
|
+
<strong>Get started</strong><br>
|
|
117
|
+
<a href="docs/tutorial.md">Your first AgentLoop</a><br>
|
|
118
|
+
<a href="docs/design/harness.md">Harness configuration</a><br>
|
|
119
|
+
<a href="docs/design/loop-interface.md">Public API and adapters</a>
|
|
120
|
+
</td>
|
|
121
|
+
<td width="40%" valign="top">
|
|
122
|
+
<strong>Understand the runtime</strong><br>
|
|
123
|
+
<a href="docs/design/architecture.md">Architecture</a><br>
|
|
124
|
+
<a href="docs/design/agent-loop.md">AgentLoop design</a><br>
|
|
125
|
+
<a href="docs/design/guarantees.md">Guarantees</a><br>
|
|
126
|
+
<a href="CONTEXT.md">Domain glossary</a><br>
|
|
127
|
+
<a href="docs/adr/">Design decisions</a>
|
|
128
|
+
</td>
|
|
129
|
+
<td width="30%" valign="top">
|
|
130
|
+
<strong>Verify and develop</strong><br>
|
|
131
|
+
<a href="docs/design/verification-matrix.md">Verification matrix</a><br>
|
|
132
|
+
<a href="CONTRIBUTING.md">Contributing</a><br>
|
|
133
|
+
<a href="CHANGELOG.md">Changelog</a><br>
|
|
134
|
+
<a href="SECURITY.md">Security</a>
|
|
135
|
+
</td>
|
|
136
|
+
</tr>
|
|
137
|
+
</table>
|
|
138
|
+
|
|
139
|
+
## Release and security
|
|
140
|
+
|
|
141
|
+
<table role="presentation">
|
|
142
|
+
<tr>
|
|
143
|
+
<td valign="top">
|
|
144
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/testing.svg" width="36" height="36" alt="">
|
|
145
|
+
<br>
|
|
146
|
+
<strong>Python support</strong><br>
|
|
147
|
+
CI covers Python 3.11, 3.12, 3.13, and 3.14.
|
|
148
|
+
</td>
|
|
149
|
+
</tr>
|
|
150
|
+
<tr>
|
|
151
|
+
<td valign="top">
|
|
152
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/release.svg" width="36" height="36" alt="">
|
|
153
|
+
<br>
|
|
154
|
+
<strong>Tagged releases</strong><br>
|
|
155
|
+
A <code>v*</code> tag verifies the package and benchmark, publishes wheel and sdist to PyPI through Trusted Publishing, and creates a GitHub Release.
|
|
156
|
+
</td>
|
|
157
|
+
</tr>
|
|
158
|
+
<tr>
|
|
159
|
+
<td valign="top">
|
|
160
|
+
<img src="https://raw.githubusercontent.com/12bitsD/nextloop/main/docs/assets/icons/security.svg" width="36" height="36" alt="">
|
|
161
|
+
<br>
|
|
162
|
+
<strong>Public repository</strong><br>
|
|
163
|
+
Do not commit credentials, private trajectories, internal endpoints, or personal data.
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
</table>
|
|
@@ -20,7 +20,7 @@ The event log is the sole source of truth. The actor inbox is only a wake-up sig
|
|
|
20
20
|
- Pending is queryable with `input_id`, original seq, original Turn, and content. No cleanup event is introduced in this version.
|
|
21
21
|
- `recover()` may be called repeatedly without duplicating Pending. A crash between recover and run has the same projection.
|
|
22
22
|
|
|
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.
|
|
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. For initial input, an already successfully completed retry with identical content is a no-op that returns the original TurnOutcome; failed, cancelled, blocked, interrupted, or still-Pending work may start a new Turn. Identical steer retries do not duplicate accepted input. The same ID with different content is rejected before a new INPUT_ACCEPTED is committed, so the original Pending content is preserved.
|
|
24
24
|
|
|
25
25
|
No cleanup event is introduced. Pending remains visible until the caller consumes it or the protocol later defines an explicit discard fact.
|
|
26
26
|
|
|
@@ -8,7 +8,7 @@ TOOL_CALL is a dispatch-boundary fact, not a Tool Intent. Approval must be decid
|
|
|
8
8
|
|
|
9
9
|
## Decision
|
|
10
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.
|
|
11
|
+
- `ApprovalPolicy(version, predicate=None, expires_after_seconds=None)` is a ToolSpec declaration. Versions must be non-empty so ordinary items and policy-bound items remain distinguishable; empty versions are rejected at declaration. A missing policy needs no approval; a missing predicate always requires it; a predicate is a pure argument callback.
|
|
12
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
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
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nextloop development and verification plan
|
|
2
2
|
|
|
3
|
-
Current stage: **1.
|
|
3
|
+
Current stage: **1.1.0rc1 release verification**. `1.0.0` is published; the maintainer-selected DeepSeek live gate is defined by ADR-0011.
|
|
4
4
|
|
|
5
5
|
## Delivery order
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ This map records reusable execution requirements and verification ownership. No
|
|
|
10
10
|
| L4 | Reject malformed Tool proposals before any side effect | [Tool admission](../design/agent-loop.md#6-tool-admission-and-parallel-scheduling) | **Design closed.** Zero execution and legal correction feedback for every invalid class |
|
|
11
11
|
| L5 | Continue after ordinary Tool errors without hiding failure | [Observation](../design/agent-loop.md#7-observation-contract) | **Design closed.** Actual results, independent continuation and dependent-action tests |
|
|
12
12
|
| L6 | Handle parallel calls, timeout and unknown effects without duplicate work | [Scheduling](../design/agent-loop.md#6-tool-admission-and-parallel-scheduling) | **Design closed.** Pool/barrier, unknown close, admission, persistent restrictions and no replay |
|
|
13
|
-
| L7 | Preserve prior provider-visible content and maximize cache reuse | [ContextBuilder](../design/context-builder.md) | **
|
|
13
|
+
| L7 | Preserve prior provider-visible content and maximize cache reuse | [ContextBuilder](../design/context-builder.md) | **Implemented.** Canonical parity, pure projection equivalence across Stores, frozen Compaction snapshots, exact retry and long-Turn benchmarks |
|
|
14
14
|
| L8 | Keep one active WorkingContext and reconstruct it after compaction | [WorkingContext](../design/context-builder.md#workingcontext-is-append-versioned) | **Design closed.** Idempotency, expiry, event order and compaction-position tests |
|
|
15
15
|
| L9 | Prevent oversized requests and compact only when useful | [Usage and compaction](../design/context-builder.md#usage-and-preflight) | **Design closed.** Usage fallbacks, thresholds, summary validation and continuation tests |
|
|
16
16
|
| L10 | Prompt convergence on long turns without forced termination or budget-tool bloat | [Step pacing watermark](../design/context-builder.md#step-pacing-watermark-replaces-litepropromax-budget-profiles) | **Design closed.** Zero-tool Step 15 pacing hint injected into Tool Results |
|
|
@@ -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) | **1.
|
|
24
|
+
| L17 | Package and release only after protocol verification | [Development plan](development-plan.md), [ADR-0003](../adr/0003-python-and-centralized-contracts.md) | **1.1.0rc1 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
|
|
|
@@ -36,9 +36,9 @@ Owner leases are optional. Same-owner restarts take over immediately; different
|
|
|
36
36
|
|
|
37
37
|
## Complexity boundaries
|
|
38
38
|
|
|
39
|
-
Conversation projection
|
|
39
|
+
Conversation projection loads the current Surface once per Turn and uses the pure projection fold for each model request. Rejected batches, approval-result anchors, Pending inputs, and WorkingContext are collected in one facts pass before messages are built. Surface storage advances by append without repeatedly copying the event tuple, and Compaction snapshots the committed Surface before awaiting a summary so concurrent steer cannot alter its source range. An incremental message-cache prototype was not retained because its 100-Step improvement did not meet the required 50% threshold on both Store backends.
|
|
40
40
|
|
|
41
|
-
Pending Input requires an ordered log scan. A new Turn
|
|
41
|
+
Pending Input requires an ordered log scan. A new Turn performs that scan once; it is not an O(1) operation. Canonical request bytes are cached per immutable `CandidateRequest`, and the Memory Store maintains an event-ID index without copying the historical ID set on each append. Trace replay is linear in processed events and payload size. Incremental and whole-history Trace projection use the same fold.
|
|
42
42
|
|
|
43
43
|
Run the 10,505-event parity benchmark with:
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ Run the 10,505-event parity benchmark with:
|
|
|
46
46
|
.venv/bin/python tests/projection_benchmark.py
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
The benchmark checks Memory/SQLite Conversation Projection parity, Model/Tool Trace payload parity, and incremental/whole-history Trace parity. Explicit canaries require the Compaction summary, assistant output, Tool arguments/results, and final content to survive projection; identical erased outputs do not pass. Timings are measurements, not a cross-machine latency guarantee.
|
|
49
|
+
The benchmark checks Memory/SQLite Conversation Projection parity, Model/Tool Trace payload parity, and incremental/whole-history Trace parity. Explicit canaries require the Compaction summary, assistant output, Tool arguments/results, and final content to survive projection; identical erased outputs do not pass. `tests/turn_projection_benchmark.py` measures complete 100/400-Step Turns on Memory and SQLite. Timings are measurements, not a cross-machine latency guarantee.
|
|
50
50
|
|
|
51
51
|
## Frozen import contract
|
|
52
52
|
|
|
@@ -14,7 +14,7 @@ A Session and its Trajectory can outlive any individual model request. The provi
|
|
|
14
14
|
|
|
15
15
|
Within one compaction boundary and a fixed set of prompt revisions, previously submitted Tool definitions, system content, and conversation messages remain unchanged. New assistant messages, Tool Calls, Tool Results, user input, steer, and WorkingContext versions are appended rather than inserted into or replacing earlier content.
|
|
16
16
|
|
|
17
|
-
This is a logical provider-visible content-prefix guarantee; canonical serialization and each provider's wire mapping remain M5 implementation-contract work. Compaction creates a new Conversation prefix, while the underlying Trajectory remains append-only and immutable.
|
|
17
|
+
This is a logical provider-visible content-prefix guarantee; canonical serialization and each provider's wire mapping remain M5 implementation-contract work. Compaction creates a new Conversation prefix, while the underlying Trajectory remains append-only and immutable. This prefix rule has two execution-specific exceptions: a committed rejected batch removes or strips its earlier assistant Tool Intent, and Pending Input is folded at the current consumption/approval anchor rather than treated as an already consumed message. The pure projection fold owns those rules.
|
|
18
18
|
|
|
19
19
|
The intended cache model is:
|
|
20
20
|
|
|
@@ -103,7 +103,7 @@ The dedicated [https://github.com/12bitsD/nika/blob/main/docs/design/compaction-
|
|
|
103
103
|
|
|
104
104
|
Compaction starts on user `/compact`, the 75% input threshold, or a preflight capacity violation as defined above. `/compact` runs immediately while Idle and otherwise at the next safe model boundary. A failed or unusable summary is not committed; the previous projection remains and the failure is reported. Provider overflow permits one compaction, not an unbounded sequence. A fresh compaction that still cannot produce an admissible request ends with the error.
|
|
105
105
|
|
|
106
|
-
The next request is normal System Prompt + `AGENTS.md` + the new task summary + the latest active WorkingContext, if any + subsequent messages. Validation requires a nonempty,
|
|
106
|
+
The next request is normal System Prompt + `AGENTS.md` + the new task summary + the latest active WorkingContext, if any + subsequent messages. Validation requires a nonempty result whose canonical UTF-8 representation, together with the retained WorkingContext, is strictly smaller than the replaced Conversation slice (excluding unchanged System Prompt, bootstrap messages, and Tool definitions). It also requires unchanged normal System Prompt and `AGENTS.md`, valid request structure, and successful `I + O` preflight. Runtime state remains in Session, and old Trajectory is never rewritten.
|
|
107
107
|
|
|
108
108
|
### Proactive is a separate mechanism
|
|
109
109
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Guarantees and non-guarantees
|
|
2
|
+
|
|
3
|
+
This page summarizes the public runtime boundaries. The linked design documents and verification matrix define the detailed semantics and their executable evidence.
|
|
4
|
+
|
|
5
|
+
| Area | Guarantee | Not a guarantee |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| 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. `steer_result` exposes structured rejection reasons. | Automatic deduplication when callers retry with a different or missing ID. |
|
|
8
|
+
| Writer lease | Optional owner/epoch/expiry checks with heartbeat, same-owner restart, expiry or forced takeover, and spawn-verified same-host contention. Legacy behavior remains when no owner is configured. | Distributed locks, cross-host leases, or execution after an expired/stale writer check. |
|
|
9
|
+
| Delivery | Delivery is at least once; DeliveryOwner must deduplicate by stable `final_message_id`. | Exactly-once delivery or delivery without an idempotent owner. |
|
|
10
|
+
| 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. |
|
|
11
|
+
| 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. |
|
|
12
|
+
| 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. |
|
|
13
|
+
| 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. |
|
|
14
|
+
| 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. |
|
|
15
|
+
| Preview | Preview is transient and cannot execute partial Tool arguments. | Preview as a durable EventStore fact or a substitute for committed Delivery. |
|
|
16
|
+
| 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. |
|
|
17
|
+
| 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. |
|
|
18
|
+
| MCP | stdio lifecycle, paginated static catalogs, operation metadata, and uncertain crash handling. | Remote MCP, OAuth, dynamic `listChanged`, or non-text content mapping. |
|
|
19
|
+
|
|
20
|
+
## Release boundaries
|
|
21
|
+
|
|
22
|
+
- nika integration is separate acceptance work.
|
|
23
|
+
- Writer leases coordinate same-host processes only; distributed locks and exactly-once export are not provided.
|
|
24
|
+
- Event-level erasure, external-asset lifecycle, backup/GC, and deletion of third-party copies are not part of this release.
|
|
25
|
+
- 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.
|
|
26
|
+
|
|
27
|
+
## Details and evidence
|
|
28
|
+
|
|
29
|
+
- [Loop interface and ownership](loop-interface.md)
|
|
30
|
+
- [Architecture and invariants](architecture.md)
|
|
31
|
+
- [Harness and extension interface](harness.md)
|
|
32
|
+
- [Verification matrix](verification-matrix.md)
|
|
33
|
+
- [ADR-0011 Live Provider acceptance](../adr/0011-live-provider-acceptance.md)
|
|
@@ -67,13 +67,17 @@ Relative paths are resolved from the configuration file. The API key is read onl
|
|
|
67
67
|
```python
|
|
68
68
|
harness = Harness.load("harness.toml")
|
|
69
69
|
await harness.check()
|
|
70
|
-
outcome = await harness.run("Hello")
|
|
70
|
+
outcome = await harness.run("Hello", input_id="request-1", preview=None)
|
|
71
71
|
await harness.steer("More detail")
|
|
72
72
|
await harness.cancel()
|
|
73
|
-
|
|
73
|
+
pending = await harness.pending_inputs()
|
|
74
|
+
locks = await harness.resource_locks()
|
|
75
|
+
recovery = await harness.recover(force=False)
|
|
74
76
|
await harness.close()
|
|
75
77
|
```
|
|
76
78
|
|
|
79
|
+
`Harness` also thinly delegates `steer_result()`, `resume()`, `retry_operation()`, `resource_locks()`, `release_resource()`, and `delete_session()`. Execution entries share the same checked Tool/Skill context and reuse a Harness-owned Provider. `resume()` accepts decisions or `reject_all`, optional replacement input, `input_id`, and `preview`; `retry_operation()` preserves the original operation ID. `delete_session()` deletes only EventStore state; an independently constructed SQLiteOutbox retains its separate explicit cleanup contract.
|
|
80
|
+
|
|
77
81
|
Skills remain instructions only. Their metadata is added to the system prompt, and the read-only `skill_view` Tool loads a body on demand. Loading a Skill never runs adjacent scripts or expands Tool permissions.
|
|
78
82
|
|
|
79
83
|
## Adapter injection and ownership
|
|
@@ -96,17 +100,17 @@ Python ToolSpecs can declare `ApprovalPolicy(version, predicate=None, expires_af
|
|
|
96
100
|
|
|
97
101
|
## Pending Input
|
|
98
102
|
|
|
99
|
-
The event log is the sole source of truth for accepted input. `AgentLoop.pending_inputs(session_id, store)` returns accepted inputs that have not been consumed by a USER_MESSAGE, ordered by their
|
|
103
|
+
The event log is the sole source of truth for accepted input. `AgentLoop.pending_inputs(session_id, store)` returns accepted inputs that have not been consumed by a USER_MESSAGE, ordered by their latest acceptance seq. Reaccepting an ID after consumption reopens Pending; a USER_MESSAGE consumes only that ID. The next Turn loads these inputs from the log and commits their USER_MESSAGE consumption at its first Step boundary; `recover()` itself does not rebuild an in-memory inbox. Callers must provide a stable `input_id` to deduplicate retries or query Pending before retrying.
|
|
100
104
|
|
|
101
105
|
```python
|
|
102
106
|
pending = await loop.pending_inputs("session-id", store)
|
|
103
107
|
```
|
|
104
108
|
|
|
105
|
-
Pending historical inputs appear before the new Turn's initial input. Inputs from cancelled or budget-terminated Turns carry forward by default. Repeated recovery and a crash between recover and run do not duplicate them. Explicit IDs must be non-empty.
|
|
109
|
+
Pending historical inputs appear before the new Turn's initial input. Inputs from cancelled or budget-terminated Turns carry forward by default. Repeated recovery and a crash between recover and run do not duplicate them. Explicit IDs must be non-empty. For an already successful initial input, the same ID with identical content returns the original TurnOutcome without new execution; unfinished or unsuccessful work may start a new Turn. Different content is rejected without consuming or replacing the original Pending input.
|
|
106
110
|
|
|
107
111
|
## Budgets and Tool Results
|
|
108
112
|
|
|
109
|
-
All budget fields default to `None`. Step, model-attempt, and validated Tool-batch limits stop the next side effect. Model attempts include retries and compaction. Token limits use Provider-reported usage and fail closed when required usage is missing or invalid. `turn_deadline_seconds` reuses cancellation and uncertain Tool semantics. Budgets are Turn-local; recovery closes an interrupted Turn and a later Turn gets a new budget.
|
|
113
|
+
All budget fields default to `None`. Step, model-attempt, and validated Tool-batch limits stop the next side effect. `max_tool_calls = 0` disables Tool dispatch; `output_reserve = 0` and `pacing_step_interval = 0` retain their direct LoopConfig meanings in TOML as well. Model attempts include retries and compaction. Token limits use Provider-reported usage and fail closed when required usage is missing or invalid. `turn_deadline_seconds` reuses cancellation and uncertain Tool semantics. Budgets are Turn-local; recovery closes an interrupted Turn and a later Turn gets a new budget.
|
|
110
114
|
|
|
111
115
|
`ToolSpec.result_mode` supports `PREVIEW`, `PAGED`, and `FULL`, with `PREVIEW` as the default. Small results are unchanged. Large previews retain UTF-8-safe head/tail content and an `event_id`; pages are continuous. The durable outcome retains full content while the model Message contains the projection. `read_tool_result` reads committed content from the recovery log by `event_id`, UTF-8 byte offset, and bounded limit. FULL and terminal results are not generically truncated; exceeding the hard limit commits the full result and ends the Turn as failed without final delivery.
|
|
112
116
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Loop interface and ownership
|
|
2
2
|
|
|
3
|
-
Status: **v1.1 implemented for 1.
|
|
3
|
+
Status: **v1.1 implemented for 1.1.0rc1**, with public contracts in `src/nextloop/contracts.py`.
|
|
4
4
|
|
|
5
5
|
## Independence and version dependency
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ Third-party implementations must pass `nextloop.testing.check_event_store()`. Wr
|
|
|
54
54
|
|
|
55
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
56
|
|
|
57
|
-
Initial input and explicit steer IDs must be non-empty.
|
|
57
|
+
Initial input and explicit steer IDs must be non-empty. For an already successful initial input, reusing the ID with identical content returns the original TurnOutcome without new execution; unfinished or unsuccessful work may start a new Turn. Identical steer retries do not duplicate accepted input. Reusing any ID with different content raises `InvariantViolation` before a new INPUT_ACCEPTED is committed, preserving the original Pending input.
|
|
58
58
|
|
|
59
59
|
### 2. ModelProvider
|
|
60
60
|
|