taut-shape 0.9.1__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 (80) hide show
  1. taut_shape-0.9.1/.github/workflows/publish.yml +97 -0
  2. taut_shape-0.9.1/.gitignore +9 -0
  3. taut_shape-0.9.1/LICENSE +21 -0
  4. taut_shape-0.9.1/PKG-INFO +101 -0
  5. taut_shape-0.9.1/README.md +75 -0
  6. taut_shape-0.9.1/dev-docs/InitialPlan.md +854 -0
  7. taut_shape-0.9.1/pyproject.toml +64 -0
  8. taut_shape-0.9.1/setup.cfg +4 -0
  9. taut_shape-0.9.1/src/taut_shape/__init__.py +26 -0
  10. taut_shape-0.9.1/src/taut_shape/_schema.py +21 -0
  11. taut_shape-0.9.1/src/taut_shape/atom/__init__.py +5 -0
  12. taut_shape-0.9.1/src/taut_shape/atom/_generated.py +115 -0
  13. taut_shape-0.9.1/src/taut_shape/atom/engine.py +229 -0
  14. taut_shape-0.9.1/src/taut_shape/atom/wire.py +202 -0
  15. taut_shape-0.9.1/src/taut_shape/crdt/__init__.py +7 -0
  16. taut_shape-0.9.1/src/taut_shape/crdt/_generated.py +106 -0
  17. taut_shape-0.9.1/src/taut_shape/crdt/engine.py +209 -0
  18. taut_shape-0.9.1/src/taut_shape/crdt/text.py +103 -0
  19. taut_shape-0.9.1/src/taut_shape/crdt/wire.py +106 -0
  20. taut_shape-0.9.1/src/taut_shape/log/__init__.py +61 -0
  21. taut_shape-0.9.1/src/taut_shape/log/_generated.py +134 -0
  22. taut_shape-0.9.1/src/taut_shape/log/_sessions.py +160 -0
  23. taut_shape-0.9.1/src/taut_shape/log/_window.py +165 -0
  24. taut_shape-0.9.1/src/taut_shape/log/engine.py +322 -0
  25. taut_shape-0.9.1/src/taut_shape/log/messages.py +81 -0
  26. taut_shape-0.9.1/src/taut_shape/schemas/shape_atom.taut.py +202 -0
  27. taut_shape-0.9.1/src/taut_shape/schemas/shape_crdt.taut.py +89 -0
  28. taut_shape-0.9.1/src/taut_shape/schemas/shape_log.taut.py +177 -0
  29. taut_shape-0.9.1/src/taut_shape/schemas/shape_stream.taut.py +100 -0
  30. taut_shape-0.9.1/src/taut_shape/schemas/shape_swmr.taut.py +315 -0
  31. taut_shape-0.9.1/src/taut_shape/schemas/shape_value.taut.py +134 -0
  32. taut_shape-0.9.1/src/taut_shape/snapshot_delta.py +72 -0
  33. taut_shape-0.9.1/src/taut_shape/stream/__init__.py +5 -0
  34. taut_shape-0.9.1/src/taut_shape/stream/_generated.py +113 -0
  35. taut_shape-0.9.1/src/taut_shape/stream/engine.py +297 -0
  36. taut_shape-0.9.1/src/taut_shape/stream/wire.py +194 -0
  37. taut_shape-0.9.1/src/taut_shape/swmr/__init__.py +5 -0
  38. taut_shape-0.9.1/src/taut_shape/swmr/_generated.py +146 -0
  39. taut_shape-0.9.1/src/taut_shape/swmr/engine.py +419 -0
  40. taut_shape-0.9.1/src/taut_shape/swmr/wire.py +241 -0
  41. taut_shape-0.9.1/src/taut_shape/tool/__init__.py +11 -0
  42. taut_shape-0.9.1/src/taut_shape/tool/__main__.py +8 -0
  43. taut_shape-0.9.1/src/taut_shape/tool/atom_adapter.py +40 -0
  44. taut_shape-0.9.1/src/taut_shape/tool/crdt_adapter.py +29 -0
  45. taut_shape-0.9.1/src/taut_shape/tool/framing.py +134 -0
  46. taut_shape-0.9.1/src/taut_shape/tool/log_adapter.py +74 -0
  47. taut_shape-0.9.1/src/taut_shape/tool/main.py +988 -0
  48. taut_shape-0.9.1/src/taut_shape/tool/oraclefmt.py +136 -0
  49. taut_shape-0.9.1/src/taut_shape/tool/runtime.py +112 -0
  50. taut_shape-0.9.1/src/taut_shape/tool/stream_adapter.py +47 -0
  51. taut_shape-0.9.1/src/taut_shape/tool/swmr_adapter.py +52 -0
  52. taut_shape-0.9.1/src/taut_shape/tool/value_adapter.py +29 -0
  53. taut_shape-0.9.1/src/taut_shape/value/__init__.py +6 -0
  54. taut_shape-0.9.1/src/taut_shape/value/_generated.py +58 -0
  55. taut_shape-0.9.1/src/taut_shape/value/engine.py +67 -0
  56. taut_shape-0.9.1/src/taut_shape/value/wire.py +146 -0
  57. taut_shape-0.9.1/src/taut_shape.egg-info/PKG-INFO +101 -0
  58. taut_shape-0.9.1/src/taut_shape.egg-info/SOURCES.txt +78 -0
  59. taut_shape-0.9.1/src/taut_shape.egg-info/dependency_links.txt +1 -0
  60. taut_shape-0.9.1/src/taut_shape.egg-info/entry_points.txt +2 -0
  61. taut_shape-0.9.1/src/taut_shape.egg-info/requires.txt +7 -0
  62. taut_shape-0.9.1/src/taut_shape.egg-info/scm_file_list.json +74 -0
  63. taut_shape-0.9.1/src/taut_shape.egg-info/scm_version.json +8 -0
  64. taut_shape-0.9.1/src/taut_shape.egg-info/top_level.txt +1 -0
  65. taut_shape-0.9.1/tests/conftest.py +24 -0
  66. taut_shape-0.9.1/tests/oracle/SOURCE.md +45 -0
  67. taut_shape-0.9.1/tests/oracle/loader.py +32 -0
  68. taut_shape-0.9.1/tests/test_atom_oracle.py +62 -0
  69. taut_shape-0.9.1/tests/test_crdt_oracle.py +60 -0
  70. taut_shape-0.9.1/tests/test_engine_unit.py +117 -0
  71. taut_shape-0.9.1/tests/test_lockstep.py +28 -0
  72. taut_shape-0.9.1/tests/test_oracle.py +61 -0
  73. taut_shape-0.9.1/tests/test_packaged_schemas.py +18 -0
  74. taut_shape-0.9.1/tests/test_runtime.py +114 -0
  75. taut_shape-0.9.1/tests/test_smoke.py +22 -0
  76. taut_shape-0.9.1/tests/test_snapshot_delta_profile.py +54 -0
  77. taut_shape-0.9.1/tests/test_stream_oracle.py +70 -0
  78. taut_shape-0.9.1/tests/test_swmr_oracle.py +62 -0
  79. taut_shape-0.9.1/tests/test_tool_selfpair.py +214 -0
  80. taut_shape-0.9.1/tests/test_value_oracle.py +82 -0
@@ -0,0 +1,97 @@
1
+ name: Publish taut-shape to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ name: Tests (Python ${{ matrix.python }})
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python: ["3.10", "3.11", "3.12", "3.13"]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+ with:
22
+ fetch-depth: 0
23
+ path: workspace/taut-shape-py
24
+ - uses: actions/checkout@v6
25
+ with:
26
+ repository: owebeeone/taut-shape
27
+ path: workspace/taut-shape
28
+ - uses: actions/setup-python@v6
29
+ with:
30
+ python-version: ${{ matrix.python }}
31
+ - name: Install and test
32
+ working-directory: workspace/taut-shape-py
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ python -m pip install -e '.[dev]'
36
+ python -m pytest -q
37
+
38
+ build:
39
+ name: Build and smoke-test distributions
40
+ runs-on: ubuntu-latest
41
+ needs: test
42
+
43
+ steps:
44
+ - uses: actions/checkout@v6
45
+ with:
46
+ fetch-depth: 0
47
+ - uses: actions/setup-python@v6
48
+ with:
49
+ python-version: "3.12"
50
+ - name: Build and check
51
+ run: |
52
+ python -m pip install --upgrade build twine
53
+ python -m build
54
+ python -m twine check dist/*
55
+ - name: Smoke-test wheel
56
+ run: |
57
+ python -m pip install dist/*.whl
58
+ python - <<'PY'
59
+ import importlib.metadata as metadata
60
+ import taut_shape
61
+ from taut_shape.atom import wire as atom_wire
62
+ from taut_shape.crdt import wire as crdt_wire
63
+ from taut_shape.stream import wire as stream_wire
64
+ from taut_shape.swmr import wire as swmr_wire
65
+ from taut_shape.value import wire as value_wire
66
+ from taut_shape.tool import oraclefmt
67
+
68
+ assert metadata.version("taut-shape") == "${{ github.event.release.tag_name }}".removeprefix("v")
69
+ assert all(module._SCHEMA.messages for module in (
70
+ atom_wire, crdt_wire, stream_wire, swmr_wire, value_wire, oraclefmt
71
+ ))
72
+ print("taut-shape standalone schema imports/version OK")
73
+ PY
74
+ taut-shape-tool --help
75
+ - uses: actions/upload-artifact@v7
76
+ with:
77
+ name: dist
78
+ path: dist/*
79
+
80
+ publish:
81
+ name: Publish to PyPI
82
+ runs-on: ubuntu-latest
83
+ needs: build
84
+ environment:
85
+ name: pypi
86
+ url: https://pypi.org/p/taut-shape
87
+ permissions:
88
+ id-token: write
89
+
90
+ steps:
91
+ - uses: actions/download-artifact@v8
92
+ with:
93
+ name: dist
94
+ path: dist
95
+ - uses: pypa/gh-action-pypi-publish@release/v1
96
+ with:
97
+ packages-dir: dist/
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .mypy_cache/
5
+ .ruff_cache/
6
+ *.egg-info/
7
+ build/
8
+ dist/
9
+ .venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gianni Mariani
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.
@@ -0,0 +1,101 @@
1
+ Metadata-Version: 2.4
2
+ Name: taut-shape
3
+ Version: 0.9.1
4
+ Summary: taut-shape — pure-Python delivery-shape engine (`log` first): a clean-room mailbox LogNode gated by the taut-shape behavioral oracle (import: `taut_shape`)
5
+ Author-email: Gianni Mariani <gianni@mariani.ws>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/owebeeone/taut-shape-py
8
+ Project-URL: Repository, https://github.com/owebeeone/taut-shape-py
9
+ Keywords: taut,log,delivery-shape,mailbox,streaming,oracle
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Topic :: Software Development :: Libraries
15
+ Classifier: Topic :: System :: Networking
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: taut-proto<0.10,>=0.9.1
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest; extra == "dev"
22
+ Requires-Dist: syrupy; extra == "dev"
23
+ Requires-Dist: ruff; extra == "dev"
24
+ Requires-Dist: mypy; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ # taut-shape (Python)
28
+
29
+ `pip install taut-shape` → `import taut_shape`.
30
+
31
+ A **pure-Python** implementation of the Taut `atom`, `log`, `stream`, and `value` delivery shapes. No Rust,
32
+ no PyO3, no native extension. The engine is a synchronous **mailbox endpoint**
33
+ (`LogNode.handle(msg) -> [outputs]`); the only concurrency is an optional
34
+ `asyncio` shell layered on top (not yet built).
35
+
36
+ This is a **clean-room** implementation: written against the shared plan
37
+ (`taut-shape/dev-docs/TautClientImplPlan.md`, D1–D19) and the behavioral oracle
38
+ (`taut-shape/corpus/log.v0.json`) only — it does not mirror `taut-shape-rs`. A
39
+ hand-written engine that still reproduces every oracle vector is the evidence
40
+ that **the oracle, not shared source, is the contract**.
41
+
42
+ ## Status
43
+
44
+ - Phase 0 — scaffold + vendored generated message types. ✓
45
+ - Phase 1 — the `LogNode` mailbox engine (pure, sync). ✓
46
+ - Phase 2 — oracle conformance (`tests/test_oracle.py`, whole-transcript `==`). ✓
47
+ - Phase 4 — the `taut-shape-tool` CLI (`node`/`client` modes over stdin/stdout
48
+ framing, `python3 -m taut_shape.tool`; see `src/taut_shape/tool/main.py`). ✓
49
+ - Phase 5 — interop matrix participation (`taut-shape/matrix/driver.py` runs
50
+ this tool as the `py` language). ✓
51
+ - Phase 3 (an `asyncio` shell) — not built; the engine has no built-in
52
+ concurrency layer beyond the CLI's synchronous read/handle/write loop.
53
+
54
+ ## Layout
55
+
56
+ ```
57
+ src/taut_shape/log/
58
+ _generated.py # tautc-generated message/value types (vendored, do NOT edit)
59
+ messages.py # InMsg/OutMsg unions + re-exports
60
+ _window.py # store core: bounded window, head/floor, evict (internal)
61
+ _sessions.py # session table: held reads, timers, watermarks (internal)
62
+ engine.py # LogNode.handle + read-only accessors
63
+ src/taut_shape/value/
64
+ _generated.py # tautc-generated value messages (vendored, do NOT edit)
65
+ engine.py # attributed LWW ValueNode
66
+ src/taut_shape/atom/
67
+ _generated.py # tautc-generated atom messages (vendored, do NOT edit)
68
+ engine.py # latest-state AtomNode
69
+ src/taut_shape/stream/
70
+ _generated.py # tautc-generated stream messages (vendored, do NOT edit)
71
+ engine.py # bounded live-only StreamNode
72
+ ```
73
+
74
+ ## Tool (node / client)
75
+
76
+ Run the framing CLI as a module. Both modes accept exact `--shape <NAME>`
77
+ selection and default to `log`; the implemented registry contains `atom`, `log`,
78
+ `stream`, and `value`.
79
+
80
+ ```
81
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool node --shape log
82
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape log \
83
+ --stream-id s1 --from 0
84
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape value \
85
+ --value-id value-A --stream-id s1 --reads 1
86
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape atom \
87
+ --atom-id atom-A --stream-id s1 --from 0
88
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape stream \
89
+ --stream-id live-metrics
90
+ ```
91
+
92
+ An unsupported name exits 2 with `TAUT_SHAPE_UNSUPPORTED_SHAPE` before stdin is
93
+ read or a client request is written.
94
+
95
+ ## Running the tests
96
+
97
+ The `taut` codec is a workspace sibling; point `PYTHONPATH` at it:
98
+
99
+ ```
100
+ PYTHONPATH=../taut/src:src pytest
101
+ ```
@@ -0,0 +1,75 @@
1
+ # taut-shape (Python)
2
+
3
+ `pip install taut-shape` → `import taut_shape`.
4
+
5
+ A **pure-Python** implementation of the Taut `atom`, `log`, `stream`, and `value` delivery shapes. No Rust,
6
+ no PyO3, no native extension. The engine is a synchronous **mailbox endpoint**
7
+ (`LogNode.handle(msg) -> [outputs]`); the only concurrency is an optional
8
+ `asyncio` shell layered on top (not yet built).
9
+
10
+ This is a **clean-room** implementation: written against the shared plan
11
+ (`taut-shape/dev-docs/TautClientImplPlan.md`, D1–D19) and the behavioral oracle
12
+ (`taut-shape/corpus/log.v0.json`) only — it does not mirror `taut-shape-rs`. A
13
+ hand-written engine that still reproduces every oracle vector is the evidence
14
+ that **the oracle, not shared source, is the contract**.
15
+
16
+ ## Status
17
+
18
+ - Phase 0 — scaffold + vendored generated message types. ✓
19
+ - Phase 1 — the `LogNode` mailbox engine (pure, sync). ✓
20
+ - Phase 2 — oracle conformance (`tests/test_oracle.py`, whole-transcript `==`). ✓
21
+ - Phase 4 — the `taut-shape-tool` CLI (`node`/`client` modes over stdin/stdout
22
+ framing, `python3 -m taut_shape.tool`; see `src/taut_shape/tool/main.py`). ✓
23
+ - Phase 5 — interop matrix participation (`taut-shape/matrix/driver.py` runs
24
+ this tool as the `py` language). ✓
25
+ - Phase 3 (an `asyncio` shell) — not built; the engine has no built-in
26
+ concurrency layer beyond the CLI's synchronous read/handle/write loop.
27
+
28
+ ## Layout
29
+
30
+ ```
31
+ src/taut_shape/log/
32
+ _generated.py # tautc-generated message/value types (vendored, do NOT edit)
33
+ messages.py # InMsg/OutMsg unions + re-exports
34
+ _window.py # store core: bounded window, head/floor, evict (internal)
35
+ _sessions.py # session table: held reads, timers, watermarks (internal)
36
+ engine.py # LogNode.handle + read-only accessors
37
+ src/taut_shape/value/
38
+ _generated.py # tautc-generated value messages (vendored, do NOT edit)
39
+ engine.py # attributed LWW ValueNode
40
+ src/taut_shape/atom/
41
+ _generated.py # tautc-generated atom messages (vendored, do NOT edit)
42
+ engine.py # latest-state AtomNode
43
+ src/taut_shape/stream/
44
+ _generated.py # tautc-generated stream messages (vendored, do NOT edit)
45
+ engine.py # bounded live-only StreamNode
46
+ ```
47
+
48
+ ## Tool (node / client)
49
+
50
+ Run the framing CLI as a module. Both modes accept exact `--shape <NAME>`
51
+ selection and default to `log`; the implemented registry contains `atom`, `log`,
52
+ `stream`, and `value`.
53
+
54
+ ```
55
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool node --shape log
56
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape log \
57
+ --stream-id s1 --from 0
58
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape value \
59
+ --value-id value-A --stream-id s1 --reads 1
60
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape atom \
61
+ --atom-id atom-A --stream-id s1 --from 0
62
+ PYTHONPATH=../taut/src:src python3 -m taut_shape.tool client --shape stream \
63
+ --stream-id live-metrics
64
+ ```
65
+
66
+ An unsupported name exits 2 with `TAUT_SHAPE_UNSUPPORTED_SHAPE` before stdin is
67
+ read or a client request is written.
68
+
69
+ ## Running the tests
70
+
71
+ The `taut` codec is a workspace sibling; point `PYTHONPATH` at it:
72
+
73
+ ```
74
+ PYTHONPATH=../taut/src:src pytest
75
+ ```