litedbmodel-runtime 2.0.1__tar.gz → 2.0.2__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 (24) hide show
  1. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/PKG-INFO +2 -2
  2. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/__init__.py +1 -1
  3. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime.egg-info/PKG-INFO +2 -2
  4. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime.egg-info/requires.txt +1 -1
  5. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/pyproject.toml +2 -2
  6. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/tests/test_consumes_bc_core.py +8 -1
  7. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/tests/test_runtime.py +27 -0
  8. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/README.md +0 -0
  9. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/dialect.py +0 -0
  10. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/driver.py +0 -0
  11. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/errors.py +0 -0
  12. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/livedb_runner.py +0 -0
  13. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/relation.py +0 -0
  14. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/runtime.py +0 -0
  15. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/static_bundle.py +0 -0
  16. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime/vectors_runner.py +0 -0
  17. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime.egg-info/SOURCES.txt +0 -0
  18. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime.egg-info/dependency_links.txt +0 -0
  19. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/litedbmodel_runtime.egg-info/top_level.txt +0 -0
  20. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/setup.cfg +0 -0
  21. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/tests/test_conformance_corpus.py +0 -0
  22. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/tests/test_dialect.py +0 -0
  23. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/tests/test_parallel_read.py +0 -0
  24. {litedbmodel_runtime-2.0.1 → litedbmodel_runtime-2.0.2}/tests/test_render.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: litedbmodel-runtime
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Thin multi-language runtime for litedbmodel v2 SCP makeSQL bundles (Python port). Executes the published static-makeSQL artifacts (a read ReadGraph = a bc surrogate ComponentGraphIR + per-node static statement templates, or a gate-first TransactionPlan) against a SQL driver — semantics-identical to the TS reference. Delegates the Expression-IR evaluation + map/Φ/wiring orchestration to behavior-contracts.
5
5
  Author: foo-ogawa
6
6
  License: MIT
7
7
  Keywords: orm,sql,ir,runtime,conformance,litedbmodel
8
8
  Requires-Python: >=3.9
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: behavior-contracts==0.2.3
10
+ Requires-Dist: behavior-contracts==0.5.0
11
11
  Provides-Extra: test
12
12
  Requires-Dist: pytest>=7.0; extra == "test"
13
13
  Provides-Extra: livedb
@@ -38,7 +38,7 @@ from .relation import (
38
38
  run_relation_op,
39
39
  )
40
40
 
41
- __version__ = "2.0.1"
41
+ __version__ = "2.0.2"
42
42
 
43
43
  __all__ = [
44
44
  "__version__",
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: litedbmodel-runtime
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Thin multi-language runtime for litedbmodel v2 SCP makeSQL bundles (Python port). Executes the published static-makeSQL artifacts (a read ReadGraph = a bc surrogate ComponentGraphIR + per-node static statement templates, or a gate-first TransactionPlan) against a SQL driver — semantics-identical to the TS reference. Delegates the Expression-IR evaluation + map/Φ/wiring orchestration to behavior-contracts.
5
5
  Author: foo-ogawa
6
6
  License: MIT
7
7
  Keywords: orm,sql,ir,runtime,conformance,litedbmodel
8
8
  Requires-Python: >=3.9
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: behavior-contracts==0.2.3
10
+ Requires-Dist: behavior-contracts==0.5.0
11
11
  Provides-Extra: test
12
12
  Requires-Dist: pytest>=7.0; extra == "test"
13
13
  Provides-Extra: livedb
@@ -1,4 +1,4 @@
1
- behavior-contracts==0.2.3
1
+ behavior-contracts==0.5.0
2
2
 
3
3
  [livedb]
4
4
  psycopg[binary]>=3.1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "litedbmodel-runtime"
7
- version = "2.0.1"
7
+ version = "2.0.2"
8
8
  description = "Thin multi-language runtime for litedbmodel v2 SCP makeSQL bundles (Python port). Executes the published static-makeSQL artifacts (a read ReadGraph = a bc surrogate ComponentGraphIR + per-node static statement templates, or a gate-first TransactionPlan) against a SQL driver — semantics-identical to the TS reference. Delegates the Expression-IR evaluation + map/Φ/wiring orchestration to behavior-contracts."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -16,7 +16,7 @@ keywords = ["orm", "sql", "ir", "runtime", "conformance", "litedbmodel"]
16
16
  # evaluation (ref/refOpt/coalesce/eq/… — the SKIP guards + param slots) to the shared common
17
17
  # core, exactly as the TS reference imports `behavior-contracts` from npm. HARD dependency,
18
18
  # consumed from the published PyPI registry (NO local path — the no-local-deps gate forbids it).
19
- dependencies = ["behavior-contracts==0.2.3"]
19
+ dependencies = ["behavior-contracts==0.5.0"]
20
20
 
21
21
  [project.optional-dependencies]
22
22
  test = ["pytest>=7.0"]
@@ -9,6 +9,8 @@ that the declared dependency is the PyPI package spec with NO local `../` path.
9
9
 
10
10
  from __future__ import annotations
11
11
 
12
+ import re
13
+
12
14
  import ast
13
15
  from pathlib import Path
14
16
 
@@ -39,7 +41,12 @@ def test_no_local_generic_evaluator_reimplemented():
39
41
 
40
42
  def test_pyproject_declares_bc_as_pypi_dep_no_local_path():
41
43
  text = PYPROJECT.read_text(encoding="utf-8")
42
- assert 'behavior-contracts==0.2.0' in text
44
+ # bc is consumed as an EXACTLY-PINNED PyPI dependency (`behavior-contracts==<semver>`), never a
45
+ # range and never a local path — the runtime + the generated §8 bundle must stay in lockstep
46
+ # (WS7a #30). Assert the pinned FORM, version-agnostically, so this survives version bumps.
47
+ assert re.search(r'"behavior-contracts==\d+\.\d+\.\d+"', text), (
48
+ "pyproject must pin behavior-contracts to an exact PyPI version (behavior-contracts==X.Y.Z)"
49
+ )
43
50
  # No local path dep (the no-local-deps gate forbids `../` / file:// / path = ...).
44
51
  assert "../" not in text
45
52
  assert "file://" not in text
@@ -187,3 +187,30 @@ def test_write_tx_idempotent_duplicate_short_circuits():
187
187
  assert driver.prepare("SELECT post_count FROM users WHERE id = 7").all([])[0]["post_count"] == 3
188
188
  finally:
189
189
  driver.close()
190
+
191
+
192
+ # ── M4 (re-audit): an unknown gate rule FAILS CLOSED (never a silent commit) ──
193
+ #
194
+ # Aligned across all 5 runtimes (Python + Rust + TS + Go + PHP): a corrupt / forward-incompatible
195
+ # gate string MUST abort the transaction (raise + ROLLBACK), NOT silently continue and COMMIT.
196
+ def _unknown_gate_bundle():
197
+ b = _write_bundle()
198
+ # Tag the requires gate with a bogus rule the runtime does not recognize.
199
+ b["transaction"]["statements"][0]["gate"] = "someFutureGateRuleThatDoesNotExist"
200
+ return b
201
+
202
+
203
+ def test_write_tx_unknown_gate_fails_closed():
204
+ driver = SqliteDriver.in_memory(WRITE_SCHEMA)
205
+ try:
206
+ raised = False
207
+ try:
208
+ execute_transaction_bundle(_unknown_gate_bundle(), {"author_id": 7, "title": "X", "request_id": "req-u"}, driver)
209
+ except Exception as e: # noqa: BLE001 — any raise is fail-closed; assert the message survives
210
+ raised = True
211
+ assert "unknown gate rule" in str(e)
212
+ assert raised, "an unknown gate rule must fail closed (raise), not silently commit"
213
+ # FAIL-CLOSED: nothing committed.
214
+ assert driver.prepare("SELECT COUNT(*) AS c FROM posts").all([])[0]["c"] == 0
215
+ finally:
216
+ driver.close()