feat(profiler/behave_shell): emit motor.keystroke_cadence
BEHAVE-EXTRACTOR.md Phase B Step B.1.
* SessionContext gains typing_bursts: tuple[tuple[float, ...], ...]
built by _split_typing_bursts(iats) — splits at gaps > IKI_THINK_MAX_S
(1.5s) and drops bursts of fewer than 3 IATs. Mirrors prototype's
_split_into_bursts at BEHAVE/prototype_extractors/shell/extract.py:275.
* _features/motor.py:keystroke_cadence(ctx) emits one Observation
in {steady, bursty, hunt_and_peck, machine}. Median CV across
typing bursts; mean IKI < IKI_MACHINE_MAX_S paired with CV <
CV_MACHINE_MAX → machine. Confidence 0.85/0.70/0.65/0.60 per the
prototype's calibration history.
* < MIN_INPUTS_FOR_CADENCE inputs or zero typing bursts → skip
emission. v0.1 emits only the burst-CV variant; the prototype's
NAIVE session-CV variant is parked for v0.2.
* Calibration grid widened (PHASE_A_PRIMITIVES → PHASE_AB_PRIMITIVES)
to include motor.keystroke_cadence. Grid green across all five
shards.
Tests: too-few-inputs → no emit, all-think-pauses → no burst → no
emit, uniform IATs → steady, sub-5ms → machine, mixed-pace → bursty,
extreme bimodal → hunt_and_peck.
This commit is contained in:
@@ -75,3 +75,18 @@ FEEDBACK_MIN_PAIRS: int = 5
|
||||
# via Hartigan dip is filed for v0.2).
|
||||
PAUSE_CV_METRONOMIC_MAX: float = 0.40
|
||||
PAUSE_CV_BIMODAL_MIN: float = 1.50
|
||||
|
||||
# ── motor.keystroke_cadence (Step B.1) ──────────────────────────────────────
|
||||
# Typing bursts split at gaps > IKI_THINK_MAX_S so think-pauses between
|
||||
# commands don't inflate the within-burst CV. Mirrors the prototype's
|
||||
# _split_into_bursts (BEHAVE/prototype_extractors/shell/extract.py:275-286).
|
||||
IKI_THINK_MAX_S: float = 1.50
|
||||
# Sub-human floor for the "machine" classification — only paired with a
|
||||
# pathologically uniform CV, since real humans never produce sub-5ms IATs
|
||||
# in a sustained burst.
|
||||
IKI_MACHINE_MAX_S: float = 0.005
|
||||
CV_MACHINE_MAX: float = 0.05
|
||||
CV_STEADY_MAX: float = 0.50
|
||||
CV_BURSTY_MAX: float = 1.50
|
||||
# Need this many input events before we'll claim a cadence at all.
|
||||
MIN_INPUTS_FOR_CADENCE: int = 5
|
||||
|
||||
Reference in New Issue
Block a user