main: read the headless report's stance through one seam - #22
Merged
Merged
Conversation
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 #19
print_linux_report(the--no-uipath, which headless--reviewalso uses) read the default-inboundstance itself and printed it in the same breath. No test executed that line, so deleting it would have
left the gate green while every headless report silently lost the verdict that tells a reader whether a
listening socket with no rule is exposed. This is the second site of the defect PR #18 closed inside
linux::bridge.The whole report body now renders into a
Stringvialinux_report_text(backend, &Report, &Sources),reading the stance through the
Sources/read_fromseam PR #18 added.print_linux_reportkeeps itssignature and is one
print!line. Rendering the whole report rather than just the stance line isdeliberate: a pure
stance_line()helper would still have let the call be deleted with the gate green,which is the actual defect.
Verified
./scripts/gate.sh— green;231 passed; 0 failed(was 229)Nonefailsthe_headless_report_reads_the_stance_through_the_supplied_sources:"Unmatched inbound: could not be determined on this host"where"blocked — ufw's DEFAULT_INPUT_POLICY is DROP"was expected. Before this change the same deletionpassed.
print_linux_reportand the newlinux_report_text— identical text, identical order, 15println!→ 15
writeln!, andprint!pairs withwriteln!'s trailing newline. breaker independentlyreconstructed and byte-compared four report shapes (empty; firewalld with the instrumentation line,
idle rows, a note and two unmeasurable entries;
None-only hits with an embedded newline in the note;negative and
i64::MAXhits against the{:>12}width) — identical 4/4.forbidden from touching an assertion. Recorded in
factory/runs/20260910-001337-no-ui-stance.json.NOT verified
src/main.rs:789print_text_reportopen-codes its zero-hit filter asis_enabled() && total_hits() == 0, so onWindows
--no-uithe synthetic default-policy row and zero-hit WFP pseudo-filters print as disablecandidates.
ui.rs:84 is_zero_hit()is the existing guard —hits_known && is_editable() && total_hits() == 0— andmain.rs:789is the only site that does not use it. Filed as The headless Windows report lists the default-policy row as a disable candidate #21 andupdated with that diagnosis. Deferred rather than fixed: it is the Windows path, nothing tests
print_text_reportat all, and doing it properly needs its own seam.note: None,unmeasurable: [], no idle rows.Deleting the
Collection: opt-in…line, the idle block, the note block or the unmeasurable blockleaves the gate green. The stance is guarded; those sections are not.
Sources::system()line in each entry point is executed only by a real run. Declared irreduciblein the plan — pinning it would need a test that reads
/etc/default/ufw, the exact host-dependencethis work removes — and both sites now carry a comment saying so.
could read the existing code to derive the expected text. seraph judged that immaterial, since
byte-identical output is the spec and the mutation test discriminates.
linux::default_policy::readwas deleted once its last caller went, because-D warningsmakes dead code a hard error.git grepacross the whole tree shows no remainingreference; its doc prose was folded into
read_from.read_from's ufw walk stops at the first readablefile, so a readable-but-keyless
/etc/default/ufwnever falls through to/etc/ufw/ufw.conf. Thatsemantic was deliberately preserved from before PR linux/bridge: inject the default-inbound stance into to_result #18. It fails to unknown, never to a deny.