netsec-agent/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sirius DevOps bde343c75f netsec-scan: a seed is silent for its whole span, --dry-run included
The seeding guard only ran in on_batch for the archive path, so a cold
start still announced the entire retained window whenever the tick was a
--dry-run (11-14 egress-new-dst lines: history reported as news, all of it
inside the window the line itself quoted). The guard also lived *after*
the flow rules had already produced findings, and it was skipped entirely
for dry runs.

- absorption now happens in on_batch and is keyed on 'seeded' alone, so it
  covers the cold start, every resume tick of a budget-limited seed, and
  --dry-run (history is not news in a dry run either);
- each seeding tick explains its silence on stderr: 'seed: N tuple(s)
  absorbed, 0 reported; window Xh from <stamp>, N file(s)', including the
  still-pending count when the budget stopped the pass;
- the warm-state archive pass gets the same one-line summary;
- state.seed.absorbed records the count, and absorb() reports whether a
  fingerprint was new so the number is the baseline's growth, not a loop
  counter.

tests/test_seed.py pins all four: cold start, dry-run cold start, resume
tick while unseeded, and single-fire from a seeded state (the guard must
not turn into a permanently silent sensor).
2026-11-27 02:17:16 -05:00
..
fixtures netsec-scan: deterministic sensor (6 PromQL tripwires + 2 flow-store novelty rules) 2026-11-27 00:20:46 -05:00
helpers.py netsec-scan: deterministic sensor (6 PromQL tripwires + 2 flow-store novelty rules) 2026-11-27 00:20:46 -05:00
test_archives.py netsec-scan: read flows-*.jsonl.gz so a cold start baselines the retained window, not the live file 2026-11-27 02:09:51 -05:00
test_flows.py netsec-scan: deterministic sensor (6 PromQL tripwires + 2 flow-store novelty rules) 2026-11-27 00:20:46 -05:00
test_rules.py netsec-scan: three-tick web-port gate (2 still leaked ~2 lines per CI build) 2026-11-27 00:41:41 -05:00
test_seed.py netsec-scan: a seed is silent for its whole span, --dry-run included 2026-11-27 02:17:16 -05:00
test_state.py netsec-scan: honest observation window, /dropped tuples, report baseline counts 2026-11-27 00:24:22 -05:00