Skip to content

capture: Feed's drop compiles without a warning on Windows and macOS - #787

Open
kitokey-marc[bot] wants to merge 3 commits into
mainfrom
capture/feed-drop-irrefutable
Open

kitokey-marc[bot] wants to merge 3 commits into
mainfrom
capture/feed-drop-irrefutable

Conversation

@kitokey-marc

@kitokey-marc kitokey-marc Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

capture: Feed's drop compiles without a warning on Windows and macOS

Supersedes #644 (by dime-hermes, credited in the commit's Co-authored-by), taken up on today's main; #644 is left open for its author.


Module

modules/capture — exactly one.

  • This pull request touches a single module
  • ⚠️ Cross-module — the cross-module label is required, justification below

Deliverable

Out of cycle: a compiler warning on Windows and macOS, outside any deliverable; no behaviour changes.

What it changes

Feed has two variants on Linux (Cpal, Passive) and one elsewhere (Cpal). Its Drop used if let Feed::Cpal { .. }, irrefutable off Linux: rustc warns irrefutable_let_patterns there — the Windows run of main (run 43366983469, job Windows — capture) prints it at src\main.rs:511. A match with the Passive arm under #[cfg(target_os = "linux")] does the same on every system, without the warning. What a drop does is unchanged: a cpal stream is marked closing, a passive stream nothing.

Oracle

  • The success criterion was written before the implementation
  • It was seen failing, for the right reason
  • It passes now — this pull request's runs: Windows 43421753066 and macOS 43421753167, no irrefutable in either log

Kind of oracle: other: the Windows and macOS CI logs of capture hold no irrefutable warning; on main the Windows one does (line quoted above).


Review budget

  • Lines changed (excluding generated): 6
  • Files touched: 1
  • Within budget

Contracts

  • No contract affected

Definition of Done

  • Oracle green — this pull request's Windows and macOS runs
  • Lint, format, types — cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, Linux
  • Unit tests — cargo test --locked, Linux: all green
  • Build
  • Diff self-reviewed line by line

Test sheet

Verifier: session bfdb23f1-1199-4cda-ab11-22e178326643

# Given · when · then Kind Result Evidence Commit Confirmed
S1 Given capture built on Windows and on macOS, when this head is compiled, then its log holds no irrefutable warning automated passed Runs 43421753066 (job Windows — capture, 131873181711) and 43421753167 (job macOS — capture, 131873181292), both on e3a18e1, both success: Checking kitokey-capture present, grep -ci irrefutable = 0 on each log; Windows's 3 warnings are all linker LNK4098. Baseline on main dae27f1: Windows run 43366983469 prints irrefutable if let pattern at src\main.rs:511:12, macOS run 43366983566 prints it too e3a18e1 —
S2 Given capture on Linux, when its check and test run, then clippy with -D warnings and every test pass automated passed On a git archive of e3a18e1, own target: cargo fmt --check 0, cargo clippy --locked --all-targets -- -D warnings 0, cargo test --locked 0 — 121 passed, 0 failed e3a18e1 —

Verifier's remarks: S1's oracle is read, not enforced — the Windows and macOS jobs run cargo check without -D warnings, so the old if let would pass them green (seen on main). Mutants on Linux, under timeout, source restored: 3 applied, 0 killed — old if let (warns only off Linux, as expected), closing.store(false), Feed::Passive(_) => unreachable!(): no test drops a Feed, so "what a drop does is unchanged" holds by reading, not by a test; a gap older than this change.


Summary

DONE
Feed::drop matches its variants instead of an if let, the Linux-only arm under its cfg.

VERIFIED
On Linux: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked — green. On main, the Windows and macOS runs' logs show the warning; this pull request's (Windows 43421753066, macOS 43421753167) hold no irrefutable.

ASSUMED
None.

NOT VERIFIED
No Windows or macOS build locally (no such target here): the pull request's own runs are the evidence.

RISKS
None seen: same behaviour on drop.


Signals to report

  • I had to look at another module's implementation
  • A kernel or playbook rule got in my way for no good reason
  • A quality gate blocked without improving quality
  • A rule applied by hand would be worth automating

🤖 Generated with Claude Code

… Linux

On Windows and macOS, Feed has one variant, Cpal, so the `if let` in its
Drop was irrefutable and rustc warned (irrefutable_let_patterns, seen in
the Windows run of main). A match with the Linux-only Passive arm under
its cfg compiles clean on every system. Supersedes #644.

Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948
Co-authored-by: dime-hermes[bot] <349604419+dime-hermes[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kitokey-marc
kitokey-marc Bot requested a review from a team as a code owner November 13, 2026 12:01
@kitokey-marc kitokey-marc Bot added the out-of-cycle Work outside the current cycle: an incident, a production defect; justified in the PR label Nov 13, 2026

@napkinstack-admin napkinstack-admin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capture : Feed::drop compile sans avertissement sous Windows et macOS.

napkinstack-agent Bot pushed a commit that referenced this pull request Nov 14, 2026
* capture: the e2e runs on a PipeWire of its own, no hardware in it

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>

* capture: the e2e sealed in a bubblewrap without /dev/snd; the guard fails 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>

* capture: the e2e's graph without pipewire-pulse's fallback sink; the 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>

* capture: the guard's device trial on a stubbed pw-dump, and a trial that 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>

* capture: e2e waits on E2's signallers alone, and its cleanup outlives 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>

* capture: a TERM from outside ends e2e as stopped, 143, never as NOT RUN

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>

* capture: e2e's folders made and removed outside the seal, so a cut run leaves none

A run cut by `timeout` ended the outer script by TERM; the sealed one, --die-with-parent,
went by SIGKILL before its restore, and $work and $graph stayed in /tmp (#796, S4). The
outer part now makes both, passes them in (KITOKEY_E2E_WORK, KITOKEY_E2E_GRAPH) and removes
them on its own exit, with the guard's files beside $work. The sealed restore still reads
them first, as before, when it runs.

Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: kitokey-marc[bot] <356215105+kitokey-marc[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The capture e2e sealed from main: this branch's runs no longer touch the computer's sound.

Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The e2e finds a start's tray item in a second: this branch's attest saves about 20 minutes.

Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

out-of-cycle Work outside the current cycle: an incident, a production defect; justified in the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant