4 Commits
Author SHA1 Message Date
tack 8811fb955e polish(m2): review follow-ups — tighten CLI suppress, generalise R5 preset check, document layer=0
Addresses the LOW/MEDIUM items flagged in the Task 8-10 and Task 3-6
code reviews:

- validator.py: R5 no longer hardcodes the preset enum; any non-custom
  template value is treated as a preset. Future enum additions in
  schema.py flow through automatically.
- validate.py: narrow contextlib.suppress(Exception) to specific
  exception types (AttributeError / io.UnsupportedOperation / OSError),
  and move the contextlib/io imports to the module-top stdlib block.
- validator.py: document the layer=0 convention (CLI I/O / pre-validation)
  on the CheckError dataclass field so future readers understand why
  validate.py emits layer=0 for missing-file / JSON-parse errors.
- test_cli_validate.py: add regression test for the "missing file in
  --json mode becomes layer=0 + exit 1" behaviour previously uncovered.
2026-04-23 16:14:54 +08:00
tack 98e5a7c3e2 feat(cli): multi-file summary + --max-errors truncation 2026-04-23 15:54:39 +08:00
tack c223d22981 feat(cli): --json machine-readable output mode 2026-04-23 15:53:07 +08:00
tack 6825d8520a feat(cli): validate entrypoint with exit codes + human output 2026-04-23 15:51:37 +08:00