@davesheffer/hunch 1.3.0 → 1.3.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 +18 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,30 +7,34 @@
|
|
|
7
7
|
[](https://nodejs.org)
|
|
8
8
|
[](https://modelcontextprotocol.io)
|
|
9
9
|
|
|
10
|
-
> **
|
|
11
|
-
>
|
|
12
|
-
>
|
|
13
|
-
>
|
|
10
|
+
> **Your repo remembers *what* changed. Hunch makes it remember *why*** — the decisions, the
|
|
11
|
+
> trade-offs, the bugs you already paid for — and keeps every AI coding session consistent with them.
|
|
12
|
+
> When a change would quietly undo something you decided on purpose, Hunch notices and shows the
|
|
13
|
+
> receipt: which decision, and which past bug it protects you from. A linter checks *patterns*;
|
|
14
|
+
> Hunch understands your *architecture* (layering, must-reach, dependency direction) — deterministically,
|
|
15
|
+
> from a **git-native** graph, across any MCP assistant.
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
18
|
npm i -g @davesheffer/hunch
|
|
17
|
-
cd your-repo && hunch init
|
|
19
|
+
cd your-repo && hunch init # 2 minutes; advisory by default — nothing blocks until you say so
|
|
18
20
|
|
|
19
|
-
#
|
|
21
|
+
# teach it one architectural rule, in plain words — with the why
|
|
20
22
|
hunch conform --add "controllers never reach the DB directly — go through the service layer" \
|
|
21
|
-
--assert not-calls --subject listOrders --object dbQuery --why "the Mar-2025 N+1
|
|
23
|
+
--assert not-calls --subject listOrders --object dbQuery --why "the Mar-2025 N+1 incident"
|
|
22
24
|
|
|
23
|
-
hunch conform
|
|
25
|
+
hunch conform # ✅ deterministic check — and when you're ready, --strict wires it into CI
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
>
|
|
27
|
-
>
|
|
28
|
-
>
|
|
28
|
+
> Here's the moment it earns its keep: an AI "optimizes" your controller to query the DB directly.
|
|
29
|
+
> Pattern tools stay **green** — it's a legitimate internal import, no bad pattern to match.
|
|
30
|
+
> Hunch quietly flags it: *"listOrders now reaches dbQuery · why this matters: the Mar-2025 N+1
|
|
31
|
+
> incident · protects against a repeat of bug_0317."* You decide what happens next — advisory
|
|
32
|
+
> shows the note, **strict** (opt-in) holds the change. Watch the whole loop in 15 seconds:
|
|
29
33
|
> [`demo/architectural-conformance.sh`](demo/architectural-conformance.sh).
|
|
30
34
|
|
|
31
|
-
**It
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
35
|
+
**It helps twice — before the change, and after:**
|
|
36
|
+
- **Before** — the recorded rule rides into the AI's context. In a reproducible benchmark ([`bench/`](bench/architectural-conformance.md): n=90, three models, 3 invariant classes), that alone cut architectural drift **58% → 16%** (one model: **67% → 0%**).
|
|
37
|
+
- **After** — reminders help, but models still drift even when told (the same benchmark measured it). So a deterministic check — [`hunch check`](https://hunch-pi.vercel.app/docs#ci) on commit or in your PR gate — catches what reminders miss, always with the receipt, **no model in the loop**. Advisory first; you choose the [firmness](https://hunch-pi.vercel.app/docs#firmness).
|
|
34
38
|
|
|
35
39
|
<sub>Works with **Claude Code, Cursor, Copilot, Windsurf & Google Antigravity** from one shared, git-native graph.</sub>
|
|
36
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davesheffer/hunch",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Dave Sheffer <dave.sheffer1@gmail.com>",
|
|
6
6
|
"description": "Architectural Conformance for AI-generated code: a git-native graph that deterministically blocks AI changes which break your architecture — the semantic invariants (layering, must-reach, dependency direction) pattern-SAST can't express — grounded in the decisions and bugs behind each rule, across any MCP assistant (Claude Code, Cursor, Copilot, Windsurf, Codex).",
|