src/learn/ (pure libraries; nothing in the daemon calls them yet, Stage 3
uses them in replay):
- tokenize: path templates (user homes, per-uid dirs, pids, digit and hex
runs, UUIDs, mktemp-style names abstracted) and command-line shapes
(flags kept, values, paths, URLs, IPs, numbers and encoded blobs
classed; the first plain word kept as a subcommand; long argument lists
summarized). Bounded and noexcept.
- rarity: decayed count-min sketches over parent>child, grandparent>
parent>child, exe+command-line shape, exe+connection class and
exe+persistence location, scored as surprisal in bits; a bounded
first-seen table; deterministic hashing for replay. About 1.3 MiB.
tests/test_learn.cpp: tokenizer cases and idempotence; count-min never
underestimates (also after decay); determinism; rare scores above common;
half-life decay; bounded first-seen. fuzz_tokenizer found two
idempotence bugs (truncation before templating, and a cut that left a
" (deleted)" suffix), fixed here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>