Skip to content

Judge the chaos sweep's fault windows with NSE 2.7.0 - #195

Merged
onyks-os merged 1 commit into
mainfrom
test/chaos-nse-2.7.0
Nov 30, 2026
Merged

onyks-os merged 1 commit into
mainfrom
test/chaos-nse-2.7.0

Conversation

@onyks-os

Copy link
Copy Markdown
Owner

The chaos sweep was the last VM check with its own probe (tests/chaos_observation.py) and its own capture reader (scripts/vm/lifecycle/chaos_capture.py). It now uses NSE, the way the lifecycle VM has since #189.

Guest. Six NSE streams run as the ordinary user for the whole sweep: DNS, UDP and TCP to the TEST-NET fixture, in each family. Root sends NSE's clocked beacons at every phase edge. The host prepares the agents and the stream plans (chaos_observer.py plan), and chaos.sh copies them into the guest.

Host. scripts/vm/lifecycle/chaos_observer.py check replaces chaos_capture.py. The acceptance rules have not changed:

  • Every guest frame to a fixture destination that is captured between two beacons of the same fault counts as egress, by QEMU's clock. That is now true whatever the frame's layout, IPv6 extension headers included.
  • If any stream starts no attempt for more than 500 ms of a fault window, the run is inconclusive. This is measured on the guest's clock.
  • Both positive controls must see every stream on the wire.
  • Nothing may leak during a fault's final hold. Only faults that rewrite the enforcement itself may expose traffic before the hold.
  • Egress counted before the evidence broke is kept in the report.
  • A damaged capture, a lost or reordered beacon, or an incomplete stream log is never read as clean.

Also in this PR:

  • The nse extra requires network-sandbox-engine>=2.7.0, and the lock is regenerated for NSE only.
  • from_pcap(keep=) reads the full-frame capture one record at a time and keeps only the guest's frames to the fixture.
  • chaos.sh compresses the stream logs before copying them over QGA.
  • The automap experiment keeps its strict pcap reader. It moved into scripts/vm/automap/capture.py, together with its corruption test.

Tests. tests/test_chaos_observer.py runs NSE's real agents against loopback, then breaks one instrument at a time. To check that the tests can fail, I weakened four conditions one at a time: hold egress, the stream gap, log completeness and the guest-MAC filter. Each one made a test fail. The real VM run is the chaos job of the lifecycle workflow.

🤖 Generated with Claude Code

The chaos sweep no longer needs its own probe and pcap reader. In the guest,
six NSE streams (DNS, UDP and TCP to the TEST-NET fixture in each family) run
as the ordinary user for the whole sweep, and the sweep sends NSE's clocked
beacons at every phase edge. scripts/vm/lifecycle/chaos_observer.py replaces
chaos_capture.py and judges QEMU's capture with the same rules:

- every guest frame to a fixture destination between two beacons of a fault
  is egress, by the capture's clock, now whatever its layout (IPv6 extension
  headers included);
- a stream idle for more than 500 ms of a fault window, by the guest's clock,
  makes the run inconclusive;
- both positive controls must see every stream on the wire;
- no fault may expose traffic during its final hold; only faults that rewrite
  the enforcement may expose it before;
- egress counted before the evidence broke is kept, and a damaged capture, a
  lost or reordered beacon or an incomplete stream log is never clean.

The capture is read one record at a time and keeps only the guest's frames to
the fixture. The streams end before the closing beacon, so the beacons bracket
every attempt. chaos.sh compresses the logs before copying them over QGA.

The nse extra requires network-sandbox-engine>=2.7.0 (one floor for the
extra). The automap experiment keeps its own strict pcap reader, moved into
scripts/vm/automap/capture.py with its corruption test. Tests run NSE's real
agents against loopback and break one instrument at a time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: onyks-os <129986281+onyks-os@users.noreply.github.com>
@onyks-os
onyks-os merged commit 03fffe2 into main Nov 30, 2026
44 of 45 checks passed
@onyks-os
onyks-os deleted the test/chaos-nse-2.7.0 branch November 30, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant