PR #802 follow-ups: probe.py --help has the same bug, and one width-dependent assertion nf-ygo3 ← Beads

closed priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/805 by tools/beads/import_github.py's reconcile pass.

Suggestions from ninefold-reviewer's review of #802 (probe_all.py --help, #663 / design 006 S10). Both are out of that PR's stated scope; neither blocked it. Unclaimed.

1. ./probe.py --help is the same defect, and costs strictly more

#802 fixed the sweep runner. Its sibling — advertised on the adjacent line of notes/probes.md:15-16 — still has the original bug, and a worse version of it:

So ./probe.py --help pays an Xvfb re-exec *and* a full dotnet build Ninefold.sln to answer a usage question — the exact cost #663 reported, in the tool a dev is more likely to run by hand. After #802 the pair is inconsistent: probe_all.py answers in milliseconds, probe.py builds the solution.

The fix is #802's, transplanted: an argparse.ArgumentParser with one positional, parsed before the if argv is None: re-exec guard. probe.py is outside GOVERNANCE; its tests are tools/tests/test_probes.py, which is in GOVERNED_TESTS (perimeter.py:315) — so this lands on @aedanpope's approval, same route #802 took, for the same reason.

DEV_PRINCIPLES C1 (least surprising thing) and D2 (fail noisily and as soon as possible).

2. UsageTest.test_the_usage_says_a_bare_run_is_the_whole_suite asserts on wrapped output

The case asserts "whole sweep" appears in --help output. That string comes from the names positional's help text, which argparse wraps to shutil.get_terminal_size().columns — so in a sufficiently narrow terminal the phrase splits across lines and the test reds for a reason unrelated to the code.

Not reachable under presubmit.py, where the lane's stdout is a pipe and get_terminal_size falls back to 80 columns; it is a hand-run hazard (python3 -m unittest tools/tests/test_probes.py in a narrow pane). Asserting on the two words separately, or on a phrase short enough not to wrap, removes it.

Minor. Recorded rather than raised in the gate.

Dependencies

None.

Comments

No comments.

Add a comment