Searches ANSI-stripped output for LANG / LC_ALL / LC_CTYPE envvar substrings emitted by env / locale / printenv. Highest-priority key wins (LC_ALL > LANG > LC_CTYPE); POSIX value normalised to BCP-47: en_US.UTF-8 → en-US, pt_BR.UTF-8 → pt-BR, C/POSIX → und. Free-string registry value emitted directly. PII discipline: only the parsed locale value enters observations; surrounding output is read once for matching and dropped.
79 lines
2.0 KiB
Python
79 lines
2.0 KiB
Python
"""Registered feature functions.
|
|
|
|
Each entry takes a ``SessionContext`` and yields zero or more
|
|
``Observation`` instances. Adding a primitive = adding a function in a
|
|
sibling module and appending it to ``FEATURES``.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from typing import Callable, Iterable
|
|
|
|
from decnet_behave_core.spec.envelope import Observation
|
|
|
|
from decnet.profiler.behave_shell._ctx import SessionContext
|
|
from decnet.profiler.behave_shell._features.cognitive import (
|
|
cognitive_load,
|
|
command_branch_diversity,
|
|
error_resilience_fallback_to_man,
|
|
error_resilience_frustration_typing,
|
|
error_resilience_retry_tactic,
|
|
exploration_style,
|
|
feedback_loop_engagement,
|
|
planning_depth,
|
|
tool_vocabulary,
|
|
inter_command_consistency,
|
|
inter_command_latency_class,
|
|
)
|
|
from decnet.profiler.behave_shell._features.environmental import (
|
|
locale,
|
|
shell_type,
|
|
terminal_multiplexer,
|
|
)
|
|
from decnet.profiler.behave_shell._features.temporal import (
|
|
escalation_pattern,
|
|
landing_ritual,
|
|
session_duration,
|
|
)
|
|
from decnet.profiler.behave_shell._features.motor import (
|
|
command_chunking,
|
|
error_correction,
|
|
input_modality,
|
|
keystroke_cadence,
|
|
motor_stability,
|
|
paste_burst_rate,
|
|
pipe_chaining_depth,
|
|
shortcut_usage,
|
|
tab_completion,
|
|
)
|
|
|
|
FeatureFn = Callable[[SessionContext], Iterable[Observation]]
|
|
|
|
FEATURES: tuple[FeatureFn, ...] = (
|
|
input_modality,
|
|
paste_burst_rate,
|
|
keystroke_cadence,
|
|
motor_stability,
|
|
error_correction,
|
|
command_chunking,
|
|
tab_completion,
|
|
shortcut_usage,
|
|
pipe_chaining_depth,
|
|
inter_command_latency_class,
|
|
command_branch_diversity,
|
|
feedback_loop_engagement,
|
|
inter_command_consistency,
|
|
cognitive_load,
|
|
exploration_style,
|
|
planning_depth,
|
|
tool_vocabulary,
|
|
error_resilience_retry_tactic,
|
|
error_resilience_frustration_typing,
|
|
error_resilience_fallback_to_man,
|
|
session_duration,
|
|
escalation_pattern,
|
|
landing_ritual,
|
|
shell_type,
|
|
terminal_multiplexer,
|
|
locale,
|
|
)
|