testsAndMisc/docs/superpowers/evidence/rpi-nc-ca-suite-2026-08-22.json
Krzysztof kuhy Rudnicki 92678c9506 Cover rpi_nc_ca.sh (98.63%) and bind the two paths its suite needed
A 26-assertion suite for rpi_nc_ca.sh, third in the hardest-first order. All
five OS branches are exercised by seeding the marker file each one tests for
inside the jailed /etc, plus a uname stub for Darwin; both NSS stores and all
three Firefox outcomes are covered.

SHARED-FILE BUG: the Debian branch does `mkdir -p
/usr/local/share/ca-certificates` and jail_args bound only /usr/local/bin, so
the suite aborted there under set -e. /usr/local/share and /etc/pki are now
bound. jail_args is shared by every suite in the directory, so all five libs
were re-measured: dot_resolver_install.sh still 39/39 = 100.00%, and
rpi_nc_install.sh, dwm_config.sh and aw_autostart.sh are unchanged. An
over-aggressive mount looks exactly like unreachable code, so this check is
not optional.

That bind also unblocked the runner for the whole directory: with the old
args the run exited 1 before nc_php.sh could be measured at all.

Measured 72/73 = 98.63% through run_all.sh, which is the exact subject
is_covered() builds -- the gate's own view -- so the lib STAYS on the
allowlist. The single test file alone reports 73/73 = 100.00%, both figures
reproduced twice. The one-line delta is line 141, the first line of
show_help's heredoc BODY: not a statement, so the denominator is wrong rather
than a test missing. Excluding heredoc bodies from the denominator is the
next piece of work; it is what stands between this suite and the bar.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016sxxsDHWgdRhmdmzNMA6XM
2026-08-22 12:59:51 +02:00

51 lines
4.6 KiB
JSON

{
"intent": "Add a test suite for rpi_nc_ca.sh (score 51), the third target in the hardest-first order, and add the two bind paths its suite exposed as missing from the shared jail_args. It stays on the allowlist at 98.63% as measured through run_all.sh, which is the invocation the gate itself uses.",
"scope": [
"linux_configuration/scripts/single_use/features/lib/tests/test_rpi_nc_ca.sh: new, 26 assertions covering all 5 OS branches, both NSS stores and every Firefox outcome",
"linux_configuration/scripts/single_use/features/lib/tests/jail_args: add --bind /usr/local/share and --bind /etc/pki",
"Non-goal: no change to rpi_nc_ca.sh -- no latent bug surfaced",
"Non-goal: excluding heredoc bodies from the coverage denominator; that is the next piece of work and is what stands between this suite and 100%"
],
"changes": [
"The five OS branches (Arch/Debian/RHEL/macOS/unknown) are selected by SEEDING the marker file each one tests for inside the jailed /etc, plus a `uname` stub for Darwin. Safe only because /etc is bind-mounted -- on a real host this would make the machine claim to be a different distribution.",
"The sshpass stub EMITS a certificate rather than recording the call. A record-only stub leaves an empty file and the subject dies on its own emptiness check, per the documented trap that a stub must materialise what the real tool produces.",
"SHARED-FILE BUG FIXED: the Debian branch does `mkdir -p /usr/local/share/ca-certificates`, and jail_args bound only /usr/local/bin. The suite aborted there under set -e. /usr/local/share and /etc/pki are now bound. Because jail_args is shared by every suite in the directory, all five libs were re-measured after the change (see verification) -- an over-aggressive mount looks exactly like unreachable code."
],
"verification": [
{
"command": "shell_coverage_jail.sh --subject .../run_all.sh <jail_args> --measure rpi_nc_ca.sh --min 100 --fail-on-case-error",
"result": "pass",
"evidence": "rpi_nc_ca.sh: 72/73 = 98.63%, uncovered line 141, and no 'warn: case exited' -- every assertion passes. Measured through run_all.sh because that is the exact subject is_covered() builds; it is the gate's own view."
},
{
"command": "same, but with the single test file as the subject",
"result": "pass",
"evidence": "73/73 = 100.00%, reproduced twice. The runner reports 98.63% twice. Stable in both modes, so this is a kcov per-process merge artifact, not flakiness. Line 141 is the first line of show_help's heredoc BODY -- not a statement, so the denominator is wrong rather than the test missing."
},
{
"command": "re-measure all five libs through run_all.sh after the jail_args change",
"result": "pass",
"evidence": "dot_resolver_install.sh 39/39 = 100.00% (unchanged, and it is already off the allowlist so a regression here would make the gate unsatisfiable); rpi_nc_install.sh 11.36%, dwm_config.sh 47.95%, aw_autostart.sh 82.93% -- all unchanged. No mount masked anything."
},
{
"command": "measure nc_php.sh with the OLD jail_args vs the NEW, single-file",
"result": "pass",
"evidence": "84/85 = 98.82% under both -- no regression. Under the OLD args the RUNNER could not measure it at all (the suite exited 1 on the /usr/local/share abort this commit fixes); it now reports 'instrumented no lines' via the runner, a pre-existing merge artifact of the same family as line 141."
},
{
"command": "shellcheck on the new suite",
"result": "pass",
"evidence": "clean, no suppressions added."
}
],
"risks": [
"jail_args is shared by every suite in the directory, so these two binds affect all of them. Mitigated by re-measuring all five libs; if a future bind does mask something, scope it to the leaf directory (--bind /usr/local/share/ca-certificates) rather than reverting the suite that needed it.",
"The suite seeds /etc/arch-release, /etc/debian_version and /etc/redhat-release. Run outside the jail this would make the host claim a false distribution, which is why the suite refuses to start when /etc is not writable.",
"98.63% vs 100% hinges on one heredoc-body line. Until shell_coverage_report.py excludes heredoc bodies from the denominator, any lib with a show_help-style heredoc is permanently capped below the bar."
],
"rollback": [
"git revert the commit; the suite disappears and jail_args loses the two binds, which returns the whole directory's runner to exiting 1 on the /usr/local/share abort.",
"After rollback, confirm the runner fails again for every suite in the directory -- that shared failure is the symptom this commit removes."
]
}