Skip to content

feat(lint): escape-hatch + tab-mix rules#3

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/modest-hawking-3fd6it
Jun 18, 2026
Merged

feat(lint): escape-hatch + tab-mix rules#3
hyperpolymath merged 1 commit into
mainfrom
claude/modest-hawking-3fd6it

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Phase 1 (cont.) — round out the v0.1 lint pack

Follows the merged engine (#2). Adds the two cheap, high-value rules from the spec/plan that need no external tooling, on top of multi-root reachability.

New rules

  • escape-hatch (warn) — surfaces soundness escape hatches: termination-checker overrides (TERMINATING, NON_TERMINATING, NO_TERMINATION_CHECK) and trust primitives (believe_me/primTrustMe). Warn, not hard-block — these are sometimes legitimately budgeted (echo-types' quarantine discipline), so the rule makes them visible without blocking promotion. Precise: ignores the words inside -- comments and only matches whole tokens (so believe_me_helper doesn't trip it).
  • tab-mix (warn) — a tab in leading whitespace (Agda style is spaces).

missing-without-k is intentionally not added — missing-safe-pragma already reports a missing --without-K.

Verification (real toolchain, dogfooded)

  • cargo fmt --check / clippy -D warnings / test clean — 28 tests (+7 unit: 2 tab-mix, 5 escape-hatch).
  • Re-dogfooded on echo-types (193 modules): 0 escape-hatch/tab-mix hits — confirmed a true negative by ground-truth grep (the only two .agda files containing the word "TERMINATING" carry it in -- TERMINATING CONDITION comments, which the rule correctly skips). A synthetic file with a real {-# TERMINATING #-} + believe_me produces exactly two warns. So the rule is both precise (no comment false-positives) and correct (fires on real escapes).

Still deferred

unpinned-headline (needs Smoke.agda parsing + a configurable regex), unused-import (shells out to agda-unused), content-hash invalidation of proven, the Groove service manifest, and the .machine_readable/ RSR retrofit (its own PR next).

Draft for review.

🤖 Generated with Claude Code

https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs


Generated by Claude Code

Rounds out the v0.1 rule pack with the two cheap, high-value rules from
the spec/plan that need no external tooling.

- `escape-hatch` (warn): surfaces soundness escape hatches — the
  termination-checker overrides (`TERMINATING`, `NON_TERMINATING`,
  `NO_TERMINATION_CHECK`) and the trust primitives
  (`believe_me`/`primTrustMe`). Warn, not hard-block: these are
  sometimes legitimately budgeted (echo-types' quarantine discipline),
  so the rule makes them visible without blocking promotion. Precise:
  it ignores the words in `--` comments and only matches whole tokens
  (so `believe_me_helper` does not trip it).
- `tab-mix` (warn): a tab in leading whitespace (Agda style is spaces).

Verification
- cargo fmt/clippy(-D warnings)/test clean; 28 tests (+7 unit).
- Re-dogfooded on echo-types: 0 escape-hatch/tab-mix hits, confirmed a
  TRUE negative by ground-truth grep — the only two `.agda` files
  containing the word "TERMINATING" carry it in `-- TERMINATING
  CONDITION` comments, not pragmas, which the rule correctly skips. A
  synthetic file with a real `{-# TERMINATING #-}` + `believe_me`
  produces exactly two warns.

`missing-without-k` is intentionally not added: `missing-safe-pragma`
already reports a missing `--without-K`. Still deferred:
`unpinned-headline` (needs Smoke.agda parsing + configurable regex),
`unused-import` (shells out to agda-unused), content-hash invalidation,
the Groove manifest, and the `.machine_readable/` RSR retrofit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs
@hyperpolymath hyperpolymath marked this pull request as ready for review June 18, 2026 15:06
@hyperpolymath hyperpolymath merged commit 4802018 into main Jun 18, 2026
1 check passed
@hyperpolymath hyperpolymath deleted the claude/modest-hawking-3fd6it branch June 18, 2026 15:06
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.

2 participants