Commit Graph

2 Commits

Author SHA1 Message Date
Alexander 8d2f2fa11c Accept single-edit typos in correction gates
difflib's SequenceMatcher underrates adjacent transpositions, so the
flagship examples (gti->git 0.667, greo->grep 0.75, psuh->push 0.75)
fell below the 0.8 ratio gates and were declined. Per the plan
amendment, the token and candidate gates in the history resolver,
guess_from_path and the help resolver additionally accept a
first-char-equal single edit (one substitution, insertion, deletion
or adjacent transposition; new thefuck/typo.py), with the ratio
cutoffs, the exact-one-candidate rule and the 0.79 boundary (edit
distance >= 2) unchanged.
2026-09-13 21:00:20 +02:00
Alexander b02582d7b9 Add generic binary-help subcommand resolver
Consult a PATH-resolved binary's own --help (mtime-cached, LC_ALL=C,
2s timeout with kill) when a segment's first non-flag token is not a
listed subcommand, and splice the unique close match (ratio >= 0.8,
same first character). Ambiguity, sudo heads, flat-fallback artifact
heads, valid subcommands and nested levels all decline to the rest of
the chain; only <binary> --help is ever run.
2026-09-13 20:51:01 +02:00