Skip to content

Latest commit

 

History

History
133 lines (109 loc) · 3.78 KB

File metadata and controls

133 lines (109 loc) · 3.78 KB
id 76
title Rename misleading parameter names
status
summary Rename ratio to tokens-per-word, max-words to max-words-per-sentence, max-column-width-variance to max-column-width-ratio, and warn on directory-structure no-op.

Rename misleading parameter names

Part of the user-model work from plan 73. Addresses #68 (user model clarity) and #73 (Hugo user "did you mean?" hint).

Depends on: none (independent of other plans). Update plan 74 guide after landing.

Goal

Each config parameter name tells you what it measures and what unit it uses.

Context

Blind trials (plan 73) found three names that mislead:

  • ratio: 0.75 in token-budget: 2/5 read it as a warning threshold. It is a words-to- tokens multiplier.
  • max-words: 40 in paragraph-structure: reads as per-paragraph limit. It is per-sentence.
  • max-column-width-variance: 60 in table-readability: reads as statistical variance. It is max/min ratio.

Also found: directory-structure: true without allowed is a silent no-op.

Design

No deprecation. Rename in place, update all config files and docs in a single PR.

Tasks

  1. Rename ratio to tokens-per-word in MDS028 (token-budget):
  • Update ApplySettings and DefaultSettings in internal/rules/tokenbudget/rule.go
  • Update internal/rules/MDS028-token-budget/README.md
  • Update .mdsmith.yml
  1. Rename max-words to max-words-per-sentence in MDS024 (paragraph-structure):
  • Update internal/rules/paragraphstructure/rule.go
  • Update internal/rules/MDS024-paragraph-structure/README.md
  • Update .mdsmith.yml
  1. Rename max-column-width-variance to max-column-width-ratio in MDS026 (table-readability):
  • Update internal/rules/tablereadability/rule.go
  • Update internal/rules/MDS026-table-readability/README.md
  • Update .mdsmith.yml
  1. Add config warning for MDS033 (directory-structure) when enabled without allowed:
  • In ApplySettings, when enabled but allowed is empty or absent, mark the rule as configured so Check runs
  • In Check, when configured with an empty allowed, emit a config warning: directory-structure: rule enabled but no "allowed" patterns configured
  • Update internal/rules/MDS033-directory-structure/README.md
  1. Add "did you mean?" diagnostic for case-mismatched front-matter keys in catalog (MDS019):
  • Extract referenced {Field} placeholder names from the row template (or {{.Field}} if plan 75 has not yet landed)
  • For each name, check key presence in the file's front-matter map (not empty-value)
  • If exact key is missing but a case- insensitive match exists, emit: catalog: field "Title" not found; did you mean "title"?
  • Hugo users write .Title; this catches muscle-memory errors without false- positiving on intentionally empty values
  1. Update all overrides in .mdsmith.yml that reference renamed keys.
  2. Update docs/guides/directives/ guides and docs/guides/metrics-tradeoffs.md if they reference old names.
  3. Run mdsmith check . to verify.

Acceptance Criteria

  • ratio renamed to tokens-per-word
  • max-words renamed to max-words-per-sentence
  • max-column-width-variance renamed to max-column-width-ratio
  • directory-structure: true without allowed emits a config warning
  • Case-mismatched front-matter key in catalog emits "did you mean?" hint
  • .mdsmith.yml uses new names throughout
  • All rule READMEs use new names
  • All tests pass: go test ./...
  • go tool golangci-lint run reports no issues
  • mdsmith check . passes