pi-durable-python 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. pi_durable_python-1.3.0/.github/workflows/ci.yml +124 -0
  2. pi_durable_python-1.3.0/.gitignore +222 -0
  3. pi_durable_python-1.3.0/AGENTS.md +13 -0
  4. pi_durable_python-1.3.0/GLOSSARY.md +75 -0
  5. pi_durable_python-1.3.0/LICENSE +21 -0
  6. pi_durable_python-1.3.0/PARITY.md +860 -0
  7. pi_durable_python-1.3.0/PKG-INFO +276 -0
  8. pi_durable_python-1.3.0/README.md +238 -0
  9. pi_durable_python-1.3.0/docs/adr/0001-parity-baseline-and-boundary.md +32 -0
  10. pi_durable_python-1.3.0/docs/agents/domain.md +51 -0
  11. pi_durable_python-1.3.0/docs/agents/issue-tracker.md +57 -0
  12. pi_durable_python-1.3.0/docs/agents/triage-labels.md +15 -0
  13. pi_durable_python-1.3.0/docs/parity-report.md +178 -0
  14. pi_durable_python-1.3.0/docs/release-notes-1.3.0.md +63 -0
  15. pi_durable_python-1.3.0/docs/release.md +127 -0
  16. pi_durable_python-1.3.0/docs/upstream/LICENSE +21 -0
  17. pi_durable_python-1.3.0/docs/upstream/README.md +21 -0
  18. pi_durable_python-1.3.0/docs/upstream/spec-1.3.0.md +5361 -0
  19. pi_durable_python-1.3.0/docs/usage.md +631 -0
  20. pi_durable_python-1.3.0/pyproject.toml +121 -0
  21. pi_durable_python-1.3.0/src/pi_durable/__init__.py +320 -0
  22. pi_durable_python-1.3.0/src/pi_durable/context.py +328 -0
  23. pi_durable_python-1.3.0/src/pi_durable/delta.py +269 -0
  24. pi_durable_python-1.3.0/src/pi_durable/documents.py +366 -0
  25. pi_durable_python-1.3.0/src/pi_durable/entries.py +66 -0
  26. pi_durable_python-1.3.0/src/pi_durable/env/__init__.py +408 -0
  27. pi_durable_python-1.3.0/src/pi_durable/env/decode.py +48 -0
  28. pi_durable_python-1.3.0/src/pi_durable/env/line_scan.py +190 -0
  29. pi_durable_python-1.3.0/src/pi_durable/env/posix.py +1547 -0
  30. pi_durable_python-1.3.0/src/pi_durable/errors.py +89 -0
  31. pi_durable_python-1.3.0/src/pi_durable/harness/__init__.py +1 -0
  32. pi_durable_python-1.3.0/src/pi_durable/harness/agent.py +344 -0
  33. pi_durable_python-1.3.0/src/pi_durable/harness/compaction.py +673 -0
  34. pi_durable_python-1.3.0/src/pi_durable/harness/context.py +515 -0
  35. pi_durable_python-1.3.0/src/pi_durable/harness/define.py +111 -0
  36. pi_durable_python-1.3.0/src/pi_durable/harness/events.py +766 -0
  37. pi_durable_python-1.3.0/src/pi_durable/harness/generation.py +1079 -0
  38. pi_durable_python-1.3.0/src/pi_durable/harness/harness.py +570 -0
  39. pi_durable_python-1.3.0/src/pi_durable/harness/inbox.py +255 -0
  40. pi_durable_python-1.3.0/src/pi_durable/harness/live.py +374 -0
  41. pi_durable_python-1.3.0/src/pi_durable/harness/output.py +467 -0
  42. pi_durable_python-1.3.0/src/pi_durable/harness/prompt.py +288 -0
  43. pi_durable_python-1.3.0/src/pi_durable/harness/provider.py +78 -0
  44. pi_durable_python-1.3.0/src/pi_durable/harness/registry.py +136 -0
  45. pi_durable_python-1.3.0/src/pi_durable/harness/scheduler.py +1977 -0
  46. pi_durable_python-1.3.0/src/pi_durable/harness/submissions.py +357 -0
  47. pi_durable_python-1.3.0/src/pi_durable/harness/task_graph.py +334 -0
  48. pi_durable_python-1.3.0/src/pi_durable/harness/tool.py +1365 -0
  49. pi_durable_python-1.3.0/src/pi_durable/harness/types.py +772 -0
  50. pi_durable_python-1.3.0/src/pi_durable/harness/usage.py +88 -0
  51. pi_durable_python-1.3.0/src/pi_durable/harness/util.py +204 -0
  52. pi_durable_python-1.3.0/src/pi_durable/harness/validation.py +460 -0
  53. pi_durable_python-1.3.0/src/pi_durable/harness/view.py +324 -0
  54. pi_durable_python-1.3.0/src/pi_durable/ids.py +63 -0
  55. pi_durable_python-1.3.0/src/pi_durable/json.py +186 -0
  56. pi_durable_python-1.3.0/src/pi_durable/providers/__init__.py +362 -0
  57. pi_durable_python-1.3.0/src/pi_durable/providers/anthropic.py +603 -0
  58. pi_durable_python-1.3.0/src/pi_durable/providers/base.py +97 -0
  59. pi_durable_python-1.3.0/src/pi_durable/providers/json_parse.py +117 -0
  60. pi_durable_python-1.3.0/src/pi_durable/providers/openai.py +574 -0
  61. pi_durable_python-1.3.0/src/pi_durable/providers/request.py +35 -0
  62. pi_durable_python-1.3.0/src/pi_durable/providers/retry.py +127 -0
  63. pi_durable_python-1.3.0/src/pi_durable/providers/stream.py +183 -0
  64. pi_durable_python-1.3.0/src/pi_durable/providers/transcript.py +224 -0
  65. pi_durable_python-1.3.0/src/pi_durable/providers/usage.py +58 -0
  66. pi_durable_python-1.3.0/src/pi_durable/py.typed +0 -0
  67. pi_durable_python-1.3.0/src/pi_durable/search.py +115 -0
  68. pi_durable_python-1.3.0/src/pi_durable/session/__init__.py +5 -0
  69. pi_durable_python-1.3.0/src/pi_durable/session/drafts.py +762 -0
  70. pi_durable_python-1.3.0/src/pi_durable/session/forks.py +109 -0
  71. pi_durable_python-1.3.0/src/pi_durable/session/observation.py +374 -0
  72. pi_durable_python-1.3.0/src/pi_durable/session/session.py +1193 -0
  73. pi_durable_python-1.3.0/src/pi_durable/session/transaction.py +1088 -0
  74. pi_durable_python-1.3.0/src/pi_durable/storage/__init__.py +5 -0
  75. pi_durable_python-1.3.0/src/pi_durable/storage/jsonl/__init__.py +15 -0
  76. pi_durable_python-1.3.0/src/pi_durable/storage/jsonl/storage.py +958 -0
  77. pi_durable_python-1.3.0/src/pi_durable/storage/memory.py +889 -0
  78. pi_durable_python-1.3.0/src/pi_durable/storage/scan.py +57 -0
  79. pi_durable_python-1.3.0/src/pi_durable/storage/sqlite/__init__.py +26 -0
  80. pi_durable_python-1.3.0/src/pi_durable/storage/sqlite/database.py +62 -0
  81. pi_durable_python-1.3.0/src/pi_durable/storage/sqlite/migrations.py +191 -0
  82. pi_durable_python-1.3.0/src/pi_durable/storage/sqlite/posix.py +314 -0
  83. pi_durable_python-1.3.0/src/pi_durable/storage/sqlite/schema.py +97 -0
  84. pi_durable_python-1.3.0/src/pi_durable/storage/sqlite/storage.py +1130 -0
  85. pi_durable_python-1.3.0/src/pi_durable/tasks.py +89 -0
  86. pi_durable_python-1.3.0/src/pi_durable/testing/__init__.py +41 -0
  87. pi_durable_python-1.3.0/src/pi_durable/testing/assertions.py +44 -0
  88. pi_durable_python-1.3.0/src/pi_durable/testing/env_conformance.py +828 -0
  89. pi_durable_python-1.3.0/src/pi_durable/testing/runner.py +64 -0
  90. pi_durable_python-1.3.0/src/pi_durable/testing/storage_conformance.py +2008 -0
  91. pi_durable_python-1.3.0/src/pi_durable/testing/types.py +99 -0
  92. pi_durable_python-1.3.0/src/pi_durable/tool_search/__init__.py +159 -0
  93. pi_durable_python-1.3.0/src/pi_durable/tools/__init__.py +81 -0
  94. pi_durable_python-1.3.0/src/pi_durable/tools/_values.py +43 -0
  95. pi_durable_python-1.3.0/src/pi_durable/tools/bash.py +250 -0
  96. pi_durable_python-1.3.0/src/pi_durable/tools/edit.py +214 -0
  97. pi_durable_python-1.3.0/src/pi_durable/tools/edit_diff.py +452 -0
  98. pi_durable_python-1.3.0/src/pi_durable/tools/env.py +19 -0
  99. pi_durable_python-1.3.0/src/pi_durable/tools/file_mutation_queue.py +68 -0
  100. pi_durable_python-1.3.0/src/pi_durable/tools/image.py +248 -0
  101. pi_durable_python-1.3.0/src/pi_durable/tools/image_processor.py +77 -0
  102. pi_durable_python-1.3.0/src/pi_durable/tools/path_utils.py +111 -0
  103. pi_durable_python-1.3.0/src/pi_durable/tools/read.py +506 -0
  104. pi_durable_python-1.3.0/src/pi_durable/tools/write.py +71 -0
  105. pi_durable_python-1.3.0/src/pi_durable/truncate.py +185 -0
  106. pi_durable_python-1.3.0/src/pi_durable/types.py +1297 -0
  107. pi_durable_python-1.3.0/tests/chat_support.py +488 -0
  108. pi_durable_python-1.3.0/tests/conftest.py +16 -0
  109. pi_durable_python-1.3.0/tests/harness_support.py +152 -0
  110. pi_durable_python-1.3.0/tests/provider_support.py +445 -0
  111. pi_durable_python-1.3.0/tests/session_support.py +183 -0
  112. pi_durable_python-1.3.0/tests/storage_support.py +90 -0
  113. pi_durable_python-1.3.0/tests/submission_support.py +207 -0
  114. pi_durable_python-1.3.0/tests/task_support.py +203 -0
  115. pi_durable_python-1.3.0/tests/test_context.py +173 -0
  116. pi_durable_python-1.3.0/tests/test_entries.py +196 -0
  117. pi_durable_python-1.3.0/tests/test_env_conformance.py +75 -0
  118. pi_durable_python-1.3.0/tests/test_env_filesystem.py +186 -0
  119. pi_durable_python-1.3.0/tests/test_env_line_scan.py +131 -0
  120. pi_durable_python-1.3.0/tests/test_env_posix.py +713 -0
  121. pi_durable_python-1.3.0/tests/test_env_truncate.py +106 -0
  122. pi_durable_python-1.3.0/tests/test_errors.py +66 -0
  123. pi_durable_python-1.3.0/tests/test_harness_cancellation_barrier.py +305 -0
  124. pi_durable_python-1.3.0/tests/test_harness_compaction.py +2654 -0
  125. pi_durable_python-1.3.0/tests/test_harness_context.py +447 -0
  126. pi_durable_python-1.3.0/tests/test_harness_context_ranges.py +802 -0
  127. pi_durable_python-1.3.0/tests/test_harness_conversations.py +361 -0
  128. pi_durable_python-1.3.0/tests/test_harness_events.py +1077 -0
  129. pi_durable_python-1.3.0/tests/test_harness_generation.py +1076 -0
  130. pi_durable_python-1.3.0/tests/test_harness_generation_recovery.py +304 -0
  131. pi_durable_python-1.3.0/tests/test_harness_inbox.py +485 -0
  132. pi_durable_python-1.3.0/tests/test_harness_input_entries.py +198 -0
  133. pi_durable_python-1.3.0/tests/test_harness_inspect.py +342 -0
  134. pi_durable_python-1.3.0/tests/test_harness_lifecycle.py +314 -0
  135. pi_durable_python-1.3.0/tests/test_harness_lifecycle_observations.py +207 -0
  136. pi_durable_python-1.3.0/tests/test_harness_live_deltas.py +417 -0
  137. pi_durable_python-1.3.0/tests/test_harness_nested_tools.py +1126 -0
  138. pi_durable_python-1.3.0/tests/test_harness_nested_tools_restart.py +836 -0
  139. pi_durable_python-1.3.0/tests/test_harness_output.py +156 -0
  140. pi_durable_python-1.3.0/tests/test_harness_ownership.py +839 -0
  141. pi_durable_python-1.3.0/tests/test_harness_prompt.py +410 -0
  142. pi_durable_python-1.3.0/tests/test_harness_registry_agent.py +653 -0
  143. pi_durable_python-1.3.0/tests/test_harness_scheduler_indexes.py +335 -0
  144. pi_durable_python-1.3.0/tests/test_harness_scheduler_retention.py +766 -0
  145. pi_durable_python-1.3.0/tests/test_harness_storage_failure.py +732 -0
  146. pi_durable_python-1.3.0/tests/test_harness_structured_cycles.py +377 -0
  147. pi_durable_python-1.3.0/tests/test_harness_structured_output.py +398 -0
  148. pi_durable_python-1.3.0/tests/test_harness_submissions.py +237 -0
  149. pi_durable_python-1.3.0/tests/test_harness_task_graph.py +509 -0
  150. pi_durable_python-1.3.0/tests/test_harness_tasks.py +1570 -0
  151. pi_durable_python-1.3.0/tests/test_harness_tasks_recovery.py +1117 -0
  152. pi_durable_python-1.3.0/tests/test_harness_tools.py +1043 -0
  153. pi_durable_python-1.3.0/tests/test_harness_tools_recovery.py +405 -0
  154. pi_durable_python-1.3.0/tests/test_harness_usage.py +128 -0
  155. pi_durable_python-1.3.0/tests/test_harness_validation.py +122 -0
  156. pi_durable_python-1.3.0/tests/test_harness_view.py +442 -0
  157. pi_durable_python-1.3.0/tests/test_ids.py +61 -0
  158. pi_durable_python-1.3.0/tests/test_json.py +116 -0
  159. pi_durable_python-1.3.0/tests/test_jsonl_storage.py +1290 -0
  160. pi_durable_python-1.3.0/tests/test_memory_storage.py +124 -0
  161. pi_durable_python-1.3.0/tests/test_provider_session_cache_e2e.py +86 -0
  162. pi_durable_python-1.3.0/tests/test_providers_anthropic.py +486 -0
  163. pi_durable_python-1.3.0/tests/test_providers_extras.py +118 -0
  164. pi_durable_python-1.3.0/tests/test_providers_openai.py +467 -0
  165. pi_durable_python-1.3.0/tests/test_release_docs.py +170 -0
  166. pi_durable_python-1.3.0/tests/test_scaffold.py +5 -0
  167. pi_durable_python-1.3.0/tests/test_session_checkpoints_migrations.py +1187 -0
  168. pi_durable_python-1.3.0/tests/test_session_definitions.py +179 -0
  169. pi_durable_python-1.3.0/tests/test_session_document_retention.py +642 -0
  170. pi_durable_python-1.3.0/tests/test_session_documents.py +888 -0
  171. pi_durable_python-1.3.0/tests/test_session_forks.py +873 -0
  172. pi_durable_python-1.3.0/tests/test_session_states.py +310 -0
  173. pi_durable_python-1.3.0/tests/test_session_tables.py +632 -0
  174. pi_durable_python-1.3.0/tests/test_session_watches.py +606 -0
  175. pi_durable_python-1.3.0/tests/test_spec_usage.py +444 -0
  176. pi_durable_python-1.3.0/tests/test_sqlite_facade.py +491 -0
  177. pi_durable_python-1.3.0/tests/test_sqlite_migrations.py +194 -0
  178. pi_durable_python-1.3.0/tests/test_sqlite_storage.py +895 -0
  179. pi_durable_python-1.3.0/tests/test_storage_protocol.py +195 -0
  180. pi_durable_python-1.3.0/tests/test_storage_runtime_boundary.py +103 -0
  181. pi_durable_python-1.3.0/tests/test_system_order_cache_e2e.py +86 -0
  182. pi_durable_python-1.3.0/tests/test_testing_conformance.py +165 -0
  183. pi_durable_python-1.3.0/tests/test_tool_search.py +382 -0
  184. pi_durable_python-1.3.0/tests/test_tools.py +1002 -0
  185. pi_durable_python-1.3.0/tests/test_tools_read_differential.py +357 -0
  186. pi_durable_python-1.3.0/tests/test_types.py +483 -0
  187. pi_durable_python-1.3.0/tests/tool_support.py +148 -0
  188. pi_durable_python-1.3.0/uv.lock +1028 -0
@@ -0,0 +1,124 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ test:
17
+ name: Python ${{ matrix.python }} on ${{ matrix.os }}
18
+ runs-on: ${{ matrix.os }}
19
+ timeout-minutes: 20
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ os: [ubuntu-latest, macos-latest]
24
+ # Every version the package claims, plus both free-threaded builds. Free-threaded runs the
25
+ # same suite with the GIL disabled: it proves the code does not depend on the GIL, not that
26
+ # concurrent threads can share a Session. 3.13t stays out; free-threading only reached
27
+ # stable support in 3.14 (PEP 779).
28
+ python: ["3.11", "3.12", "3.13", "3.14", "3.15", "3.14t", "3.15t"]
29
+
30
+ steps:
31
+ - uses: actions/checkout@v7
32
+
33
+ - uses: actions/setup-python@v7
34
+ with:
35
+ python-version: ${{ matrix.python }}
36
+
37
+ - name: Install
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ python -m pip install -e ".[dev,openai,anthropic,schema]"
41
+
42
+ - name: Lint
43
+ run: ruff check src tests
44
+
45
+ - name: Type check
46
+ run: mypy
47
+
48
+ - name: Test
49
+ run: pytest
50
+
51
+ package:
52
+ name: sdist and wheel install in fresh environments
53
+ runs-on: ubuntu-latest
54
+ timeout-minutes: 15
55
+
56
+ steps:
57
+ - uses: actions/checkout@v7
58
+
59
+ - uses: actions/setup-python@v7
60
+ with:
61
+ python-version: "3.13"
62
+
63
+ - name: Build both artifacts
64
+ run: |
65
+ python -m pip install --upgrade pip build twine
66
+ python -m build
67
+ python -m twine check dist/*
68
+
69
+ - name: Install the wheel in a fresh environment
70
+ run: |
71
+ python -m venv wheel-env
72
+ wheel-env/bin/python -m pip install --upgrade pip
73
+ wheel-env/bin/python -m pip install dist/*.whl
74
+ wheel-env/bin/python -c "import tomllib, pi_durable; expected = tomllib.load(open('pyproject.toml', 'rb'))['project']['version']; assert pi_durable.__version__ == expected, (pi_durable.__version__, expected)"
75
+ test -f wheel-env/lib/python*/site-packages/pi_durable/py.typed
76
+
77
+ - name: Install the sdist in a fresh environment
78
+ run: |
79
+ python -m venv sdist-env
80
+ sdist-env/bin/python -m pip install --upgrade pip
81
+ sdist-env/bin/python -m pip install dist/*.tar.gz
82
+ sdist-env/bin/python -c "import tomllib, pi_durable; expected = tomllib.load(open('pyproject.toml', 'rb'))['project']['version']; assert pi_durable.__version__ == expected, (pi_durable.__version__, expected)"
83
+
84
+ - name: Install every extra from the built wheel
85
+ run: |
86
+ wheel="$(ls "$PWD"/dist/*.whl)"
87
+ for extra in openai anthropic schema all dev; do
88
+ python -m venv "extra-$extra"
89
+ "extra-$extra/bin/python" -m pip install --upgrade pip
90
+ "extra-$extra/bin/python" -m pip install "pi-durable-python[$extra] @ file://$wheel"
91
+ done
92
+ extra-openai/bin/python -c "import pi_durable.providers.openai, importlib.util; assert importlib.util.find_spec('anthropic') is None"
93
+ extra-anthropic/bin/python -c "import pi_durable.providers.anthropic, importlib.util; assert importlib.util.find_spec('openai') is None"
94
+ extra-schema/bin/python -c "import jsonschema"
95
+ extra-dev/bin/python -c "import pytest, ruff, mypy"
96
+
97
+ extras:
98
+ name: ${{ matrix.extra }} extra installs alone
99
+ runs-on: ubuntu-latest
100
+ timeout-minutes: 10
101
+ strategy:
102
+ fail-fast: false
103
+ matrix:
104
+ # Each provider extra must install and pass its adapter suite without the other SDK, which
105
+ # proves the extras are independent and that the core package carries neither dependency.
106
+ extra: [openai, anthropic]
107
+
108
+ steps:
109
+ - uses: actions/checkout@v7
110
+
111
+ - uses: actions/setup-python@v7
112
+ with:
113
+ python-version: "3.13"
114
+
115
+ - name: Install only this extra
116
+ run: |
117
+ python -m pip install --upgrade pip
118
+ python -m pip install -e ".[dev,${{ matrix.extra }}]"
119
+
120
+ - name: Import the adapter without the other SDK
121
+ run: python -c "import pi_durable.providers.${{ matrix.extra }}"
122
+
123
+ - name: Test the adapter and the extras independence cases
124
+ run: pytest tests/test_providers_${{ matrix.extra }}.py tests/test_providers_extras.py
@@ -0,0 +1,222 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # uv
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ # Directory patterns are anchored to the repo root: an unanchored `env/` would also match
154
+ # `src/pi_durable/env/` on case-insensitive filesystems (macOS) and silently drop the package.
155
+ .env
156
+ .envrc
157
+ .venv
158
+ /env/
159
+ /venv/
160
+ /ENV/
161
+ /env.bak/
162
+ /venv.bak/
163
+
164
+ # Spyder project settings
165
+ .spyderproject
166
+ .spyproject
167
+
168
+ # Rope project settings
169
+ .ropeproject
170
+
171
+ # mkdocs/Zensical documentation
172
+ /site
173
+
174
+ # mypy
175
+ .mypy_cache/
176
+ .dmypy.json
177
+ dmypy.json
178
+
179
+ # Pyre type checker
180
+ .pyre/
181
+
182
+ # pytype static type analyzer
183
+ .pytype/
184
+
185
+ # Cython debug symbols
186
+ cython_debug/
187
+
188
+ # PyCharm
189
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
190
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
191
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
192
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
193
+ # .idea/
194
+
195
+ # Abstra
196
+ # Abstra is an AI-powered process automation framework.
197
+ # Ignore directories containing user credentials, local state, and settings.
198
+ # Learn more at https://abstra.io/docs
199
+ .abstra/
200
+
201
+ # Visual Studio Code
202
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
203
+ # can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
204
+ # and can be added to the global gitignore or merged into this file. However, if you prefer, you
205
+ # could uncomment the following to ignore the entire vscode folder
206
+ # .vscode/
207
+ # Temporary file for partial code execution
208
+ tempCodeRunnerFile.py
209
+
210
+ # Ruff stuff:
211
+ .ruff_cache/
212
+
213
+ # PyPI configuration file
214
+ .pypirc
215
+
216
+ # Marimo
217
+ marimo/_static/
218
+ marimo/_lsp/
219
+ __marimo__/
220
+
221
+ # Streamlit
222
+ .streamlit/secrets.toml
@@ -0,0 +1,13 @@
1
+ ## Agent skills
2
+
3
+ ### Issue tracker
4
+
5
+ Issues live in GitHub Issues for `arpesenti/pi-durable-python`. See `docs/agents/issue-tracker.md`.
6
+
7
+ ### Triage labels
8
+
9
+ Uses the five canonical triage labels. See `docs/agents/triage-labels.md`.
10
+
11
+ ### Domain docs
12
+
13
+ Single-context: root `GLOSSARY.md` plus `docs/adr/`. See `docs/agents/domain.md`.
@@ -0,0 +1,75 @@
1
+ # pi-durable-python
2
+
3
+ A Python port of `@earendil-works/pi-durable` v1.3.0: durable conversations, tasks, and documents on
4
+ `asyncio`, held to the upstream semantics and persisted record shapes.
5
+
6
+ ## Python support
7
+
8
+ **Claimed version set**:
9
+ The Python versions the package says it runs on: `requires-python` plus the classifiers it publishes.
10
+ _Avoid_: supported versions, target versions
11
+
12
+ **Verified version set**:
13
+ The Python versions a blocking CI job runs the full suite against.
14
+ _Avoid_: tested versions, CI matrix
15
+
16
+ **Blessed version set**:
17
+ The part of the verified set a distribution statement names: the `Programming Language :: Python`
18
+ classifiers and the README runtime line. Classifiers mirror the verified set; a version is never
19
+ blessed before it is verified.
20
+ _Avoid_: supported versions, official versions
21
+
22
+ **Free-threaded-clean**:
23
+ Passes the suite on a build with the GIL disabled. It says the code does not depend on the GIL.
24
+ _Avoid_: free-threading support, thread-safe
25
+
26
+ **Thread-safe**:
27
+ Safe for concurrent threads sharing one `Session` or `Storage`. Reserved: nothing claims it today.
28
+ _Avoid_: free-threaded-clean
29
+
30
+ **Submission**:
31
+ A durable admission of user input or a passive entry write.
32
+ It is `queued` in the inbox, `placed` as an entry, then `done` or `unanswered`.
33
+ _Avoid_: message, job
34
+
35
+ **Inbox**:
36
+ The built-in `pi.inbox` conversation document holding queued submissions in submission-ID order.
37
+ _Avoid_: queue, buffer
38
+
39
+ **Boundary**:
40
+ A point in a run (`postTools` or `final`) where queued submissions are selected and placed.
41
+ _Avoid_: flush, drain, checkpoint
42
+
43
+ **Run**:
44
+ The `pi.generation` task named by `pi.live.run` that owns the placed input submissions it must answer.
45
+ A run is present exactly while the conversation is busy.
46
+ _Avoid_: turn, request, generation
47
+
48
+ **Compaction**:
49
+ A `pi.compaction` task that replaces an old prefix of the model context with a summary entry.
50
+ It is manual, threshold, or overflow; only a blocking one makes the run wait for it.
51
+ _Avoid_: truncation, pruning
52
+
53
+ **Cut**:
54
+ The first entry a compaction keeps verbatim. Range selection picks it so the kept entries cover
55
+ `keepRecentTokens`; the summary's `head` is the cut's entry ID.
56
+ _Avoid_: boundary, split
57
+
58
+ **Summary**:
59
+ The `pi.compaction` entry a compaction places: the wrapped summary text as a user message, with
60
+ `head` naming the cut and `data.reason` naming what started the compaction.
61
+ _Avoid_: checkpoint, digest
62
+
63
+ **Conversation view**:
64
+ A fixed structural mount of one conversation's active entries and built-in documents.
65
+ It advances only from committed publications and keeps at most one mount per conversation.
66
+ _Avoid_: snapshot, projection
67
+
68
+ **Agent event stream**:
69
+ The experimental adapter that translates one conversation's committed publications into events
70
+ shaped like the coding agent's session events.
71
+ _Avoid_: audit log, replay
72
+
73
+ **Task graph**:
74
+ The Session-wide mount of every live task, its waits, and the conversations it owns.
75
+ _Avoid_: task tree, scheduler state
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Armando Pesenti Gritti
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.