Skip to content

damage: the command line says what a damage takes, not only that it exists - #96

Merged
donislawdev merged 1 commit into
mainfrom
damage/tfg-damage-command
Sep 9, 2026
Merged

damage: the command line says what a damage takes, not only that it exists#96
donislawdev merged 1 commit into
mainfrom
damage/tfg-damage-command

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

The window drew the settings of a chosen damage from the declaration on the day
damage arrived. The command line named the damages and stopped there, so
learning that zero-head takes bytes, and that bytes runs from 4 to 4096,
meant typing a wrong value and reading the refusal.

The parity guard cannot see that gap: it counts recipe keys, formats and
presets, and a damage parameter is none of the three.

What is here

tfg damage                  every damage, and what each one does to the bytes
tfg damage zero-head        what one of them takes
tfg damage --json           the same, for a script

The list carries a sentence rather than only a name, which is the difference
from tfg formats: png and zip say what they are and zero-head does not,
so a list of names would repeat what the --damage flag help already says. In
--json the parameters ride under the key tfg preset show already uses, in
the shape tfg formats already uses, because a damage parameter is a
format.Property.

Three things it does not do quietly

  • The smallest file follows the settings, so the column is measured with the
    defaults and says so. That column got it wrong once for formats: until
    2026-08-04 MINIMUM was the structural floor and pdf announced 3265 while
    runs took 3286.
  • An unknown name ends with 2, not 4. damage.UnknownError is already
    classified that way tool-wide, because a recipe naming one is refused while
    the recipe is read. One mistake, one code, matters more than matching the
    neighbouring command.
  • Two names at once are refused. Measured while writing this: tfg formats png svg describes png, ignores svg and ends with zero. formats is not
    changed here, because that is a visible behaviour change to a released
    command.

Guards

Four, each with a mutation, all caught and re-proved after the refactor below.
The last one holds commandsTakingHelp against the dispatch itself: adding this
command meant remembering two hand kept lists in two files, and nothing asked.
The rule is mechanical rather than a list of exceptions, so version, license
and help are not exempted - they simply do not hand on args[1:].

Flattening beat raising a ceiling again: the command pushed the count of
functions nesting three deep from 51 to 52, and lifting the list builder out put
it back at 51.

Verification

  • full go test ./... green, gofmt, go vet, staticcheck@v0.8.1 clean
  • tools/journey.py 300 of 300
  • tools/mutate/staleness.py: 940 patterns, each occurring exactly once
  • argument order, unknown flag, empty argument and wrong case exercised on the
    built binary

🤖 Generated with Claude Code

…xists

The window drew the settings of a chosen damage from the declaration on the
day damage arrived. The command line named the damages and stopped there, so
learning that zero-head takes bytes, and that bytes runs from 4 to 4096, meant
typing a wrong value and reading the refusal.

The parity guard cannot see that: it counts recipe keys, formats and presets,
and a damage parameter is none of the three.

tfg damage lists what this build can break, with the smallest file each one
takes and the settings it accepts, and tfg damage <id> describes one. Both
have --json, carrying the parameters under the same key and in the same shape
tfg preset show already uses, because a damage parameter is a format property.

Three things it refuses to do quietly. The smallest file follows the settings,
so the column is measured with the defaults and says so - the same column got
this wrong once for formats, announcing a floor that runs refused. An unknown
name ends with 2 rather than 4, which is the code the same mistake already got
from --damage. And two names at once are refused rather than answered about
the first.

Four guards, four mutations, all caught. The last of them holds the list that
watches --help against the dispatch itself, because adding this command meant
remembering two hand kept lists in two files and nothing asked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@donislawdev
donislawdev force-pushed the damage/tfg-damage-command branch from 2bbe959 to e5f4e7c Compare September 9, 2026 10:24
@donislawdev
donislawdev merged commit cc54cf9 into main Sep 9, 2026
18 checks passed
@donislawdev
donislawdev deleted the damage/tfg-damage-command branch September 9, 2026 10:42
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