Files
DECNET/tests/profiler/behave_shell/test_pin_smoke.py
anti f2b3393669 chore: relicense to AGPL-3.0-or-later and add SPDX headers
Replaces LICENSE (GPLv3 -> AGPLv3) and prepends
`SPDX-License-Identifier: AGPL-3.0-or-later` to every source file
across decnet/, decnet_web/, tests/, scripts/, and tools/.

Rationale: closes the GPLv3 ASP loophole so any party operating a
modified DECNET as a network service must offer their modified
source. Personal copyright (Samuel Paschuan) + inbound=outbound
contributions make a future unilateral relicense infeasible.

- LICENSE: full AGPL-3.0 text (gnu.org/licenses/agpl-3.0.txt)
- COPYRIGHT: project copyright notice
- tools/add_spdx_headers.py: idempotent header injector
  (shebang- and PEP 263-aware)

Touches 1565 source files (.py, .ts, .tsx, .js, .jsx, .css, .sh).
No behavior change; comments only.
2026-05-22 21:04:16 -04:00

59 lines
2.1 KiB
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""W.2 smoke: BEHAVE library pins are install-time importable.
Three asserts protect the pyproject.toml pin from a broken wheel /
missing install / drift in the BEHAVE-side public API. CI catches
these before they make it onto a running master.
"""
from __future__ import annotations
def test_envelope_imports_cleanly() -> None:
from behave_core.spec.envelope import Observation, Window
# construction smoke — registry-agnostic envelope
obs = Observation(
primitive="motor.input_modality",
value="typed",
confidence=0.9,
window=Window(start_ts=0.0, end_ts=1.0),
source="test",
)
assert obs.primitive == "motor.input_modality"
assert obs.v >= 1
def test_registry_imports_and_is_non_empty() -> None:
from behave_shell.spec.primitives import PRIMITIVE_REGISTRY
assert len(PRIMITIVE_REGISTRY) > 0
# spot-check a primitive every Tier-A engine emits
assert "motor.input_modality" in PRIMITIVE_REGISTRY
def test_event_adapter_topic_shape() -> None:
from behave_shell.spec.event_adapter import event_topic_for
assert (
event_topic_for("motor.input_modality")
== "attacker.observation.motor.input_modality"
)
def test_to_event_payload_excludes_envelope_meta_fields() -> None:
"""The adapter excludes id/ts/v from payload (they ride at the
DECNET Event envelope level). The profiler worker re-merges them
in per BEHAVE-INTEGRATION.md §339-366."""
from behave_core.spec.envelope import Observation, Window
from behave_shell.spec.event_adapter import to_event_payload
obs = Observation(
primitive="motor.input_modality",
value="typed",
confidence=0.9,
window=Window(start_ts=0.0, end_ts=1.0),
source="test",
)
payload = to_event_payload(obs)
for excluded in ("id", "ts", "v"):
assert excluded not in payload, (
f"event_adapter.to_event_payload leaked {excluded!r} into "
f"the payload body — DECNET re-merges these explicitly"
)