Files
BEHAVE/BEHAVE-TEXT/behave_text/spec/__init__.py
anti 315ca0b225 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>
2026-05-10 06:20:01 -04:00

44 lines
1.4 KiB
Python

# SPDX-License-Identifier: GPL-3.0-or-later
"""BEHAVE-TEXT spec — text/messaging-domain registry, layered on behave-core.
Public API:
from spec import Observation, Window, OBSERVATION_SCHEMA_VERSION
from spec import PRIMITIVE_REGISTRY, ValueKind, ValueTypeSpec
from spec import TOPIC_PREFIX, event_topic_for
The ``Observation`` exported here is a registry-aware subclass of the base
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.
"""
from .envelope import OBSERVATION_SCHEMA_VERSION, Observation, ObservationValue, Window
from .primitives import PRIMITIVE_REGISTRY, ValueKind, ValueTypeSpec, get, is_known
# Topic namespace deliberately uses *actor* (not *attacker*) because chat-group
# members may include observers, brokers, victims, and bystanders alongside
# threat actors. Attribution of role is the engine's job, not BEHAVE-TEXT's.
TOPIC_PREFIX: str = "actor.observation.text"
def event_topic_for(primitive: str) -> str:
"""Return the canonical bus topic for a BEHAVE-TEXT primitive."""
return f"{TOPIC_PREFIX}.{primitive}"
__all__ = [
"OBSERVATION_SCHEMA_VERSION",
"Observation",
"ObservationValue",
"Window",
"PRIMITIVE_REGISTRY",
"ValueKind",
"ValueTypeSpec",
"is_known",
"get",
"TOPIC_PREFIX",
"event_topic_for",
]