@webpieces/ai-hook-rules 0.4.571 → 0.4.573
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/ai-hook-rules",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.573",
|
|
4
4
|
"description": "Pluggable write-time validation framework for AI coding agents (@webpieces/ai-hook-rules). Claude Code PreToolUse + openclaw before_tool_call adapters share one rule engine.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"directory": "packages/tooling/ai-hook-rules"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@webpieces/rules-config": "0.4.
|
|
34
|
+
"@webpieces/rules-config": "0.4.573"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
@@ -23,6 +23,10 @@ export declare class CapRemedies {
|
|
|
23
23
|
* Deliberately takes no cache and quotes no figures. The cache is allowed to be stale by design,
|
|
24
24
|
* and a stale table is worse than no table when the reader's next move is `wp-cleanup` — which
|
|
25
25
|
* recomputes from scratch — either way.
|
|
26
|
+
*
|
|
27
|
+
* "ASK THE HUMAN" stays spelled out. Shortening it to a bare "ask" saves two words and loses the
|
|
28
|
+
* object of the verb — and the reader is an agent, which can satisfy a bare "ask" by asking
|
|
29
|
+
* itself. Every other guard in this codebase says ASK THE HUMAN for the same reason.
|
|
26
30
|
*/
|
|
27
31
|
branchCap(): FixHint;
|
|
28
32
|
/**
|
|
@@ -26,13 +26,17 @@ class CapRemedies {
|
|
|
26
26
|
* Deliberately takes no cache and quotes no figures. The cache is allowed to be stale by design,
|
|
27
27
|
* and a stale table is worse than no table when the reader's next move is `wp-cleanup` — which
|
|
28
28
|
* recomputes from scratch — either way.
|
|
29
|
+
*
|
|
30
|
+
* "ASK THE HUMAN" stays spelled out. Shortening it to a bare "ask" saves two words and loses the
|
|
31
|
+
* object of the verb — and the reader is an agent, which can satisfy a bare "ask" by asking
|
|
32
|
+
* itself. Every other guard in this codebase says ASK THE HUMAN for the same reason.
|
|
29
33
|
*/
|
|
30
34
|
branchCap() {
|
|
31
35
|
return new fix_hint_1.FixHint('Too many local branches.', '', [
|
|
32
36
|
new fix_hint_1.Option('Run: pnpm wp-cleanup — reaps the dead branches, prompts about the rest.', true),
|
|
33
|
-
new fix_hint_1.Option('Only if that leaves you at the cap:
|
|
34
|
-
'Never delete a spared branch or edit webpieces.config.json ' +
|
|
35
|
-
'(maxLocalBranches / turnOffRuleUntilEpoch) without
|
|
37
|
+
new fix_hint_1.Option('Only if that leaves you at the cap: ASK THE HUMAN which of the branches it spared ' +
|
|
38
|
+
'may go. Never delete a spared branch or edit webpieces.config.json ' +
|
|
39
|
+
'(maxLocalBranches / turnOffRuleUntilEpoch) without their explicit yes.'),
|
|
36
40
|
]);
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
@@ -44,9 +48,9 @@ class CapRemedies {
|
|
|
44
48
|
worktreeCap() {
|
|
45
49
|
return new fix_hint_1.FixHint('Too many worktrees. Do NOT remove one by hand — an agent may be working in it right now.', '', [
|
|
46
50
|
new fix_hint_1.Option('Run: pnpm wp-cleanup — removes the dead worktrees, prompts about the rest.', true),
|
|
47
|
-
new fix_hint_1.Option('Only if that leaves you at the cap:
|
|
48
|
-
'Never edit webpieces.config.json (maxWorktrees / turnOffRuleUntilEpoch)
|
|
49
|
-
'
|
|
51
|
+
new fix_hint_1.Option('Only if that leaves you at the cap: ASK THE HUMAN which of the worktrees it spared ' +
|
|
52
|
+
'may go. Never edit webpieces.config.json (maxWorktrees / turnOffRuleUntilEpoch) ' +
|
|
53
|
+
'without their explicit yes.'),
|
|
50
54
|
]);
|
|
51
55
|
}
|
|
52
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cap-remedies.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/ai-hook-rules/src/core/rules/cap-remedies.ts"],"names":[],"mappings":";;;AAAA,0CAA8C;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,WAAW;IACpB
|
|
1
|
+
{"version":3,"file":"cap-remedies.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/ai-hook-rules/src/core/rules/cap-remedies.ts"],"names":[],"mappings":";;;AAAA,0CAA8C;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,WAAW;IACpB;;;;;;;;OAQG;IACH,SAAS;QACL,OAAO,IAAI,kBAAO,CACd,0BAA0B,EAC1B,EAAE,EACF;YACI,IAAI,iBAAM,CAAC,yEAAyE,EAAE,IAAI,CAAC;YAC3F,IAAI,iBAAM,CACN,oFAAoF;gBACpF,qEAAqE;gBACrE,wEAAwE,CAC3E;SACJ,CACJ,CAAC;IACN,CAAC;IAED;;;;;OAKG;IACH,WAAW;QACP,OAAO,IAAI,kBAAO,CACd,0FAA0F,EAC1F,EAAE,EACF;YACI,IAAI,iBAAM,CAAC,4EAA4E,EAAE,IAAI,CAAC;YAC9F,IAAI,iBAAM,CACN,qFAAqF;gBACrF,kFAAkF;gBAClF,6BAA6B,CAChC;SACJ,CACJ,CAAC;IACN,CAAC;CACJ;AA7CD,kCA6CC","sourcesContent":["import { FixHint, Option } from '../fix-hint';\n\n/**\n * What branch-creation-guard says when a CAP is what blocked. TWO SHORT LINES, and never a\n * destructive command.\n *\n * It used to be forty. The branch remedy printed every spared branch with its SHA, PR state, unique\n * commit count and prose reason, told the agent to paste that table at the human and ask which may\n * go, and then listed the config knobs it must not touch. The human's verdict on that, verbatim:\n * \"I am tired of AI asking me to cleanup things it can do by itself\". They were right twice over —\n * the wall of text buried the one actionable line, and the biggest spared group (pre-merge snapshots\n * of a branch that still exists) was never a judgement call at all. That group is auto-reaped now\n * (see CLASSIFICATION_BACKUP_OF_LIVE), so the remedy is one command.\n *\n * Everything this class used to say still exists — in `pnpm wp-cleanup`, which recomputes the\n * verdicts fresh, archives each branch as an `archive/<date>/<branch>` tag before deleting, logs a\n * `recover=` command per removal, refuses the primary clone and the tree it is standing in, never\n * passes `--force`, and PROMPTS about anything not provably dead. A guard that duplicates that\n * inventory is a second copy to keep in sync and a wall to read before running the command anyway.\n * So: name the command, stop talking.\n */\nexport class CapRemedies {\n /**\n * Deliberately takes no cache and quotes no figures. The cache is allowed to be stale by design,\n * and a stale table is worse than no table when the reader's next move is `wp-cleanup` — which\n * recomputes from scratch — either way.\n *\n * \"ASK THE HUMAN\" stays spelled out. Shortening it to a bare \"ask\" saves two words and loses the\n * object of the verb — and the reader is an agent, which can satisfy a bare \"ask\" by asking\n * itself. Every other guard in this codebase says ASK THE HUMAN for the same reason.\n */\n branchCap(): FixHint {\n return new FixHint(\n 'Too many local branches.',\n '',\n [\n new Option('Run: pnpm wp-cleanup — reaps the dead branches, prompts about the rest.', true),\n new Option(\n 'Only if that leaves you at the cap: ASK THE HUMAN which of the branches it spared ' +\n 'may go. Never delete a spared branch or edit webpieces.config.json ' +\n '(maxLocalBranches / turnOffRuleUntilEpoch) without their explicit yes.',\n ),\n ],\n );\n }\n\n /**\n * Same shape for worktrees, with one extra sentence that is not boilerplate: a worktree whose\n * branch has no commits yet is almost always one an agent is working in RIGHT NOW. That is why\n * this never emits `git worktree remove` — it once printed a `prune && remove && branch -D` chain\n * naming three live worktrees under the words \"so no work can be lost\".\n */\n worktreeCap(): FixHint {\n return new FixHint(\n 'Too many worktrees. Do NOT remove one by hand — an agent may be working in it right now.',\n '',\n [\n new Option('Run: pnpm wp-cleanup — removes the dead worktrees, prompts about the rest.', true),\n new Option(\n 'Only if that leaves you at the cap: ASK THE HUMAN which of the worktrees it spared ' +\n 'may go. Never edit webpieces.config.json (maxWorktrees / turnOffRuleUntilEpoch) ' +\n 'without their explicit yes.',\n ),\n ],\n );\n }\n}\n"]}
|