Skip to content

Standards review: bounded diagnostics, stable finding IDs, offline rule help - #57

Merged
jt14den merged 1 commit into
mainfrom
standards-review
Sep 30, 2026
Merged

jt14den merged 1 commit into
mainfrom
standards-review

Conversation

@jt14den

@jt14den jt14den commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Implements the 2026-09-30 standards review. The design and review notes are in design/2026-09-30-*: the audit, schema/help proposal, handoff, implementation prompt, the external review of this work, and its adjudication. The theme is to say no more than a check can see.

What changes

  • Sources and wording: citations point at the exact section. Config rules cite the config.yaml page they should have, and CLDT citations use the focused pages. Rationale, hints, and the AI prompt no longer overstate the evidence (STD-02/04/05/08/09/11).
  • Stable IDs (STD-06): a new optional identity_anchor keeps 0.2.1 finding IDs when a message is reworded or a detector stops reporting a false positive, so .wbcheck.toml ignores and filed issues (open or closed) still match. The results file is now format v3; versions 1-3 are readable, and 0.2.1 refuses v3 with its usual "re-run wbcheck check".
  • Detector fixes:
    • WB301 accepts explicit, multi-line, and decorative {alt=""} alt attributes (STD-01).
    • WB403 states the zero-minutes observation without claiming the objectives go unassessed (STD-02).
    • WB212 judges duplicate headings within their hierarchy, as pegboard does (STD-03).
    • Objectives are counted as top-level items with any list marker (STD-07).
    • WB404 skips blockquotes (STD-08).
    • WB104 rejects true, .nan, .inf, and negative timings (STD-12).
  • Rule help (DES-01/02): metadata for all 48 rules, including authority, detection, a default severity that matches what each check emits, and dated sources. New offline wbcheck explain CODE and wbcheck rules commands. One explanation is shared across the CLI, the TUI detail pane, a report appendix, and issue drafts, with severity words and plain URLs.

Behaviour changes

  • An explicit --fail-on warning can now trip on + and numbered objectives and on invalid timings. It can also stop tripping on some WB212, WB301, WB404, and nested-bullet WB401 findings.
  • Default severities, which rules run, issue grouping, and --fail-on error are unchanged.
  • Hints are labelled "Next:" instead of "Fix:" in the CLI, TUI, and issues.

Testing

  • 492 tests pass (up from 337), and ruff is clean. check-wheel covers the new checker/help.py.
  • Golden IDs from 0.2.1 are checked on a fixture lesson, including a saved v2 results file, old-ID ignores with no saved results, open and closed issue markers, partial refresh, and fix planning from old and new findings.
  • On scratch copies of five real lessons (lc-open-hw, lc-reproducible-research, lc-r, rclone-intro, better-research-software), every finding that still appears keeps its 0.2.1 ID and nothing new appears. What goes away is 22 WB212 repeats under different sections (spot-checked) and one WB404 driven by a blockquoted interview excerpt.
  • A core-only wheel install, with no AI extras, runs explain and rules from outside the checkout.
  • An external review found four issues (REV-01..04): WB401 occurrence slots, alt text matched inside another attribute, the TUI showing the rule default instead of the finding's severity, and a width-sensitive test. All four were reproduced and fixed, with regression tests.

Not done or deferred

  • AI prompt: it changed but has had no live wbcheck review evaluation, which CONTRIBUTING asks for. Only mocked tests cover it.
  • Deferred: WB213's automatic fix becoming a suggestion (STD-10), WB012 becoming an exit-2 command error (DES-03), a TUI F1 help modal, per-challenge WB205 (OPEN-02), div class order (OPEN-01), and the created citation question (OPEN-05).
  • Pre-existing: three older tests fail at COLUMNS=40 on main too, because of Rich wrapping. Worth a separate issue.
  • Local paths in design notes: the review notes contain absolute local file links (/Users/...), which won't resolve on GitHub. They were kept unchanged as review records.

Implements the 2026-09-30 standards review (design/2026-09-30-*):

- Source links point at the exact section; rationale, hints, and the AI
  prompt no longer claim more than a check can see (STD-02/04/05/08/09/11).
- Finding identity survives rewording and detector fixes: an optional frozen
  identity_anchor (results format v3; v1-v3 readable) keeps 0.2.1 IDs, so
  .wbcheck.toml ignores and filed issues still match (STD-06).
- Detector fixes: explicit/multi-line/decorative alt (STD-01), observation-
  only WB403 (STD-02), hierarchy-scoped duplicate headings (STD-03),
  marker-independent top-level objectives (STD-07), blockquotes excluded
  from WB404 (STD-08), finite non-negative timings (STD-12).
- Rule metadata for all 48 rules with a dated REFERENCES table, offline
  `wbcheck explain` and `wbcheck rules`, and one shared explanation in the
  CLI, TUI, report appendix, and issue drafts (DES-01/02).
- Fixes from an external review of this work (REV-01..04): WB401 legacy
  occurrence slots, quote-aware alt parsing, the TUI shows each finding's
  own severity, width-independent TUI test.

Tested against 0.2.1 golden IDs and scratch copies of five real lessons:
every surviving finding keeps its 0.2.1 ID. 492 tests, ruff clean.
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