From 315ca0b225e2ad4fa9c4f3cb7af263f42caafa41 Mon Sep 17 00:00:00 2001 From: anti Date: Sun, 10 May 2026 06:20:01 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20drop=20decnet-=20prefix=20=E2=80=94?= =?UTF-8?q?=20BEHAVE=20is=20now=20standalone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename packages and imports: decnet-behave-core → behave-core decnet-behave-shell → behave-shell decnet-behave-text → behave-text decnet_behave_* → behave_* BEHAVE is no longer a DECNET sub-project. Co-Authored-By: Claude Opus 4.7 --- .../{decnet_behave_shell => behave_shell}/__init__.py | 0 .../spec/__init__.py | 0 .../spec/envelope.py | 6 +++--- .../spec/event_adapter.py | 0 .../spec/primitives.py | 0 BEHAVE-SHELL/pyproject.toml | 8 ++++---- BEHAVE-SHELL/scripts/generate_schema.py | 2 +- BEHAVE-SHELL/tests/test_envelope.py | 4 ++-- BEHAVE-SHELL/tests/test_event_adapter.py | 2 +- BEHAVE-SHELL/tests/test_primitives.py | 2 +- .../{decnet_behave_text => behave_text}/__init__.py | 0 .../{decnet_behave_text => behave_text}/spec/__init__.py | 4 ++-- .../{decnet_behave_text => behave_text}/spec/envelope.py | 6 +++--- .../spec/primitives.py | 2 +- BEHAVE-TEXT/pyproject.toml | 8 ++++---- BEHAVE-TEXT/scripts/generate_schema.py | 2 +- BEHAVE-TEXT/tests/test_primitives.py | 4 ++-- README.md | 8 ++++---- core/{decnet_behave_core => behave_core}/__init__.py | 0 core/{decnet_behave_core => behave_core}/spec/__init__.py | 4 ++-- core/{decnet_behave_core => behave_core}/spec/envelope.py | 0 core/pyproject.toml | 4 ++-- core/tests/test_envelope.py | 2 +- 23 files changed, 34 insertions(+), 34 deletions(-) rename BEHAVE-SHELL/{decnet_behave_shell => behave_shell}/__init__.py (100%) rename BEHAVE-SHELL/{decnet_behave_shell => behave_shell}/spec/__init__.py (100%) rename BEHAVE-SHELL/{decnet_behave_shell => behave_shell}/spec/envelope.py (89%) rename BEHAVE-SHELL/{decnet_behave_shell => behave_shell}/spec/event_adapter.py (100%) rename BEHAVE-SHELL/{decnet_behave_shell => behave_shell}/spec/primitives.py (100%) rename BEHAVE-TEXT/{decnet_behave_text => behave_text}/__init__.py (100%) rename BEHAVE-TEXT/{decnet_behave_text => behave_text}/spec/__init__.py (93%) rename BEHAVE-TEXT/{decnet_behave_text => behave_text}/spec/envelope.py (88%) rename BEHAVE-TEXT/{decnet_behave_text => behave_text}/spec/primitives.py (99%) rename core/{decnet_behave_core => behave_core}/__init__.py (100%) rename core/{decnet_behave_core => behave_core}/spec/__init__.py (78%) rename core/{decnet_behave_core => behave_core}/spec/envelope.py (100%) diff --git a/BEHAVE-SHELL/decnet_behave_shell/__init__.py b/BEHAVE-SHELL/behave_shell/__init__.py similarity index 100% rename from BEHAVE-SHELL/decnet_behave_shell/__init__.py rename to BEHAVE-SHELL/behave_shell/__init__.py diff --git a/BEHAVE-SHELL/decnet_behave_shell/spec/__init__.py b/BEHAVE-SHELL/behave_shell/spec/__init__.py similarity index 100% rename from BEHAVE-SHELL/decnet_behave_shell/spec/__init__.py rename to BEHAVE-SHELL/behave_shell/spec/__init__.py diff --git a/BEHAVE-SHELL/decnet_behave_shell/spec/envelope.py b/BEHAVE-SHELL/behave_shell/spec/envelope.py similarity index 89% rename from BEHAVE-SHELL/decnet_behave_shell/spec/envelope.py rename to BEHAVE-SHELL/behave_shell/spec/envelope.py index 785cee1..046d895 100644 --- a/BEHAVE-SHELL/decnet_behave_shell/spec/envelope.py +++ b/BEHAVE-SHELL/behave_shell/spec/envelope.py @@ -2,7 +2,7 @@ """BEHAVE-SHELL Observation envelope (registry-aware subclass). The base envelope (`Observation`, `Window`, `OBSERVATION_SCHEMA_VERSION`, -`ObservationValue`) lives in `decnet-behave-core`; it enforces only structural +`ObservationValue`) lives in `behave-core`; it enforces only structural invariants (window ordering, confidence bounds, schema version, no extras). This module subclasses the core `Observation` to add registry-aware validation @@ -19,12 +19,12 @@ from __future__ import annotations from pydantic import model_validator -from decnet_behave_core.spec.envelope import ( +from behave_core.spec.envelope import ( OBSERVATION_SCHEMA_VERSION, ObservationValue, Window, ) -from decnet_behave_core.spec.envelope import Observation as _BaseObservation +from behave_core.spec.envelope import Observation as _BaseObservation from .primitives import PRIMITIVE_REGISTRY diff --git a/BEHAVE-SHELL/decnet_behave_shell/spec/event_adapter.py b/BEHAVE-SHELL/behave_shell/spec/event_adapter.py similarity index 100% rename from BEHAVE-SHELL/decnet_behave_shell/spec/event_adapter.py rename to BEHAVE-SHELL/behave_shell/spec/event_adapter.py diff --git a/BEHAVE-SHELL/decnet_behave_shell/spec/primitives.py b/BEHAVE-SHELL/behave_shell/spec/primitives.py similarity index 100% rename from BEHAVE-SHELL/decnet_behave_shell/spec/primitives.py rename to BEHAVE-SHELL/behave_shell/spec/primitives.py diff --git a/BEHAVE-SHELL/pyproject.toml b/BEHAVE-SHELL/pyproject.toml index 770db7d..7762d86 100644 --- a/BEHAVE-SHELL/pyproject.toml +++ b/BEHAVE-SHELL/pyproject.toml @@ -3,13 +3,13 @@ requires = ["setuptools>=68", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "decnet-behave-shell" +name = "behave-shell" version = "0.1.0" -description = "BEHAVE-SHELL — shell-session behavioral observation registry, layered on decnet-behave-core" +description = "BEHAVE-SHELL — shell-session behavioral observation registry, layered on behave-core" requires-python = ">=3.11" license = { text = "GPL-3.0-or-later" } authors = [{ name = "ANTI" }] -dependencies = ["pydantic>=2.6", "decnet-behave-core>=0.1.0"] +dependencies = ["pydantic>=2.6", "behave-core>=0.1.0"] [project.optional-dependencies] dev = ["pytest>=8", "pytest-cov", "ruff"] @@ -18,7 +18,7 @@ dev = ["pytest>=8", "pytest-cov", "ruff"] "Source" = "https://git.resacachile.cl/anti/BEHAVE" [tool.setuptools.packages.find] -include = ["decnet_behave_shell*"] +include = ["behave_shell*"] [tool.ruff] line-length = 100 diff --git a/BEHAVE-SHELL/scripts/generate_schema.py b/BEHAVE-SHELL/scripts/generate_schema.py index 23bc816..a1c1d35 100644 --- a/BEHAVE-SHELL/scripts/generate_schema.py +++ b/BEHAVE-SHELL/scripts/generate_schema.py @@ -17,7 +17,7 @@ _REPO_ROOT = Path(__file__).resolve().parent.parent if str(_REPO_ROOT) not in sys.path: sys.path.insert(0, str(_REPO_ROOT)) -from decnet_behave_shell.spec.envelope import OBSERVATION_SCHEMA_VERSION, Observation # noqa: E402 +from behave_shell.spec.envelope import OBSERVATION_SCHEMA_VERSION, Observation # noqa: E402 def build_schema() -> dict: diff --git a/BEHAVE-SHELL/tests/test_envelope.py b/BEHAVE-SHELL/tests/test_envelope.py index d39d5b8..bea2370 100644 --- a/BEHAVE-SHELL/tests/test_envelope.py +++ b/BEHAVE-SHELL/tests/test_envelope.py @@ -2,7 +2,7 @@ """Registry-aware envelope tests for BEHAVE-SHELL. Structural envelope tests (window, confidence bounds, schema version, etc.) -live in `decnet-behave-core`'s test suite. This file exercises the SHELL- +live in `behave-core`'s test suite. This file exercises the SHELL- SPECIFIC validation: that BEHAVE-SHELL's Observation subclass rejects primitives not in the shell registry and rejects values that violate the per-primitive ValueTypeSpec. @@ -13,7 +13,7 @@ from __future__ import annotations import pytest from pydantic import ValidationError -from decnet_behave_shell.spec import Observation, Window +from behave_shell.spec import Observation, Window def _make(primitive: str = "motor.keystroke_cadence", value="steady", **kwargs) -> Observation: diff --git a/BEHAVE-SHELL/tests/test_event_adapter.py b/BEHAVE-SHELL/tests/test_event_adapter.py index 705434f..346f971 100644 --- a/BEHAVE-SHELL/tests/test_event_adapter.py +++ b/BEHAVE-SHELL/tests/test_event_adapter.py @@ -5,7 +5,7 @@ from __future__ import annotations import pytest -from decnet_behave_shell.spec import ( +from behave_shell.spec import ( Observation, Window, event_topic_for, diff --git a/BEHAVE-SHELL/tests/test_primitives.py b/BEHAVE-SHELL/tests/test_primitives.py index 42ab025..3e06b7b 100644 --- a/BEHAVE-SHELL/tests/test_primitives.py +++ b/BEHAVE-SHELL/tests/test_primitives.py @@ -11,7 +11,7 @@ from __future__ import annotations import re from pathlib import Path -from decnet_behave_shell.spec import PRIMITIVE_REGISTRY, ValueKind +from behave_shell.spec import PRIMITIVE_REGISTRY, ValueKind # Primitive paths expected by scratchpad.md (hand-extracted; v0.1). EXPECTED_PRIMITIVES = { diff --git a/BEHAVE-TEXT/decnet_behave_text/__init__.py b/BEHAVE-TEXT/behave_text/__init__.py similarity index 100% rename from BEHAVE-TEXT/decnet_behave_text/__init__.py rename to BEHAVE-TEXT/behave_text/__init__.py diff --git a/BEHAVE-TEXT/decnet_behave_text/spec/__init__.py b/BEHAVE-TEXT/behave_text/spec/__init__.py similarity index 93% rename from BEHAVE-TEXT/decnet_behave_text/spec/__init__.py rename to BEHAVE-TEXT/behave_text/spec/__init__.py index 723e293..c3ae2ae 100644 --- a/BEHAVE-TEXT/decnet_behave_text/spec/__init__.py +++ b/BEHAVE-TEXT/behave_text/spec/__init__.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -"""BEHAVE-TEXT spec — text/messaging-domain registry, layered on decnet-behave-core. +"""BEHAVE-TEXT spec — text/messaging-domain registry, layered on behave-core. Public API: @@ -8,7 +8,7 @@ Public API: from spec import TOPIC_PREFIX, event_topic_for The ``Observation`` exported here is a registry-aware subclass of the base -class from ``decnet-behave-core``; it validates that ``primitive`` is in the +class from ``behave-core``; it validates that ``primitive`` is in the text registry and that ``value`` matches the registry's per-primitive spec. See ``spec.envelope`` (and the core envelope module) for PII discipline. diff --git a/BEHAVE-TEXT/decnet_behave_text/spec/envelope.py b/BEHAVE-TEXT/behave_text/spec/envelope.py similarity index 88% rename from BEHAVE-TEXT/decnet_behave_text/spec/envelope.py rename to BEHAVE-TEXT/behave_text/spec/envelope.py index ce697ef..6edaef1 100644 --- a/BEHAVE-TEXT/decnet_behave_text/spec/envelope.py +++ b/BEHAVE-TEXT/behave_text/spec/envelope.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later """BEHAVE-TEXT Observation envelope (registry-aware subclass). -Mirrors BEHAVE-SHELL's pattern: structural envelope from `decnet-behave-core`, +Mirrors BEHAVE-SHELL's pattern: structural envelope from `behave-core`, registry-aware validation added here against BEHAVE-TEXT's `PRIMITIVE_REGISTRY`. PII discipline (TIGHTER for text than for shell): @@ -15,12 +15,12 @@ from __future__ import annotations from pydantic import model_validator -from decnet_behave_core.spec.envelope import ( +from behave_core.spec.envelope import ( OBSERVATION_SCHEMA_VERSION, ObservationValue, Window, ) -from decnet_behave_core.spec.envelope import Observation as _BaseObservation +from behave_core.spec.envelope import Observation as _BaseObservation from .primitives import PRIMITIVE_REGISTRY diff --git a/BEHAVE-TEXT/decnet_behave_text/spec/primitives.py b/BEHAVE-TEXT/behave_text/spec/primitives.py similarity index 99% rename from BEHAVE-TEXT/decnet_behave_text/spec/primitives.py rename to BEHAVE-TEXT/behave_text/spec/primitives.py index 2ae7926..3d13c53 100644 --- a/BEHAVE-TEXT/decnet_behave_text/spec/primitives.py +++ b/BEHAVE-TEXT/behave_text/spec/primitives.py @@ -5,7 +5,7 @@ Source-of-truth for what `Observation.primitive` may be in the text/messaging domain and what `Observation.value` must look like. Mirrors every row in the primitive tables of `scratchpad.md`. -PII discipline notice (carried over from decnet-behave-core's envelope module): +PII discipline notice (carried over from behave-core's envelope module): TEXT-domain observations carry CATEGORICAL LABELS, AGGREGATE RATES, and HASHES of distributions. Sensors operating on Telegram/messaging text MUST NOT emit raw message content into BEHAVE-TEXT observations — only derived diff --git a/BEHAVE-TEXT/pyproject.toml b/BEHAVE-TEXT/pyproject.toml index ed0402e..c636b93 100644 --- a/BEHAVE-TEXT/pyproject.toml +++ b/BEHAVE-TEXT/pyproject.toml @@ -3,13 +3,13 @@ requires = ["setuptools>=68", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "decnet-behave-text" +name = "behave-text" version = "0.1.0" -description = "BEHAVE-TEXT — text/messaging-domain behavioral observation registry, layered on decnet-behave-core" +description = "BEHAVE-TEXT — text/messaging-domain behavioral observation registry, layered on behave-core" requires-python = ">=3.11" license = { text = "GPL-3.0-or-later" } authors = [{ name = "ANTI" }] -dependencies = ["pydantic>=2.6", "decnet-behave-core>=0.1.0"] +dependencies = ["pydantic>=2.6", "behave-core>=0.1.0"] [project.optional-dependencies] dev = ["pytest>=8", "pytest-cov", "ruff"] @@ -18,7 +18,7 @@ dev = ["pytest>=8", "pytest-cov", "ruff"] "Source" = "https://git.resacachile.cl/anti/BEHAVE" [tool.setuptools.packages.find] -include = ["decnet_behave_text*"] +include = ["behave_text*"] [tool.ruff] line-length = 100 diff --git a/BEHAVE-TEXT/scripts/generate_schema.py b/BEHAVE-TEXT/scripts/generate_schema.py index 5c2c5e9..9d4fcc4 100644 --- a/BEHAVE-TEXT/scripts/generate_schema.py +++ b/BEHAVE-TEXT/scripts/generate_schema.py @@ -17,7 +17,7 @@ _REPO_ROOT = Path(__file__).resolve().parent.parent if str(_REPO_ROOT) not in sys.path: sys.path.insert(0, str(_REPO_ROOT)) -from decnet_behave_text.spec.envelope import OBSERVATION_SCHEMA_VERSION, Observation # noqa: E402 +from behave_text.spec.envelope import OBSERVATION_SCHEMA_VERSION, Observation # noqa: E402 def build_schema() -> dict: diff --git a/BEHAVE-TEXT/tests/test_primitives.py b/BEHAVE-TEXT/tests/test_primitives.py index e6ceedd..cea4cf9 100644 --- a/BEHAVE-TEXT/tests/test_primitives.py +++ b/BEHAVE-TEXT/tests/test_primitives.py @@ -11,7 +11,7 @@ from __future__ import annotations import re from pathlib import Path -from decnet_behave_text.spec import PRIMITIVE_REGISTRY, ValueKind +from behave_text.spec import PRIMITIVE_REGISTRY, ValueKind # Primitive paths expected by scratchpad.md (hand-extracted; v0). EXPECTED_PRIMITIVES = { @@ -96,6 +96,6 @@ def test_experimental_primitives_are_in_content_layer_only(): def test_topic_namespace_uses_actor_not_attacker(): """The text-domain topic prefix must be `actor.*`, not `attacker.*`.""" - from decnet_behave_text.spec import TOPIC_PREFIX, event_topic_for + from behave_text.spec import TOPIC_PREFIX, event_topic_for assert TOPIC_PREFIX == "actor.observation.text" assert event_topic_for("stylometric.emoji_usage") == "actor.observation.text.stylometric.emoji_usage" diff --git a/README.md b/README.md index 10b8d4a..303f57f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DECNET BEHAVE +# BEHAVE Behavioral observation spec for adversarial network attribution. BEHAVE defines a structured observation envelope (`core`) and two domain registries — shell-session (`BEHAVE-SHELL`) and text/messaging (`BEHAVE-TEXT`) — used to build behavioral signatures over collected operator activity. @@ -7,9 +7,9 @@ BEHAVE defines a structured observation envelope (`core`) and two domain registr | Package | Description | Path | |---|---|---| -| `decnet-behave-core` | Shared observation envelope — schema contract used by all registries | [`core/`](core/) | -| `decnet-behave-shell` | Shell-session behavioral observation registry | [`BEHAVE-SHELL/`](BEHAVE-SHELL/) | -| `decnet-behave-text` | Text/messaging-domain behavioral observation registry | [`BEHAVE-TEXT/`](BEHAVE-TEXT/) | +| `behave-core` | Shared observation envelope — schema contract used by all registries | [`core/`](core/) | +| `behave-shell` | Shell-session behavioral observation registry | [`BEHAVE-SHELL/`](BEHAVE-SHELL/) | +| `behave-text` | Text/messaging-domain behavioral observation registry | [`BEHAVE-TEXT/`](BEHAVE-TEXT/) | ## Install diff --git a/core/decnet_behave_core/__init__.py b/core/behave_core/__init__.py similarity index 100% rename from core/decnet_behave_core/__init__.py rename to core/behave_core/__init__.py diff --git a/core/decnet_behave_core/spec/__init__.py b/core/behave_core/spec/__init__.py similarity index 78% rename from core/decnet_behave_core/spec/__init__.py rename to core/behave_core/spec/__init__.py index 358b154..cd26f22 100644 --- a/core/decnet_behave_core/spec/__init__.py +++ b/core/behave_core/spec/__init__.py @@ -3,9 +3,9 @@ Importable as:: - from decnet_behave_core.spec.envelope import Observation, Window, OBSERVATION_SCHEMA_VERSION + from behave_core.spec.envelope import Observation, Window, OBSERVATION_SCHEMA_VERSION # or, equivalently, from this top-level re-export: - from decnet_behave_core.spec import Observation, Window, OBSERVATION_SCHEMA_VERSION + from behave_core.spec import Observation, Window, OBSERVATION_SCHEMA_VERSION Both BEHAVE-SHELL and BEHAVE-TEXT depend on this package as their single source of truth for the wire-format envelope. JSON Schema artifacts in each sibling package diff --git a/core/decnet_behave_core/spec/envelope.py b/core/behave_core/spec/envelope.py similarity index 100% rename from core/decnet_behave_core/spec/envelope.py rename to core/behave_core/spec/envelope.py diff --git a/core/pyproject.toml b/core/pyproject.toml index f9712bb..d359b66 100644 --- a/core/pyproject.toml +++ b/core/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=68", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "decnet-behave-core" +name = "behave-core" version = "0.1.0" description = "BEHAVE shared observation envelope — schema contract used by BEHAVE-SHELL and BEHAVE-TEXT" requires-python = ">=3.11" @@ -18,7 +18,7 @@ dev = ["pytest>=8", "pytest-cov", "ruff"] "Source" = "https://git.resacachile.cl/anti/BEHAVE" [tool.setuptools.packages.find] -include = ["decnet_behave_core*"] +include = ["behave_core*"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/core/tests/test_envelope.py b/core/tests/test_envelope.py index 054a56f..b272b67 100644 --- a/core/tests/test_envelope.py +++ b/core/tests/test_envelope.py @@ -13,7 +13,7 @@ from __future__ import annotations import pytest from pydantic import ValidationError -from decnet_behave_core.spec import OBSERVATION_SCHEMA_VERSION, Observation, Window +from behave_core.spec import OBSERVATION_SCHEMA_VERSION, Observation, Window def _make(primitive: str = "motor.example", value="x", **kwargs) -> Observation: