@davesheffer/hunch 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/cli/index.js +4 -3
- package/dist/mcp/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -135,6 +135,16 @@ forbidden dependency) — code that never existed, so a diff reviewer is blind t
|
|
|
135
135
|
decision carries machine-checkable **tripwires**; re-introduce one and Hunch blocks it with
|
|
136
136
|
the receipt of what you rejected and why. → [docs](https://hunch-pi.vercel.app/docs#veto)
|
|
137
137
|
|
|
138
|
+
### Redundancy Guard — "this already exists"
|
|
139
|
+
|
|
140
|
+
An agent works from a *local* context window, so it re-implements a helper that already
|
|
141
|
+
lives three modules over, or re-adds a dependency the codebase already has — sprawl a
|
|
142
|
+
diff-only reviewer can't see, but Hunch's symbol graph can. Add a function or class already
|
|
143
|
+
defined elsewhere and `hunch check` / the CI guard / `hunch_merge_verdict` flag it with the
|
|
144
|
+
existing location. Deterministic and **advisory** — it never blocks; tuned to stay quiet
|
|
145
|
+
(stopword + length filters, scoped to the change's own project root, move-aware so a
|
|
146
|
+
refactor isn't mistaken for a duplicate). → [docs](https://hunch-pi.vercel.app/docs#redundancy)
|
|
147
|
+
|
|
138
148
|
Plus the **Regression Guard** (re-adding deliberately-retired code) and the
|
|
139
149
|
**[CI Constraint Guard](https://hunch-pi.vercel.app/docs#ci)** (`hunch ci` — a PR gate that
|
|
140
150
|
comments the affected `con_`/`dec_` ids and fails on a blocking one).
|
package/dist/cli/index.js
CHANGED
|
@@ -545,7 +545,7 @@ program
|
|
|
545
545
|
// ---- check (constraint enforcement) ---------------------------------------
|
|
546
546
|
program
|
|
547
547
|
.command("check")
|
|
548
|
-
.description("Flag changes that touch a do-not-break invariant — the local guardrail AND the CI/PR Constraint Guard.")
|
|
548
|
+
.description("Flag changes that touch a do-not-break invariant — the local guardrail AND the CI/PR Constraint Guard. Also flags (advisory) symbols you add that already exist elsewhere — possible re-implementation/sprawl.")
|
|
549
549
|
.option("--staged", "check git staged files (default)")
|
|
550
550
|
.option("--commit <sha>", "check a specific commit's files")
|
|
551
551
|
.option("--base <ref>", "check a PR/branch: files changed vs <ref> (e.g. origin/main) — for CI")
|
|
@@ -575,8 +575,9 @@ program
|
|
|
575
575
|
return;
|
|
576
576
|
}
|
|
577
577
|
// DIRECT (scope match) + NEAR (blast radius) + REGRESSION (re-added retired
|
|
578
|
-
// code) +
|
|
579
|
-
//
|
|
578
|
+
// code) + REDUNDANT (adds a symbol already defined elsewhere — advisory) + the
|
|
579
|
+
// hardened strict gate + causal `why` citations — all assembled by the shared
|
|
580
|
+
// store.buildCheckReport (also used by the hunch_merge_verdict tool).
|
|
580
581
|
const diff = opts.commit ? commitDiff(opts.commit, root) : opts.base ? rangeDiff(opts.base, root) : stagedDiff(root);
|
|
581
582
|
const report = store.buildCheckReport(files, diff, {
|
|
582
583
|
strict: !!opts.strict,
|
package/dist/mcp/server.js
CHANGED
|
@@ -323,7 +323,7 @@ export function buildServer(root) {
|
|
|
323
323
|
// -- hunch_merge_verdict (Causal Merge Verdict — read-only, client-agnostic) --
|
|
324
324
|
server.registerTool("hunch_merge_verdict", {
|
|
325
325
|
title: "Causal merge verdict: is this change safe against the recorded WHY?",
|
|
326
|
-
description: "Before opening or merging a PR, replay a diff against engineering memory and return ONE verdict — BLOCK / WARN / PASS. For each invariant DIRECTLY in scope it cites WHY the guard exists (the decision that motivated it + the bug whose root cause spawned it); it also lists invariants reached via blast radius (near, advisory)
|
|
326
|
+
description: "Before opening or merging a PR, replay a diff against engineering memory and return ONE verdict — BLOCK / WARN / PASS. For each invariant DIRECTLY in scope it cites WHY the guard exists (the decision that motivated it + the bug whose root cause spawned it); it also lists invariants reached via blast radius (near, advisory), any deliberately-retired code the diff re-introduces, and symbols the diff adds that are already defined elsewhere in the graph (possible re-implementation/sprawl, advisory). Deterministic, no LLM. Omit base AND commit to check STAGED changes; pass base (e.g. origin/main) for a PR range, or commit for a single commit. Call this before merging a widely-scoped change.",
|
|
327
327
|
inputSchema: {
|
|
328
328
|
base: z.string().optional().describe("Diff against this base ref (e.g. origin/main) — for a PR/branch."),
|
|
329
329
|
commit: z.string().optional().describe("Diff a single commit (sha/ref). Omit base AND commit to check staged changes."),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davesheffer/hunch",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Dave Sheffer <dave.sheffer1@gmail.com>",
|
|
6
6
|
"description": "Hunch — an Engineering Memory OS: a persistent, git-native reasoning graph over a codebase, exposed to Claude Code via MCP.",
|