Design decisions

277. The v0.3 linter and formatter design is approved (2026-11-22)

  • Decision. plan/domains/lint-fmt/design/overview.md stands:
    1. One fact table, owned by cpl-check, is read by lint, LSP and cpl explain; the linter does no analysis of its own.
    2. Each lint is a data record in spec/lints/<name>/, and the Rust registry is generated from the records (done: crates/cpl-lint/build.rs).
    3. The formatter stays token-preserving and changes order only through separately verified passes.
  • Why. This was the recommendation in plan/QUESTIONS.md, and tech-debt reviewed it against the code (plan/domains/tech-debt/worklog.md; its six points are taken in the design). (1) removes the duplicated analysis and the stdlib privilege, (2) turns each lint's contract into a test, and (3) keeps 0 non-idempotent files and formats broken code on save.
  • Reverse. (1) holds until rules/bounds.rs is deleted. (2) The records can be compiled back into Rust consts. (3) A pretty-printer can replace layout.rs behind the same format API.