@webpieces/agent-workflow-rules 0.4.847 → 0.4.848
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 +9 -8
- package/src/adapters/hook-app-fixtures.d.ts +2 -2
- package/src/adapters/hook-app-fixtures.js +39 -13
- package/src/adapters/hook-app-fixtures.js.map +1 -1
- package/src/bin/l0-allowlist.js +13 -21
- package/src/bin/l0-allowlist.js.map +1 -1
- package/src/bin/l0-decide.js +3 -1
- package/src/bin/l0-decide.js.map +1 -1
- package/src/bin/setup-config.d.ts +1 -19
- package/src/bin/setup-config.js +18 -363
- package/src/bin/setup-config.js.map +1 -1
- package/src/bin/shim.js +11 -4
- package/src/bin/shim.js.map +1 -1
- package/src/core/load-rules.d.ts +0 -7
- package/src/core/load-rules.js +0 -48
- package/src/core/load-rules.js.map +1 -1
- package/src/core/rules/index.d.ts +9 -1
- package/src/core/rules/index.js +19 -2
- package/src/core/rules/index.js.map +1 -1
- package/src/core/runner.js +60 -48
- package/src/core/runner.js.map +1 -1
- package/src/core/workflow-hook-rules.js +3 -5
- package/src/core/workflow-hook-rules.js.map +1 -1
- package/src/rule-help.d.ts +3 -0
- package/src/rule-help.js +11 -0
- package/src/rule-help.js.map +1 -0
- package/src/rule-pack.js +3 -13
- package/src/rule-pack.js.map +1 -1
- package/src/rule-runtime.d.ts +5 -0
- package/src/rule-runtime.js +29 -0
- package/src/rule-runtime.js.map +1 -0
- package/src/workflow-policy-registry.d.ts +12 -0
- package/src/workflow-policy-registry.js +42 -0
- package/src/workflow-policy-registry.js.map +1 -0
- package/templates/ai-hook.sh +105 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OwnedRuleDefinition } from '@webpieces/rules-sdk';
|
|
2
|
+
export declare class WorkflowImplementation {
|
|
3
|
+
readonly exportName: string;
|
|
4
|
+
readonly commandHint: 'upsertPr' | 'mergeComplete' | null;
|
|
5
|
+
constructor(exportName: string, commandHint: 'upsertPr' | 'mergeComplete' | null);
|
|
6
|
+
}
|
|
7
|
+
export declare class WorkflowPolicy {
|
|
8
|
+
readonly definition: OwnedRuleDefinition;
|
|
9
|
+
readonly implementations: readonly WorkflowImplementation[];
|
|
10
|
+
constructor(definition: OwnedRuleDefinition, implementations: readonly WorkflowImplementation[]);
|
|
11
|
+
}
|
|
12
|
+
export declare const WORKFLOW_POLICIES: readonly WorkflowPolicy[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WORKFLOW_POLICIES = exports.WorkflowPolicy = exports.WorkflowImplementation = void 0;
|
|
4
|
+
const rules_sdk_1 = require("@webpieces/rules-sdk");
|
|
5
|
+
const rule_configs_1 = require("./configs/rule-configs");
|
|
6
|
+
const main_sync_guard_configs_1 = require("./configs/main-sync-guard-configs");
|
|
7
|
+
const rule_settings_1 = require("./rule-settings");
|
|
8
|
+
const rule_help_1 = require("./rule-help");
|
|
9
|
+
class WorkflowImplementation {
|
|
10
|
+
exportName;
|
|
11
|
+
commandHint;
|
|
12
|
+
constructor(exportName, commandHint) {
|
|
13
|
+
this.exportName = exportName;
|
|
14
|
+
this.commandHint = commandHint;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.WorkflowImplementation = WorkflowImplementation;
|
|
18
|
+
class WorkflowPolicy {
|
|
19
|
+
definition;
|
|
20
|
+
implementations;
|
|
21
|
+
constructor(definition, implementations) {
|
|
22
|
+
this.definition = definition;
|
|
23
|
+
this.implementations = implementations;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.WorkflowPolicy = WorkflowPolicy;
|
|
27
|
+
exports.WORKFLOW_POLICIES = [
|
|
28
|
+
new WorkflowPolicy(new rules_sdk_1.OwnedRuleDefinition('branch-creation-guard', rule_configs_1.BranchCreationGuardConfig.SCHEMA, rules_sdk_1.RULE_SCHEMA_API_VERSION, rule_settings_1.optionalTuning['branch-creation-guard'], rule_settings_1.recommendedSeeds['branch-creation-guard'], 'hookGuards', rule_help_1.ruleHelp['branch-creation-guard']), [new WorkflowImplementation('BranchCreationGuardRule', null)]),
|
|
29
|
+
new WorkflowPolicy(new rules_sdk_1.OwnedRuleDefinition('pr-lifecycle-guard', rule_configs_1.PrLifecycleGuardConfig.SCHEMA, rules_sdk_1.RULE_SCHEMA_API_VERSION, rule_settings_1.optionalTuning['pr-lifecycle-guard'], rule_settings_1.recommendedSeeds['pr-lifecycle-guard'], 'hookGuards', rule_help_1.ruleHelp['pr-lifecycle-guard']), [
|
|
30
|
+
new WorkflowImplementation('PrCreationOrPushGuardRule', 'upsertPr'),
|
|
31
|
+
new WorkflowImplementation('MergeInProgressGuardRule', 'mergeComplete'),
|
|
32
|
+
new WorkflowImplementation('PrMergeGuardRule', null),
|
|
33
|
+
new WorkflowImplementation('RedirectHowToMergeMainRule', null),
|
|
34
|
+
]),
|
|
35
|
+
new WorkflowPolicy(new rules_sdk_1.OwnedRuleDefinition('branch-state-guard', main_sync_guard_configs_1.BranchStateGuardConfig.SCHEMA, rules_sdk_1.RULE_SCHEMA_API_VERSION, rule_settings_1.optionalTuning['branch-state-guard'], rule_settings_1.recommendedSeeds['branch-state-guard'], 'hookGuards', rule_help_1.ruleHelp['branch-state-guard']), [
|
|
36
|
+
new WorkflowImplementation('FeatureBranchGuardRule', null),
|
|
37
|
+
new WorkflowImplementation('ReadStaleGuardRule', null),
|
|
38
|
+
new WorkflowImplementation('MergedBranchBashGuardRule', null),
|
|
39
|
+
new WorkflowImplementation('StaleMainBashGuardRule', null),
|
|
40
|
+
]),
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=workflow-policy-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-policy-registry.js","sourceRoot":"","sources":["../../../../../packages/tooling/agent-workflow-rules/src/workflow-policy-registry.ts"],"names":[],"mappings":";;;AAAA,oDAAoF;AACpF,yDAA2F;AAC3F,+EAA2E;AAC3E,mDAAmE;AACnE,2CAAuC;AAEvC,MAAa,sBAAsB;IAElB;IACA;IAFb,YACa,UAAkB,EAClB,WAAgD;QADhD,eAAU,GAAV,UAAU,CAAQ;QAClB,gBAAW,GAAX,WAAW,CAAqC;IAC1D,CAAC;CACP;AALD,wDAKC;AAED,MAAa,cAAc;IAEV;IACA;IAFb,YACa,UAA+B,EAC/B,eAAkD;QADlD,eAAU,GAAV,UAAU,CAAqB;QAC/B,oBAAe,GAAf,eAAe,CAAmC;IAC5D,CAAC;CACP;AALD,wCAKC;AAEY,QAAA,iBAAiB,GAA8B;IACxD,IAAI,cAAc,CACd,IAAI,+BAAmB,CACnB,uBAAuB,EACvB,wCAAyB,CAAC,MAAM,EAChC,mCAAuB,EACvB,8BAAc,CAAC,uBAAuB,CAAC,EACvC,gCAAgB,CAAC,uBAAuB,CAAC,EACzC,YAAY,EACZ,oBAAQ,CAAC,uBAAuB,CAAC,CACpC,EACD,CAAC,IAAI,sBAAsB,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC,CAChE;IACD,IAAI,cAAc,CACd,IAAI,+BAAmB,CACnB,oBAAoB,EACpB,qCAAsB,CAAC,MAAM,EAC7B,mCAAuB,EACvB,8BAAc,CAAC,oBAAoB,CAAC,EACpC,gCAAgB,CAAC,oBAAoB,CAAC,EACtC,YAAY,EACZ,oBAAQ,CAAC,oBAAoB,CAAC,CACjC,EACD;QACI,IAAI,sBAAsB,CAAC,2BAA2B,EAAE,UAAU,CAAC;QACnE,IAAI,sBAAsB,CAAC,0BAA0B,EAAE,eAAe,CAAC;QACvE,IAAI,sBAAsB,CAAC,kBAAkB,EAAE,IAAI,CAAC;QACpD,IAAI,sBAAsB,CAAC,4BAA4B,EAAE,IAAI,CAAC;KACjE,CACJ;IACD,IAAI,cAAc,CACd,IAAI,+BAAmB,CACnB,oBAAoB,EACpB,gDAAsB,CAAC,MAAM,EAC7B,mCAAuB,EACvB,8BAAc,CAAC,oBAAoB,CAAC,EACpC,gCAAgB,CAAC,oBAAoB,CAAC,EACtC,YAAY,EACZ,oBAAQ,CAAC,oBAAoB,CAAC,CACjC,EACD;QACI,IAAI,sBAAsB,CAAC,wBAAwB,EAAE,IAAI,CAAC;QAC1D,IAAI,sBAAsB,CAAC,oBAAoB,EAAE,IAAI,CAAC;QACtD,IAAI,sBAAsB,CAAC,2BAA2B,EAAE,IAAI,CAAC;QAC7D,IAAI,sBAAsB,CAAC,wBAAwB,EAAE,IAAI,CAAC;KAC7D,CACJ;CACJ,CAAC","sourcesContent":["import { OwnedRuleDefinition, RULE_SCHEMA_API_VERSION } from '@webpieces/rules-sdk';\nimport { BranchCreationGuardConfig, PrLifecycleGuardConfig } from './configs/rule-configs';\nimport { BranchStateGuardConfig } from './configs/main-sync-guard-configs';\nimport { optionalTuning, recommendedSeeds } from './rule-settings';\nimport { ruleHelp } from './rule-help';\n\nexport class WorkflowImplementation {\n constructor(\n readonly exportName: string,\n readonly commandHint: 'upsertPr' | 'mergeComplete' | null,\n ) {}\n}\n\nexport class WorkflowPolicy {\n constructor(\n readonly definition: OwnedRuleDefinition,\n readonly implementations: readonly WorkflowImplementation[],\n ) {}\n}\n\nexport const WORKFLOW_POLICIES: readonly WorkflowPolicy[] = [\n new WorkflowPolicy(\n new OwnedRuleDefinition(\n 'branch-creation-guard',\n BranchCreationGuardConfig.SCHEMA,\n RULE_SCHEMA_API_VERSION,\n optionalTuning['branch-creation-guard'],\n recommendedSeeds['branch-creation-guard'],\n 'hookGuards',\n ruleHelp['branch-creation-guard'],\n ),\n [new WorkflowImplementation('BranchCreationGuardRule', null)],\n ),\n new WorkflowPolicy(\n new OwnedRuleDefinition(\n 'pr-lifecycle-guard',\n PrLifecycleGuardConfig.SCHEMA,\n RULE_SCHEMA_API_VERSION,\n optionalTuning['pr-lifecycle-guard'],\n recommendedSeeds['pr-lifecycle-guard'],\n 'hookGuards',\n ruleHelp['pr-lifecycle-guard'],\n ),\n [\n new WorkflowImplementation('PrCreationOrPushGuardRule', 'upsertPr'),\n new WorkflowImplementation('MergeInProgressGuardRule', 'mergeComplete'),\n new WorkflowImplementation('PrMergeGuardRule', null),\n new WorkflowImplementation('RedirectHowToMergeMainRule', null),\n ],\n ),\n new WorkflowPolicy(\n new OwnedRuleDefinition(\n 'branch-state-guard',\n BranchStateGuardConfig.SCHEMA,\n RULE_SCHEMA_API_VERSION,\n optionalTuning['branch-state-guard'],\n recommendedSeeds['branch-state-guard'],\n 'hookGuards',\n ruleHelp['branch-state-guard'],\n ),\n [\n new WorkflowImplementation('FeatureBranchGuardRule', null),\n new WorkflowImplementation('ReadStaleGuardRule', null),\n new WorkflowImplementation('MergedBranchBashGuardRule', null),\n new WorkflowImplementation('StaleMainBashGuardRule', null),\n ],\n ),\n];\n"]}
|
package/templates/ai-hook.sh
CHANGED
|
@@ -363,10 +363,111 @@ case "$TOOL" in
|
|
|
363
363
|
wp_log "$WP_FAULT" ALLOW-IGNORED
|
|
364
364
|
exit 0 ;;
|
|
365
365
|
esac
|
|
366
|
+
# The same compiled Node probe is used by the live runner; it requires no installed package.
|
|
367
|
+
if printf '%s' "$PAYLOAD" | node -e '/** Self-contained Node probe: serialized into the POSIX shim so repairs work with missing packages. */
|
|
368
|
+
class ConfigRepairProbe {
|
|
369
|
+
rootFor(cwd) {
|
|
370
|
+
const fs = require('\''node:fs'\''), path = require('\''node:path'\'');
|
|
371
|
+
let directory = path.resolve(cwd);
|
|
372
|
+
while (!fs.existsSync(path.join(directory, '\''webpieces.config.json'\''))) {
|
|
373
|
+
const parent = path.dirname(directory);
|
|
374
|
+
if (parent === directory)
|
|
375
|
+
return cwd;
|
|
376
|
+
directory = parent;
|
|
377
|
+
}
|
|
378
|
+
return directory;
|
|
379
|
+
}
|
|
380
|
+
isRepairPatch(root, patch) {
|
|
381
|
+
const lines = patch.trim().split('\''\n'\'');
|
|
382
|
+
if (lines[0] !== '\''*** Begin Patch'\'' || lines.at(-1) !== '\''*** End Patch'\'')
|
|
383
|
+
return false;
|
|
384
|
+
let targets = 0;
|
|
385
|
+
for (const line of lines.slice(1, -1)) {
|
|
386
|
+
if (!line.startsWith('\''*** '\''))
|
|
387
|
+
continue;
|
|
388
|
+
const match = /^\*\*\* (?:Add|Update) File: (.+)$/.exec(line);
|
|
389
|
+
if (!match || !this.isRepairFile(root, match[1]))
|
|
390
|
+
return false;
|
|
391
|
+
targets += 1;
|
|
392
|
+
}
|
|
393
|
+
return targets > 0;
|
|
394
|
+
}
|
|
395
|
+
isRepairFile(root, filename) {
|
|
396
|
+
const toError = this.error;
|
|
397
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- bootstrap cannot trust package imports or malformed declarations
|
|
398
|
+
try {
|
|
399
|
+
const fs = require('\''node:fs'\''), path = require('\''node:path'\'');
|
|
400
|
+
const target = this.canonical(root, path.resolve(root, filename));
|
|
401
|
+
const rootFile = this.canonical(root, path.join(root, '\''webpieces.config.json'\''));
|
|
402
|
+
if (target === rootFile)
|
|
403
|
+
return true;
|
|
404
|
+
// webpieces-disable no-any-unknown -- only validated declaration strings grant repair access
|
|
405
|
+
const raw = JSON.parse(fs.readFileSync(rootFile, '\''utf8'\''));
|
|
406
|
+
if (!raw ||
|
|
407
|
+
typeof raw !== '\''object'\'' ||
|
|
408
|
+
!('\''rulePacks'\'' in raw) ||
|
|
409
|
+
!Array.isArray(raw.rulePacks) ||
|
|
410
|
+
!raw.rulePacks.length)
|
|
411
|
+
return false;
|
|
412
|
+
const files = new Set(), packages = new Set();
|
|
413
|
+
const lock = this.canonical(root, path.join(root, '\''.webpieces/rules.lock.json'\''));
|
|
414
|
+
for (const declaration of raw.rulePacks) {
|
|
415
|
+
if (!declaration ||
|
|
416
|
+
typeof declaration !== '\''object'\'' ||
|
|
417
|
+
Array.isArray(declaration) ||
|
|
418
|
+
typeof declaration.package !== '\''string'\'' ||
|
|
419
|
+
!declaration.package ||
|
|
420
|
+
typeof declaration.config !== '\''string'\'' ||
|
|
421
|
+
!declaration.config.endsWith('\''.json'\'') ||
|
|
422
|
+
path.isAbsolute(declaration.config) ||
|
|
423
|
+
Object.keys(declaration).some((key) => !['\''package'\'', '\''config'\''].includes(key)))
|
|
424
|
+
return false;
|
|
425
|
+
const file = this.canonical(root, path.join(root, declaration.config));
|
|
426
|
+
if (file === rootFile ||
|
|
427
|
+
file === lock ||
|
|
428
|
+
files.has(file) ||
|
|
429
|
+
packages.has(declaration.package))
|
|
430
|
+
return false;
|
|
431
|
+
files.add(file);
|
|
432
|
+
packages.add(declaration.package);
|
|
433
|
+
}
|
|
434
|
+
files.add(lock);
|
|
435
|
+
files.add(this.canonical(root, path.join(root, '\''.webpieces/instruct-ai/rules-catalog.md'\'')));
|
|
436
|
+
return files.has(target);
|
|
437
|
+
// webpieces-disable no-any-unknown -- external JSON or runtime exports are validated before policy execution
|
|
438
|
+
}
|
|
439
|
+
catch (err) {
|
|
440
|
+
const error = toError(err);
|
|
441
|
+
void error;
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
canonical(root, filename) {
|
|
446
|
+
const fs = require('\''node:fs'\''), path = require('\''node:path'\'');
|
|
447
|
+
const pending = [];
|
|
448
|
+
let ancestor = filename;
|
|
449
|
+
while (!fs.lstatSync(ancestor, { throwIfNoEntry: false })) {
|
|
450
|
+
pending.unshift(path.basename(ancestor));
|
|
451
|
+
const parent = path.dirname(ancestor);
|
|
452
|
+
if (parent === ancestor)
|
|
453
|
+
throw new Error('\''Cannot resolve config repair path.'\'');
|
|
454
|
+
ancestor = parent;
|
|
455
|
+
}
|
|
456
|
+
const canonical = path.resolve(fs.realpathSync(ancestor), ...pending), relative = path.relative(fs.realpathSync(root), canonical);
|
|
457
|
+
if (relative === '\''..'\'' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))
|
|
458
|
+
throw new Error('\''Config repair path escapes the repository.'\'');
|
|
459
|
+
return canonical;
|
|
460
|
+
}
|
|
461
|
+
// webpieces-disable no-any-unknown -- the bootstrap adapter must remain self-contained when node_modules is corrupt
|
|
462
|
+
error(err) {
|
|
463
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
const probe = new ConfigRepairProbe(); const root = probe.rootFor(process.argv[1]); const payload = JSON.parse(require('\''node:fs'\'').readFileSync(0, '\''utf8'\'')); const input = payload.tool_input; const tool = payload.tool_name; const allowed = ['\''Write'\'','\''Edit'\'','\''MultiEdit'\''].includes(tool) && input && typeof input.file_path === '\''string'\'' ? probe.isRepairFile(root, input.file_path) : tool === '\''apply_patch'\'' && input && typeof input.command === '\''string'\'' && probe.isRepairPatch(root, input.command); if (!allowed) process.exitCode = 1;' "$WP_CWD" >/dev/null 2>&1; then
|
|
467
|
+
wp_log "$WP_FAULT" ALLOW-CONFIG
|
|
468
|
+
exit 0
|
|
469
|
+
fi
|
|
366
470
|
case "$FILE" in
|
|
367
|
-
*/webpieces.config.json|webpieces.config.json)
|
|
368
|
-
wp_log "$WP_FAULT" ALLOW-CONFIG # the always-allowed recovery target — every guard is configured from it
|
|
369
|
-
exit 0 ;;
|
|
370
471
|
*/pnpm-workspace.yaml|pnpm-workspace.yaml|*/package.json|package.json)
|
|
371
472
|
# A manifest AT THE ROOT OF A GOVERNED TREE, which is the only place the version pin lives. The test
|
|
372
473
|
# is the sibling webpieces.config.json — TRACKED, so the main clone has one and every worktree has its
|
|
@@ -378,7 +479,7 @@ case "$FILE" in
|
|
|
378
479
|
exit 0
|
|
379
480
|
fi ;;
|
|
380
481
|
esac
|
|
381
|
-
if printf '%s' "$CMD" | grep -Eq '^(cd[[:space:]]+([A-Za-z0-9._/@~+-]+|'\''[^'\'']+'\'')[[:space:]]*&&[[:space:]]*)?((pnpm|npm)[[:space:]]+(install|i)([[:space:]]+--[A-Za-z][A-Za-z0-9=._/@:-]*)*|rm[[:space:]]+-rf[[:space:]]+(\./)?node_modules/?([[:space:]]*&&[[:space:]]*(pnpm|npm)[[:space:]]+(install|i)([[:space:]]+--[A-Za-z][A-Za-z0-9=._/@:-]*)*)?|git[[:space:]]+fetch([[:space:]]+(--)?[A-Za-z0-9][A-Za-z0-9=._/@:-]*)*|git[[:space:]]+checkout[[:space:]]+main[[:space:]]*&&[[:space:]]*git[[:space:]]+pull[[:space:]]+origin[[:space:]]+main|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-upgrade-shim|cp[[:space:]]+(\./)?node_modules/@webpieces/agent-workflow-rules/templates/ai-hook\.sh[[:space:]]+(\./)?\.claude/webpieces/ai-hook\.sh|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-prune-unknown-config|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-install-ai-hooks([[:space:]]+--[A-Za-z][A-Za-z0-9=._/@:-]*)*|(pnpm|npm)[[:space:]]+add([[:space:]]+(-[A-Za-z]|--[A-Za-z][A-Za-z0-9=._/@:-]*))*[[:space:]]+@webpieces/agent-workflow-rules(@[A-Za-z0-9._+-]+)?([[:space:]]+(-[A-Za-z]|--[A-Za-z][A-Za-z0-9=._/@:-]*))*|(pwd|git[[:space:]]+(status|log|diff|show|branch|rev-parse)|git[[:space:]]+worktree[[:space:]]+list)([[:space:]]+(--)?[A-Za-z0-9][A-Za-z0-9=._/@:-]*)*)([[:space:]]+2>(&1|/dev/null))?([[:space:]]*\|[[:space:]]*(tail|head)([[:space:]]+-(n[[:space:]]+)?[0-9]+)?)?[[:space:]]*$'; then
|
|
482
|
+
if printf '%s' "$CMD" | grep -Eq '^(cd[[:space:]]+([A-Za-z0-9._/@~+-]+|'\''[^'\'']+'\'')[[:space:]]*&&[[:space:]]*)?((pnpm|npm)[[:space:]]+(install|i)([[:space:]]+--[A-Za-z][A-Za-z0-9=._/@:-]*)*|rm[[:space:]]+-rf[[:space:]]+(\./)?node_modules/?([[:space:]]*&&[[:space:]]*(pnpm|npm)[[:space:]]+(install|i)([[:space:]]+--[A-Za-z][A-Za-z0-9=._/@:-]*)*)?|git[[:space:]]+fetch([[:space:]]+(--)?[A-Za-z0-9][A-Za-z0-9=._/@:-]*)*|git[[:space:]]+checkout[[:space:]]+main[[:space:]]*&&[[:space:]]*git[[:space:]]+pull[[:space:]]+origin[[:space:]]+main|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-upgrade-shim|cp[[:space:]]+(\./)?node_modules/@webpieces/agent-workflow-rules/templates/ai-hook\.sh[[:space:]]+(\./)?\.claude/webpieces/ai-hook\.sh|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-prune-unknown-config|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-rules-sync([[:space:]]+(--upgrade|--pack(=|[[:space:]]+)[[:alnum:]_@./-]+=[[:alnum:]_./-]+))*|(pnpm|npm|npx)([[:space:]]+(exec|run))?[[:space:]]+wp-install-ai-hooks([[:space:]]+--[A-Za-z][A-Za-z0-9=._/@:-]*)*|(pnpm|npm)[[:space:]]+add([[:space:]]+(-[A-Za-z]|--[A-Za-z][A-Za-z0-9=._/@:-]*))*[[:space:]]+@webpieces/agent-workflow-rules(@[A-Za-z0-9._+-]+)?([[:space:]]+(-[A-Za-z]|--[A-Za-z][A-Za-z0-9=._/@:-]*))*|(pwd|git[[:space:]]+(status|log|diff|show|branch|rev-parse)|git[[:space:]]+worktree[[:space:]]+list)([[:space:]]+(--)?[A-Za-z0-9][A-Za-z0-9=._/@:-]*)*)([[:space:]]+2>(&1|/dev/null))?([[:space:]]*\|[[:space:]]*(tail|head)([[:space:]]+-(n[[:space:]]+)?[0-9]+)?)?[[:space:]]*$'; then
|
|
382
483
|
wp_log "$WP_FAULT" ALLOW-CURE # record the self-heal we let through (re-enables the guards)
|
|
383
484
|
exit 0 # allow the cure so the assistant can break the deadlock
|
|
384
485
|
fi
|