← roadmap

intercheck

improve priority P2 effort S wave 2

What it does: Two PostToolUse hooks matched on Edit|Write|NotebookEdit: (1) syntax-check.sh validates the edited file with the language’s native parser — py_compile (Python), bash -n (shell), json.load (JSON), tomllib (TOML), yaml.safe_load (YAML), go vet (Go), node —check (TS/JS) — incrementing a syntax_errors counter and returning the truncated error via additionalContext, silent on success; (2) auto-format.sh runs the canonical formatter in place (ruff/shfmt/gofmt/jq/prettier), silent and fail-open on missing tools, incrementing format_runs. State lives in /tmp/intercheck-${SESSION_ID}.json. A ‘quality’ skill prints the two counters. Repo also ships a gitleaks secret-scan CI workflow + waiver validator and a shared bash lib. NOTE: context-pressure tracking described in README/vision has actually been extracted to interpulse — those docs are stale.

Rationale: Architecturally this is already the 2026 SOTA shape: a deterministic, zero-token PostToolUse hook providing tool-grounded (native parser/formatter) feedback. That maps directly to the ‘harness engineering as a discipline’ finding (‘anything that must happen every time should be a deterministic hook, not something you hope the model remembers’) and to the reflection/verification finding that structured, executable feedback (tests, type checks, executors) drives improvement where free-form LLM critique fails. So this should NOT be modernized away from its current design. The verdict is ‘improve’ purely because of concrete defects: (1) significant doc drift — README, intercheck-vision.md, and the architecture diagram still describe context-monitor.sh pressure tracking and /intercheck:status, neither of which exist (the work moved to interpulse and the skill is now /intercheck:quality); (2) a latent correctness bug — node —check only validates JavaScript syntax, so .ts/.tsx files with type annotations or TS-only syntax either falsely pass or falsely error; it is not a TS validator despite the docs claiming TS support; (3) a minor injection/robustness hole — JSON and TOML validation interpolate $FP directly into an inline Python string literal (open(‘$FP’)), so a path containing a single quote breaks the check and is a small untrusted-input surface, relevant given the 2026 agent supply-chain/prompt-injection emphasis; (4) state file is world-readable /tmp with predictable name, fine for ephemeral counters but worth noting. These are fixable in place without rearchitecting.

SOTA gap: Type-level verification. The strongest frontier signal for a code-quality guard is that tool-grounded, executable verification beats free-form critique — intercheck nails syntax/parse-level checking but stops short of the next deterministic gate: type checking (tsc —noEmit, mypy —no-error-summary, ruff check for lint diagnostics). Its own vision explicitly scopes type-checking out, but type errors are the highest-value catch that is still fully deterministic and zero-token, and competing agentic-review tooling (Greptile/agentic Copilot, 44-82% bug catch) wins on cross-file/type context depth. Adding an opt-in, fail-open type-check tier would close the most meaningful gap without violating the plugin’s silence/fail-open contract. (No multi-agent/memory/context-engineering frontier idea is missing — those would be over-engineering for a deterministic per-edit guard.)

Redundancy: Low / already resolved. Context-pressure tracking that the README still advertises has been correctly delegated to interpulse (session context monitoring) and the skill description explicitly disambiguates from /interpulse:pressure and /intermux:agents. Remaining adjacencies are complementary, not duplicative: intertest (tests/TDD) and interflux/flux-drive (multi-agent review/lint) are explicitly positioned by the vision as later gates in the same stack; intercheck owns only the cheapest first gate (per-edit parse + format). The gitleaks secret-scan CI is demarch-managed baseline tooling shared across plugins, not intercheck-specific logic. Net: this is now a clean single-purpose plugin; the only cleanup is removing the stale pressure-tracking prose that overlaps interpulse’s charter.

Actions:

  • Fix doc drift: rewrite README.md (remove context-monitor.sh / pressure scoring / Yellow-Orange-Red / /intercheck:status, fix the architecture block to list syntax-check.sh + auto-format.sh + skills/quality), and update docs/intercheck-vision.md to v0.2.2 reality (skill is /intercheck:quality, pressure tracking lives in interpulse).
  • Fix the TS/JS validation bug: node —check only parses JavaScript, so route .ts/.tsx through a real TS check when available (tsc —noEmit on the single file or typescript-go/swc parse) and fall back to skip (fail-open) rather than misreporting; update _ic_detect_lang/syntax-check.sh accordingly.
  • Harden the JSON/TOML validators: stop interpolating $FP into inline Python string literals — pass the path via sys.argv or an env var (e.g. python3 -c ’…’ “$FP” reading sys.argv[1]) to remove the quoted-path breakage and the small untrusted-path injection surface.
  • Add an opt-in, fail-open type-check/lint tier (tsc —noEmit, mypy, ruff check) gated on tool presence and a config flag, preserving the silence-means-clean and fail-open-on-missing-tools contracts, and surface a syntax_errors threshold warning via the quality skill as the vision’s Direction section already proposes.