Last updated: 2026-02-22
Repo: RPi4_behavior_tasks
Primary branch: main
Behavioral task framework split from hardware code, with shared protocol runtime, user namespaces, preflight guardrails, run artifact validation, and parity/regression tests.
- Entry point:
run_task.py. - Protocol implementations:
protocols/. - Runtime and policy layer:
runtime/. - User/project-owned config and wrappers:
users/. - Tests:
tests/(smoke, parity, regression).
- Protocols now emit a structured runtime event object (
BehaviorEvent) instead of(event_type, payload)pairs. - Event object definition:
runtime/events.py. BehaviorEventfields:event_type: strpayload: dict[str, object]timestamp: str(wall-clock ISO-8601, UTC)- Factory helper:
make_behavior_event(...)inruntime/events.py. - Dispatch signature:
run_protocol(..., emit_event: Callable[[BehaviorEvent], None])- Base protocol contract:
BaseProtocol.run(..., emit_event: Callable[[BehaviorEvent], None])- Logging path:
run_task.pyreceivesBehaviorEventand writes viaappend_event(...).events.jsonlschema is unchanged:timestamp,event_type,payload.- Backward-compatibility:
runtime/logging_schema.append_event(...)accepts eitherBehaviorEventor legacyevent_type + payload.
--run-mode productionenforces shared-checkout safety checks.--require-release-tagcan enforce release-tag-only production runs.- Experimental protocols require
--allow-experimental. - Artifact and quality validation run after each task unless explicitly disabled in debug mode.
run_task.pyruntime/events.pyruntime/runner.pyruntime/logging_schema.pyruntime/preflight.pyruntime/quality_checks.pyusers/julia_duy/wrappers/run_gonogo_julia_duy.pyusers/matt_context/wrappers/run_context_matt.pyINSTRUCTIONS.md
- Run tests:
pytest -q tests- Run shared go/no-go:
python run_task.py --protocol gonogo --yes --output-dir .task_runs- Run Julia/Duy wrapper:
python users/julia_duy/wrappers/run_gonogo_julia_duy.py --yes --output-dir .task_runs- Run Matt context wrapper:
python users/matt_context/wrappers/run_context_matt.py --yes --output-dir .task_runs
- Migrated runtime emit interface to structured wall-clock
BehaviorEventobjects across all protocols, runners, and smoke/parity helpers. - Preserved
events.jsonlformat for downstream tooling compatibility. - Added/updated tests to validate new callback signature and keep parity/regression behavior stable.