Skip to content

memhog: no description swallow, real values, and the usage operands - #162

Open
sadigaxund wants to merge 5 commits into
mainfrom
r12/memhog
Open

sadigaxund wants to merge 5 commits into
mainfrom
r12/memhog

Conversation

@sadigaxund

@sadigaxund sadigaxund commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Stops a headingless option table landing in the root description, stops a row with no placeholder reading its description's first word as a value — the row's own text is never trusted for that now, only the tool's own usage line — and recovers an unlabelled single-line synopsis's own operand tail. Every one of memhog's five printed lines was wrong or lost in the tree, which is why the fixture's own note calls for a full revision.

Sweep numbers, full PATH, 2270 tools matched against cf5912f:

  • 8 positionals gained across 5 tools: memhog 0 to 3, xfs_rtcp 0 to 2, blkdeactivate, dbiprof and dbus-cleanup-sockets 0 to 1 each. Zero flag losses, zero flag gains, zero subcommand movement, zero positional losses. All nine control tools byte-identical on their #fp2 records: git, gcc, aarch64-linux-gnu-g++-13, ar, pnpm, systemctl, tar, find, docker.
  • The value rule moves 6 tools fleet-wide, so it clears the five-tool bar rather than needing an exception: host (16 rows), kpartx (11), numastat (6), vm-support (3), memhog (3), savelog (1). 30 fabricated values are dropped and 8 more are replaced by the real name the usage line spells (host -c class, -N ndots, -t type, -W time, -R number, -m flag, -p port; memhog -f FILE); no boolean gains a placeholder anywhere.
  • Five status transitions, all upward: host, kpartx, memhog, numastat and vm-support move from low-confidence to ok.
  • corpus/memhog/2.0.18 promotes out of [xfail] with must_contain_positionals, three must_describe entries and must_value_name all passing; corpus/host/9.18.39 is added, passing from the start.

Stated remainder: host's -A, -s, -U, -4 and -6 are named in no usage line at all, so they keep their pre-existing fabricated value and no description — 5 rows on 1 tool, recorded in the fixture's own header rather than claimed fixed. Fixing them needs evidence this rule does not have.

Two losses were found by field-level lists rather than by any count bar and fixed before this branch shipped. savelog's -r rolldir - use rolldir instead of . to roll files had its real value thrown away while its description was recovered; reading the value off the usage line keeps both. lsof's -F [f] select fields; -F? for help gained its description with [f] printed twice, once as the value and once opening the description; a leading bare, bracketed or angled repeat of the usage value is now stripped. lsof -F is the only change to that fixture besides its root description splitting into the two paragraphs its help really has.

sadigaxund and others added 5 commits September 13, 2026 22:10
…ered

memhog's flag rows carry no column gap, so its whole screen was wrong:
a fabricated value name on -f/-H, the root description swallowing every
row, and no positionals at all. Widens S-165's bound to cover a usage
line too, recovers -f/-H's real value and description from the usage
line's own evidence, and flattens the nested [policy [nodeset]] tail
into ordered optional positionals for an unlabelled single-line synopsis.

Fixed along the way: a table row with two candidate lines (lsof's -T)
could glue a neighbour's text into the wrong flag; now refused unless
exactly one candidate row exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ands

r12/usage-operands keeps S-175 (its PR is already open). S-176-to-S-177
done before S-175-to-S-176 so the two renames never collide.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
savelog's -r rolldir row uses the document's own ' - ' separator like
every sibling row, but rolldir is long enough that the gap before the
dash narrows to one space. The fabrication guard read that as a bare-
word guess and threw the real value away recovering the description.

A document where other option rows show the same ' - ' separator now
keeps the row's own value and recovers only the description from it,
checked ahead of the bare-word-guess branch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
host's own -c/-N/-t/-W/-R/-m/-p lost their real usage-named values
under the earlier version of this rule, which only knew a glued
uppercase run or an already-dash-separated row. One rule now reads
every usage spelling: glued run, spaced placeholder, glued optional
group, and no placeholder at all (alone, in an alternation, or in a
bundle) all come from extract_usage_flags's own grammar, never a
second reading built for this repair. A letter no usage line names
gets no change at all.

Fixes host, kpartx and numastat the same way; savelog's -r keeps
its value and gains its description through the same lookup. Also
refuses a row packing a second flag by a real column gap (lsof's
own multi-column -T/-U/-v summary), which the previous version read
as one row's description and destroyed -T's real value.

Adds corpus/host/9.18.39, passing from the start.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lsof's `-F [f] select fields; -F? for help` printed `[f]` twice: once
as the flag's Optional value, once again opening the description the
same rule had just recovered. Bare, bracketed and angled spellings of
the leading value are now stripped alike.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant