Skip to content

format: the sentence saying which words a setting takes is written in one place - #41

Merged
donislawdev merged 1 commit into
mainfrom
format/one-voice-for-a-closed-set
Sep 2, 2026
Merged

format: the sentence saying which words a setting takes is written in one place#41
donislawdev merged 1 commit into
mainfrom
format/one-voice-for-a-closed-set

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

Two places in the archive package listed the values of a closed set by hand, in the registry's order and the registry's phrasing - compression and entry_owner. The registry builds that sentence from the declared set, so both were copies of it with nothing comparing the two.

Identical copies are the dangerous kind, because nothing goes red while they agree, and they agreed. The day they stop agreeing is the day somebody adds a value to the declaration: the registry lists it, tfg formats prints it, the window offers it, and the hand written line does not.

The second copy arrived through the change that closed the first half of this, in the same week the note warning about copies was written.

What changes for a person using the tool

Nothing. Measured on the built binary: --set compression=TURBO and --set entry_owner=USER are refused by the registry, exit 4, in the registry's own words. Both hand written branches sit behind that check and no surface reaches them - they are there for a direct caller, which is what a guard is. No changelog entry, because there is nothing a person would notice.

Guards

Three, each proven by mutation.

  • The sentence is built in one place. Read from string literals through the parser rather than from the file text, so a comment explaining the rule may still name the sentence.
  • A refusal quotes the registry. This catches a copy that was reworded rather than repeated, which the first guard cannot see.
  • Every word the declaration offers is one its reader accepts. This closes the hole the fix itself opens: Allows says nothing is wrong with a value it allows, so a word added to the set and not handled by the reader would arrive as a refusal with an empty reason.

The first mutation is worth naming: it puts back a sentence identical to the one the registry builds, so the second guard stays green under it. That is the whole shape of the problem.

Checks

Full go test green, preflight --quick green on all twelve checks, staleness clean at 727 entries.

🤖 Generated with Claude Code

… one place

Two places in the archive package listed the values of a closed set by hand,
in the registry's order and the registry's phrasing, for compression and for
entry_owner. The registry builds that sentence from the declared set, so these
were copies of it with nothing comparing the two.

Identical copies are the dangerous kind, because nothing goes red while they
agree - and they agreed. The day they stop agreeing is the day somebody adds a
value to the declaration: the registry lists it, tfg formats prints it, the
window offers it, and the hand written line does not.

The second copy arrived through the change that closed the first half of this,
which is the clearest evidence available that this copies itself faster than
anybody notices.

Both now ask the declaration. Nothing a person sees changes: a bad value is
refused by the registry first, with exit 4, in the registry's own words, and
these branches sit behind that check for a direct caller.

Three guards, each proven by mutation. The sentence is built in one place,
read from string literals rather than file text so a comment may still name it.
A refusal quotes the registry, which catches a copy that was reworded rather
than repeated. And every word the declaration offers is one its reader accepts,
which closes the hole the fix itself opens: Allows says nothing is wrong with a
value it allows, so a word added to the set and not handled by the reader would
be refused with an empty reason.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@donislawdev
donislawdev merged commit c15205d into main Sep 2, 2026
18 checks passed
@donislawdev
donislawdev deleted the format/one-voice-for-a-closed-set branch September 2, 2026 14:24
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