cli: a listing command refuses a name it cannot answer about - #97
Merged
Conversation
Measured on the built binary: "tfg formats png svg" described png, said nothing at all about svg and ended with zero, and "tfg preset list some-name" printed the whole list and ignored the name though that operation takes no name at all. Both are silence about an argument somebody typed, and in a script a confident answer about the wrong thing is worse than a refusal. The second one is not in the observation that asked for this. It came out of measuring the first, and fixing only the named half would have left that observation's own sentence true about a different pair of commands. Both now end with 2 and name the word they could not use. The guard asks four commands at once, including the two that already refused, and requires the refusal to name the rejected word - an exit code alone is satisfied by a build that refuses everything, so the other half checks these commands still answer. The flag spelling guard stops naming its directories by hand and derives them from the layer map. internal/damage arrived on layer 2, under both surfaces, without joining that list, and the hole would have taken every later package too. The layer map is the right source because the layering guard already refuses a package that is neither on the ladder nor declared test only, and because it leaves out internal/oracle on purpose - that one carries real command lines for inkscape and ffprobe in raw strings. 113 files scanned became 128, with zero findings. Refusing the extra name pushed internal/cli/preset.go past the file ceiling, so it is split by what the parts do: presetcmd.go answers somebody who typed tfg preset, preset.go turns a named question into targets. The ratchet then took the ceiling down, 433 to 408 and crowdedFiles 1 to 0. Three new mutations, and four existing ones retargeted after the split - only staleness.py said they had gone stale. All eight run and caught. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes O196 and O197.
O196 - the silence
Measured on the built binary before touching anything:
tfg formats png svgsvgtfg preset list some-nametfg preset show <id> extratfg verify a bpreset listis not in the observation. It came out of measuring the onethat was, and fixing only the named half would have left O196's own sentence -
"two commands answer one question two ways" - true about a different pair.
Flagging it because only
formatswas authorised.tfg preset listtakes no name at all, so anything after it was always amistake, most likely somebody reaching for
tfg preset show. The refusal saysso.
O197 - the hand written list
The flag spelling guard named seven directories by hand and
internal/damagearrived on layer 2, under both surfaces, without joining it. The fix derives
the directories from the layer map, so this closes the class rather than the
instance: every later package below the surfaces is covered with nothing to
remember.
The layer map is the right source rather than a walk of
internal, for tworeasons.
TestLayeringHoldsForEveryPackagealready refuses a package that isneither on the ladder nor declared test only. And it leaves
internal/oracleout on purpose - that one carries three real command lines for inkscape and
ffprobe in raw strings, and a walk would redden on them, which is how a guard
gets switched off inside a week.
Measured: 113 files scanned became 128 (
damage4,legal7,site3,version1), zero findings - the hole was empty, and it was still a hole.What it cost
Refusing the extra name pushed
internal/cli/preset.goto 439 lines against aceiling of 433. Carving beat raising the number:
presetcmd.goanswers somebodywho typed
tfg preset,preset.goturns a named question into targets. Theratchet then took the ceiling down -
longestFile433 to 408,crowdedFiles1 to 0.The split invalidated three mutation entries and the ceiling change a fourth,
and only
staleness.pysaid so.Guards
One new guard asking four commands at once, including the two that already
refused - the defect was not a missing check in one place, it was four commands
answering one question two ways. It requires the refusal to name the rejected
word, because an exit code alone is satisfied by a build that refuses
everything, and the control half checks these commands still answer.
Three new mutations plus four retargeted, all eight run and caught.
Verification
go test ./...green,gofmt,go vet,staticcheck@v0.8.1cleantools/journey.py300 of 300tools/mutate/staleness.py: 943 patterns, each occurring exactly once🤖 Generated with Claude Code