0232. Discover canonical format-check inputs from tracked sources
- Status: Accepted (owner maintenance request)
- Date: 2026-11-14
- Plan: M16.6
- Review: Repository audit, Harness source-format coverage
Context
The gate's explicit source-root list omitted TUI examples and most benchmarks. Recursive formatter checks stop at nested packages and reject directly named generated files. Some tracked fixtures deliberately preserve noncanonical input or diagnostic locations; design sketches and historical model submissions are not canonical maintained source.
Decision
Discover tracked .hn files with NUL-delimited
git ls-files and check each eligible file directly.
Keep a commented exclusion list in
scripts/fmt-check.sh for parser/diagnostic and
layout-pinned fixtures, generator outputs/placeholders, design
sketches, and historical T0 authoring captures. Preserve directory
scopes for focused TUI checks; the gate uses unscoped discovery.
Finish discovery before invoking the formatter so Git errors fail
without a partial check.
This changes gate coverage, not formatter output or
FMT_VERSION (still 1).
Alternatives considered
- Extend the include list — future source roots could silently escape again.
- Walk the whole filesystem — includes untracked builds, downloaded packages and temporary fixtures; package boundaries also require special traversal.
Consequences
New tracked source roots and nested packages enter the gate automatically. Intentional noncanonical categories need explicit review when added. The script requires a Git checkout; untracked files are checked only after staging. One formatter process per eligible file keeps failure attribution simple; measure the complete format step to guard its runtime.