refactor: drop decnet- prefix — BEHAVE is now standalone
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 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"""BEHAVE-SHELL Observation envelope (registry-aware subclass).
|
"""BEHAVE-SHELL Observation envelope (registry-aware subclass).
|
||||||
|
|
||||||
The base envelope (`Observation`, `Window`, `OBSERVATION_SCHEMA_VERSION`,
|
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).
|
invariants (window ordering, confidence bounds, schema version, no extras).
|
||||||
|
|
||||||
This module subclasses the core `Observation` to add registry-aware validation
|
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 pydantic import model_validator
|
||||||
|
|
||||||
from decnet_behave_core.spec.envelope import (
|
from behave_core.spec.envelope import (
|
||||||
OBSERVATION_SCHEMA_VERSION,
|
OBSERVATION_SCHEMA_VERSION,
|
||||||
ObservationValue,
|
ObservationValue,
|
||||||
Window,
|
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
|
from .primitives import PRIMITIVE_REGISTRY
|
||||||
|
|
||||||
@@ -3,13 +3,13 @@ requires = ["setuptools>=68", "wheel"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "decnet-behave-shell"
|
name = "behave-shell"
|
||||||
version = "0.1.0"
|
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"
|
requires-python = ">=3.11"
|
||||||
license = { text = "GPL-3.0-or-later" }
|
license = { text = "GPL-3.0-or-later" }
|
||||||
authors = [{ name = "ANTI" }]
|
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]
|
[project.optional-dependencies]
|
||||||
dev = ["pytest>=8", "pytest-cov", "ruff"]
|
dev = ["pytest>=8", "pytest-cov", "ruff"]
|
||||||
@@ -18,7 +18,7 @@ dev = ["pytest>=8", "pytest-cov", "ruff"]
|
|||||||
"Source" = "https://git.resacachile.cl/anti/BEHAVE"
|
"Source" = "https://git.resacachile.cl/anti/BEHAVE"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["decnet_behave_shell*"]
|
include = ["behave_shell*"]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ _REPO_ROOT = Path(__file__).resolve().parent.parent
|
|||||||
if str(_REPO_ROOT) not in sys.path:
|
if str(_REPO_ROOT) not in sys.path:
|
||||||
sys.path.insert(0, str(_REPO_ROOT))
|
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:
|
def build_schema() -> dict:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"""Registry-aware envelope tests for BEHAVE-SHELL.
|
"""Registry-aware envelope tests for BEHAVE-SHELL.
|
||||||
|
|
||||||
Structural envelope tests (window, confidence bounds, schema version, etc.)
|
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
|
SPECIFIC validation: that BEHAVE-SHELL's Observation subclass rejects
|
||||||
primitives not in the shell registry and rejects values that violate the
|
primitives not in the shell registry and rejects values that violate the
|
||||||
per-primitive ValueTypeSpec.
|
per-primitive ValueTypeSpec.
|
||||||
@@ -13,7 +13,7 @@ from __future__ import annotations
|
|||||||
import pytest
|
import pytest
|
||||||
from pydantic import ValidationError
|
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:
|
def _make(primitive: str = "motor.keystroke_cadence", value="steady", **kwargs) -> Observation:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from decnet_behave_shell.spec import (
|
from behave_shell.spec import (
|
||||||
Observation,
|
Observation,
|
||||||
Window,
|
Window,
|
||||||
event_topic_for,
|
event_topic_for,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from __future__ import annotations
|
|||||||
import re
|
import re
|
||||||
from pathlib import Path
|
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).
|
# Primitive paths expected by scratchpad.md (hand-extracted; v0.1).
|
||||||
EXPECTED_PRIMITIVES = {
|
EXPECTED_PRIMITIVES = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# 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:
|
Public API:
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ Public API:
|
|||||||
from spec import TOPIC_PREFIX, event_topic_for
|
from spec import TOPIC_PREFIX, event_topic_for
|
||||||
|
|
||||||
The ``Observation`` exported here is a registry-aware subclass of the base
|
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.
|
text registry and that ``value`` matches the registry's per-primitive spec.
|
||||||
|
|
||||||
See ``spec.envelope`` (and the core envelope module) for PII discipline.
|
See ``spec.envelope`` (and the core envelope module) for PII discipline.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
"""BEHAVE-TEXT Observation envelope (registry-aware subclass).
|
"""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`.
|
registry-aware validation added here against BEHAVE-TEXT's `PRIMITIVE_REGISTRY`.
|
||||||
|
|
||||||
PII discipline (TIGHTER for text than for shell):
|
PII discipline (TIGHTER for text than for shell):
|
||||||
@@ -15,12 +15,12 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from pydantic import model_validator
|
from pydantic import model_validator
|
||||||
|
|
||||||
from decnet_behave_core.spec.envelope import (
|
from behave_core.spec.envelope import (
|
||||||
OBSERVATION_SCHEMA_VERSION,
|
OBSERVATION_SCHEMA_VERSION,
|
||||||
ObservationValue,
|
ObservationValue,
|
||||||
Window,
|
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
|
from .primitives import PRIMITIVE_REGISTRY
|
||||||
|
|
||||||
@@ -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
|
domain and what `Observation.value` must look like. Mirrors every row in the
|
||||||
primitive tables of `scratchpad.md`.
|
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
|
TEXT-domain observations carry CATEGORICAL LABELS, AGGREGATE RATES, and
|
||||||
HASHES of distributions. Sensors operating on Telegram/messaging text MUST
|
HASHES of distributions. Sensors operating on Telegram/messaging text MUST
|
||||||
NOT emit raw message content into BEHAVE-TEXT observations — only derived
|
NOT emit raw message content into BEHAVE-TEXT observations — only derived
|
||||||
@@ -3,13 +3,13 @@ requires = ["setuptools>=68", "wheel"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "decnet-behave-text"
|
name = "behave-text"
|
||||||
version = "0.1.0"
|
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"
|
requires-python = ">=3.11"
|
||||||
license = { text = "GPL-3.0-or-later" }
|
license = { text = "GPL-3.0-or-later" }
|
||||||
authors = [{ name = "ANTI" }]
|
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]
|
[project.optional-dependencies]
|
||||||
dev = ["pytest>=8", "pytest-cov", "ruff"]
|
dev = ["pytest>=8", "pytest-cov", "ruff"]
|
||||||
@@ -18,7 +18,7 @@ dev = ["pytest>=8", "pytest-cov", "ruff"]
|
|||||||
"Source" = "https://git.resacachile.cl/anti/BEHAVE"
|
"Source" = "https://git.resacachile.cl/anti/BEHAVE"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["decnet_behave_text*"]
|
include = ["behave_text*"]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ _REPO_ROOT = Path(__file__).resolve().parent.parent
|
|||||||
if str(_REPO_ROOT) not in sys.path:
|
if str(_REPO_ROOT) not in sys.path:
|
||||||
sys.path.insert(0, str(_REPO_ROOT))
|
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:
|
def build_schema() -> dict:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from __future__ import annotations
|
|||||||
import re
|
import re
|
||||||
from pathlib import Path
|
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).
|
# Primitive paths expected by scratchpad.md (hand-extracted; v0).
|
||||||
EXPECTED_PRIMITIVES = {
|
EXPECTED_PRIMITIVES = {
|
||||||
@@ -96,6 +96,6 @@ def test_experimental_primitives_are_in_content_layer_only():
|
|||||||
|
|
||||||
def test_topic_namespace_uses_actor_not_attacker():
|
def test_topic_namespace_uses_actor_not_attacker():
|
||||||
"""The text-domain topic prefix must be `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 TOPIC_PREFIX == "actor.observation.text"
|
||||||
assert event_topic_for("stylometric.emoji_usage") == "actor.observation.text.stylometric.emoji_usage"
|
assert event_topic_for("stylometric.emoji_usage") == "actor.observation.text.stylometric.emoji_usage"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# DECNET BEHAVE
|
# BEHAVE
|
||||||
|
|
||||||
Behavioral observation spec for adversarial network attribution.
|
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.
|
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 |
|
| Package | Description | Path |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `decnet-behave-core` | Shared observation envelope — schema contract used by all registries | [`core/`](core/) |
|
| `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/) |
|
| `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-text` | Text/messaging-domain behavioral observation registry | [`BEHAVE-TEXT/`](BEHAVE-TEXT/) |
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
Importable as::
|
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:
|
# 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
|
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
|
truth for the wire-format envelope. JSON Schema artifacts in each sibling package
|
||||||
@@ -3,7 +3,7 @@ requires = ["setuptools>=68", "wheel"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "decnet-behave-core"
|
name = "behave-core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "BEHAVE shared observation envelope — schema contract used by BEHAVE-SHELL and BEHAVE-TEXT"
|
description = "BEHAVE shared observation envelope — schema contract used by BEHAVE-SHELL and BEHAVE-TEXT"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
@@ -18,7 +18,7 @@ dev = ["pytest>=8", "pytest-cov", "ruff"]
|
|||||||
"Source" = "https://git.resacachile.cl/anti/BEHAVE"
|
"Source" = "https://git.resacachile.cl/anti/BEHAVE"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["decnet_behave_core*"]
|
include = ["behave_core*"]
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
testpaths = ["tests"]
|
testpaths = ["tests"]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from __future__ import annotations
|
|||||||
import pytest
|
import pytest
|
||||||
from pydantic import ValidationError
|
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:
|
def _make(primitive: str = "motor.example", value="x", **kwargs) -> Observation:
|
||||||
|
|||||||
Reference in New Issue
Block a user