The rarity-greedy comparator acted on every evaluated window, so it spent
each hour's budget on the first ~15 windows and scored 0 hits in every
cell. Criteria 2 and 3 of the Stage 4 gate were void against it.
rarity_calibrated keeps the same rarity value, chooser, costs and budget,
and adds a per-node threshold frozen before the evaluated span: the m-th
largest value over the trailing 24 h of label-free history between the
warm-up and the --eval-after bound, with m set so expected spend matches
the hourly budget. Without that history the comparator is uncalibrated
and the gate fails by name; it never falls back to another rule.
rarity_greedy (the old first-come rule) and rarity_hindsight (per-hour
ordering, not causal) are reported as diagnostics and never judged.
fleet gate pools counts, keeps thresholds per node, and fails a pooled
cell when any node is uncalibrated or lacks the comparator.
Contract change: in `fleet gate --json`, rarity_hits and
rarity_cpu_seconds now describe the calibrated comparator; the old
numbers are rarity_greedy_hits and rarity_greedy_cpu_seconds.
Pre-registration: docs/evaluation/stage4-rarity-baseline-preregistration.md,
sha256 4916c95cd2581e3749acfe46c3ccf827aa5ce98c06150b49b978fc70da013f95,
indexed in YAMS at 2026-11-20T18:55:48Z, before the code. This commit is
dated after the registration time in that document (2026-11-21T00:00Z);
the YAMS record is what predates it.
Checked: meson suite 58/58, scripts/fleet_e2e.sh, clang-tidy and the
strict analyzer on the changed TUs. Not run: fold on the changed TUs,
make fuzz, the live Docker tests and the perf KPI. The comparator has
not been run on validation-range data.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
make docker-compiler-matrix builds and tests the working tree in throwaway
containers per distro and compiler, ninja -k 0 so every compile error shows.
Minutes per leg locally vs ~3 h for a ci/** run. The apt list moves to
packaging/ci/build-deps.txt, read by build-release.sh and Dockerfile.matrix.
noble's clang leg uses clang-19 + llvm-19: clang 18 cannot use libstdc++ 13's
std::expected.
The gate's own documentation claimed more than the tool did, in ways that
mattered once the integrity checks landed.
- "passes only if all 9 cells pass" was enforced by scripts, not by the gate; it
is now enforced (previous commit) and the text says which criterion the tool
applies: complete evidence, refused false, every pooled cell passing.
- The model digest proves agreement ACROSS reports. It cannot prove that the
file on disk now is the one that was evaluated. Corrected everywhere.
- The remedy was described inconsistently: cutting the training bundles earlier
is NOT enough (evaluation still replays the whole store), a bounded evaluation
range is required. Written consistently, with --eval-after NS|auto.
- scripts/fleet_e2e.sh asserted three gate checks; promotion_gate emits five. It
now asserts >= 5, requires the provenance fields, and adds the honest-evidence
invariant: today every cell is in-sample, so at least one cell must report
in_sample true, none may pass, and each must carry the out-of-sample failure.
A pass over in-sample cells is itself a failure.
- The Salt/range runbooks advertised the flow as producing promotion evidence;
it collects gate INPUT, and a passing verdict requires out-of-sample windows.
compare() budgeted daemon_rss_last_mb only, so a regression that spiked and
then settled passed: the peak was printed but never checked, leaving just the
absolute 512 MB ceiling. Both metrics are now budgeted per phase through one
helper — max(32 MB, 15% of the baseline) for the phase-end value and
max(64 MB, 15%) for the peak.
The 64 MB floor is measured, not chosen: with a shared 32 MB floor three
same-version repeat pairs (8-r1->8-r2 idle peak +59.6 MB, 9-r1->9-r2 storm
+36.3 MB, 9-r1->9-r3 +36.0 MB) would be called regressions, because a single
transient sample spreads about twice as wide as the phase-end value. 64 MB
clears all nine same-version pairs while every v0.2.8 -> v0.2.9 pair still
trips it; re-checked four same-version pairs here with zero over-budget phases.
The peak check adds real signal: on the stored runs it catches v0.2.9's idle
peak at +137.4 MB where the last-sample check saw +102.4 MB. Missing samples
still fail closed and never read as "no growth".
The constrained-lane report gated idle CPU, exec-decision p95 and dropped
events, so a real memory regression could pass unnoticed — v0.2.9 grew daemon
RSS by 132-141 MiB against v0.2.8 in all three interleaved pairs.
Each phase now reports daemon RSS (max, last, sample count) from the existing
status.jsonl resources.rss_mb samples, with container memory kept as a
secondary metric, and reports fail closed when daemon RSS samples are missing
rather than silently skipping the check. --compare prints a per-phase delta
column against a baseline-relative budget of max(32 MB, 15% of the baseline)
and exits non-zero with OVER BUDGET lines, so a regression is visible instead
of buried in container statistics that also include the harness.
Measured on the stored runs: the v0.2.8 -> v0.2.9 pairs breach the budget in
all six phases (+87.2 to +141.0 MB), while a same-version pair does not (worst
spread +29.1 MB). The docstring states exactly what a non-zero exit covers.
rule_partition.cpp parses rule sources (splitting rules, extracting top-level
condition identifiers and facts), but had no fuzz target, contradicting the
repository rule that every parser of attacker-influenced input gets one.
fuzz_rule_partition asserts the splitter is a total, exact partition of its
input, that rule/condition slicing stays within the rule, and that partition
selection agrees with magic bytes and the size bucket boundaries.
It is registered in fuzz/meson.build (with rule_partition.cpp), swept by
scripts/run_fuzzers.sh, and documented next to the other targets. Seeds cover
comments, strings, regexes, hex blocks, an include and a truncated source.
- scripts/threat_traces.py: enforces the mechanical rules of the 2026-10-28
threat-trace pre-registration: required # meta keys; eval families first
reported 2025-07-01..2026-10-28 with a new-family/new-variant bucket and
write-up sources only; training families before the cutoff with every
fifth family (first-report order) in dev; no family in both files;
RFC 5737 addresses and .example domains only; size caps; and that every
file compiles with replay's parser. --sha256 prints the freeze digest.
- tests/trace_check.cpp: strawberry-trace-check dev tool (replay's parser).
- strawberry.gate: optional gate.warmup_hours (unset = the pre-registered
12 h; TEST pillars only).
- deploy/salt/test/fleet_run.sh: gate phase - tops sensor history past the
10 min injection floor, runs orch.strawberry_gate, asserts 3 gate models
were published, 9 pooled cells over 3 sensors with positives, sensors keep
their reports, and still no promoted model anywhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-registered gate (docs/evaluation/stage4-promotion-gate.md) asks for the
criteria to hold on 3 non-overlapping periods x 3 training seeds; until now the
tool reported a single run and the operator recorded the rest. This produces
the 9 results for a fleet, with the criteria unchanged:
- replay --policy-eval --eval-model FILE (repeatable) --periods N: one pass
evaluates every model on every equal time slice of the ranked history; each
(model, period) cell simulates the model and rarity-greedy with their own
hourly budgets exactly as policy_eval does (policy_eval.cells). With one
model equal to --model and one period the cell equals the single-model
evaluation (test R11b); periods partition windows and positives.
- strawberry fleet gate DIR: pools the cells of every node report (windows,
positives, inspections, CPU-s, hits, refusals) per (model, period) and
applies learn::promotion_gate unchanged to each; passes only if all pass.
Malformed / cell-less reports are skipped and listed.
- Evaluation stays on the node (raw telemetry never leaves it): the central
cycle now also publishes all three seed models to dist/gate/; strawberry.gate
(sensors) evaluates them with the pre-registered evaluation traces; the
operator-run orch.strawberry_gate pushes the reports back and pools them;
evidence under central.work_dir/gate-<stamp>/. Nothing promotes.
- docs/evaluation/stage4-fleet-gate.md: the procedure (new dated document;
criteria and numbers unchanged).
Validated: test_fleet_gate (pooling sums, pooling reaching 10 positives
neither node has alone, one failing cell fails the fleet, malformed reports
skipped), R11b, Salt render checks (no models -> refusal; 3 models x 3
periods; orchestration pools), and scripts/fleet_e2e.sh end to end: 3 nodes ->
9 pooled cells with 28-50 positives each; the untrained synthetic models
correctly do not pass (exit code matches the verdict).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Polls a profiled process's CPU every 5 s and, after sustained use above a
threshold, attaches scripts/profile_capture.sh for a fixed window. For bugs
that only appear sometimes (the tray spinning a core during the 2026-11-14
hang). Verified attach on the live profiled tray: zones tray.on_reply /
update_status / update_tray / poll arrive (~4 ms per 3 s poll when healthy).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- third_party/tracy.wrap pins the Tracy client to v0.15.0 (sha256-checked), matching
the Arch tracy 0.15.0 capture/export tools (client and tools must match exactly);
built with tracy_enable + on_demand, so nothing is recorded or paid for unless a
capture is connected. -Denable_profiling=true picks it up; default builds are
unchanged (macros are no-ops).
- scripts/profile_capture.sh: headless (no GUI, no root) `run OUT -- CMD` or
`attach OUT SECONDS` -> OUT.tracy + OUT.zones.csv + a top-zones table.
- strawberry-scan-bench (dev tool, not installed): the real scan_on_demand path over
files with the real governor and rule set, so the scan path can be profiled
without root or the daemon.
- Zones: scan_on_demand, image.read, image.sha256 (next to yara_scan/scan_image/
assess_exec), tray.* (poll, on_reply, refresh_evidence, update_status/_policy,
refresh_findings, notify) and evidence/database reloads.
Baseline (6 yams ASan binaries, 668 MiB, idle host): YARA 86%, read 9%, sha256 5%,
~61 MiB/s; PT_LOAD segments are 35-48% of those files. DEVELOPER.md: profiling
section, and the balanced row corrected (64 MiB image cap, 768 MiB budget).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deploy/salt/test/: builds a release tarball from HEAD in ubuntu:24.04 (CI path),
boots systemd containers (rootless, no --privileged), master==central + 3
sensors with the host's Salt onedir mounted read-only, applies the real states,
runs a workload with planted YARA detections, then two orchestrated cycles.
43 checks (install/config/idempotence, real daemons + telemetry, R2 cache
miss/hit, cp.push collect, 3-seed cycle, canary hold then fleet rollout, no
promoted model anywhere, fleet bits in round 2, --since cursor, dedup).
State fixes found by running them for real:
- init.sls no longer includes strawberry.distribute: a plain state.apply on
sensors shipped models fleet-wide and bypassed the canary; only the
orchestration distributes now.
- install.sls: CI tarballs carry a +g<sha> suffix that 'strawberry version'
does not print, so install.sh re-ran on every apply; record the installed
release and compare base version + marker.
- orch collect: mv -f (re-collected bundles must not be skipped).
- central cycle: builds the overlay first; a training refusal for too few
teacher labels (normal on a young fleet) publishes the overlay only and
keeps the sensors' shadow, any other error still fails.
- distribute.sls: serves only what the cycle published (cp.hash_file; the
cp.list_master file-list cache can miss a just-published file).
Render check gains overlay-only and full publish cases (20 checks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fleet train advertised --json but printed text, so the central cycle's
train-seedN.json evidence was not JSON; it now emits one object incl.
duplicate_windows. fleet overlay gains --json (bundles_superseded,
overlays_skipped). Both commands read only *.sbx (no dotfiles) from the
bundle dir, so a cursor or stray file is never fed to the merge.
scripts/fleet_e2e.sh drives the real binary + central cycle script over N
synthetic sensors: --since auto export chain, Salt-pull simulation, 3-seed
train + overlay, sha256 publish, determinism, overlay distribution and a
round-2 export carrying fleet rarity features. 6/6 checks pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The version lived in three hard-coded copies (CLI `version`, daemon status,
banner); v0.2.0 shipped with the CLI still saying 0.1.0. meson.build is now
the only source: it passes STRAWBERRY_VERSION to every target, and the CLI
test requires the exact version.
packaging/ci/build-release.sh refuses to publish a tag build unless
meson.build, the tag and the built binary's `strawberry version` agree; CI
never rewrites the version.
scripts/release.sh X.Y.Z is the one manual release step: on a clean main
equal to forgejo/main it bumps meson.build, makes a signed commit and a
signed tag, and pushes both (--dry-run shows the plan). The Security Hub
release channel deploys signed tags only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use suspend-aware BOOTTIME waits and owned-container cleanup without changing the workload. Reject missing coverage and preserve producer/report failures. Include runtime/helper regressions, constrained build-job support and live exec-guard crash safety. Document the failed live/idle gates without relaxing thresholds or claiming production acceptance.
Second half of the sandbox-safe tracker transport. A small relay in the host
network namespace bridges OpenSnitch to the sandboxed daemon, so the daemon keeps
PrivateNetwork=true + RestrictAddressFamilies=AF_UNIX and never sees argv/env.
- `strawberry opensnitch relay` (new CLI verb, Map::flag -> --opensnitch-relay):
binds the OpenSnitch loopback port via the existing OpenSnitchEventListener
(root-peer check, argv/env dropped at parse), and forwards each redacted tuple
(encode_connection) to the daemon's AF_UNIX ingest socket, reconnecting on
failure. Foreground loop until SIGTERM/SIGINT; drops (not blocks) when the
socket is down. Linux-only. The listener callback runs on one thread, so the
sink needs no lock.
- scripts/strawberry-trackerd.service: runs the relay in the host namespace with
only CAP_NET_BIND_SERVICE, no PrivateNetwork, and /proc/net kept readable for
the peer check (no ProcSubset=pid); otherwise the same tight sandbox as
strawberry-update.service. install.sh installs+manifests+starts it when
OpenSnitch is present and privacy_trackers is not false.
- docs/tracker-attribution.md: replace the "known limitation" with the relay
architecture (rejected alternatives noted). API_CONTRACT: privacy.listener now
describes the ingest socket + relay; also documents feed-add max_severity (B1).
Suite 51/51; clang static analyzer and clang-tidy clean on main.cpp and
cli_commands.cpp. Full relay->OpenSnitch end-to-end needs host validation
(sudo + a real OpenSnitch); the socket path is covered by E9.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The packaged strawberry.service runs with PrivateNetwork=true and
RestrictAddressFamilies=AF_UNIX, so the OpenSnitch-events loopback listener
cannot bind (EAFNOSUPPORT/EPERM) and could not reach OpenSnitch's host namespace
anyway. Rather than surface a bare errno:
- start_tracker_attribution() translates the sandbox bind failure into a plain
explanation in status privacy.error (names PrivateNetwork/RestrictAddressFamilies
and points at docs/tracker-attribution.md). Nothing blocks, no finding.
- install.sh no longer implies tracker events are working: it says OpenSnitch was
*configured* to send, and to check `strawberry status` (privacy.listener), since
the daemon can only receive if its sandbox permits a loopback listener.
- docs/tracker-attribution.md documents the limitation and that the planned fix is
a host-namespace relay over the AF_UNIX control socket (sandbox preserved);
relaxing the sandbox is an operator choice, not a default.
Transport redesign deferred to the architecture deep dive. Suite 50/50; clang
static analyzer and clang-tidy clean on daemon_app.cpp.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- scripts/analyze_changed.sh + `make analyze`: clang-check --analyze over the
changed TUs via builddir/compile_commands.json (host build may be gcc; clang
tolerates those flags), nice -n 19, 2 at a time. Strict by default (any
analyzer diagnostic fails), ANALYZE_STRICT=0 reports only; ANALYZE_FILES/--all
override selection. Results in build/audit/out/analyze.log.
- AGENTS.md "Per-change checks": new analyzer row, positioned as path-sensitive
intra-TU analysis that complements fold's bounded symbolic cross-call pass and
the syntactic invariants (run all three); YAMS index-at-checkpoint reminder.
- CLAUDE.md: analyzer added to the checks pointer + a Performance & C++ bullet
(perf-kpi + Tracy/PerfStats).
- docs/prompts/PROMPT-strawberry-audit.md: "Clang static analyzer" subsection
under Symbolic SAST.
No C++ changed; unit suite 50/50 green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Second piece of tracker attribution (docs/tracker-attribution.md): which
programs reach domains on a trackers list. Advisory only: never a block,
never a finding (source invariant R11).
- OpenSnitch event listener: OpenSnitch's JSON "remote" logger is the
hostname source (Strawberry's eBPF connects have none). It streams over
TCP and cannot leave fields out, so events carry command lines and
environments. The listener binds 127.0.0.1 at a port below 1024 (only
root can), accepts only root-owned peers (/proc/net/tcp), bounds
clients/object size/buffering, and reads only pid, uid, path,
destination and action; arguments and environment are never copied.
- TrackerContacts: per program x domain, bounded at 20000 keys. A root-only
tracker_contact telemetry record (type 25) on the first contact, then at
most hourly with the count since.
- Status `privacy` block; control verb privacy-trackers; CLI
`strawberry privacy trackers [--json]`.
- `strawberry opensnitch enable-events` adds the logger to OpenSnitch's
config (with a .bak); the installer runs it when OpenSnitch is present,
unless privacy_trackers=false. Config: privacy_trackers (default true),
opensnitch_events (default 127.0.0.1:979).
- EasyPrivacy is a default trackers feed (GPL-3.0+ or CC-BY-SA-3.0,
downloaded at run time).
Tests: E1-E7 (test_opensnitch_events: event fields, stream splitting,
peer uid, address rules, listener end to end, contacts and record, config
editor), the control verb, CLI translation and help, daemon status. New
fuzz_opensnitch_events (90 s clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`model train` on a host without detections stops with "0 positive
windows" and pointed at --inject-train FILE, but only the evaluation set
(standard.trace) existed. Add config/traces/training.trace: 7 attack
shapes (document macro dropper, web reverse shell, cron miner, /dev/shm
perl stager, ssh key backdoor, npm postinstall, ld.so.preload) that differ
from the evaluation set, so the gate never judges a model on what it
trained on. P4 in test_trace enforces that (no shared trace name or exec
sequence); it caught an evince -> python3 overlap in the first draft.
Both installers put the traces in /usr/local/share/strawberry/traces/
(install_traces in install_common.sh); the hint and README name it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/install.sh hands off to scripts/macos_install.sh on Darwin (it
failed on getent/groupadd) and runs from the repo root. `make install`
runs it on either OS.
Signing: an ad hoc signature carrying the ES entitlement is killed at
launch while SIP is on, and the hardened runtime rejected the Homebrew
dylibs (different Team ID). Both entitlement files now disable library
validation; with SIP on and IDENTITY=- the installer signs with
strawberry-base.entitlements (libproc fallback), test-launches the
binary and re-signs without ES if it is killed. `make macos-sign`
refuses the combination that would be killed.
The installer no longer sets enable_bpf_monitoring=false, which turned
off all process monitoring; it sets db_path explicitly. The rule
updater runs as the new _strawberry user, which owns only feeds/, and
starts on update-requested via KeepAlive PathState (WatchPaths also
fired on removal). launchd jobs use `daemon run` / `rules fetch`.
Parity with Linux: completions, the installed-files manifest,
evidence permissions, group offer. Shared helpers in
scripts/install_common.sh. MCP registration moved to the README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shadow scorer's rarity model started empty at every daemon start, so
each restart cost an hour of warm-up with no decisions. The daemon now
saves it to model_dir/rarity.state (checksummed, atomic write, hourly and
at stop) and restores it at start. A restored state younger than the
7-day half-life skips the warm-up; decay catches up on the first event.
A file made with other rarity settings, a bad checksum, or a negative or
non-finite count is refused with a reason (status model.rarity_state,
doctor model.rarity_state) and the model starts empty. The file must be
owned by the daemon user and not group/world writable, like model files.
Also fixes status model.warmup_windows, which was never filled in.
Tests: R1/R2 in test_learn (round trip, decay clock, refusals), S8 in
test_shadow (warm-up skipped only when recent), daemon restart restores
the saved state, doctor warning; new fuzz_rarity_state target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A promoted model (promoted.sbm, written only by `model promote` after the
gate) can now request real inspections. Only two, both additive:
- memory_scan: through the daemon's memory-scan queue;
- deep_rescan: the root's image re-scanned on demand; new matches are
recorded as indicators of kind model_inspection (findings titled "YARA
match found by a deeper rescan the inspection model requested") and
positive labels.
watch_subtree has no mechanism and rescan_on_next_rules is the retro-hunt's
job, so both are masked out of acting decisions (kExecutableActions), and
replay's policy evaluation uses the same action set.
Guardrails:
- InspectionExecutor (bounded queue, one low-priority worker, submit()
never blocks); WorkClass::model_inspect lets the governor defer it, and
a deferred decision is dropped.
- Each action rechecks that the promoted model is still active at the
decision's generation (demoting or replacing it revokes queued work),
that the root's node id and raw image path still match (decisions carry
root_image, not the feature template), and skips protected processes.
A deep rescan discards its result if the process, image or rules changed
during the scan.
- An acting decision is durably written before it is dispatched; every
attempt becomes an inspection_outcome record (queued, scanned, skipped,
deferred, revoked, queue_full, failed).
- Source invariant R10: no file may couple learning types to the
exec-guard, OpenSnitch or policy APIs (daemon_app.cpp and main.cpp, the
wiring points, are reviewed by hand). Models never block, contain, kill
or create findings directly.
- Config model_act and model_lambda; status model block reports acting
stats; timings.model_inspection.
docs/evaluation/stage4-execution-gate.md amends the gate's method (not its
thresholds): executable action set, greedy promoted decisions, budgets as
estimated inspection seconds by scan profile.
Also: TerminalSafeBuf's destructor no longer lets an exception escape;
the health message clamps huge durations; replay timestamp overflow; the
Docker test build runs with -j2.
Tests: test_inspection_executor (every skip and execute path, revocation,
queue limits); shadow and replay acting cases; R10 fixture; fault injection
and invariant updates. Validation reported by the session that wrote it:
48/48 local, 46/46 Docker plus privileged live checks, 20 fuzz targets
(9.5M runs), three paired KPI runs without regressions (no acting model
was loaded, so active-inspection cost is not measured yet).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
packaging/macos/ holds the ES entitlement and two LaunchDaemons: the
scanner (root, group strawberry, umask 027, XDG_DATA_HOME=/var/db so
evidence lands in /var/db/strawberry) and the rule updater (daily, and
on feeds/update-requested like strawberry-update.path).
scripts/macos_install.sh creates the group with dseditgroup, the
config (/run paths moved to /var/run), state directories, signs the
binary with the entitlement and bootstraps both jobs.
make macos-sign (IDENTITY=- ad hoc, or a Developer ID), make
macos-install, and make macos-live-tests (signs and runs
macos_es_live under sudo). An ad hoc signature carries the ES
entitlement only with SIP disabled; the install script says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
include/strawberry/platform_process.hpp answers what /proc answers on
Linux: running PIDs (proc_listallpids), executable path
(proc_pidpath), parent and start time (sysctl KERN_PROC_PID, readable
for every process), argv (KERN_PROCARGS2) and a boot id
(kern.bootsessionuuid). A process is identified by its start time in
microseconds since the epoch plus the boot id, so node ids survive PID
reuse as on Linux. It is header-only, so the per-test source lists stay
as they are.
Users on macOS: resolve_process_ref (default root), the pipeline's
image hashing and exec-decision actor, and YaraScanner::scan_process
(scans the image by path). A synthetic procfs root still takes the
procfs code, so the existing procfs tests run on macOS too.
The resource governor samples Mach/sysctl on macOS: own CPU from
getrusage, RSS from task_info, load from getloadavg, available memory
from host_statistics64 (free + inactive + purgeable + speculative).
The behavior engine knows macOS debuggers (debugserver, dtrace) and
kext loaders (kernelmanagerd, kmutil), and macOS temp and Downloads
paths count as drop locations. The Linux lists are unchanged.
The KERN_PROCARGS2 parser is portable: a property test (exact argv
recovery, truncation never invents data, total on junk) and the
fuzz_procargs target run on every platform. test_platform_process
checks the live helpers against this process; the daemon test reads
the stopped state through sysctl on macOS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Evidence strings are attacker-controlled: every CLI command's stdout
and stderr now pass through a filter that shows control characters
(C0, DEL, C1) and invalid UTF-8 as \xNN (src/term_safe.hpp), so a
crafted process name or path cannot inject terminal escape sequences.
The daemon's journal output is unchanged.
- `strawberry` alone prints help; an unknown word (`strawberry fix`) is an
error with a "did you mean" hint. Both used to start a daemon as the
calling user with the word as its config path. Config paths (contain
'/' or end in .conf) still run the daemon, for older units.
- Shell completions generated from the command table: `strawberry
completion bash|zsh|fish`; install.sh installs them under
/usr/local/share.
- One correlation pass at daemon start (stored findings catch up with the
current rules, e.g. stable ids), and retire-superseded-findings
correlates first, so replacements exist before old copies are retired.
The user's first run reported "no duplicates" for that reason.
- docs/cli-ux.md: CLI UX rules adapted from yams (grammar, flags, human
and JSON output, status words, security rules for output, help and
completions, adding a command, known gaps). Exit code 3 and
confirmation prompts are proposed there, pending a decision. AGENTS.md
and CLAUDE.md point to it.
tests/test_cli.cpp: bare and unknown words, terminal_safe and the stream
filter, completion scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
strawberry [--config PATH] [--json] <command> [<subcommand>] [args] [--flags]
status, doctor, doctor fix <action>, daemon run, findings list/show/
correlate, process search/trace/trace-node/suspend/resume/kill, scan
file/processes/memory, rules reload/update/check/fetch, policy show/set,
opensnitch enable-checksums, store verify/compact, replay, demo seed,
help [command], version.
One table in src/cli_commands.cpp defines each command (words,
positionals, flags, help) and how it maps onto the existing flag form,
which main() still parses; help is generated from the same table.
Unknown options and wrong arity print the command's usage. Process
actions validate node ids before building their JSON payload.
The older flag form (strawberry --status, strawberry <config>) still
works. The systemd units now run `strawberry daemon run --config ...` and
`strawberry rules fetch --config ...`. README, AGENTS.md and the
false-positive guide use the command form.
doctor renders the daemon's checks with their fixes; doctor fix runs a
maintenance action (with --dry-run). Against an older daemon the CLI says
to reinstall rather than "unknown command". replay explains that
telemetry is root-only instead of reporting zeros, and keeps config
output out of --json.
tests/test_cli.cpp: translations, flag-form passthrough, errors, help.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 2 increment 1. Until now only detections were stored, so the
learning stages would never see a normal example.
- TelemetrySink: bounded lock-free multi-producer queue (8192); try_emit
never blocks, allocates or throws; a full queue drops and counts.
- A guarded writer thread drains it every 2 s (or at a quarter full)
into the store's root-only telemetry stream through the pipeline,
writing a gap record whenever events were dropped.
- The pipeline emits one process_exec (pid, parent, node ids, exe,
capped cmdline, sha256, deleted/memfd, live/inventory) and one
scan_result (outcome: scanned, cache_hit, too_large, unavailable,
read_error, no_rules, yara_error, pid_scan; bytes, scan time, rules
generation, matched rules) for every handled exec, detection or not.
- Config telemetry=true (default); status gains a telemetry block
(emitted, dropped, queued, written, gaps).
Tests: C1 (never blocks; exactly once and in order under concurrency,
clean under ThreadSanitizer), record round-trips, C2 (one process_exec
and one scan_result per handled exec, stored in the telemetry stream);
fuzz_telemetry_records.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A detect phase runs 40 distinct binaries carrying a KPI-only YARA marker,
then repeats them, so db_commit and correlation are timed (the earlier
workload never produced a detection).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per the triage decisions:
- DeletedExecutable when a new file exists at the executable's path (an
update or reinstall) is stored as evidence only. A binary with nothing
left at its path still raises a low finding.
- scripts/install.sh writes /var/lib/strawberry/installed-files.sha256
(hashes of the units it installs, root-owned, written first). A
PersistenceWrite whose file matches its listed hash is evidence only;
other content at those paths, or a suspicious writer, is reported as
before. The daemon ignores a manifest that is not root-owned or is
group/world-writable.
Evidence-only indicators make no finding, alert or containment on their
own; correlation counts them when the same process has another signal.
Status reports pipeline.evidence_only. Tests cover the manifest, the
behavior hook, correlation and the pipeline (replaced vs deleted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sched_process_fork's comm fields became 4-byte __data_loc offsets in
newer kernels, moving child_pid from offset 44 to 20. The hand-written
tracepoint struct read past the event, so the kernel refused to attach
the program and parent-PID enrichment was always off ("Fork tracepoint
✘" in the app). The struct is now CO-RE (preserve_access_index), so
parent_pid/child_pid relocate against the running kernel's BTF. Checked
in a privileged container on kernel 7.2: attaches now, did not before.
The exec smoke test reports whether the tracepoint attached and, when it
did, requires a parent pid on the exec event. The eBPF smokes still
miss the test's own exec inside the container (an older problem, noted
in the live-test runner and tracked separately).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing shipped used the library after the event store landed. A small
reader/writer for its file format (src/store/legacy_kv) replaces it for
the legacy code, and the submodule, subproject and library test are
removed.
A writer open now imports a legacy database.db file into the event
store: indicators are replayed in an order consistent with the old
hash/rule indexes, the result is verified against the old file, the
old file is kept as database.db.migrated-<ts>, and an import
interrupted between its final renames is finished on the next open.
Read-only handles read a legacy file directly and switch to the store
once it is imported. Ids re-stored under another hash are reported
(their old index entries cannot be carried over).
Tests: legacy import properties I1-I6 (locked and corrupt files are
left untouched), the differential test now shares its comparisons, and
fuzz_legacy_kv covers the file parser. A copy of a real 137 KB legacy
database imported cleanly into 7 KB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wire the policy, feeds, containment, exec guard, behavior, governor,
crash safety and event store into the daemon, detection pipeline, CLI
and meson build (zstd now required); Dockerfile, conan, systemd unit
(LimitCORE=0, resource limits) and installer updates; existing tests
adapted (store paths are directories now). Detections are counted and
notified even when evidence cannot be persisted (persist_failures in
status). prevention_timeout_ms is clamped and behavior dedupe handles
out-of-order events. Docs: API contract, developer guide, plan, UX,
agent rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix for the 2026-10-25 host freeze (an uncaught iostream exception on a
/proc read aborted the daemon; its core dump deadlocked with the exec
guard): non-throwing /proc reads, crash handlers that release fanotify
permission fds, guarded thread entries, from_chars parsing.
Adds the io fault-injection seam with property tests, source invariant
checks (R1-R6) with self-test fixtures, libFuzzer targets and seeds
(including I/O-fault fuzzing), the fold changed-files scan scripts and
the agent workflow docs (CLAUDE.md, prompts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PSI/cgroup-aware governor with efficient/balanced/aggressive profiles,
background pacing and thread priorities; timing histograms and optional
Tracy zones; a capped Docker KPI harness with report/compare tooling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fanotify exec-permission guard (audit/enforce, fail-open deadline),
eBPF behavior engine (IOC connections, ptrace, module loads,
download-then-execute) and fanotify persistence watch, with unit tests
and privileged Docker live tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PolicyStore (allowlist, protection settings, operator actions), the
rule/feed updater with HTTPS-only fetches and a systemd timer, IOC
hash/domain/network sets, OpenSnitch blocklist containment, the root
control socket (SCM_RIGHTS credentials, verb allowlist) and scanner
health snapshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the browser UI, its Python server and the web API contract test.
Add the Qt6 tray app (status, findings, process search, policy
controls, notifications) and EvidenceStore, the read-only view of the
daemon's evidence that the app and MCP server share. The GUI demo
config becomes strawberry.demo.conf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>