Nothing runs in the daemon yet; these are the pieces the next increments
train and run in shadow.
- learn/features: a WindowSummary accumulated from a window's events
(exec locations, memfd/deleted/uid0 execs, depth, connection classes
and ports, persistence and drop writes, ptrace, module loads, scan
outcomes, capped surprisal per tuple kind, bounded tokens) and
featurize(): 48 explicit features scaled to about [0, 1] plus signed
hashing of tokens into 208 dims, with the governor level and budget
left as context. A window's own detections are never features: they
are the teacher labels.
- learn/mlp: 256 -> 128 -> 64 ReLU with a policy head over the
inspection actions (none, memory_scan, deep_rescan, watch_subtree,
rescan_on_next_rules) and a value head. Scalar reference, AVX2+FMA
chosen at runtime, NEON on aarch64; safe default (no inspection) on a
wrong input size or an inconsistent model. Deterministic init per seed.
- learn/model_file: "SBMD" format with bounded dimensions, exact length,
a sha256 trailer and finite weights checked on load, each failure
named; atomic save into a 0700 directory.
Tests: test_model (kernels against scalar for arbitrary sizes, forward
pass invariants, deterministic init, round-trip, every flipped byte and
truncation rejected, non-finite weights rejected, features bounded and
deterministic). fuzz_model_file. NEON is built and tested only on aarch64.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>