Skip to content

Judge the lifecycle VM's phases with NSE 2.6.0 - #189

Merged
onyks-os merged 3 commits into
mainfrom
test/lifecycle-nse-2.6.0
Nov 30, 2026
Merged

onyks-os merged 3 commits into
mainfrom
test/lifecycle-nse-2.6.0

Conversation

@onyks-os

Copy link
Copy Markdown
Owner

This PR is slice 3 of the leak-testing plan for the lifecycle VM: continuous capture, stimulus streams and a phase/time model, built on NSE 2.6.0 ("observing outside the sandbox").

What changes

  • Phases are observed with NSE. In the guest, NSE's portable agents run over SSH: a clocked beacon, then a UDP and a TCP stimulus stream to 198.51.100.7 as the non-bypassed user, then a second beacon once the streams stop. scripts/vm/lifecycle/observer.py judges each phase from QEMU's pcap using CaptureReport.from_pcap, StreamLog.parse, ClockMap and correlate.

  • An attempt on the wire always counts. An absence counts only when:

    • the capture is intact and holds both beacons (window_complete);
    • the beacons place every attempt on the capture's clock;
    • each stream's log is complete;
    • no time went untested, except a gap NSE measured as a suspend (Gap.suspended, with the monotonic part within the limit).

    Anything else is inconclusive, and the check fails.

  • One capture per QEMU process instead of one per phase: control and session together, then reboot through suspend/resume.

  • Suspend/resume: the streams now run through the suspend. Before, nothing was measured until after the move to the new network. vm_swap_network waits until QEMU no longer lists the old NIC, so the reply is read rather than trusted after a fixed sleep. It then hands the capture to the new network before its NIC exists, and the observer joins the two files after checking each one.

  • Power-off stays on probe.py and egress.py. A stream that its machine kills never has a complete log, so NSE 2.6.0 cannot vouch for its absences. Two NSE additions have been asked for to close this gap: reporting orphan stream packets, and evaluating a log that a boot cut short.

  • Dependency floor: nse extra and the suite gate move to >=2.6.0, with ci.txt hashes taken from PyPI's JSON API. The lifecycle job installs the reviewed ci lock on the runner for the observer.

Evidence

  • tests/test_lifecycle_observer.py (15 tests) runs NSE's real agents against loopback, so nothing reaches a real network. It breaks one instrument at a time and requires each of these to come out failing or inconclusive, never clean:
    • a leak, including a leak the capture cannot vouch for;
    • a missing beacon on the wire;
    • a failed beacon report;
    • a cut capture;
    • a killed stream;
    • attempts before the opening beacon;
    • a suspend gap when suspends are not allowed;
    • a running gap disguised as a suspend;
    • a cleartext control the capture misses;
    • a joined capture with damage at the hand-off.
  • Not yet verified: the real VM run. This PR's Lifecycle (VM) jobs are the first end-to-end run, so their result is the evidence.

🤖 Generated with Claude Code

onyks-os and others added 3 commits November 30, 2026 09:42
Each phase now runs NSE's portable stimulus streams in the guest (UDP and
TCP to 198.51.100.7 as the non-bypassed user) between two clocked beacons,
and scripts/vm/lifecycle/observer.py judges it from QEMU's capture. An
attempt on the wire always counts. An absence counts only when the capture
is intact and holds both beacons, the beacons place every attempt inside
it, each stream's log is complete, and no time went untested except a gap
NSE measured as a suspend (CLOCK_BOOTTIME advancing while CLOCK_MONOTONIC
stops).

One capture now runs per QEMU process instead of one per phase. The
suspend/resume streams run through the suspend; before, nothing was
measured until after the move to the new network. vm_swap_network hands
the capture to the new network before its NIC exists, once QEMU no longer
lists the old one. The power-off phase stays on probe.py and egress.py: a
stream its machine kills never has a complete log, so NSE cannot vouch
for its absences.

The nse extra requires network-sandbox-engine>=2.6.0, and the zero-leak
suite's gate follows it (one floor for the extra). The lifecycle job
installs the reviewed ci lock on the runner for the observer. 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>
Signed-off-by: onyks-os <129986281+onyks-os@users.noreply.github.com>
The first Fedora VM run failed "suspend and resume onto a new network"
with 1 of 303 attempts on the wire. The packet was the reboot phase's
cleartext probe (its payload carries that stream's probe ID), captured
10 s before the suspend phase's opening beacon, from an ephemeral port a
suspend attempt later reused. NSE 2.6.0's RequestIndex matches a request
by source port alone, even when the packet carries another probe ID, and
the joined capture holds the earlier phase.

The observer now drops packets captured before the phase's opening
beacon: the streams start after it is on the wire, so nothing before it
is theirs. Re-judged on that run's artifacts, every phase passes. The
docs build failed on a relative link in the changelog; it is absolute
now.

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 d684fd5 into main Nov 30, 2026
30 checks passed
@onyks-os
onyks-os deleted the test/lifecycle-nse-2.6.0 branch November 30, 2026 09:10
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