Repository navigation
capture: E2 fails when a signaller sends nothing - #829
Open
kitokey-sam[bot] wants to merge 9 commits into
Open
kitokey-sam[bot] wants to merge 9 commits into
kitokey-sam[bot] wants to merge 9 commits into
Conversation
On the desktop's graph, AirPods connected during the attest of #787 became the default input and scenarios J, K, L and O recorded from them. The e2e now starts its own PipeWire, WirePlumber (no ALSA, no Bluetooth monitor) and pipewire-pulse, as private_graph.sh does, and never speaks to the desktop's. A guard reads the graph every half second: a device, or a source or sink not the run's own, or a sound card held by the run's capture, kills capture and the graph at once; the run ends NOT RUN, exit 77. The desktop's defaults are read before and after: the same. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ails closed A graph of its own does not keep ALSA from the sound cards: the run now starts in bwrap with a /dev of its own (no /dev/snd), its own processes, and neither the desktop's runtime folder nor the system bus. Inside, no card must be in sight before anything starts. The guard stops the run when pw-dump is late or empty, reads every process of the seal for anything under /dev/snd, and is tried with a sink, a source and a device (E2E_INTRUDER=<kind>:<seconds>). The desktop's defaults are compared outside the seal. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…guard's trial judged by its intruder pipewire-pulse loads module-always-sink by default: its `auto_null` sink, in a graph with no sink yet, stopped every run at the guard's first look, the trial included (S1 at cb3d698 named `auto_null`, not `intruder_sink`). Off by pulse.cmd.always-sink = false, the condition pipewire-pulse.conf puts on it. With E2E_INTRUDER set, a run stopped by anything but intruder_<kind>, or not stopped, now fails; the device intruder is named intruder_device. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hat proves nothing ends at once No Device factory runs in the seal without hardware or a bus: `api.alsa.enum.udev` made none, and the trial went on through the whole run. The device intruder is now a Device added to the guard's own pw-dump answer. The trial fails within 3 s when its intruder does not appear, or appears and the run is not stopped. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a cut run E2's bare `wait` waited on every child: the run's graph daemons are the script's children now, and never end — S2 hung an hour in E2. It waits on the three signallers by their PIDs. The cleanup kills pipewire, wireplumber and pipewire-pulse by their PIDs, with KILL after two seconds, and ignores further signals while it runs: `timeout` signals the script and then its group, and a second TERM in the EXIT trap ended the shell before `rm -rf`. INT and HUP end the run through the same cleanup. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard's own stop still says NOT RUN, exit 77: it writes "$work.real" before its TERM, and the cleanup reads it there. Any other TERM — a runner's timeout, a person — now exits 143, so nothing running e2e.sh directly reads a cut run as a skip. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
E2 dropped the exit status of its three signal-at helpers, so it passed when none of them signalled. Each status is now checked. signal-at exits 0 when it sent its signal, and also when the recorder ended before the moment (gone, or a zombie not yet waited for): on a fast machine the .part file may never be seen. It says which in its line. It exits 1 on an error: the moment never came while the recorder ran, or a failure. Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For the pre-commit hook to come on capture's scripts. Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e2e.sh's conflicts settled with main's #796 (the run's folders made and removed outside the seal); E2's signallers judged one by one, as this branch has it. Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 of 16 tasks
napkinstack-agent Bot
added a commit
that referenced
this pull request
Nov 15, 2026
…r transcription (#832) Both link C or C++ into their programs under +crt-static — libFLAC, whisper.cpp —, which windows.yml does not build with: #794's LNK2019 was seen only by a run asked by hand, twice, and #787, #796, #810, #829 had no run of it. Shell and summary are Rust alone, compiled by windows.yml on every change, and keep out of it. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-authored-by: kitokey-marc[bot] <356215105+kitokey-marc[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: napkinstack-agent[bot] <330339777+napkinstack-agent[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #814
Module
modules/capture— exactly one.cross-modulelabel is required, justification belowDeliverable
Out of cycle: a gap in capture's e2e, found while verifying #796 (#814). Scenario E2 (D87) passed whether or not its three
signal-athelpers sent their signal:wait "${signallers[@]}" 2>/dev/null || truedropped their statuses, as the barewaitbefore #796 did. A recorder never killed is then stopped by the nextkill -INT, its folder is whole, and E2 passes without testing the interruption it is meant to test.Written on #796's branch; #796 merged (3bdac68), main is merged in at 0a8deaf,
e2e.sh's conflicts settled with #796's final version.What it changes
scripts/e2e.sh, E2: each signaller's exit status is checked (check wait "$signaller", one line each in the run), replacingwait … || true.scripts/e2e_measure_v2.py signal-at: says which outcome is acceptable and which is an error, because a check on its status would otherwise fail E2 on a fast machine:SIGKILL sent as local.flac.part appeared, as before..partcame and went between two looks, 0.5 ms apart. It saysSIGKILL not sent: the recorder ended before local.flac.part appeared(or… as … appeared), and returns at once. Before, it waited two minutes, then failed with a status no one read. E2's own comment accepts this: "Where the moment is caught depends on the machine: whatever is left is judged whole.""Ended" means gone from
/proc, or a zombie that the script has not yet waited for. The e2e's shell is the recorders' parent and waits for them only after itskill -INT, so before that an ended recorder is a zombie:os.killwould still succeed on it, and "sent" would be said of a signal that did nothing.ruff F841 fixed, for the hook to come: in
stopped-source, the unusedremoteis now_. marc's pre-commit hook will cover capture's scripts once this merges. With the hook's selection (F,PLW2901),scripts/passes at 0a8deaf.Why not fail when the moment is missed: whether the rename is caught depends on the machine, and E2 is written to judge whatever is left. A status that fails on a fast machine would make E2 flaky, not stricter. Whether at least one of the three moments is caught is not asked here; #814 does not ask it either.
Oracle
signal-atthat exits 1 without signalling makes E2 fail."main, 3bdac68), E2 raised no FAIL and the run ended « e2e: passed »: the mutant went unseen, which is capture e2e: E2 passes even if a signal-at never signals #814's gap. Log: the coordinator'scap-829mutbase.log.FAIL wait 2543,FAIL wait 2548,FAIL wait 2553, then « e2e: FAILED » (cap-829mut.log). Still to come, the attest's run: without the mutant,nstack e2e capturepassed, with threeok wait <pid>lines in E2 and a "sent" or "not sent" line from each signaller, at least one of themsent as … appeared(see RISKS).The mutant, one line, at the top of
signal-at:+ sys.exit(1) # mutant (#814): exits 1, nothing sent pid, sent, name = int(args[0]), getattr(signal, args[1]), args[2]Kind of oracle: end-to-end, the module's own e2e, not run by the author: the capture e2e and its mutant are the coordinator's, under the machine lock. Run here,
signal-atalone, on asleepas the recorder, in a scratch folder:SIGKILL sent as x.part appeared; the recorder ended 137SIGKILL not sent: the recorder ended before y.part appearedSIGKILL not sent: the recorder ended as z.flac appearednever.part never appeared, the recorder still runningThe loop as written in E2, with one signaller exiting 0 and one exiting 1:
ok wait 18,FAIL wait 19,failed=1.Test sheet
Verifier: session bfdb23f1-1199-4cda-ab11-22e178326643
ok wait <pid>three times), each says « sent » or « not sent », at least onesent as … appeared, and the run passessignal-atexiting 1 without signalling (the mutant above), when the e2e runs at this head, then E2 failswait <pid>three times and the run failscap-829mut.log, read by me): E2FAIL wait 2543,FAIL wait 2548,FAIL wait 2553, no « sent » line, then « e2e: FAILED »; the desktop's defaults the same.0a8deafmainbefore this pull request), when the e2e runs, then it passes: the gap #814 namescap-829mutbase.log, read by me): E2 noFAIL, its three folders « each track whole », « e2e: passed » — the gap #814 names.3bdac68signal-atalone, on asleepas the recorder, when the recorder ended before the moment, ended as it came, or is still running when it never comes, then it exits 0, 0, and 1 after 120 s, saying whichscripts/e2e_measure_v2.py signal-atalone, asleepas the recorder, in a scratch folder: the file appearing, the recorder running → 0, « SIGKILL sent as x.part appeared », the recorder 137; the recorder a zombie (/proc/<pid>/statstateZ, its parent a Python that had not waited) before the file → 0, « not sent: the recorder ended before zb.part appeared »; already waited for → 0, the same; the file there, the recorder a zombie → 0, « not sent: the recorder ended as zd.flac appeared »; the file never there, the recorder running → 1 after 120 s, « never.part never appeared, the recorder still running ».0a8deafVerifier's remarks: S2's and S3's runs are the coordinator's, under the lock; their queue logs, read by me, say « head at start 0a8deaf » and « head at start 3bdac68 », each « diff 1 0 modules/capture/scripts/e2e_measure_v2.py » — one line added; that it is the description's
sys.exit(1)is the coordinator's word, the line itself not logged. Survivor, by my hand at 0a8deaf:endedblind to a zombie (== "Z"→== "never") makessignal-atsay « SIGKILL sent as late.part appeared » to a recorder that had ended, exit 0 — the false « sent » the change guards against. No automated check holds it: E2 accepts « sent » and « not sent » alike, and S4 is run by hand. Betweenendedandos.kill, a recorder reaped by the shell could see its number given to another process: half a millisecond, not exercised.Review budget
main: 30 (+25 −5)Contracts
Definition of Done
bash -n scripts/e2e.sh,python3 -m py_compile scripts/e2e_measure_v2.py;ruff check --select F,PLW2901(0.14.0, the hook's selection) onscripts/: all checks passedsignal-atexercised as abovesignal-atSummary
DONE
signal-atexits 0 when it sent its signal or the recorder ended before the moment, and says which; it exits 1 on an error, including a moment that never came while the recorder ran.VERIFIED
signal-at's five cases above, at 5b0823c, and E2's loop with a signaller exiting 1.bash -n,py_compile,ruff checkat 0a8deaf.ASSUMED
/proc/<pid>/statis read on the e2e's machine: Linux, as everything else in it (PipeWire,pactl,bwrap).signal-at's next look, 0.5 ms later.NOT VERIFIED
RISKS
sent as … appeared. There is deliberately no assertion for this: depending on the machine, all three moments can be missed legitimately. Before this change it was the same, after a two-minute wait.🤖 Generated with Claude Code