feat(profiler/behave_shell): emit motor.command_chunking

BEHAVE-EXTRACTOR.md Phase B Step B.4. First implementation —
prototype doesn't ship this primitive.

* SessionContext gains intra_command_iats: per-command tuple of
  IATs between consecutive input events whose timestamps fall
  inside [cmd.start_ts, cmd.end_ts). Excludes the terminator IAT.
  Built by _per_command_iats.
* _features/motor.py:command_chunking(ctx) emits one Observation
  in {fluent, fragmented, single_command}.
  - 0 commands → skip emit
  - 1 command → single_command (registry-allowed point)
  - ≥2 commands → median CV across per-command typed-IATs;
    < CMD_CHUNKING_FLUENT_CV_MAX (0.50) → fluent, else fragmented
  - paste-only sessions (no command has ≥3 typed IATs) → skip emit
    (no honest within-command rhythm to measure)
  Confidence 0.80 / 0.65 / 0.60.
* Calibration grid widened to include motor.command_chunking;
  green across all five shards. Phase B primitive set complete.

Tests: no commands → skip, 1 command → single_command, uniform
typing → fluent, alternating fast/slow → fragmented, paste-only
multi-command → skip emit.
This commit is contained in:
2026-05-03 21:29:31 -04:00
parent d04f91cd8c
commit 8161c67ec5
6 changed files with 158 additions and 0 deletions

View File

@@ -104,3 +104,8 @@ TREMOR_RATE_MIN: float = 0.10 # ≥10% sub-floor → tremor
# typo mid-keystroke" (immediate). Beyond this = the operator paused,
# noticed, then went back (deferred).
BACKSPACE_IMMEDIATE_MAX_S: float = 0.50
# ── motor.command_chunking (Step B.4) ───────────────────────────────────────
# Median CV of within-command IATs. Below this → fluent (steady within
# each command); above → fragmented (operator pauses mid-command).
CMD_CHUNKING_FLUENT_CV_MAX: float = 0.50