@davesheffer/hunch 0.36.0 → 0.36.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.
|
@@ -73,13 +73,17 @@ export function importedDeps(lines) {
|
|
|
73
73
|
* goes stale. Conservative: only fires on an explicit import/require verb + a
|
|
74
74
|
* module-shaped token; returns null otherwise (caller falls back to scope-only). */
|
|
75
75
|
export function deriveForbids(rule) {
|
|
76
|
-
//
|
|
76
|
+
// Derive ONLY from a NEGATIVE rule with an UNAMBIGUOUS import verb. "use"/"add" are
|
|
77
|
+
// deliberately excluded: "don't use react hooks" names hooks, not react, and "never use
|
|
78
|
+
// synchronous fs" names no dependency at all — over-deriving there mints a wrong or
|
|
79
|
+
// never-firing rule on the seamless path. Under-deriving is safe (caller falls back to a
|
|
80
|
+
// scope-only rule + the "add --forbid-dep" warning); over-deriving is not.
|
|
77
81
|
if (!/\b(never|don'?t|do\s+not|avoid|stop|without|ban|banned|forbid|forbidden|prohibit|not\s+allowed|no\s+longer)\b/i.test(rule))
|
|
78
82
|
return null;
|
|
79
|
-
const m = rule.match(/\b(?:import(?:ing)?|requir(?:e|ing)|
|
|
83
|
+
const m = rule.match(/\b(?:import(?:ing)?|requir(?:e|ing)|depend(?:s|ing)?\s+on)\s+(?:from\s+|the\s+)?["'`]?(@?[a-z0-9][\w.@/-]*)["'`]?/i);
|
|
80
84
|
if (!m || !m[1])
|
|
81
85
|
return null;
|
|
82
|
-
|
|
86
|
+
const dep = m[1].replace(/[).,;:'"`]+$/, "").toLowerCase();
|
|
83
87
|
if (!dep || dep.length < 2 || /\s/.test(dep) || STOP_TOKENS.has(dep))
|
|
84
88
|
return null;
|
|
85
89
|
return { deps: [dep], symbols: [], patterns: [] };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davesheffer/hunch",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.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 graph of the decisions, bugs, and rules behind your code, served to any MCP coding assistant (Claude Code, Cursor, Copilot, Windsurf, Codex).",
|