You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SPEC.md's BOLT-CFG-7 says "A setting in a bolt.bend whose name is no rule or group is a finding." Nothing implements it today: bolt/config.bend reads every def <name>() and grading only ever looks names up, so an unknown name is silently ignored. This issue proposes the rule that makes CFG-7 true, so it can then be proved like the other CFG rows (#107).
Why
A typo in a bolt.bend fails open. def wrp() -> String: "off" leaves wrap at its group level, and nothing says so. CFG-3 already made an unknown level word fail closed ("a typo makes a rule stricter, never silently off"); an unknown name is the same mistake one token to the left. Retired names hit it too: def quantify() (L004) and def shadow() (C001) are now dead settings, and def law() is the trap bolt/README.md already warns about.
Proposal
slug
setting
code
C011, the next correctness code (C001 stays retired)
group
correctness, default error, like the rest of the group: a setting that does nothing is a config bug, and CFG-3 already chose fail-closed
message
`wrp` names no rule or group, so it sets nothing. plus, when one slug or group is one edit away, Did you mean `wrap`? (optional; drop it if it costs more than it earns)
position
the def line of the setting in the bolt.bend: bolt.bend:L:1
Known names are exactly Codes.table()'s slugs plus the five group names. A retired slug (quantify, shadow) is unknown, and gets the finding.
Where it runs. A bolt.bend is read, never linted (BOLT-SCOPE-5), so this cannot be a per-file rule over Src. It belongs where the config is read: the grader already finds the nearest bolt.bend per file, so the natural home is a check over each bolt.bend that grading reads, reported once per bolt.bend in the run, after the per-file findings and before coverage/unsafe (BOLT-OUT-3's order gains one slot; the row would say so). The LSP, which runs per-file rules only, would report it when the open document is a bolt.bend, which today gets no lint (BOLT-LSP-4's "an open bolt.bend gets no lint" would change to "gets only setting").
Its own level.setting is graded like any rule, by the bolt.bend it reports on, so def setting() -> String: "off" turns it off, and def correctness() sets it with its group.
bolt/config.bend: a pure unknown(cfg: Config) -> List<(name, line)> over the parsed settings, which needs the settings to keep their line.
bolt/lint.bend (and bolt/lsp/ for the open-bolt.bend case): report it.
bolt/README.md: the group table, the code table, the rule's entry.
SPEC.md: BOLT-CFG-7 cites the law; BOLT-OUT-3 and BOLT-LSP-4 wording as above; a BOLT-RULE-C011 row.
The law (CFG-7)
Over every list of settings: unknown(Config{sets}) holds exactly the settings whose name is neither a slug of Codes.table() nor one of the five groups, in file order, one each. Stated against a spec function in bolt/LAWS.bend, proved in bolt/PROOF.bend, next to the CFG laws.
Open questions
Correctness/error, or style/warn (S005) so existing projects with a stale def quantify() get a warning, not a failing gate, on upgrade?
Keep the "did you mean" suggestion, or leave it out of the first version?
SPEC.md's BOLT-CFG-7 says "A setting in a bolt.bend whose name is no rule or group is a finding." Nothing implements it today:
bolt/config.bendreads everydef <name>()and grading only ever looks names up, so an unknown name is silently ignored. This issue proposes the rule that makes CFG-7 true, so it can then be proved like the other CFG rows (#107).Why
A typo in a bolt.bend fails open.
def wrp() -> String: "off"leaveswrapat its group level, and nothing says so. CFG-3 already made an unknown level word fail closed ("a typo makes a rule stricter, never silently off"); an unknown name is the same mistake one token to the left. Retired names hit it too:def quantify()(L004) anddef shadow()(C001) are now dead settings, anddef law()is the trap bolt/README.md already warns about.Proposal
settingC011, the next correctness code (C001 stays retired)correctness, default error, like the rest of the group: a setting that does nothing is a config bug, and CFG-3 already chose fail-closed`wrp` names no rule or group, so it sets nothing.plus, when one slug or group is one edit away,Did you mean `wrap`?(optional; drop it if it costs more than it earns)defline of the setting in the bolt.bend:bolt.bend:L:1Known names are exactly
Codes.table()'s slugs plus the five group names. A retired slug (quantify,shadow) is unknown, and gets the finding.Where it runs. A bolt.bend is read, never linted (BOLT-SCOPE-5), so this cannot be a per-file rule over
Src. It belongs where the config is read: the grader already finds the nearest bolt.bend per file, so the natural home is a check over each bolt.bend that grading reads, reported once per bolt.bend in the run, after the per-file findings and beforecoverage/unsafe(BOLT-OUT-3's order gains one slot; the row would say so). The LSP, which runs per-file rules only, would report it when the open document is a bolt.bend, which today gets no lint (BOLT-LSP-4's "an open bolt.bend gets no lint" would change to "gets onlysetting").Its own level.
settingis graded like any rule, by the bolt.bend it reports on, sodef setting() -> String: "off"turns it off, anddef correctness()sets it with its group.Files it touches
bolt/codes.bend: asetting/C011/correctnessrow (and the one-per-row proof arm OUT-1's laws inbolt/PROOF.bendneed, test(output): prove the code table one-to-one and the finding format (BOLT-OUT-1, BOLT-OUT-2) #112).bolt/config.bend: a pureunknown(cfg: Config) -> List<(name, line)>over the parsed settings, which needs the settings to keep their line.bolt/lint.bend(andbolt/lsp/for the open-bolt.bend case): report it.bolt/README.md: the group table, the code table, the rule's entry.SPEC.md: BOLT-CFG-7 cites the law; BOLT-OUT-3 and BOLT-LSP-4 wording as above; aBOLT-RULE-C011row.The law (CFG-7)
Over every list of settings:
unknown(Config{sets})holds exactly the settings whose name is neither a slug ofCodes.table()nor one of the five groups, in file order, one each. Stated against a spec function inbolt/LAWS.bend, proved inbolt/PROOF.bend, next to the CFG laws.Open questions
style/warn (S005) so existing projects with a staledef quantify()get a warning, not a failing gate, on upgrade?Generated by Claude Code