Skip to content

Hunch 1.60.0 — Quieter hooks and line-ending-proof ADR approvals

Latest

Choose a tag to compare

@davesheffer davesheffer released this 23 Nov 13:00
· 18 commits to main since this release
d5ba115
  • Antigravity's Stop hook gets 30 s instead of 15 s. Hunch wires no post-tool event for Antigravity, so its Stop gate judges every file that differs from HEAD: the changed-file list, then the Veto and the invariant check, each with its own git budget. On slow git that can pass 15 s, and Antigravity then killed the hook, which gave no verdict and lost its Stop bookkeeping. hunch init now writes timeout: 30 for the Stop handler, Antigravity's documented default; PreInvocation and PreToolUse keep 15 s. hunch update does not rewrite hook entries: an existing install picks this up by re-running hunch init, which replaces only Hunch's own entries. (#688)
  • An imported ADR's approval no longer depends on line endings. hunch import-adr hashed the file's raw bytes, so the same unchanged ADR got a different source hash on a Windows core.autocrlf checkout (CRLF) than on Linux, macOS or CI (LF), and re-importing on the other side dropped its approval back to pending review. The importer now reads and hashes the ADR with line endings normalized and a leading UTF-8 byte-order mark removed, so a CRLF, CR-only or BOM copy maps to the same decision and the same hashes as the LF file. Approvals made from LF checkouts without a BOM stay valid; one made from a CRLF checkout or a BOM-prefixed file shows as changed once and needs re-approval. (#673, #689)
  • A deny now warns that a scripted batch may be partly applied. In a Code Mode script or another multi-call script, a denied write reaches the script as that one call's exception, and the script can carry on, so the writes before and after it land. Every pre-edit deny reason now ends with a note to review or revert the batch's other writes before continuing. (#676, #690)
  • Quoted text no longer reads as a correction. The prompt hook suggested hunch_record_correction when a prompt merely quoted a correction phrase, such as echo "No, that's wrong. Never do X again." in a command to run. Correction detection now ignores text inside fenced code blocks, inline code, double-quoted strings, > blockquote lines and <pasted_content> blocks, and reacts only to the human's own words. Single-quoted text still counts, since a single quote is also an apostrophe. Curly apostrophes (don’t, that’s) are now recognized in correction cues. (#677, #692)
  • A commit that only refreshes Hunch's grounding docs is no longer captured as a decision. Committing just the regenerated HUNCH:START…END stats block in CLAUDE.md, AGENTS.md or .github/copilot-instructions.md, or the generated .cursor/rules/hunch.mdc and .windsurf/rules/hunch.md, made the post-commit hook record a decision about Hunch's own stats line, which then bumped the count it described and triggered a follow-up capture commit. hunch sync now skips a commit whose every changed file is one of these and whose text outside the managed block is unchanged (line endings and a byte-order mark aside). A human edit to the authored part of AGENTS.md, or a grounding refresh committed alongside other files, is still captured; text inside the managed block and the two rules files counts as generated, since Hunch overwrites it. A Hunch root in a monorepo subdirectory is recognised, and the check runs no git command unless every changed path is a grounding doc. (#658, #693)
  • The Stop VERIFY gate fired again after a passing check. It now credits a passing node check with flags before -e or --test (such as --experimental-strip-types or --import tsx) and any passing check run through hunch task verify <id> -- <command>. This closes one way a passing check could leave the gate firing (#679, #696)
  • Docs stamped by a pre-release build no longer read as "written by a newer Hunch". The published renderer stamped grounding blocks with template 2, but pre-release builds had stamped template 7 (CLAUDE.md) and 4 (AGENTS.md, Copilot, Cursor, Windsurf), so the latest release reported those docs as newer, froze their prose and told you to upgrade Hunch, which no published version could satisfy. The template is now 8, above every pre-release stamp, so those docs count as older and are re-rendered on the next hunch grounding --refresh or sync; release docs re-render with the same prose. Text outside the managed block is kept as written. The "newer Hunch" message now also names hunch grounding --refresh --force as the way out on the latest release. (#659, #698)