# Hako Check — Diagnostics Contract (MVP) This tool lints .hako sources and emits diagnostics. Diagnostics schema (typed) - Map fields: - `rule`: string like "HC011" - `message`: string (human-readable, one line) - `file`: string (path) - `line`: int (1-based) - `severity`: string ("error"|"warning"|"info"), optional (default: warning) - `quickFix`: string, optional Backwards compatibility - Rules may still `out.push("[HCxxx] ...")` with a single-line string. - The CLI accepts both forms. String diagnostics are converted to typed internally. Suppression policy - HC012 (dead static box) takes precedence over HC011 (unreachable method). - If a box is reported by HC012, HC011 diagnostics for methods in that box are suppressed at aggregation. Quiet / JSON output - When `--format json-lsp` is used, output is pure JSON (pretty). Combine with `NYASH_JSON_ONLY=1` in the runner to avoid extra lines. - Non-JSON formats print human-readable lines per finding. Planned AST metadata (parser_core.hako) - `boxes[].span_line`: starting line of the `static box` declaration. - `methods[].arity`: parameter count as an integer. - `boxes[].is_static`: boolean. Notes - Prefer AST intake; text scans are a minimal fallback. - For tests, use `tools/hako_check/run_tests.sh`.