@webpieces/agent-workflow-rules 0.0.0-stage → 0.0.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 +23 -2
- package/package.json +45 -4
- package/src/adapters/agent-response.d.ts +5 -0
- package/src/adapters/agent-response.js +86 -0
- package/src/adapters/agent-response.js.map +1 -0
- package/src/adapters/codex-subagent-guard.d.ts +45 -0
- package/src/adapters/codex-subagent-guard.js +88 -0
- package/src/adapters/codex-subagent-guard.js.map +1 -0
- package/src/adapters/guards-hook.d.ts +3 -0
- package/src/adapters/guards-hook.js +30 -0
- package/src/adapters/guards-hook.js.map +1 -0
- package/src/adapters/hook-app-fixtures.d.ts +68 -0
- package/src/adapters/hook-app-fixtures.js +170 -0
- package/src/adapters/hook-app-fixtures.js.map +1 -0
- package/src/adapters/hook-core.d.ts +22 -0
- package/src/adapters/hook-core.js +359 -0
- package/src/adapters/hook-core.js.map +1 -0
- package/src/adapters/hook-pipeline-evaluator.d.ts +5 -0
- package/src/adapters/hook-pipeline-evaluator.js +18 -0
- package/src/adapters/hook-pipeline-evaluator.js.map +1 -0
- package/src/adapters/review-identity-stamper.d.ts +20 -0
- package/src/adapters/review-identity-stamper.js +34 -0
- package/src/adapters/review-identity-stamper.js.map +1 -0
- package/src/bin/codex-trust.d.ts +105 -0
- package/src/bin/codex-trust.js +205 -0
- package/src/bin/codex-trust.js.map +1 -0
- package/src/bin/dev-hook-install.d.ts +1 -0
- package/src/bin/dev-hook-install.js +80 -0
- package/src/bin/dev-hook-install.js.map +1 -0
- package/src/bin/dev-hook-uninstall.d.ts +1 -0
- package/src/bin/dev-hook-uninstall.js +45 -0
- package/src/bin/dev-hook-uninstall.js.map +1 -0
- package/src/bin/hook-registration.d.ts +429 -0
- package/src/bin/hook-registration.js +661 -0
- package/src/bin/hook-registration.js.map +1 -0
- package/src/bin/install-entry.d.ts +19 -0
- package/src/bin/install-entry.js +128 -0
- package/src/bin/install-entry.js.map +1 -0
- package/src/bin/l0-allowlist.d.ts +46 -0
- package/src/bin/l0-allowlist.js +527 -0
- package/src/bin/l0-allowlist.js.map +1 -0
- package/src/bin/l0-codex-read.d.ts +20 -0
- package/src/bin/l0-codex-read.js +108 -0
- package/src/bin/l0-codex-read.js.map +1 -0
- package/src/bin/l0-decide.d.ts +49 -0
- package/src/bin/l0-decide.js +90 -0
- package/src/bin/l0-decide.js.map +1 -0
- package/src/bin/l0-entry.d.ts +103 -0
- package/src/bin/l0-entry.js +98 -0
- package/src/bin/l0-entry.js.map +1 -0
- package/src/bin/l0-ignored-tools.d.ts +38 -0
- package/src/bin/l0-ignored-tools.js +44 -0
- package/src/bin/l0-ignored-tools.js.map +1 -0
- package/src/bin/managed-env.d.ts +46 -0
- package/src/bin/managed-env.js +50 -0
- package/src/bin/managed-env.js.map +1 -0
- package/src/bin/neighbour-hooks.d.ts +42 -0
- package/src/bin/neighbour-hooks.js +177 -0
- package/src/bin/neighbour-hooks.js.map +1 -0
- package/src/bin/reviewer-agent.d.ts +19 -0
- package/src/bin/reviewer-agent.js +135 -0
- package/src/bin/reviewer-agent.js.map +1 -0
- package/src/bin/settings-shape.d.ts +37 -0
- package/src/bin/settings-shape.js +17 -0
- package/src/bin/settings-shape.js.map +1 -0
- package/src/bin/setup-config.d.ts +20 -0
- package/src/bin/setup-config.js +371 -0
- package/src/bin/setup-config.js.map +1 -0
- package/src/bin/setup.d.ts +78 -0
- package/src/bin/setup.js +411 -0
- package/src/bin/setup.js.map +1 -0
- package/src/bin/shim-audit-log.d.ts +119 -0
- package/src/bin/shim-audit-log.js +286 -0
- package/src/bin/shim-audit-log.js.map +1 -0
- package/src/bin/shim-deny-reason.d.ts +1 -0
- package/src/bin/shim-deny-reason.js +244 -0
- package/src/bin/shim-deny-reason.js.map +1 -0
- package/src/bin/shim-drift-fix.d.ts +1 -0
- package/src/bin/shim-drift-fix.js +73 -0
- package/src/bin/shim-drift-fix.js.map +1 -0
- package/src/bin/shim-testkit.d.ts +107 -0
- package/src/bin/shim-testkit.js +197 -0
- package/src/bin/shim-testkit.js.map +1 -0
- package/src/bin/shim-version-drift.d.ts +1 -0
- package/src/bin/shim-version-drift.js +164 -0
- package/src/bin/shim-version-drift.js.map +1 -0
- package/src/bin/shim.d.ts +16 -0
- package/src/bin/shim.js +641 -0
- package/src/bin/shim.js.map +1 -0
- package/src/bin/upgrade-shim.d.ts +18 -0
- package/src/bin/upgrade-shim.js +283 -0
- package/src/bin/upgrade-shim.js.map +1 -0
- package/src/configs/main-sync-guard-configs.d.ts +38 -0
- package/src/configs/main-sync-guard-configs.js +54 -0
- package/src/configs/main-sync-guard-configs.js.map +1 -0
- package/src/configs/rule-configs.d.ts +47 -0
- package/src/configs/rule-configs.js +96 -0
- package/src/configs/rule-configs.js.map +1 -0
- package/src/core/ai-type-context.d.ts +36 -0
- package/src/core/ai-type-context.js +45 -0
- package/src/core/ai-type-context.js.map +1 -0
- package/src/core/decision-log.d.ts +190 -0
- package/src/core/decision-log.js +409 -0
- package/src/core/decision-log.js.map +1 -0
- package/src/core/excluded-path-escape.d.ts +101 -0
- package/src/core/excluded-path-escape.js +236 -0
- package/src/core/excluded-path-escape.js.map +1 -0
- package/src/core/force-to-root.d.ts +32 -0
- package/src/core/force-to-root.js +60 -0
- package/src/core/force-to-root.js.map +1 -0
- package/src/core/guard-index-doc.d.ts +63 -0
- package/src/core/guard-index-doc.js +172 -0
- package/src/core/guard-index-doc.js.map +1 -0
- package/src/core/instruct-ai-writer.d.ts +1 -0
- package/src/core/instruct-ai-writer.js +6 -0
- package/src/core/instruct-ai-writer.js.map +1 -0
- package/src/core/l0-matrix.d.ts +102 -0
- package/src/core/l0-matrix.js +357 -0
- package/src/core/l0-matrix.js.map +1 -0
- package/src/core/l0-tooling-doc.d.ts +45 -0
- package/src/core/l0-tooling-doc.js +258 -0
- package/src/core/l0-tooling-doc.js.map +1 -0
- package/src/core/l1-doc.d.ts +7 -0
- package/src/core/l1-doc.js +340 -0
- package/src/core/l1-doc.js.map +1 -0
- package/src/core/l1-matrix-doc.d.ts +31 -0
- package/src/core/l1-matrix-doc.js +111 -0
- package/src/core/l1-matrix-doc.js.map +1 -0
- package/src/core/l1-rows.d.ts +167 -0
- package/src/core/l1-rows.js +262 -0
- package/src/core/l1-rows.js.map +1 -0
- package/src/core/l2-doc.d.ts +7 -0
- package/src/core/l2-doc.js +385 -0
- package/src/core/l2-doc.js.map +1 -0
- package/src/core/l2-matrix-doc.d.ts +23 -0
- package/src/core/l2-matrix-doc.js +72 -0
- package/src/core/l2-matrix-doc.js.map +1 -0
- package/src/core/l2-row.d.ts +54 -0
- package/src/core/l2-row.js +75 -0
- package/src/core/l2-row.js.map +1 -0
- package/src/core/l2-rows.d.ts +56 -0
- package/src/core/l2-rows.js +272 -0
- package/src/core/l2-rows.js.map +1 -0
- package/src/core/load-rules.d.ts +9 -0
- package/src/core/load-rules.js +65 -0
- package/src/core/load-rules.js.map +1 -0
- package/src/core/log-stream.d.ts +117 -0
- package/src/core/log-stream.js +156 -0
- package/src/core/log-stream.js.map +1 -0
- package/src/core/log-streams.d.ts +48 -0
- package/src/core/log-streams.js +55 -0
- package/src/core/log-streams.js.map +1 -0
- package/src/core/log-target.d.ts +21 -0
- package/src/core/log-target.js +29 -0
- package/src/core/log-target.js.map +1 -0
- package/src/core/main-sync-log.d.ts +16 -0
- package/src/core/main-sync-log.js +108 -0
- package/src/core/main-sync-log.js.map +1 -0
- package/src/core/main-sync-refresh.d.ts +39 -0
- package/src/core/main-sync-refresh.js +96 -0
- package/src/core/main-sync-refresh.js.map +1 -0
- package/src/core/main-sync-timeout.d.ts +33 -0
- package/src/core/main-sync-timeout.js +95 -0
- package/src/core/main-sync-timeout.js.map +1 -0
- package/src/core/matrix-cures.d.ts +12 -0
- package/src/core/matrix-cures.js +56 -0
- package/src/core/matrix-cures.js.map +1 -0
- package/src/core/missing-directory.d.ts +38 -0
- package/src/core/missing-directory.js +66 -0
- package/src/core/missing-directory.js.map +1 -0
- package/src/core/read-only-inspection.d.ts +34 -0
- package/src/core/read-only-inspection.js +88 -0
- package/src/core/read-only-inspection.js.map +1 -0
- package/src/core/rejection-log.d.ts +9 -0
- package/src/core/rejection-log.js +262 -0
- package/src/core/rejection-log.js.map +1 -0
- package/src/core/rules/branch-creation-guard.d.ts +113 -0
- package/src/core/rules/branch-creation-guard.js +425 -0
- package/src/core/rules/branch-creation-guard.js.map +1 -0
- package/src/core/rules/branch-switch-scan.d.ts +43 -0
- package/src/core/rules/branch-switch-scan.js +132 -0
- package/src/core/rules/branch-switch-scan.js.map +1 -0
- package/src/core/rules/build-output-pipe-guard.d.ts +56 -0
- package/src/core/rules/build-output-pipe-guard.js +120 -0
- package/src/core/rules/build-output-pipe-guard.js.map +1 -0
- package/src/core/rules/build-output-pipe-scan.d.ts +47 -0
- package/src/core/rules/build-output-pipe-scan.js +84 -0
- package/src/core/rules/build-output-pipe-scan.js.map +1 -0
- package/src/core/rules/cap-remedies.d.ts +39 -0
- package/src/core/rules/cap-remedies.js +59 -0
- package/src/core/rules/cap-remedies.js.map +1 -0
- package/src/core/rules/commit-message-substitution-guard.d.ts +72 -0
- package/src/core/rules/commit-message-substitution-guard.js +134 -0
- package/src/core/rules/commit-message-substitution-guard.js.map +1 -0
- package/src/core/rules/commit-message-substitution-scan.d.ts +42 -0
- package/src/core/rules/commit-message-substitution-scan.js +145 -0
- package/src/core/rules/commit-message-substitution-scan.js.map +1 -0
- package/src/core/rules/content-read-scan.d.ts +76 -0
- package/src/core/rules/content-read-scan.js +176 -0
- package/src/core/rules/content-read-scan.js.map +1 -0
- package/src/core/rules/cure-prefix-scan.d.ts +64 -0
- package/src/core/rules/cure-prefix-scan.js +133 -0
- package/src/core/rules/cure-prefix-scan.js.map +1 -0
- package/src/core/rules/feature-branch-guard.d.ts +121 -0
- package/src/core/rules/feature-branch-guard.js +327 -0
- package/src/core/rules/feature-branch-guard.js.map +1 -0
- package/src/core/rules/index.d.ts +1 -0
- package/src/core/rules/index.js +5 -0
- package/src/core/rules/index.js.map +1 -0
- package/src/core/rules/judged-tree.d.ts +66 -0
- package/src/core/rules/judged-tree.js +97 -0
- package/src/core/rules/judged-tree.js.map +1 -0
- package/src/core/rules/main-freshness.d.ts +37 -0
- package/src/core/rules/main-freshness.js +61 -0
- package/src/core/rules/main-freshness.js.map +1 -0
- package/src/core/rules/merge-in-progress-guard.d.ts +17 -0
- package/src/core/rules/merge-in-progress-guard.js +124 -0
- package/src/core/rules/merge-in-progress-guard.js.map +1 -0
- package/src/core/rules/merged-branch-bash-guard.d.ts +62 -0
- package/src/core/rules/merged-branch-bash-guard.js +171 -0
- package/src/core/rules/merged-branch-bash-guard.js.map +1 -0
- package/src/core/rules/merged-branch-message.d.ts +59 -0
- package/src/core/rules/merged-branch-message.js +137 -0
- package/src/core/rules/merged-branch-message.js.map +1 -0
- package/src/core/rules/pr-creation-or-push-guard.d.ts +26 -0
- package/src/core/rules/pr-creation-or-push-guard.js +150 -0
- package/src/core/rules/pr-creation-or-push-guard.js.map +1 -0
- package/src/core/rules/pr-merge-guard.d.ts +36 -0
- package/src/core/rules/pr-merge-guard.js +87 -0
- package/src/core/rules/pr-merge-guard.js.map +1 -0
- package/src/core/rules/read-stale-guard.d.ts +136 -0
- package/src/core/rules/read-stale-guard.js +328 -0
- package/src/core/rules/read-stale-guard.js.map +1 -0
- package/src/core/rules/recovery-allowlist.d.ts +49 -0
- package/src/core/rules/recovery-allowlist.js +187 -0
- package/src/core/rules/recovery-allowlist.js.map +1 -0
- package/src/core/rules/redirect-how-to-merge-main.d.ts +16 -0
- package/src/core/rules/redirect-how-to-merge-main.js +159 -0
- package/src/core/rules/redirect-how-to-merge-main.js.map +1 -0
- package/src/core/rules/stale-main-bash-guard.d.ts +198 -0
- package/src/core/rules/stale-main-bash-guard.js +363 -0
- package/src/core/rules/stale-main-bash-guard.js.map +1 -0
- package/src/core/rules/stale-main-message.d.ts +62 -0
- package/src/core/rules/stale-main-message.js +102 -0
- package/src/core/rules/stale-main-message.js.map +1 -0
- package/src/core/rules/tree-recovery.d.ts +92 -0
- package/src/core/rules/tree-recovery.js +165 -0
- package/src/core/rules/tree-recovery.js.map +1 -0
- package/src/core/rules/wait-spin-guard.d.ts +128 -0
- package/src/core/rules/wait-spin-guard.js +211 -0
- package/src/core/rules/wait-spin-guard.js.map +1 -0
- package/src/core/rules/wait-spin-scan.d.ts +118 -0
- package/src/core/rules/wait-spin-scan.js +203 -0
- package/src/core/rules/wait-spin-scan.js.map +1 -0
- package/src/core/rules/whole-repo-build-guard.d.ts +125 -0
- package/src/core/rules/whole-repo-build-guard.js +257 -0
- package/src/core/rules/whole-repo-build-guard.js.map +1 -0
- package/src/core/rules/whole-repo-build-scan.d.ts +28 -0
- package/src/core/rules/whole-repo-build-scan.js +198 -0
- package/src/core/rules/whole-repo-build-scan.js.map +1 -0
- package/src/core/runner.d.ts +19 -0
- package/src/core/runner.js +482 -0
- package/src/core/runner.js.map +1 -0
- package/src/core/session-call-history.d.ts +44 -0
- package/src/core/session-call-history.js +79 -0
- package/src/core/session-call-history.js.map +1 -0
- package/src/core/sync-main.d.ts +46 -0
- package/src/core/sync-main.js +176 -0
- package/src/core/sync-main.js.map +1 -0
- package/src/core/version-sync.d.ts +219 -0
- package/src/core/version-sync.js +558 -0
- package/src/core/version-sync.js.map +1 -0
- package/src/core/webpieces-versions.d.ts +98 -0
- package/src/core/webpieces-versions.js +206 -0
- package/src/core/webpieces-versions.js.map +1 -0
- package/src/core/workflow-hook-rules.d.ts +5 -0
- package/src/core/workflow-hook-rules.js +15 -0
- package/src/core/workflow-hook-rules.js.map +1 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +28 -0
- package/src/index.js.map +1 -0
- package/src/policy-keys.d.ts +2 -0
- package/src/policy-keys.js +6 -0
- package/src/policy-keys.js.map +1 -0
- package/src/rule-migrations.d.ts +3 -0
- package/src/rule-migrations.js +22 -0
- package/src/rule-migrations.js.map +1 -0
- package/src/rule-pack.d.ts +2 -0
- package/src/rule-pack.js +20 -0
- package/src/rule-pack.js.map +1 -0
- package/src/rule-settings.d.ts +5 -0
- package/src/rule-settings.js +31 -0
- package/src/rule-settings.js.map +1 -0
- package/src/safeguard-catalog.d.ts +3 -0
- package/src/safeguard-catalog.js +16 -0
- package/src/safeguard-catalog.js.map +1 -0
- package/templates/ai-hook.sh +497 -0
- package/templates/claude-settings-hook.json +28 -0
- package/templates/webpieces-reviewer.md +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-migrations.js","sourceRoot":"","sources":["../../../../../packages/tooling/agent-workflow-rules/src/rule-migrations.ts"],"names":[],"mappings":";;;AAAA,oDAAwD;AAExD,uFAAuF;AAC1E,QAAA,cAAc,GAAgC;IACvD,IAAI,4BAAgB,CAAC,MAAM,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,4LAA4L,EAAE,oBAAoB,EAAE,KAAK,CAAC;IACjS,IAAI,4BAAgB,CAAC,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,ySAAyS,EAAE,qBAAqB,EAAE,KAAK,CAAC;IAChZ,IAAI,4BAAgB,CAAC,MAAM,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,iVAAiV,EAAE,oBAAoB,EAAE,KAAK,CAAC;IACtb,IAAI,4BAAgB,CAAC,MAAM,EAAE,wBAAwB,EAAE,gEAAgE,EAAE,4VAA4V,EAAE,0BAA0B,EAAE,IAAI,CAAC;IACxf,IAAI,4BAAgB,CAAC,MAAM,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,oxBAAoxB,EAAE,wBAAwB,EAAE,KAAK,CAAC;IACj4B,IAAI,4BAAgB,CAAC,MAAM,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oxBAAoxB,EAAE,oBAAoB,EAAE,KAAK,CAAC;IACz3B,IAAI,4BAAgB,CAAC,MAAM,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,oxBAAoxB,EAAE,yBAAyB,EAAE,KAAK,CAAC;IACn4B,IAAI,4BAAgB,CAAC,MAAM,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,oxBAAoxB,EAAE,4BAA4B,EAAE,KAAK,CAAC;IACz4B,IAAI,4BAAgB,CAAC,MAAM,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,isBAAisB,EAAE,6BAA6B,EAAE,KAAK,CAAC;IACxzB,IAAI,4BAAgB,CAAC,MAAM,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,isBAAisB,EAAE,2BAA2B,EAAE,KAAK,CAAC;IACpzB,IAAI,4BAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,isBAAisB,EAAE,kBAAkB,EAAE,KAAK,CAAC;IAClyB,IAAI,4BAAgB,CAAC,MAAM,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,isBAAisB,EAAE,8BAA8B,EAAE,KAAK,CAAC;IAC1zB,IAAI,4BAAgB,CAAC,OAAO,EAAE,oCAAoC,EAAE,EAAE,EAAE,2MAA2M,EAAE,sBAAsB,EAAE,KAAK,CAAC;IACnT,IAAI,4BAAgB,CAAC,OAAO,EAAE,yCAAyC,EAAE,EAAE,EAAE,0MAA0M,EAAE,sBAAsB,EAAE,KAAK,CAAC;CAC1T,CAAC","sourcesContent":["import { RetiredConfigKey } from '@webpieces/rules-sdk';\n\n/** Rejected obsolete workflow switches, preserving their exact repair instructions. */\nexport const ruleMigrations: readonly RetiredConfigKey[] = [\n new RetiredConfigKey(\"rule\", \"pr-merge-cleanup\", \"pr-lifecycle-guard\", \"Rename the key to \\\"pr-lifecycle-guard\\\" (merging its value into that entry if you already have one — the four PR/merge guards share one key now). Its mode and escape hatches carry over.\", \"[pr-merge-cleanup]\", false),\n new RetiredConfigKey(\"rule\", \"pr-creation-guard\", \"pr-lifecycle-guard\", \"Rename the key to \\\"pr-lifecycle-guard\\\" (merging its value into that entry if you already have one — the four PR/merge guards share one key now). Its mode and escape hatches carry over; the old \\\"upsertPrCommand\\\" field does NOT — that string lives only in commands.guardHints.prCreationOrPush.\", \"[pr-creation-guard]\", false),\n new RetiredConfigKey(\"rule\", \"main-stale-guard\", \"branch-state-guard\", \"Rename the key to \\\"branch-state-guard\\\" (merging its value into that entry if you already have one — the four branch-state guards share one key now). Its mode and escape hatches carry over. Note the widened scope: that key arms the Write, Read AND Bash halves of the branch-state policy, not just the Read block this key used to name.\", \"[main-stale-guard]\", false),\n new RetiredConfigKey(\"rule\", \"whole-repo-build-guard\", \"~/.webpieces/config.json → experimental.whole-repo-build-guard\", \"DELETE this entry from webpieces.config.json — no repo config key controls this guard any more. The guard is OFF by default for everyone, with no file and no key required. To turn it ON for YOUR machine only, put {\\\"experimental\\\": {\\\"whole-repo-build-guard\\\": true}} in ~/.webpieces/config.json — that file is optional and is tracked by no repo.\", \"[whole-repo-build-guard]\", true),\n new RetiredConfigKey(\"rule\", \"feature-branch-guard\", \"branch-state-guard\", \"MERGE it into ONE \\\"branch-state-guard\\\" entry under \\\"hookGuards\\\". All four of feature-branch-guard, read-stale-guard, stale-main-bash-guard and merged-branch-bash-guard now read that single entry — they are one policy (\\\"may I work here, and is what I read current?\\\") implemented by four classes, and configuring them separately let you switch on half of it. Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\"; the ONE \\\"hangTimeoutMinutes\\\" survives (there was only ever one refresher and one cache, so at most one of the four values could ever take effect); \\\"branchNamingConvention\\\" survives from feature-branch-guard. If the four disagreed on \\\"mode\\\", pick the one you meant — \\\"ON\\\" arms the whole policy including the Read block. Then DELETE this key.\", \"[feature-branch-guard]\", false),\n new RetiredConfigKey(\"rule\", \"read-stale-guard\", \"branch-state-guard\", \"MERGE it into ONE \\\"branch-state-guard\\\" entry under \\\"hookGuards\\\". All four of feature-branch-guard, read-stale-guard, stale-main-bash-guard and merged-branch-bash-guard now read that single entry — they are one policy (\\\"may I work here, and is what I read current?\\\") implemented by four classes, and configuring them separately let you switch on half of it. Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\"; the ONE \\\"hangTimeoutMinutes\\\" survives (there was only ever one refresher and one cache, so at most one of the four values could ever take effect); \\\"branchNamingConvention\\\" survives from feature-branch-guard. If the four disagreed on \\\"mode\\\", pick the one you meant — \\\"ON\\\" arms the whole policy including the Read block. Then DELETE this key.\", \"[read-stale-guard]\", false),\n new RetiredConfigKey(\"rule\", \"stale-main-bash-guard\", \"branch-state-guard\", \"MERGE it into ONE \\\"branch-state-guard\\\" entry under \\\"hookGuards\\\". All four of feature-branch-guard, read-stale-guard, stale-main-bash-guard and merged-branch-bash-guard now read that single entry — they are one policy (\\\"may I work here, and is what I read current?\\\") implemented by four classes, and configuring them separately let you switch on half of it. Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\"; the ONE \\\"hangTimeoutMinutes\\\" survives (there was only ever one refresher and one cache, so at most one of the four values could ever take effect); \\\"branchNamingConvention\\\" survives from feature-branch-guard. If the four disagreed on \\\"mode\\\", pick the one you meant — \\\"ON\\\" arms the whole policy including the Read block. Then DELETE this key.\", \"[stale-main-bash-guard]\", false),\n new RetiredConfigKey(\"rule\", \"merged-branch-bash-guard\", \"branch-state-guard\", \"MERGE it into ONE \\\"branch-state-guard\\\" entry under \\\"hookGuards\\\". All four of feature-branch-guard, read-stale-guard, stale-main-bash-guard and merged-branch-bash-guard now read that single entry — they are one policy (\\\"may I work here, and is what I read current?\\\") implemented by four classes, and configuring them separately let you switch on half of it. Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\"; the ONE \\\"hangTimeoutMinutes\\\" survives (there was only ever one refresher and one cache, so at most one of the four values could ever take effect); \\\"branchNamingConvention\\\" survives from feature-branch-guard. If the four disagreed on \\\"mode\\\", pick the one you meant — \\\"ON\\\" arms the whole policy including the Read block. Then DELETE this key.\", \"[merged-branch-bash-guard]\", false),\n new RetiredConfigKey(\"rule\", \"pr-creation-or-push-guard\", \"pr-lifecycle-guard\", \"MERGE it into ONE \\\"pr-lifecycle-guard\\\" entry under \\\"hookGuards\\\". All four of pr-creation-or-push-guard, merge-in-progress-guard, pr-merge-guard and redirect-how-to-merge-main now read that single entry — they are one policy (\\\"do PRs and merges go through the gated flow?\\\"). Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\". Know what \\\"mode\\\": \\\"OFF\\\" now means: it releases the unvalidated-merge gate as well as the PR/push blocks, because merge-in-progress-guard is under this key too. The per-guard \\\"upsertPrCommand\\\" / \\\"mergeCompleteCommand\\\" fields are gone — those strings live ONLY in commands.guardHints.prCreationOrPush / .mergeInProgress. Then DELETE this key.\", \"[pr-creation-or-push-guard]\", false),\n new RetiredConfigKey(\"rule\", \"merge-in-progress-guard\", \"pr-lifecycle-guard\", \"MERGE it into ONE \\\"pr-lifecycle-guard\\\" entry under \\\"hookGuards\\\". All four of pr-creation-or-push-guard, merge-in-progress-guard, pr-merge-guard and redirect-how-to-merge-main now read that single entry — they are one policy (\\\"do PRs and merges go through the gated flow?\\\"). Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\". Know what \\\"mode\\\": \\\"OFF\\\" now means: it releases the unvalidated-merge gate as well as the PR/push blocks, because merge-in-progress-guard is under this key too. The per-guard \\\"upsertPrCommand\\\" / \\\"mergeCompleteCommand\\\" fields are gone — those strings live ONLY in commands.guardHints.prCreationOrPush / .mergeInProgress. Then DELETE this key.\", \"[merge-in-progress-guard]\", false),\n new RetiredConfigKey(\"rule\", \"pr-merge-guard\", \"pr-lifecycle-guard\", \"MERGE it into ONE \\\"pr-lifecycle-guard\\\" entry under \\\"hookGuards\\\". All four of pr-creation-or-push-guard, merge-in-progress-guard, pr-merge-guard and redirect-how-to-merge-main now read that single entry — they are one policy (\\\"do PRs and merges go through the gated flow?\\\"). Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\". Know what \\\"mode\\\": \\\"OFF\\\" now means: it releases the unvalidated-merge gate as well as the PR/push blocks, because merge-in-progress-guard is under this key too. The per-guard \\\"upsertPrCommand\\\" / \\\"mergeCompleteCommand\\\" fields are gone — those strings live ONLY in commands.guardHints.prCreationOrPush / .mergeInProgress. Then DELETE this key.\", \"[pr-merge-guard]\", false),\n new RetiredConfigKey(\"rule\", \"redirect-how-to-merge-main\", \"pr-lifecycle-guard\", \"MERGE it into ONE \\\"pr-lifecycle-guard\\\" entry under \\\"hookGuards\\\". All four of pr-creation-or-push-guard, merge-in-progress-guard, pr-merge-guard and redirect-how-to-merge-main now read that single entry — they are one policy (\\\"do PRs and merges go through the gated flow?\\\"). Keep \\\"mode\\\", \\\"turnOffRuleUntilEpoch\\\" and \\\"turnOffRuleWhileOnBranch\\\". Know what \\\"mode\\\": \\\"OFF\\\" now means: it releases the unvalidated-merge gate as well as the PR/push blocks, because merge-in-progress-guard is under this key too. The per-guard \\\"upsertPrCommand\\\" / \\\"mergeCompleteCommand\\\" fields are gone — those strings live ONLY in commands.guardHints.prCreationOrPush / .mergeInProgress. Then DELETE this key.\", \"[redirect-how-to-merge-main]\", false),\n new RetiredConfigKey(\"field\", \"pr-lifecycle-guard.upsertPrCommand\", \"\", \"This field was removed. The command the push/PR-creation block prints lives in ONE place: \\\"commands\\\": { \\\"guardHints\\\": { \\\"prCreationOrPush\\\": <value> } }. Move your value there and delete this key.\", \"[pr-lifecycle-guard]\", false),\n new RetiredConfigKey(\"field\", \"pr-lifecycle-guard.mergeCompleteCommand\", \"\", \"This field was removed. The command the unfinished-merge block prints lives in ONE place: \\\"commands\\\": { \\\"guardHints\\\": { \\\"mergeInProgress\\\": <value> } }. Move your value there and delete this key.\", \"[pr-lifecycle-guard]\", false),\n];\n"]}
|
package/src/rule-pack.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rulePackManifest = void 0;
|
|
4
|
+
const rule_migrations_1 = require("./rule-migrations");
|
|
5
|
+
const safeguard_catalog_1 = require("./safeguard-catalog");
|
|
6
|
+
const rule_settings_1 = require("./rule-settings");
|
|
7
|
+
const rules_sdk_1 = require("@webpieces/rules-sdk");
|
|
8
|
+
const rule_configs_1 = require("./configs/rule-configs");
|
|
9
|
+
const main_sync_guard_configs_1 = require("./configs/main-sync-guard-configs");
|
|
10
|
+
const package_json_1 = require("../package.json");
|
|
11
|
+
/** Workflow policies own their concrete configuration schema. */
|
|
12
|
+
const ownedRules = [
|
|
13
|
+
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'),
|
|
14
|
+
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'),
|
|
15
|
+
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'),
|
|
16
|
+
];
|
|
17
|
+
exports.rulePackManifest = new rules_sdk_1.RulePackManifest('@webpieces/agent-workflow-rules', package_json_1.version, rules_sdk_1.RULE_PACK_API_VERSION, ownedRules, [
|
|
18
|
+
...ownedRules.map(rule => new rules_sdk_1.RuleContribution(rule.id, '@webpieces/agent-workflow-rules', 'workflow-guard')),
|
|
19
|
+
], rule_migrations_1.ruleMigrations, safeguard_catalog_1.safeguardCatalog);
|
|
20
|
+
//# sourceMappingURL=rule-pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-pack.js","sourceRoot":"","sources":["../../../../../packages/tooling/agent-workflow-rules/src/rule-pack.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,2DAAuD;AACvD,mDAAmE;AACnE,oDAA+I;AAC/I,yDAA2F;AAC3F,+EAA2E;AAC3E,kDAA0C;AAE1C,iEAAiE;AACjE,MAAM,UAAU,GAAG;IACf,IAAI,+BAAmB,CAAC,uBAAuB,EAAE,wCAAyB,CAAC,MAAM,EAAE,mCAAuB,EAAE,8BAAc,CAAC,uBAAuB,CAAC,EAAE,gCAAgB,CAAC,uBAAuB,CAAC,EAAE,YAAY,CAAC;IAC7M,IAAI,+BAAmB,CAAC,oBAAoB,EAAE,qCAAsB,CAAC,MAAM,EAAE,mCAAuB,EAAE,8BAAc,CAAC,oBAAoB,CAAC,EAAE,gCAAgB,CAAC,oBAAoB,CAAC,EAAE,YAAY,CAAC;IACjM,IAAI,+BAAmB,CAAC,oBAAoB,EAAE,gDAAsB,CAAC,MAAM,EAAE,mCAAuB,EAAE,8BAAc,CAAC,oBAAoB,CAAC,EAAE,gCAAgB,CAAC,oBAAoB,CAAC,EAAE,YAAY,CAAC;CACpM,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAI,4BAAgB,CAChD,iCAAiC,EACjC,sBAAO,EACP,iCAAqB,EACrB,UAAU,EACV;IACI,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,4BAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,iCAAiC,EAAE,gBAAgB,CAAC,CAAC;CAEhH,EACD,gCAAc,EACd,oCAAgB,CACnB,CAAC","sourcesContent":["import { ruleMigrations } from './rule-migrations';\nimport { safeguardCatalog } from './safeguard-catalog';\nimport { optionalTuning, recommendedSeeds } from './rule-settings';\nimport { OwnedRuleDefinition, RuleContribution, RulePackManifest, RULE_PACK_API_VERSION, RULE_SCHEMA_API_VERSION } from '@webpieces/rules-sdk';\nimport { BranchCreationGuardConfig, PrLifecycleGuardConfig } from './configs/rule-configs';\nimport { BranchStateGuardConfig } from './configs/main-sync-guard-configs';\nimport { version } from '../package.json';\n\n/** Workflow policies own their concrete configuration schema. */\nconst ownedRules = [\n new OwnedRuleDefinition('branch-creation-guard', BranchCreationGuardConfig.SCHEMA, RULE_SCHEMA_API_VERSION, optionalTuning['branch-creation-guard'], recommendedSeeds['branch-creation-guard'], 'hookGuards'),\n new OwnedRuleDefinition('pr-lifecycle-guard', PrLifecycleGuardConfig.SCHEMA, RULE_SCHEMA_API_VERSION, optionalTuning['pr-lifecycle-guard'], recommendedSeeds['pr-lifecycle-guard'], 'hookGuards'),\n new OwnedRuleDefinition('branch-state-guard', BranchStateGuardConfig.SCHEMA, RULE_SCHEMA_API_VERSION, optionalTuning['branch-state-guard'], recommendedSeeds['branch-state-guard'], 'hookGuards'),\n];\n\nexport const rulePackManifest = new RulePackManifest(\n '@webpieces/agent-workflow-rules',\n version,\n RULE_PACK_API_VERSION,\n ownedRules,\n [\n ...ownedRules.map(rule => new RuleContribution(rule.id, '@webpieces/agent-workflow-rules', 'workflow-guard')),\n\n ],\n ruleMigrations,\n safeguardCatalog,\n);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigObject } from '@webpieces/rules-sdk';
|
|
2
|
+
/** Optional knobs only. Required behaviour is always supplied by the repository. */
|
|
3
|
+
export declare const optionalTuning: Readonly<Record<string, ConfigObject>>;
|
|
4
|
+
/** Written for review by setup/sync; never used as a loader fallback. */
|
|
5
|
+
export declare const recommendedSeeds: Readonly<Record<string, ConfigObject>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommendedSeeds = exports.optionalTuning = void 0;
|
|
4
|
+
/** Optional knobs only. Required behaviour is always supplied by the repository. */
|
|
5
|
+
exports.optionalTuning = {
|
|
6
|
+
"branch-creation-guard": {},
|
|
7
|
+
"pr-lifecycle-guard": {},
|
|
8
|
+
"branch-state-guard": {}
|
|
9
|
+
};
|
|
10
|
+
/** Written for review by setup/sync; never used as a loader fallback. */
|
|
11
|
+
exports.recommendedSeeds = {
|
|
12
|
+
"branch-creation-guard": {
|
|
13
|
+
"mode": "ON",
|
|
14
|
+
"turnOffRuleUntilEpoch": 0,
|
|
15
|
+
"turnOffRuleWhileOnBranch": null,
|
|
16
|
+
"subBranchNaming": "feature/<ticket>/<short-description>",
|
|
17
|
+
"autoReapMergedBranches": false
|
|
18
|
+
},
|
|
19
|
+
"pr-lifecycle-guard": {
|
|
20
|
+
"mode": "ON",
|
|
21
|
+
"turnOffRuleUntilEpoch": 0,
|
|
22
|
+
"turnOffRuleWhileOnBranch": null
|
|
23
|
+
},
|
|
24
|
+
"branch-state-guard": {
|
|
25
|
+
"mode": "ON",
|
|
26
|
+
"turnOffRuleUntilEpoch": 0,
|
|
27
|
+
"turnOffRuleWhileOnBranch": null,
|
|
28
|
+
"maxCommitsBehind": 5
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=rule-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-settings.js","sourceRoot":"","sources":["../../../../../packages/tooling/agent-workflow-rules/src/rule-settings.ts"],"names":[],"mappings":";;;AAEA,oFAAoF;AACvE,QAAA,cAAc,GAA2C;IAClE,uBAAuB,EAAE,EAAE;IAC3B,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,EAAE;CAC3B,CAAC;AAEF,yEAAyE;AAC5D,QAAA,gBAAgB,GAA2C;IACpE,uBAAuB,EAAE;QACrB,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;QAChC,iBAAiB,EAAE,sCAAsC;QACzD,wBAAwB,EAAE,KAAK;KAClC;IACD,oBAAoB,EAAE;QAClB,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;KACnC;IACD,oBAAoB,EAAE;QAClB,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;QAChC,kBAAkB,EAAE,CAAC;KACxB;CACJ,CAAC","sourcesContent":["import { ConfigObject } from '@webpieces/rules-sdk';\n\n/** Optional knobs only. Required behaviour is always supplied by the repository. */\nexport const optionalTuning: Readonly<Record<string, ConfigObject>> = {\n \"branch-creation-guard\": {},\n \"pr-lifecycle-guard\": {},\n \"branch-state-guard\": {}\n};\n\n/** Written for review by setup/sync; never used as a loader fallback. */\nexport const recommendedSeeds: Readonly<Record<string, ConfigObject>> = {\n \"branch-creation-guard\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"subBranchNaming\": \"feature/<ticket>/<short-description>\",\n \"autoReapMergedBranches\": false\n },\n \"pr-lifecycle-guard\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"branch-state-guard\": {\n \"mode\": \"ON\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"maxCommitsBehind\": 5\n }\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeguardCatalog = void 0;
|
|
4
|
+
const rules_sdk_1 = require("@webpieces/rules-sdk");
|
|
5
|
+
const rules_config_1 = require("@webpieces/rules-config");
|
|
6
|
+
const codex_subagent_guard_1 = require("./adapters/codex-subagent-guard");
|
|
7
|
+
/** Existing keyless checks, cataloged for discovery without introducing config switches. */
|
|
8
|
+
exports.safeguardCatalog = [
|
|
9
|
+
...Object.values(rules_config_1.L0_FAULT_NAMES).map(id => new rules_sdk_1.SafeguardDefinition(id, 'fixed', 'L0 tooling integrity; enforced by the managed shim and workflow hook.')),
|
|
10
|
+
new rules_sdk_1.SafeguardDefinition(codex_subagent_guard_1.CODEX_SUBAGENT_RULE, 'fixed', 'Protect the shared coordinator tree and require reviewer verdicts through wp-write-review.'),
|
|
11
|
+
new rules_sdk_1.SafeguardDefinition('commit-message-substitution-guard', 'fixed', 'Reject shell substitution in commit messages.'),
|
|
12
|
+
new rules_sdk_1.SafeguardDefinition('build-output-pipe-guard', 'fixed', 'Preserve build evidence instead of piping away its output.'),
|
|
13
|
+
new rules_sdk_1.SafeguardDefinition('wait-spin-guard', 'fixed', 'Reject shell wait loops that spin without progress.'),
|
|
14
|
+
new rules_sdk_1.SafeguardDefinition('whole-repo-build-guard', 'experimental', 'Opt in through experimental.whole-repo-build-guard in the optional machine-local config.'),
|
|
15
|
+
];
|
|
16
|
+
//# sourceMappingURL=safeguard-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeguard-catalog.js","sourceRoot":"","sources":["../../../../../packages/tooling/agent-workflow-rules/src/safeguard-catalog.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,0DAAyD;AACzD,0EAAsE;AAEtE,4FAA4F;AAC/E,QAAA,gBAAgB,GAAmC;IAC5D,GAAG,MAAM,CAAC,MAAM,CAAC,6BAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,+BAAmB,CAAC,EAAE,EAAE,OAAO,EAAE,uEAAuE,CAAC,CAAC;IACzJ,IAAI,+BAAmB,CAAC,0CAAmB,EAAE,OAAO,EAAE,4FAA4F,CAAC;IACnJ,IAAI,+BAAmB,CAAC,mCAAmC,EAAE,OAAO,EAAE,+CAA+C,CAAC;IACtH,IAAI,+BAAmB,CAAC,yBAAyB,EAAE,OAAO,EAAE,4DAA4D,CAAC;IACzH,IAAI,+BAAmB,CAAC,iBAAiB,EAAE,OAAO,EAAE,qDAAqD,CAAC;IAC1G,IAAI,+BAAmB,CAAC,wBAAwB,EAAE,cAAc,EAAE,0FAA0F,CAAC;CAChK,CAAC","sourcesContent":["import { SafeguardDefinition } from '@webpieces/rules-sdk';\nimport { L0_FAULT_NAMES } from '@webpieces/rules-config';\nimport { CODEX_SUBAGENT_RULE } from './adapters/codex-subagent-guard';\n\n/** Existing keyless checks, cataloged for discovery without introducing config switches. */\nexport const safeguardCatalog: readonly SafeguardDefinition[] = [\n ...Object.values(L0_FAULT_NAMES).map(id => new SafeguardDefinition(id, 'fixed', 'L0 tooling integrity; enforced by the managed shim and workflow hook.')),\n new SafeguardDefinition(CODEX_SUBAGENT_RULE, 'fixed', 'Protect the shared coordinator tree and require reviewer verdicts through wp-write-review.'),\n new SafeguardDefinition('commit-message-substitution-guard', 'fixed', 'Reject shell substitution in commit messages.'),\n new SafeguardDefinition('build-output-pipe-guard', 'fixed', 'Preserve build evidence instead of piping away its output.'),\n new SafeguardDefinition('wait-spin-guard', 'fixed', 'Reject shell wait loops that spin without progress.'),\n new SafeguardDefinition('whole-repo-build-guard', 'experimental', 'Opt in through experimental.whole-repo-build-guard in the optional machine-local config.'),\n];\n"]}
|