Commit graph netsec-agent/tests/test_seed.py
Author SHA1 Message Date
Sirius DevOps
beb54afb89 netsec-scan: say how many tripwires a seed tick held, and test the path
The seed line now names the held count ('N current-state finding(s) held
for the next tick') so a silent seed tick is explainable without --verbose
log archaeology, and tests/test_seed.py::TestSeedHoldsCurrentStateTripwires
pins the whole contract: seed tick silent with a drop-spike firing, the
fingerprint stored with last_alert='' (due, not cooled), the first warm
tick reports it once, the second is quiet.
2026-11-27 02:21:34 -05:00
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