behavior-contracts 0.9.2__tar.gz → 0.9.3__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.
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/PKG-INFO +1 -1
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/pyproject.toml +1 -1
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/behavior.py +16 -10
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/primitives.py +7 -7
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/PKG-INFO +1 -1
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/README.md +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/setup.cfg +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/__init__.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/canonical.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/codec.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/conformance.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/envelope.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/expr_eval.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/fingerprint.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/guard.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/plan.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts/template.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/SOURCES.txt +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/dependency_links.txt +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/entry_points.txt +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/requires.txt +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/top_level.txt +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/tests/test_codegen_generated.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/tests/test_conformance.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/tests/test_plan_parallel.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/tests/test_primitives.py +0 -0
- {behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/tests/test_public_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: behavior-contracts
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.3
|
|
4
4
|
Summary: Multi-language IR-Runtime common core (Python port). The COMMON 'thin core' primitives from dsl-contracts runtime-boundary.md — validate_envelope / evaluate_expression / render_template / run_plan / canonical_value / canonical_json / py_float_repr / assert_portable — with zero backend (DynamoDB/graphddb) dependencies.
|
|
5
5
|
Author: foo-log
|
|
6
6
|
License: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "behavior-contracts"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.3"
|
|
8
8
|
description = "Multi-language IR-Runtime common core (Python port). The COMMON 'thin core' primitives from dsl-contracts runtime-boundary.md — validate_envelope / evaluate_expression / render_template / run_plan / canonical_value / canonical_json / py_float_repr / assert_portable — with zero backend (DynamoDB/graphddb) dependencies."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -31,7 +31,7 @@ import threading
|
|
|
31
31
|
from typing import Any, Callable, Dict, List, Mapping, Optional
|
|
32
32
|
|
|
33
33
|
from .expr_eval import ExprFailure, evaluate as evaluate_expression
|
|
34
|
-
from .plan import ELEMENT_POLICY_KINDS, run_plan
|
|
34
|
+
from .plan import ELEMENT_POLICY_KINDS, run_plan, _unproduced_value
|
|
35
35
|
|
|
36
36
|
Value = Any
|
|
37
37
|
|
|
@@ -509,20 +509,27 @@ def run_behavior(
|
|
|
509
509
|
if into is None and "into" not in m:
|
|
510
510
|
return {"ok": collected}
|
|
511
511
|
|
|
512
|
-
# into(v2): over と同じ長さ・順序の augment
|
|
512
|
+
# into(v2): over と同じ長さ・順序の augment 済みリスト。guard-skip 要素は無変更で pass
|
|
513
|
+
# through するが、connection 型 into(#182)は空 connection(_unproduced_value)で埋める
|
|
514
|
+
# =writeUnproduced の whole-node skip と同一 SSoT。
|
|
515
|
+
node_rk = _node_relation_kind(node)
|
|
513
516
|
augmented: List[Value] = []
|
|
514
517
|
k = 0
|
|
515
518
|
for i, el in enumerate(over):
|
|
516
519
|
if k < len(kept_idx) and kept_idx[k] == i:
|
|
517
|
-
|
|
518
|
-
_bfail(
|
|
519
|
-
"MAP_INTO_ELEMENT_NOT_OBJECT",
|
|
520
|
-
f"map '{op['id']}': 'into' requires object elements (element {i} is not an object)",
|
|
521
|
-
)
|
|
522
|
-
augmented.append({**el, into: collected[k]})
|
|
520
|
+
into_val: Value = collected[k]
|
|
523
521
|
k += 1
|
|
522
|
+
elif node_rk == "connection":
|
|
523
|
+
into_val = _unproduced_value(node_rk)
|
|
524
524
|
else:
|
|
525
525
|
augmented.append(el)
|
|
526
|
+
continue
|
|
527
|
+
if not isinstance(el, dict):
|
|
528
|
+
_bfail(
|
|
529
|
+
"MAP_INTO_ELEMENT_NOT_OBJECT",
|
|
530
|
+
f"map '{op['id']}': 'into' requires object elements (element {i} is not an object)",
|
|
531
|
+
)
|
|
532
|
+
augmented.append({**el, into: into_val})
|
|
526
533
|
return {"ok": augmented}
|
|
527
534
|
|
|
528
535
|
if kind == "fanout":
|
|
@@ -581,7 +588,6 @@ def run_behavior(
|
|
|
581
588
|
|
|
582
589
|
for i, s in enumerate(run["states"]):
|
|
583
590
|
if s is not None and s.get("status") == "skipped":
|
|
584
|
-
|
|
585
|
-
results[ops[i]["id"]] = {"items": [], "cursor": None} if rk == "connection" else None
|
|
591
|
+
results[ops[i]["id"]] = _unproduced_value(_node_relation_kind(body[i]))
|
|
586
592
|
|
|
587
593
|
return evaluate_expression(comp["output"], base_scope())
|
|
@@ -21,7 +21,7 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
21
21
|
from typing import Any, Callable, List, Mapping, Optional, Sequence, TypeVar
|
|
22
22
|
|
|
23
23
|
from .expr_eval import Scope, Value, evaluate
|
|
24
|
-
from .plan import run_plan # re-export(SSoT)
|
|
24
|
+
from .plan import run_plan, _unproduced_value # re-export(SSoT)
|
|
25
25
|
|
|
26
26
|
Expr = Any # 未評価の Expression IR ノード(primitive の被演算子)
|
|
27
27
|
T = TypeVar("T")
|
|
@@ -200,18 +200,18 @@ def map_with_concurrency(
|
|
|
200
200
|
|
|
201
201
|
# ── (d) skip / unproduced-value helper ────────────────────────────────────────
|
|
202
202
|
def unproduced_value(kind: Optional[str]) -> Value:
|
|
203
|
-
"""未生成 Port(Skip)の表現値。single→None / connection→空 connection。"""
|
|
204
|
-
return
|
|
203
|
+
"""未生成 Port(Skip)の表現値。single→None / connection→空 connection。判定 SSoT は plan._unproduced_value。"""
|
|
204
|
+
return _unproduced_value(kind)
|
|
205
205
|
|
|
206
206
|
|
|
207
207
|
def skip_single() -> Value:
|
|
208
|
-
"""single relation の未生成 = None
|
|
209
|
-
return
|
|
208
|
+
"""single relation の未生成 = None(unproduced_value("single") の明示版)。"""
|
|
209
|
+
return _unproduced_value("single")
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
def skip_connection() -> Value:
|
|
213
|
-
"""connection relation の未生成 = {items:[],cursor:None}
|
|
214
|
-
return
|
|
213
|
+
"""connection relation の未生成 = {items:[],cursor:None}(unproduced_value("connection") の明示版)。"""
|
|
214
|
+
return _unproduced_value("connection")
|
|
215
215
|
|
|
216
216
|
|
|
217
217
|
# ── (e) hydration / relation helper ───────────────────────────────────────────
|
{behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: behavior-contracts
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.3
|
|
4
4
|
Summary: Multi-language IR-Runtime common core (Python port). The COMMON 'thin core' primitives from dsl-contracts runtime-boundary.md — validate_envelope / evaluate_expression / render_template / run_plan / canonical_value / canonical_json / py_float_repr / assert_portable — with zero backend (DynamoDB/graphddb) dependencies.
|
|
5
5
|
Author: foo-log
|
|
6
6
|
License: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/requires.txt
RENAMED
|
File without changes
|
{behavior_contracts-0.9.2 → behavior_contracts-0.9.3}/src/behavior_contracts.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|