Skip to content

test: pin the CLI README's pasted --help block to the rendered long help - #379

Merged
loom-fleet-dispatch[bot] merged 1 commit into
mainfrom
feature/issue-356
Nov 14, 2026
Merged

loom-fleet-dispatch[bot] merged 1 commit into
mainfrom
feature/issue-356

Conversation

@loom-fleet-dispatch

@loom-fleet-dispatch loom-fleet-dispatch Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Pins the $ fasterhenry --help block pasted in fasterhenry-cli/README.md (the crate's crates.io landing page) to the command's real rendered long help, per the issue's decided option (a): keep the paste, pin it with a test.

Changes

  • fasterhenry-cli/README.md — one line: the --fasthenry-compat description (line 73) gains the missing trailing clause ", and turns a .equiv of a node with itself into a warning", matching cli.rs's doc comment as clap actually renders it (no trailing period — clap strips it; verified against the built binary). The ten-trailing-space gap on line 69 is deliberately untouched: it is absorbed by the comparison's trailing-whitespace normalization, and the file carries no trailing whitespace anywhere.
  • fasterhenry-cli/tests/cli.rs — new readme_help_block_matches_rendered_long_help: reads the README at compile time (include_str!), extracts the block between $ fasterhenry --help and the closing fence (asserting it found a non-empty block), renders BareCli::command().render_long_help() in-process (byte-identical to the binary's --help), and compares whole-output, per line, with trim_end() on both sides plus an explicit length check. The failure names the first differing line (block-relative and absolute README line) and shows both sides. No workflow change; tests/ is outside the crate's include allowlist, so the Package (cargo publish --dry-run) job is unaffected.

Acceptance Criteria Verification

  • Pasted block matches the binary's real long-help output line for line, trailing whitespace stripped — verified two ways: diff of the extracted block against fresh target/debug/fasterhenry --help output (47 vs 47, clean under sed -E 's/[[:space:]]+$//' normalization) and the new test passing.
  • A test fails when the two drift — demonstrated test-first (see Test Plan).
  • Failure names the first differing line and shows both sides — captured: README help block line 39 (README line 73) differs: with both lines in full.
  • Targeted suite green: cargo test -p fasterhenry-cli --test cli — 20 passed (19 existing + new). Full cargo test --workspace and the Package job are CI's gate; locally the crate's include allowlist (src/**/*.rs, build.rs, README.md, LICENSE, CHANGELOG.md) still excludes tests/, and CI's exact cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings both pass clean in this worktree.
  • No trailing whitespace introduced — grep -rn '[[:space:]]$' fasterhenry-cli/README.md finds none.

Test Plan

  • TDD: wrote readme_help_block_matches_rendered_long_help first, ran it against the still-drifted README, and captured the failure naming README line 73 with both sides shown; then made the one-line README edit and the test went green.
  • Manual bite-checks of the extraction guards: temporarily deleting a block line fires the length assertion ("README help block is 46 lines but the rendered long help is 47"); temporarily removing the $ fasterhenry --help marker fires the extraction expect. Both mutations restored; final tree has exactly the one-line README fix.
  • Manual: diff <(extracted README block) <(fresh binary --help) after trailing-whitespace normalization — identical.
  • Live verification: not applicable — no live/remote resource involved; the pin's ground truth is the local build, and the in-process render was additionally confirmed byte-identical to the spawned binary's output.

Closes #356

loom dashboard

The pasted $ fasterhenry --help block in fasterhenry-cli/README.md had
drifted from the binary: the --fasthenry-compat description was missing
its trailing clause. Fix that line, and add an in-process test that
extracts the pasted block from the README (include_str!), renders
BareCli's long help in-process, and compares line by line with trailing
whitespace stripped from both sides. The failure names the first
differing line and shows both sides; a moved fence or a length mismatch
fails loudly rather than comparing nothing.

Closes #356
@loom-fleet-dispatch loom-fleet-dispatch Bot added the loom:review-requested PR ready for Judge to review. Applied by: Builder when opening PR. label Nov 14, 2026
@loom-fleet-dispatch

loom-fleet-dispatch Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

PR #379's loom:reviewing claim is held by the judge of sweep step-judge-379-1794696217 on host host-7ec0fa4c. This comment is a PR lease record (#9401): its liveness signal is its own forge-assigned updated_at, renewed while the judge works and released when it is done. Another judge that finds this lease live stands down before touching a worktree. See defaults/docs/lease-record.md § "PR-phase leases".

@loom-fleet-dispatch loom-fleet-dispatch Bot added the loom:reviewing Judge is reviewing this PR. Applied by: Judge only. Stale after LOOM_STALE_REVIEWING_MINUTES (30m). label Nov 14, 2026
@loom-fleet-dispatch

Copy link
Copy Markdown
Contributor Author

✅ Approved!

Two-file diff, exactly the scope the issue's recorded decision (option (a) — keep the paste, pin it with a test) asks for: one README line and one in-process test in the existing fasterhenry-cli/tests/cli.rs. No workflow change, no new file, no CLI behavior change.

Spec reconciliation

spec=6c4d90480958d252 comments=6869160483@2026-11-14T01:22:53Z,6869280479@2026-11-14T01:22:33Z,6871448293@2026-11-14T04:07:18Z,6873023157@2026-11-14T06:20:25Z,6874272624@2026-11-14T08:15:25Z,6874378705@2026-11-14T08:14:02Z,6884259661@2026-11-14T21:14:56Z,6884296624@2026-11-14T21:14:17Z,6884915014@2026-11-14T22:10:39Z
baseline: none - no earlier spec baseline available; reviewed against current requirements

Reviewed against #356's current body (post re-curation) and all trusted comments. No material difference between the current requirements and this PR's scope: the live spec asks for one README line (73), a whole-block comparison with trim_end() on both sides, a failure message naming the first differing line with both sides shown, line 69 left untouched, and no new trailing whitespace. The PR does all five and nothing else. The issue's ## Superseded spec text block was correctly not implemented — the diff follows the live corrected guidance (one line, not two), and specifically does not add the ten trailing spaces to line 69. Every comment on the issue is a bot/Loom comment; no operator ruling or scope change landed during review.

Verification I ran (worktree .loom/worktrees/issue-356 @ c719c39, clean, HEAD == PR head)

  • Targeted suite green: cargo test -p fasterhenry-cli --test cli → 20 passed; 0 failed, including readme_help_block_matches_rendered_long_help.
  • TDD claim VERIFIED, not just path-checked. Restored the merge-base (37bed8c) README into the worktree and re-ran the new test: it fails there, for the reason the fix addresses, with exactly the message the PR body claims —
    README help block line 39 (README line 73) differs:
      pasted: "… with a warning"
      real:   "… with a warning, and turns a `.equiv` of a node with itself into a warning"
    
    A test that passes on the unfixed tree would have been blocking; this one bites. README restored, worktree re-verified clean (git status --porcelain empty, HEAD c719c39).
  • Length guard bites too. Deleted one block line: README help block is 46 lines but the rendered long help is 47. So a README restructure fails loudly rather than vacuously comparing a short block — the third AC's "fix it by reading the failure" property holds for both failure modes.
  • README line 73 matches cli.rs:127-128 verbatim, modulo the trailing period clap strips (sed -n '120,132p' fasterhenry-cli/src/cli.rs vs sed -n '73p' fasterhenry-cli/README.md).
  • No trailing whitespace introduced: grep -rn '[[:space:]]$' fasterhenry-cli/README.md → none.
  • Not environment-dependent. I checked the one thing that could make this pin flaky across CI legs: Cargo.toml:28 declares clap = { version = "4", features = ["derive"] }, so wrap_help is off and render_long_help() does no terminal-width wrapping. Confirmed empirically — the rendered line 39 comes back ~400 chars unwrapped, and the test is green here (non-tty) and on all three rust matrix legs.
  • Package job unaffected: fasterhenry-cli/Cargo.toml:17 include = ["src/**/*.rs", "build.rs", "README.md", "LICENSE", "CHANGELOG.md"] — tests/ is outside the allowlist, so cargo publish --dry-run cannot see the new test.
  • CI: loom-daemon forge wait-checks 379 → LOOM-CHECKS-GREEN c719c39. mergeStateStatus CLEAN. check-review-feedback.sh → REVIEW_FEEDBACK_STATE=CLEAR (0 reviews, 0 unresolved inline threads).
  • Not re-run locally (CI is the gate and is green at this exact head): cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace, and the Package (cargo publish --dry-run) job.

Acceptance criteria

AC Status
Block matches rendered long help, trailing whitespace stripped ✅ test green, 47 vs 47
A test fails when the two drift ✅ demonstrated against the merge-base README
Failure names the first differing line and shows both sides ✅ captured above; length mismatch covered too
cargo test --workspace + Package job green ✅ via CI at c719c39
No trailing whitespace introduced ✅ measured, none in the file

Closes #356 present, and it is the only close/fix/resolve keyword adjacent to a #356 reference in the body — no stray second one.

Code quality notes (non-blocking, no action needed)

  • The extraction's take_while(|&&line| line != "```") would stop early if the help output itself ever emitted a bare ``` line. That degrades into the length assertion, which fails loudly — the safe direction, and clap will not emit one. Worth leaving as-is rather than hardening.
  • position(...) takes the first $ fasterhenry --help marker, so a second pasted block elsewhere in the README would be silently unpinned. Not a defect today (there is one block) and out of this issue's scope; not worth an issue.
  • Comparing per-line with an explicit length check (rather than one whole-string assert_eq!) is what makes the failure message useful here. Good call.

Nice, tightly-scoped change that converts a twice-hand-fixed wart into an enforced invariant.

loom dashboard

@loom-fleet-dispatch loom-fleet-dispatch Bot added loom:pr PR approved by Judge, ready for Champion auto-merge. Applied by: Judge. and removed loom:review-requested PR ready for Judge to review. Applied by: Builder when opening PR. loom:reviewing Judge is reviewing this PR. Applied by: Judge only. Stale after LOOM_STALE_REVIEWING_MINUTES (30m). labels Nov 14, 2026
@loom-fleet-dispatch

loom-fleet-dispatch Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

PR #379's (no label: the lease is the claim) claim is held by the champion of sweep step-champion_merge-379-1794697333 on host host-7ec0fa4c. This comment is a PR lease record (#9401): its liveness signal is its own forge-assigned updated_at, renewed while the champion works and released when it is done. Another champion that finds this lease live stands down before touching a worktree. See defaults/docs/lease-record.md § "PR-phase leases".

@loom-fleet-dispatch

Copy link
Copy Markdown
Contributor Author

Champion Auto-Merge

This PR meets all safety criteria for automatic merging:

  • Judge approved (loom:pr label), verdict marker FRESH at head c719c39 (verdict-staleness-guard.sh → DECISION=FRESH)
  • Merge-risk judgment passed: diff is one new in-process test in fasterhenry-cli/tests/cli.rs plus a one-line fasterhenry-cli/README.md help-text correction; no runtime or shared-path behavior changes, blast radius confined to one crate's docs and test target, Judge's verdict cites specific files/lines and re-ran the suite plus a merge-base bite-check, and git revert -m 1 fully undoes it — all four axes green, no prior hold on record
  • Diff size: 54 lines (+53/-1) — informational, not a gate
  • No critical files modified (paginated files API read fresh this pass: fasterhenry-cli/README.md, fasterhenry-cli/tests/cli.rs — no Cargo.toml/package.json, no .github/workflows/*, no migration path; champion.extraCriticalPaths unset)
  • Ratification hold clear (champion-hold ratification → verdict=clear)
  • No merge conflicts (mergeable = MERGEABLE)
  • Updated recently (0 hours ago)
  • All CI checks passing (7 checks)

Proceeding with merge... If this was merged in error, you can revert with:
git revert -m 1 <merge-sha>


Automated by Champion role

loom dashboard

@loom-fleet-dispatch
loom-fleet-dispatch Bot merged commit f6c2e1a into main Nov 14, 2026
7 checks passed
@loom-fleet-dispatch
loom-fleet-dispatch Bot deleted the feature/issue-356 branch November 14, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loom:pr PR approved by Judge, ready for Champion auto-merge. Applied by: Judge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin fasterhenry-cli/README.md's pasted --help block to real output, or stop pasting it

0 participants