@deftai/directive 0.126.0-beta.2 → 0.126.0
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/dist/agents-refresh.d.ts +11 -0
- package/dist/agents-refresh.js +90 -0
- package/dist/authz.d.ts +7 -0
- package/dist/authz.js +732 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.js +3 -4333
- package/dist/branch-fixtures.d.ts +45 -0
- package/dist/branch-fixtures.js +156 -0
- package/dist/cache.d.ts +4 -0
- package/dist/cache.js +10 -0
- package/dist/capacity-backfill.d.ts +3 -0
- package/dist/capacity-backfill.js +9 -0
- package/dist/capacity-show.d.ts +3 -0
- package/dist/capacity-show.js +9 -0
- package/dist/change-init.d.ts +3 -0
- package/dist/change-init.js +59 -0
- package/dist/changelog-check.d.ts +3 -0
- package/dist/changelog-check.js +52 -0
- package/dist/check.d.ts +15 -0
- package/dist/check.js +150 -0
- package/dist/cli-package-version.d.ts +3 -0
- package/dist/cli-package-version.js +23 -0
- package/dist/cli-router/index.d.ts +8 -0
- package/dist/cli-router/index.js +44 -0
- package/dist/cli-router/route-argv.d.ts +40 -0
- package/dist/cli-router/route-argv.js +371 -0
- package/dist/codebase-default-extractor.d.ts +3 -0
- package/dist/codebase-default-extractor.js +9 -0
- package/dist/codebase-map-fresh.d.ts +3 -0
- package/dist/codebase-map-fresh.js +9 -0
- package/dist/codebase-map.d.ts +3 -0
- package/dist/codebase-map.js +9 -0
- package/dist/codebase-projection-registry.d.ts +3 -0
- package/dist/codebase-projection-registry.js +9 -0
- package/dist/codebase-provider.d.ts +3 -0
- package/dist/codebase-provider.js +9 -0
- package/dist/commit-lint.d.ts +3 -0
- package/dist/commit-lint.js +44 -0
- package/dist/content-validate-cli/validate-links.d.ts +11 -0
- package/dist/content-validate-cli/validate-links.js +37 -0
- package/dist/content-validate-cli/validate-strategy-output.d.ts +13 -0
- package/dist/content-validate-cli/validate-strategy-output.js +56 -0
- package/dist/content-validate-cli/verify-capacity.d.ts +12 -0
- package/dist/content-validate-cli/verify-capacity.js +54 -0
- package/dist/coverage-hotspots.d.ts +21 -0
- package/dist/coverage-hotspots.js +198 -0
- package/dist/design-critique-spend-resolve.d.ts +18 -0
- package/dist/design-critique-spend-resolve.js +191 -0
- package/dist/directive-finish-loop.d.ts +3 -0
- package/dist/directive-finish-loop.js +10 -0
- package/dist/dispatch.d.ts +193 -0
- package/dist/dispatch.js +3091 -0
- package/dist/doctor.d.ts +19 -0
- package/dist/doctor.js +155 -0
- package/dist/entrypoint.d.ts +6 -0
- package/dist/entrypoint.js +19 -0
- package/dist/escalation-cli.d.ts +4 -0
- package/dist/escalation-cli.js +301 -0
- package/dist/eval-health.d.ts +13 -0
- package/dist/eval-health.js +63 -0
- package/dist/eval-report.d.ts +15 -0
- package/dist/eval-report.js +97 -0
- package/dist/eval-run.d.ts +17 -0
- package/dist/eval-run.js +122 -0
- package/dist/eval-triggers.d.ts +12 -0
- package/dist/eval-triggers.js +56 -0
- package/dist/framework-check-updates.d.ts +10 -0
- package/dist/framework-check-updates.js +68 -0
- package/dist/gates-cli/_helpers.d.ts +24 -0
- package/dist/gates-cli/_helpers.js +115 -0
- package/dist/gates-cli/verify-bridge-drift.d.ts +11 -0
- package/dist/gates-cli/verify-bridge-drift.js +47 -0
- package/dist/gates-cli/verify-go-freeze.d.ts +11 -0
- package/dist/gates-cli/verify-go-freeze.js +48 -0
- package/dist/hook-bin.d.ts +3 -0
- package/dist/hook-bin.js +11 -0
- package/dist/hook-dispatch.d.ts +80 -0
- package/dist/hook-dispatch.js +186 -0
- package/dist/human-presence-mint.d.ts +70 -0
- package/dist/human-presence-mint.js +204 -0
- package/dist/identity-banner.d.ts +13 -0
- package/dist/identity-banner.js +19 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +14 -0
- package/dist/init-cli/constants.d.ts +42 -0
- package/dist/init-cli/constants.js +42 -0
- package/dist/init-cli/help.d.ts +9 -0
- package/dist/init-cli/help.js +43 -0
- package/dist/init-cli/init.d.ts +26 -0
- package/dist/init-cli/init.js +80 -0
- package/dist/init-cli/migrate.d.ts +3 -0
- package/dist/init-cli/migrate.js +51 -0
- package/dist/init-cli/resolve-binary.d.ts +34 -0
- package/dist/init-cli/resolve-binary.js +78 -0
- package/dist/init-cli/run-deft-install.d.ts +23 -0
- package/dist/init-cli/run-deft-install.js +71 -0
- package/dist/init-cli/update.d.ts +5 -0
- package/dist/init-cli/update.js +38 -0
- package/dist/install-cli/coverage-map.d.ts +14 -0
- package/dist/install-cli/coverage-map.js +113 -0
- package/dist/install-uninstall.d.ts +3 -0
- package/dist/install-uninstall.js +44 -0
- package/dist/install-upgrade.d.ts +41 -0
- package/dist/install-upgrade.js +86 -0
- package/dist/lifecycle-cli/coverage-map.d.ts +16 -0
- package/dist/lifecycle-cli/coverage-map.js +254 -0
- package/dist/lifecycle-cli/helpers.d.ts +8 -0
- package/dist/lifecycle-cli/helpers.js +20 -0
- package/dist/lifecycle-event.d.ts +11 -0
- package/dist/lifecycle-event.js +45 -0
- package/dist/lifecycle-stats.d.ts +12 -0
- package/dist/lifecycle-stats.js +100 -0
- package/dist/migrate-category-b.d.ts +9 -0
- package/dist/migrate-category-b.js +52 -0
- package/dist/migrate-preflight.d.ts +10 -0
- package/dist/migrate-preflight.js +85 -0
- package/dist/migrate-xbrief.d.ts +11 -0
- package/dist/migrate-xbrief.js +88 -0
- package/dist/occupancy-grant.d.ts +18 -0
- package/dist/occupancy-grant.js +121 -0
- package/dist/occupancy-heartbeat.d.ts +8 -0
- package/dist/occupancy-heartbeat.js +63 -0
- package/dist/occupancy-release.d.ts +23 -0
- package/dist/occupancy-release.js +102 -0
- package/dist/occupancy-steal.d.ts +10 -0
- package/dist/occupancy-steal.js +83 -0
- package/dist/occupancy-unrecognized.d.ts +3 -0
- package/dist/occupancy-unrecognized.js +5 -0
- package/dist/orchestration-cli/coverage-map.d.ts +21 -0
- package/dist/orchestration-cli/coverage-map.js +225 -0
- package/dist/orchestration-cli/helpers.d.ts +11 -0
- package/dist/orchestration-cli/helpers.js +35 -0
- package/dist/ownership-doctor.d.ts +10 -0
- package/dist/ownership-doctor.js +96 -0
- package/dist/ownership-fix.d.ts +10 -0
- package/dist/ownership-fix.js +93 -0
- package/dist/plan-sequence.d.ts +14 -0
- package/dist/plan-sequence.js +258 -0
- package/dist/policy-fixtures.d.ts +33 -0
- package/dist/policy-fixtures.js +118 -0
- package/dist/policy.d.ts +37 -0
- package/dist/policy.js +744 -0
- package/dist/pr-closing-keywords.d.ts +3 -0
- package/dist/pr-closing-keywords.js +10 -0
- package/dist/pr-finish-loop.d.ts +3 -0
- package/dist/pr-finish-loop.js +10 -0
- package/dist/pr-merge-readiness.d.ts +3 -0
- package/dist/pr-merge-readiness.js +10 -0
- package/dist/pr-monitor.d.ts +3 -0
- package/dist/pr-monitor.js +10 -0
- package/dist/pr-protected-issues.d.ts +3 -0
- package/dist/pr-protected-issues.js +10 -0
- package/dist/pr-wait-mergeable.d.ts +3 -0
- package/dist/pr-wait-mergeable.js +10 -0
- package/dist/pr-watch.d.ts +3 -0
- package/dist/pr-watch.js +10 -0
- package/dist/pre-pr-run.d.ts +39 -0
- package/dist/pre-pr-run.js +514 -0
- package/dist/preflight-cache.d.ts +18 -0
- package/dist/preflight-cache.js +113 -0
- package/dist/preflight-gh.d.ts +15 -0
- package/dist/preflight-gh.js +143 -0
- package/dist/probe-session.d.ts +3 -0
- package/dist/probe-session.js +10 -0
- package/dist/release-e2e-fixtures.d.ts +29 -0
- package/dist/release-e2e-fixtures.js +38 -0
- package/dist/release-e2e.d.ts +3 -0
- package/dist/release-e2e.js +10 -0
- package/dist/release-publish.d.ts +3 -0
- package/dist/release-publish.js +10 -0
- package/dist/release-rollback.d.ts +3 -0
- package/dist/release-rollback.js +10 -0
- package/dist/release-wait-npm.d.ts +3 -0
- package/dist/release-wait-npm.js +10 -0
- package/dist/release.d.ts +3 -0
- package/dist/release.js +10 -0
- package/dist/render-cli/deft-ts-runner.d.ts +17 -0
- package/dist/render-cli/deft-ts-runner.js +19 -0
- package/dist/render-cli/export-spec-cli.d.ts +2 -0
- package/dist/render-cli/export-spec-cli.js +6 -0
- package/dist/render-cli/prd-render-cli.d.ts +2 -0
- package/dist/render-cli/prd-render-cli.js +37 -0
- package/dist/render-cli/project-render-cli.d.ts +2 -0
- package/dist/render-cli/project-render-cli.js +6 -0
- package/dist/render-cli/rule-map-cli.d.ts +2 -0
- package/dist/render-cli/rule-map-cli.js +5 -0
- package/dist/render-cli/spec-reconstruct-cli.d.ts +3 -0
- package/dist/render-cli/spec-reconstruct-cli.js +15 -0
- package/dist/render-cli/spec-render-cli.d.ts +2 -0
- package/dist/render-cli/spec-render-cli.js +39 -0
- package/dist/render-cli/spec-validate-cli.d.ts +2 -0
- package/dist/render-cli/spec-validate-cli.js +38 -0
- package/dist/review-monitor-register.d.ts +19 -0
- package/dist/review-monitor-register.js +183 -0
- package/dist/review-monitor-release.d.ts +14 -0
- package/dist/review-monitor-release.js +123 -0
- package/dist/scm-sync-default.d.ts +34 -0
- package/dist/scm-sync-default.js +210 -0
- package/dist/scope-lifecycle.d.ts +4 -0
- package/dist/scope-lifecycle.js +34 -0
- package/dist/scope-record-approved-scope.d.ts +29 -0
- package/dist/scope-record-approved-scope.js +319 -0
- package/dist/scope-record-intent-constraint.d.ts +16 -0
- package/dist/scope-record-intent-constraint.js +202 -0
- package/dist/scope-record-observable-scope.d.ts +16 -0
- package/dist/scope-record-observable-scope.js +204 -0
- package/dist/session-ready.d.ts +15 -0
- package/dist/session-ready.js +144 -0
- package/dist/session-start.d.ts +56 -0
- package/dist/session-start.js +581 -0
- package/dist/slice.d.ts +4 -0
- package/dist/slice.js +34 -0
- package/dist/story-ready-fixtures.d.ts +47 -0
- package/dist/story-ready-fixtures.js +137 -0
- package/dist/subagent-monitor.d.ts +3 -0
- package/dist/subagent-monitor.js +10 -0
- package/dist/subagent-pre-cancel.d.ts +21 -0
- package/dist/subagent-pre-cancel.js +240 -0
- package/dist/subagent-steer-write.d.ts +41 -0
- package/dist/subagent-steer-write.js +333 -0
- package/dist/toolchain-check.d.ts +8 -0
- package/dist/toolchain-check.js +54 -0
- package/dist/triage-actions.d.ts +23 -0
- package/dist/triage-actions.js +233 -0
- package/dist/triage-aux-a-fixtures.d.ts +33 -0
- package/dist/triage-aux-a-fixtures.js +107 -0
- package/dist/triage-aux-b-fixtures.d.ts +30 -0
- package/dist/triage-aux-b-fixtures.js +167 -0
- package/dist/triage-bootstrap-fixtures.d.ts +42 -0
- package/dist/triage-bootstrap-fixtures.js +139 -0
- package/dist/triage-bootstrap.d.ts +24 -0
- package/dist/triage-bootstrap.js +175 -0
- package/dist/triage-bulk.d.ts +17 -0
- package/dist/triage-bulk.js +154 -0
- package/dist/triage-classify-fixtures.d.ts +38 -0
- package/dist/triage-classify-fixtures.js +137 -0
- package/dist/triage-classify.d.ts +45 -0
- package/dist/triage-classify.js +287 -0
- package/dist/triage-evaluate.d.ts +14 -0
- package/dist/triage-evaluate.js +153 -0
- package/dist/triage-help.d.ts +3 -0
- package/dist/triage-help.js +10 -0
- package/dist/triage-queue-fixtures.d.ts +59 -0
- package/dist/triage-queue-fixtures.js +284 -0
- package/dist/triage-queue.d.ts +38 -0
- package/dist/triage-queue.js +391 -0
- package/dist/triage-reconcile.d.ts +11 -0
- package/dist/triage-reconcile.js +76 -0
- package/dist/triage-refresh.d.ts +7 -0
- package/dist/triage-refresh.js +37 -0
- package/dist/triage-scope-drift.d.ts +12 -0
- package/dist/triage-scope-drift.js +117 -0
- package/dist/triage-scope-fixtures.d.ts +32 -0
- package/dist/triage-scope-fixtures.js +131 -0
- package/dist/triage-scope.d.ts +4 -0
- package/dist/triage-scope.js +34 -0
- package/dist/triage-smoketest.d.ts +3 -0
- package/dist/triage-smoketest.js +43 -0
- package/dist/triage-strip-withdrawn.d.ts +21 -0
- package/dist/triage-strip-withdrawn.js +102 -0
- package/dist/triage-subscribe.d.ts +15 -0
- package/dist/triage-subscribe.js +157 -0
- package/dist/triage-summary.d.ts +14 -0
- package/dist/triage-summary.js +83 -0
- package/dist/triage-welcome.d.ts +14 -0
- package/dist/triage-welcome.js +121 -0
- package/dist/ts-check-lane.d.ts +9 -0
- package/dist/ts-check-lane.js +49 -0
- package/dist/umbrella-current-shape.d.ts +9 -0
- package/dist/umbrella-current-shape.js +56 -0
- package/dist/vbrief-activate.d.ts +3 -0
- package/dist/vbrief-activate.js +7 -0
- package/dist/vbrief-build.d.ts +3 -0
- package/dist/vbrief-build.js +8 -0
- package/dist/vbrief-preflight-fixtures.d.ts +32 -0
- package/dist/vbrief-preflight-fixtures.js +79 -0
- package/dist/vbrief-preflight.d.ts +13 -0
- package/dist/vbrief-preflight.js +141 -0
- package/dist/vbrief-reconcile.d.ts +3 -0
- package/dist/vbrief-reconcile.js +7 -0
- package/dist/vbrief-validate.d.ts +3 -0
- package/dist/vbrief-validate.js +8 -0
- package/dist/vbrief-validation.d.ts +3 -0
- package/dist/vbrief-validation.js +8 -0
- package/dist/verify-ac.d.ts +28 -0
- package/dist/verify-ac.js +439 -0
- package/dist/verify-agents-md-advisory.d.ts +19 -0
- package/dist/verify-agents-md-advisory.js +65 -0
- package/dist/verify-agents-md-budget.d.ts +12 -0
- package/dist/verify-agents-md-budget.js +71 -0
- package/dist/verify-branch.d.ts +14 -0
- package/dist/verify-branch.js +81 -0
- package/dist/verify-class-checks.d.ts +11 -0
- package/dist/verify-class-checks.js +71 -0
- package/dist/verify-cohort-review-monitors.d.ts +5 -0
- package/dist/verify-cohort-review-monitors.js +11 -0
- package/dist/verify-completed-tracked.d.ts +19 -0
- package/dist/verify-completed-tracked.js +202 -0
- package/dist/verify-completed-write-guard.d.ts +13 -0
- package/dist/verify-completed-write-guard.js +84 -0
- package/dist/verify-consumer-check-contract.d.ts +12 -0
- package/dist/verify-consumer-check-contract.js +70 -0
- package/dist/verify-consumer-header-placeholder.d.ts +12 -0
- package/dist/verify-consumer-header-placeholder.js +73 -0
- package/dist/verify-consumer-test-lane.d.ts +12 -0
- package/dist/verify-consumer-test-lane.js +57 -0
- package/dist/verify-durable-effect-acquisition.d.ts +13 -0
- package/dist/verify-durable-effect-acquisition.js +70 -0
- package/dist/verify-encoding.d.ts +15 -0
- package/dist/verify-encoding.js +83 -0
- package/dist/verify-eval-health-relocation.d.ts +16 -0
- package/dist/verify-eval-health-relocation.js +93 -0
- package/dist/verify-eval-triggers-relocation.d.ts +14 -0
- package/dist/verify-eval-triggers-relocation.js +74 -0
- package/dist/verify-evaluator-surface.d.ts +15 -0
- package/dist/verify-evaluator-surface.js +87 -0
- package/dist/verify-forward-coverage.d.ts +19 -0
- package/dist/verify-forward-coverage.js +144 -0
- package/dist/verify-hooks-installed.d.ts +24 -0
- package/dist/verify-hooks-installed.js +140 -0
- package/dist/verify-intent-constraint.d.ts +15 -0
- package/dist/verify-intent-constraint.js +86 -0
- package/dist/verify-investigation.d.ts +3 -0
- package/dist/verify-investigation.js +10 -0
- package/dist/verify-judgment-gates.d.ts +3 -0
- package/dist/verify-judgment-gates.js +10 -0
- package/dist/verify-l4-owner.d.ts +15 -0
- package/dist/verify-l4-owner.js +132 -0
- package/dist/verify-lifecycle-visible.d.ts +13 -0
- package/dist/verify-lifecycle-visible.js +68 -0
- package/dist/verify-literal-ac.d.ts +14 -0
- package/dist/verify-literal-ac.js +168 -0
- package/dist/verify-no-task-runtime.d.ts +3 -0
- package/dist/verify-no-task-runtime.js +16 -0
- package/dist/verify-observable-scope.d.ts +15 -0
- package/dist/verify-observable-scope.js +86 -0
- package/dist/verify-operator-scope-limit.d.ts +17 -0
- package/dist/verify-operator-scope-limit.js +285 -0
- package/dist/verify-orphan-active.d.ts +17 -0
- package/dist/verify-orphan-active.js +135 -0
- package/dist/verify-ownership.d.ts +10 -0
- package/dist/verify-ownership.js +90 -0
- package/dist/verify-persisted-planning-narratives.d.ts +12 -0
- package/dist/verify-persisted-planning-narratives.js +82 -0
- package/dist/verify-plan-sequence.d.ts +14 -0
- package/dist/verify-plan-sequence.js +138 -0
- package/dist/verify-pr-closeout-attestable.d.ts +15 -0
- package/dist/verify-pr-closeout-attestable.js +114 -0
- package/dist/verify-presentation-ceiling.d.ts +11 -0
- package/dist/verify-presentation-ceiling.js +71 -0
- package/dist/verify-presentation-coverage.d.ts +14 -0
- package/dist/verify-presentation-coverage.js +90 -0
- package/dist/verify-review-monitor.d.ts +25 -0
- package/dist/verify-review-monitor.js +341 -0
- package/dist/verify-scope-provenance.d.ts +16 -0
- package/dist/verify-scope-provenance.js +91 -0
- package/dist/verify-session-ritual.d.ts +23 -0
- package/dist/verify-session-ritual.js +144 -0
- package/dist/verify-source-cli/rule-ownership-lint.d.ts +12 -0
- package/dist/verify-source-cli/rule-ownership-lint.js +61 -0
- package/dist/verify-source-cli/verify-biome-config.d.ts +11 -0
- package/dist/verify-source-cli/verify-biome-config.js +46 -0
- package/dist/verify-source-cli/verify-closing-keywords.d.ts +35 -0
- package/dist/verify-source-cli/verify-closing-keywords.js +139 -0
- package/dist/verify-source-cli/verify-consumer-hard-stops.d.ts +16 -0
- package/dist/verify-source-cli/verify-consumer-hard-stops.js +99 -0
- package/dist/verify-source-cli/verify-contained-writes.d.ts +13 -0
- package/dist/verify-source-cli/verify-contained-writes.js +67 -0
- package/dist/verify-source-cli/verify-content-manifest.d.ts +12 -0
- package/dist/verify-source-cli/verify-content-manifest.js +61 -0
- package/dist/verify-source-cli/verify-contract-drift.d.ts +11 -0
- package/dist/verify-source-cli/verify-contract-drift.js +47 -0
- package/dist/verify-source-cli/verify-cursor-tier1.d.ts +12 -0
- package/dist/verify-source-cli/verify-cursor-tier1.js +51 -0
- package/dist/verify-source-cli/verify-deposit-closure.d.ts +12 -0
- package/dist/verify-source-cli/verify-deposit-closure.js +52 -0
- package/dist/verify-source-cli/verify-openclaw-tier1.d.ts +12 -0
- package/dist/verify-source-cli/verify-openclaw-tier1.js +51 -0
- package/dist/verify-source-cli/verify-scm-boundary.d.ts +13 -0
- package/dist/verify-source-cli/verify-scm-boundary.js +66 -0
- package/dist/verify-source-cli/verify-semantic-single-source.d.ts +11 -0
- package/dist/verify-source-cli/verify-semantic-single-source.js +49 -0
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.d.ts +11 -0
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.js +46 -0
- package/dist/verify-source-cli/verify-spec-drift.d.ts +3 -0
- package/dist/verify-source-cli/verify-spec-drift.js +15 -0
- package/dist/verify-source-cli/verify-spec-prd-fresh.d.ts +3 -0
- package/dist/verify-source-cli/verify-spec-prd-fresh.js +15 -0
- package/dist/verify-source-cli/verify-stubs.d.ts +11 -0
- package/dist/verify-source-cli/verify-stubs.js +27 -0
- package/dist/verify-source-cli/verify-telemetry-coverage.d.ts +13 -0
- package/dist/verify-source-cli/verify-telemetry-coverage.js +67 -0
- package/dist/verify-source-cli/verify-xbrief-drift.d.ts +15 -0
- package/dist/verify-source-cli/verify-xbrief-drift.js +80 -0
- package/dist/verify-story-ready.d.ts +18 -0
- package/dist/verify-story-ready.js +190 -0
- package/dist/verify-subagent-alive.d.ts +21 -0
- package/dist/verify-subagent-alive.js +219 -0
- package/dist/verify-subagent-steer.d.ts +19 -0
- package/dist/verify-subagent-steer.js +136 -0
- package/dist/verify-test-boundary.d.ts +12 -0
- package/dist/verify-test-boundary.js +80 -0
- package/dist/verify-tools.d.ts +13 -0
- package/dist/verify-tools.js +67 -0
- package/dist/verify-wip-cap.d.ts +13 -0
- package/dist/verify-wip-cap.js +62 -0
- package/dist/windows-bin-ps1.d.ts +39 -0
- package/dist/windows-bin-ps1.js +226 -0
- package/dist/wip-cap-fixtures.d.ts +37 -0
- package/dist/wip-cap-fixtures.js +122 -0
- package/dist/wsl-ownership-guard.d.ts +2 -0
- package/dist/wsl-ownership-guard.js +15 -0
- package/dist/xbrief-create.d.ts +3 -0
- package/dist/xbrief-create.js +9 -0
- package/dist/xbrief-verify.d.ts +3 -0
- package/dist/xbrief-verify.js +9 -0
- package/package.json +23 -12
- package/scripts/remove-windows-ps1-shims.mjs +26 -0
- package/bin/deft-hook +0 -14
- package/bin/deft-hook.cmd +0 -14
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrCheckClosingKeywords } from "@deftai/directive-core/dist/pr-closing-keywords/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrCheckClosingKeywords(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-closing-keywords.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrFinishLoop } from "@deftai/directive-core/dist/finish-loop/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrFinishLoop(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-finish-loop.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrMergeReadiness } from "@deftai/directive-core/dist/pr-merge-readiness/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrMergeReadiness(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-merge-readiness.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrMonitor } from "@deftai/directive-core/dist/pr-monitor/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrMonitor(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-monitor.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrProtectedIssues } from "@deftai/directive-core/dist/pr-protected-issues/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrProtectedIssues(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-protected-issues.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrWaitMergeable } from "@deftai/directive-core/dist/pr-wait-mergeable/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrWaitMergeable(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-wait-mergeable.js.map
|
package/dist/pr-watch.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { cmdPrWatch } from "@deftai/directive-core/dist/pr-watch/main.js";
|
|
4
|
+
export function run(argv) {
|
|
5
|
+
return cmdPrWatch(argv);
|
|
6
|
+
}
|
|
7
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
8
|
+
process.exit(run(process.argv.slice(2)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pr-watch.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
interface ParsedArgs {
|
|
3
|
+
repo: string;
|
|
4
|
+
baseSha: string;
|
|
5
|
+
headSha: string;
|
|
6
|
+
treeHash: string;
|
|
7
|
+
prBodyHash: string;
|
|
8
|
+
prNodeId: string | null;
|
|
9
|
+
approvedRevision: string;
|
|
10
|
+
scope: string[];
|
|
11
|
+
acceptance: string;
|
|
12
|
+
generation: number;
|
|
13
|
+
skillVersion: string;
|
|
14
|
+
policyVersion: string;
|
|
15
|
+
runId: string | null;
|
|
16
|
+
complete: boolean;
|
|
17
|
+
observeCommand: boolean;
|
|
18
|
+
observeSemantic: boolean;
|
|
19
|
+
phase: string | null;
|
|
20
|
+
command: string;
|
|
21
|
+
exitCode: number | null;
|
|
22
|
+
inputHash: string | null;
|
|
23
|
+
skipReason: string | null;
|
|
24
|
+
suppliedContentsHash: string;
|
|
25
|
+
controllerObservedHash: string;
|
|
26
|
+
criteriaDigest: string | null;
|
|
27
|
+
reviewedFiles: string[];
|
|
28
|
+
reviewerReportRef: string | null;
|
|
29
|
+
markComplete: boolean;
|
|
30
|
+
skillOpen: boolean;
|
|
31
|
+
evaluate: boolean;
|
|
32
|
+
json: boolean;
|
|
33
|
+
help: boolean;
|
|
34
|
+
error?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
37
|
+
export declare function run(argv: string[]): number;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=pre-pr-run.d.ts.map
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Agent-facing pre-PR controller entry (#4912 Limb 3).
|
|
4
|
+
* `deft pre-pr:run` starts the prescribed workflow. Opening the skill file
|
|
5
|
+
* is not completion. Generic mark-complete cannot mint a pass.
|
|
6
|
+
*/
|
|
7
|
+
import { completeRun, computeControllerObservedHash, controllerPublisher, digestApprovedCriteria, evaluateLivePrePrCheck, getDefaultPrePrStore, markComplete, noteSkillFileOpen, observeCommandPhase, PRE_PR_PHASE_IDS, phaseSpec, resolveRecordFromStore, startControllerRun, submitReviewerReport, } from "@deftai/directive-core/pre-pr-controller";
|
|
8
|
+
import { isDirectEntrypoint } from "./entrypoint.js";
|
|
9
|
+
const USAGE = `Usage: deft pre-pr:run [options]
|
|
10
|
+
|
|
11
|
+
Start the repository-controlled pre-PR workflow. Opening the skill file is
|
|
12
|
+
not completion. A generic mark-complete cannot mint a pass.
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--repo <owner/name>
|
|
16
|
+
--base-sha <sha>
|
|
17
|
+
--head-sha <sha>
|
|
18
|
+
--tree-hash <sha>
|
|
19
|
+
--pr-body-hash <hex>
|
|
20
|
+
--pr-node-id <id>
|
|
21
|
+
--approved-revision <sha>
|
|
22
|
+
--scope <path> (repeatable)
|
|
23
|
+
--acceptance <text>
|
|
24
|
+
--generation <n>
|
|
25
|
+
--skill-version <ver>
|
|
26
|
+
--policy-version <ver>
|
|
27
|
+
--run-id <id> lookup hint only
|
|
28
|
+
--complete publisher-backed complete (fails without observables)
|
|
29
|
+
--observe-command record a command-observable phase before --complete
|
|
30
|
+
--observe-semantic record semantic / final-no-change evidence
|
|
31
|
+
--phase <id>
|
|
32
|
+
--command <text>
|
|
33
|
+
--exit-code <n> required with --observe-command; omit is a parse error
|
|
34
|
+
--input-hash <hex>
|
|
35
|
+
--skip-reason <text> skip also requires a non-zero --exit-code
|
|
36
|
+
--supplied-contents-hash <hex>
|
|
37
|
+
--controller-observed-hash <hex>
|
|
38
|
+
optional; must match independently hashed reviewed files
|
|
39
|
+
--criteria-digest <hex>
|
|
40
|
+
--reviewed-file <path> (repeatable)
|
|
41
|
+
--reviewer-report-ref <ref>
|
|
42
|
+
--mark-complete always refuses; cannot mint a pass
|
|
43
|
+
--skill-open always refuses; opening the skill is not completion
|
|
44
|
+
--evaluate evaluate live binding against the private store
|
|
45
|
+
--json
|
|
46
|
+
--help
|
|
47
|
+
`;
|
|
48
|
+
export function parseArgs(argv) {
|
|
49
|
+
const parsed = {
|
|
50
|
+
repo: "",
|
|
51
|
+
baseSha: "",
|
|
52
|
+
headSha: "",
|
|
53
|
+
treeHash: "",
|
|
54
|
+
prBodyHash: "",
|
|
55
|
+
prNodeId: null,
|
|
56
|
+
approvedRevision: "",
|
|
57
|
+
scope: [],
|
|
58
|
+
acceptance: "",
|
|
59
|
+
generation: 1,
|
|
60
|
+
skillVersion: "0.1",
|
|
61
|
+
policyVersion: "1",
|
|
62
|
+
runId: null,
|
|
63
|
+
complete: false,
|
|
64
|
+
observeCommand: false,
|
|
65
|
+
observeSemantic: false,
|
|
66
|
+
phase: null,
|
|
67
|
+
command: "",
|
|
68
|
+
exitCode: null,
|
|
69
|
+
inputHash: null,
|
|
70
|
+
skipReason: null,
|
|
71
|
+
suppliedContentsHash: "",
|
|
72
|
+
controllerObservedHash: "",
|
|
73
|
+
criteriaDigest: null,
|
|
74
|
+
reviewedFiles: [],
|
|
75
|
+
reviewerReportRef: null,
|
|
76
|
+
markComplete: false,
|
|
77
|
+
skillOpen: false,
|
|
78
|
+
evaluate: false,
|
|
79
|
+
json: false,
|
|
80
|
+
help: false,
|
|
81
|
+
};
|
|
82
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
83
|
+
const arg = argv[i];
|
|
84
|
+
if (arg === "--help" || arg === "-h") {
|
|
85
|
+
parsed.help = true;
|
|
86
|
+
}
|
|
87
|
+
else if (arg === "--json") {
|
|
88
|
+
parsed.json = true;
|
|
89
|
+
}
|
|
90
|
+
else if (arg === "--complete") {
|
|
91
|
+
parsed.complete = true;
|
|
92
|
+
}
|
|
93
|
+
else if (arg === "--observe-command") {
|
|
94
|
+
parsed.observeCommand = true;
|
|
95
|
+
}
|
|
96
|
+
else if (arg === "--observe-semantic") {
|
|
97
|
+
parsed.observeSemantic = true;
|
|
98
|
+
}
|
|
99
|
+
else if (arg === "--phase" || arg?.startsWith("--phase=")) {
|
|
100
|
+
const value = arg === "--phase" ? argv[i + 1] : arg.slice("--phase=".length);
|
|
101
|
+
if (value === undefined)
|
|
102
|
+
return { ...parsed, error: "argument --phase: expected one argument" };
|
|
103
|
+
parsed.phase = value;
|
|
104
|
+
if (arg === "--phase")
|
|
105
|
+
i += 1;
|
|
106
|
+
}
|
|
107
|
+
else if (arg === "--command" || arg?.startsWith("--command=")) {
|
|
108
|
+
const value = arg === "--command" ? argv[i + 1] : arg.slice("--command=".length);
|
|
109
|
+
if (value === undefined)
|
|
110
|
+
return { ...parsed, error: "argument --command: expected one argument" };
|
|
111
|
+
parsed.command = value;
|
|
112
|
+
if (arg === "--command")
|
|
113
|
+
i += 1;
|
|
114
|
+
}
|
|
115
|
+
else if (arg === "--exit-code" || arg?.startsWith("--exit-code=")) {
|
|
116
|
+
const value = arg === "--exit-code" ? argv[i + 1] : arg.slice("--exit-code=".length);
|
|
117
|
+
if (value === undefined) {
|
|
118
|
+
return { ...parsed, error: "argument --exit-code: expected one argument" };
|
|
119
|
+
}
|
|
120
|
+
const n = Number.parseInt(value, 10);
|
|
121
|
+
if (!Number.isFinite(n)) {
|
|
122
|
+
return { ...parsed, error: "argument --exit-code: expected an integer" };
|
|
123
|
+
}
|
|
124
|
+
parsed.exitCode = n;
|
|
125
|
+
if (arg === "--exit-code")
|
|
126
|
+
i += 1;
|
|
127
|
+
}
|
|
128
|
+
else if (arg === "--input-hash" || arg?.startsWith("--input-hash=")) {
|
|
129
|
+
const value = arg === "--input-hash" ? argv[i + 1] : arg.slice("--input-hash=".length);
|
|
130
|
+
if (value === undefined) {
|
|
131
|
+
return { ...parsed, error: "argument --input-hash: expected one argument" };
|
|
132
|
+
}
|
|
133
|
+
parsed.inputHash = value;
|
|
134
|
+
if (arg === "--input-hash")
|
|
135
|
+
i += 1;
|
|
136
|
+
}
|
|
137
|
+
else if (arg === "--skip-reason" || arg?.startsWith("--skip-reason=")) {
|
|
138
|
+
const value = arg === "--skip-reason" ? argv[i + 1] : arg.slice("--skip-reason=".length);
|
|
139
|
+
if (value === undefined) {
|
|
140
|
+
return { ...parsed, error: "argument --skip-reason: expected one argument" };
|
|
141
|
+
}
|
|
142
|
+
parsed.skipReason = value;
|
|
143
|
+
if (arg === "--skip-reason")
|
|
144
|
+
i += 1;
|
|
145
|
+
}
|
|
146
|
+
else if (arg === "--supplied-contents-hash" || arg?.startsWith("--supplied-contents-hash=")) {
|
|
147
|
+
const value = arg === "--supplied-contents-hash"
|
|
148
|
+
? argv[i + 1]
|
|
149
|
+
: arg.slice("--supplied-contents-hash=".length);
|
|
150
|
+
if (value === undefined) {
|
|
151
|
+
return { ...parsed, error: "argument --supplied-contents-hash: expected one argument" };
|
|
152
|
+
}
|
|
153
|
+
parsed.suppliedContentsHash = value;
|
|
154
|
+
if (arg === "--supplied-contents-hash")
|
|
155
|
+
i += 1;
|
|
156
|
+
}
|
|
157
|
+
else if (arg === "--controller-observed-hash" ||
|
|
158
|
+
arg?.startsWith("--controller-observed-hash=")) {
|
|
159
|
+
const value = arg === "--controller-observed-hash"
|
|
160
|
+
? argv[i + 1]
|
|
161
|
+
: arg.slice("--controller-observed-hash=".length);
|
|
162
|
+
if (value === undefined) {
|
|
163
|
+
return {
|
|
164
|
+
...parsed,
|
|
165
|
+
error: "argument --controller-observed-hash: expected one argument",
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
parsed.controllerObservedHash = value;
|
|
169
|
+
if (arg === "--controller-observed-hash")
|
|
170
|
+
i += 1;
|
|
171
|
+
}
|
|
172
|
+
else if (arg === "--criteria-digest" || arg?.startsWith("--criteria-digest=")) {
|
|
173
|
+
const value = arg === "--criteria-digest" ? argv[i + 1] : arg.slice("--criteria-digest=".length);
|
|
174
|
+
if (value === undefined) {
|
|
175
|
+
return { ...parsed, error: "argument --criteria-digest: expected one argument" };
|
|
176
|
+
}
|
|
177
|
+
parsed.criteriaDigest = value;
|
|
178
|
+
if (arg === "--criteria-digest")
|
|
179
|
+
i += 1;
|
|
180
|
+
}
|
|
181
|
+
else if (arg === "--reviewed-file" || arg?.startsWith("--reviewed-file=")) {
|
|
182
|
+
const value = arg === "--reviewed-file" ? argv[i + 1] : arg.slice("--reviewed-file=".length);
|
|
183
|
+
if (value === undefined) {
|
|
184
|
+
return { ...parsed, error: "argument --reviewed-file: expected one argument" };
|
|
185
|
+
}
|
|
186
|
+
parsed.reviewedFiles.push(value);
|
|
187
|
+
if (arg === "--reviewed-file")
|
|
188
|
+
i += 1;
|
|
189
|
+
}
|
|
190
|
+
else if (arg === "--reviewer-report-ref" || arg?.startsWith("--reviewer-report-ref=")) {
|
|
191
|
+
const value = arg === "--reviewer-report-ref" ? argv[i + 1] : arg.slice("--reviewer-report-ref=".length);
|
|
192
|
+
if (value === undefined) {
|
|
193
|
+
return { ...parsed, error: "argument --reviewer-report-ref: expected one argument" };
|
|
194
|
+
}
|
|
195
|
+
parsed.reviewerReportRef = value;
|
|
196
|
+
if (arg === "--reviewer-report-ref")
|
|
197
|
+
i += 1;
|
|
198
|
+
}
|
|
199
|
+
else if (arg === "--mark-complete") {
|
|
200
|
+
parsed.markComplete = true;
|
|
201
|
+
}
|
|
202
|
+
else if (arg === "--skill-open") {
|
|
203
|
+
parsed.skillOpen = true;
|
|
204
|
+
}
|
|
205
|
+
else if (arg === "--evaluate") {
|
|
206
|
+
parsed.evaluate = true;
|
|
207
|
+
}
|
|
208
|
+
else if (arg === "--repo" || arg?.startsWith("--repo=")) {
|
|
209
|
+
const value = arg === "--repo" ? argv[i + 1] : arg.slice("--repo=".length);
|
|
210
|
+
if (value === undefined)
|
|
211
|
+
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
212
|
+
parsed.repo = value;
|
|
213
|
+
if (arg === "--repo")
|
|
214
|
+
i += 1;
|
|
215
|
+
}
|
|
216
|
+
else if (arg === "--base-sha" || arg?.startsWith("--base-sha=")) {
|
|
217
|
+
const value = arg === "--base-sha" ? argv[i + 1] : arg.slice("--base-sha=".length);
|
|
218
|
+
if (value === undefined)
|
|
219
|
+
return { ...parsed, error: "argument --base-sha: expected one argument" };
|
|
220
|
+
parsed.baseSha = value;
|
|
221
|
+
if (arg === "--base-sha")
|
|
222
|
+
i += 1;
|
|
223
|
+
}
|
|
224
|
+
else if (arg === "--head-sha" || arg?.startsWith("--head-sha=")) {
|
|
225
|
+
const value = arg === "--head-sha" ? argv[i + 1] : arg.slice("--head-sha=".length);
|
|
226
|
+
if (value === undefined)
|
|
227
|
+
return { ...parsed, error: "argument --head-sha: expected one argument" };
|
|
228
|
+
parsed.headSha = value;
|
|
229
|
+
if (arg === "--head-sha")
|
|
230
|
+
i += 1;
|
|
231
|
+
}
|
|
232
|
+
else if (arg === "--tree-hash" || arg?.startsWith("--tree-hash=")) {
|
|
233
|
+
const value = arg === "--tree-hash" ? argv[i + 1] : arg.slice("--tree-hash=".length);
|
|
234
|
+
if (value === undefined)
|
|
235
|
+
return { ...parsed, error: "argument --tree-hash: expected one argument" };
|
|
236
|
+
parsed.treeHash = value;
|
|
237
|
+
if (arg === "--tree-hash")
|
|
238
|
+
i += 1;
|
|
239
|
+
}
|
|
240
|
+
else if (arg === "--pr-body-hash" || arg?.startsWith("--pr-body-hash=")) {
|
|
241
|
+
const value = arg === "--pr-body-hash" ? argv[i + 1] : arg.slice("--pr-body-hash=".length);
|
|
242
|
+
if (value === undefined) {
|
|
243
|
+
return { ...parsed, error: "argument --pr-body-hash: expected one argument" };
|
|
244
|
+
}
|
|
245
|
+
parsed.prBodyHash = value;
|
|
246
|
+
if (arg === "--pr-body-hash")
|
|
247
|
+
i += 1;
|
|
248
|
+
}
|
|
249
|
+
else if (arg === "--pr-node-id" || arg?.startsWith("--pr-node-id=")) {
|
|
250
|
+
const value = arg === "--pr-node-id" ? argv[i + 1] : arg.slice("--pr-node-id=".length);
|
|
251
|
+
if (value === undefined) {
|
|
252
|
+
return { ...parsed, error: "argument --pr-node-id: expected one argument" };
|
|
253
|
+
}
|
|
254
|
+
parsed.prNodeId = value;
|
|
255
|
+
if (arg === "--pr-node-id")
|
|
256
|
+
i += 1;
|
|
257
|
+
}
|
|
258
|
+
else if (arg === "--approved-revision" || arg?.startsWith("--approved-revision=")) {
|
|
259
|
+
const value = arg === "--approved-revision" ? argv[i + 1] : arg.slice("--approved-revision=".length);
|
|
260
|
+
if (value === undefined) {
|
|
261
|
+
return { ...parsed, error: "argument --approved-revision: expected one argument" };
|
|
262
|
+
}
|
|
263
|
+
parsed.approvedRevision = value;
|
|
264
|
+
if (arg === "--approved-revision")
|
|
265
|
+
i += 1;
|
|
266
|
+
}
|
|
267
|
+
else if (arg === "--scope" || arg?.startsWith("--scope=")) {
|
|
268
|
+
const value = arg === "--scope" ? argv[i + 1] : arg.slice("--scope=".length);
|
|
269
|
+
if (value === undefined)
|
|
270
|
+
return { ...parsed, error: "argument --scope: expected one argument" };
|
|
271
|
+
parsed.scope.push(value);
|
|
272
|
+
if (arg === "--scope")
|
|
273
|
+
i += 1;
|
|
274
|
+
}
|
|
275
|
+
else if (arg === "--acceptance" || arg?.startsWith("--acceptance=")) {
|
|
276
|
+
const value = arg === "--acceptance" ? argv[i + 1] : arg.slice("--acceptance=".length);
|
|
277
|
+
if (value === undefined) {
|
|
278
|
+
return { ...parsed, error: "argument --acceptance: expected one argument" };
|
|
279
|
+
}
|
|
280
|
+
parsed.acceptance = value;
|
|
281
|
+
if (arg === "--acceptance")
|
|
282
|
+
i += 1;
|
|
283
|
+
}
|
|
284
|
+
else if (arg === "--generation" || arg?.startsWith("--generation=")) {
|
|
285
|
+
const value = arg === "--generation" ? argv[i + 1] : arg.slice("--generation=".length);
|
|
286
|
+
if (value === undefined) {
|
|
287
|
+
return { ...parsed, error: "argument --generation: expected one argument" };
|
|
288
|
+
}
|
|
289
|
+
const n = Number.parseInt(value, 10);
|
|
290
|
+
if (!Number.isFinite(n) || n < 1) {
|
|
291
|
+
return { ...parsed, error: "argument --generation: expected a positive integer" };
|
|
292
|
+
}
|
|
293
|
+
parsed.generation = n;
|
|
294
|
+
if (arg === "--generation")
|
|
295
|
+
i += 1;
|
|
296
|
+
}
|
|
297
|
+
else if (arg === "--skill-version" || arg?.startsWith("--skill-version=")) {
|
|
298
|
+
const value = arg === "--skill-version" ? argv[i + 1] : arg.slice("--skill-version=".length);
|
|
299
|
+
if (value === undefined) {
|
|
300
|
+
return { ...parsed, error: "argument --skill-version: expected one argument" };
|
|
301
|
+
}
|
|
302
|
+
parsed.skillVersion = value;
|
|
303
|
+
if (arg === "--skill-version")
|
|
304
|
+
i += 1;
|
|
305
|
+
}
|
|
306
|
+
else if (arg === "--policy-version" || arg?.startsWith("--policy-version=")) {
|
|
307
|
+
const value = arg === "--policy-version" ? argv[i + 1] : arg.slice("--policy-version=".length);
|
|
308
|
+
if (value === undefined) {
|
|
309
|
+
return { ...parsed, error: "argument --policy-version: expected one argument" };
|
|
310
|
+
}
|
|
311
|
+
parsed.policyVersion = value;
|
|
312
|
+
if (arg === "--policy-version")
|
|
313
|
+
i += 1;
|
|
314
|
+
}
|
|
315
|
+
else if (arg === "--run-id" || arg?.startsWith("--run-id=")) {
|
|
316
|
+
const value = arg === "--run-id" ? argv[i + 1] : arg.slice("--run-id=".length);
|
|
317
|
+
if (value === undefined)
|
|
318
|
+
return { ...parsed, error: "argument --run-id: expected one argument" };
|
|
319
|
+
parsed.runId = value;
|
|
320
|
+
if (arg === "--run-id")
|
|
321
|
+
i += 1;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return parsed;
|
|
328
|
+
}
|
|
329
|
+
function emit(json, payload, text, err) {
|
|
330
|
+
const line = json ? `${JSON.stringify(payload)}\n` : `${text}\n`;
|
|
331
|
+
if (err)
|
|
332
|
+
process.stderr.write(line);
|
|
333
|
+
else
|
|
334
|
+
process.stdout.write(line);
|
|
335
|
+
}
|
|
336
|
+
function asPhaseId(value) {
|
|
337
|
+
return PRE_PR_PHASE_IDS.includes(value) ? value : null;
|
|
338
|
+
}
|
|
339
|
+
export function run(argv) {
|
|
340
|
+
const args = parseArgs(argv);
|
|
341
|
+
if (args.help) {
|
|
342
|
+
process.stdout.write(USAGE);
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
if (args.error !== undefined) {
|
|
346
|
+
process.stderr.write(`pre_pr_run: ${args.error}\n`);
|
|
347
|
+
return 2;
|
|
348
|
+
}
|
|
349
|
+
if (args.skillOpen) {
|
|
350
|
+
const d = noteSkillFileOpen();
|
|
351
|
+
emit(args.json, d, d.message, true);
|
|
352
|
+
return 1;
|
|
353
|
+
}
|
|
354
|
+
const store = getDefaultPrePrStore();
|
|
355
|
+
if (args.markComplete) {
|
|
356
|
+
const d = markComplete(store, args.runId ?? "");
|
|
357
|
+
emit(args.json, d, d.message, true);
|
|
358
|
+
return 1;
|
|
359
|
+
}
|
|
360
|
+
if (args.observeCommand || args.observeSemantic) {
|
|
361
|
+
if (args.runId === null || args.runId.length === 0) {
|
|
362
|
+
process.stderr.write("pre_pr_run: observe requires --run-id\n");
|
|
363
|
+
return 2;
|
|
364
|
+
}
|
|
365
|
+
if (args.phase === null || args.phase.length === 0) {
|
|
366
|
+
process.stderr.write("pre_pr_run: observe requires --phase\n");
|
|
367
|
+
return 2;
|
|
368
|
+
}
|
|
369
|
+
const phase = asPhaseId(args.phase);
|
|
370
|
+
if (phase === null) {
|
|
371
|
+
process.stderr.write(`pre_pr_run: unknown phase ${args.phase}\n`);
|
|
372
|
+
return 2;
|
|
373
|
+
}
|
|
374
|
+
const rec = store.getById(args.runId);
|
|
375
|
+
if (args.observeCommand) {
|
|
376
|
+
if (args.exitCode === null) {
|
|
377
|
+
process.stderr.write("pre_pr_run: --observe-command requires --exit-code\n");
|
|
378
|
+
return 2;
|
|
379
|
+
}
|
|
380
|
+
if (args.skipReason !== null && args.skipReason.length > 0 && args.exitCode === 0) {
|
|
381
|
+
process.stderr.write("pre_pr_run: skip requires a non-zero --exit-code plus --skip-reason\n");
|
|
382
|
+
return 2;
|
|
383
|
+
}
|
|
384
|
+
const spec = phaseSpec(phase);
|
|
385
|
+
const d = observeCommandPhase(store, args.runId, {
|
|
386
|
+
phaseId: phase,
|
|
387
|
+
command: args.command.length > 0 ? args.command : (spec.command ?? ""),
|
|
388
|
+
exitCode: args.exitCode,
|
|
389
|
+
inputHash: args.inputHash ?? rec?.inputHash ?? "",
|
|
390
|
+
skipReason: args.skipReason,
|
|
391
|
+
});
|
|
392
|
+
emit(args.json, d, d.message, !d.ok);
|
|
393
|
+
return d.ok ? 0 : 1;
|
|
394
|
+
}
|
|
395
|
+
if (args.suppliedContentsHash.length === 0) {
|
|
396
|
+
process.stderr.write("pre_pr_run: --observe-semantic requires --supplied-contents-hash\n");
|
|
397
|
+
return 2;
|
|
398
|
+
}
|
|
399
|
+
if (args.reviewedFiles.length === 0) {
|
|
400
|
+
process.stderr.write("pre_pr_run: --observe-semantic requires --reviewed-file\n");
|
|
401
|
+
return 2;
|
|
402
|
+
}
|
|
403
|
+
const observed = computeControllerObservedHash({ reviewedFiles: args.reviewedFiles });
|
|
404
|
+
if (observed === null) {
|
|
405
|
+
process.stderr.write("pre_pr_run: --observe-semantic could not hash reviewed-file contents\n");
|
|
406
|
+
return 2;
|
|
407
|
+
}
|
|
408
|
+
if (args.controllerObservedHash.length > 0 && args.controllerObservedHash !== observed) {
|
|
409
|
+
process.stderr.write("pre_pr_run: --controller-observed-hash does not match independently hashed reviewed-file contents\n");
|
|
410
|
+
return 1;
|
|
411
|
+
}
|
|
412
|
+
if (args.suppliedContentsHash !== observed) {
|
|
413
|
+
process.stderr.write("pre_pr_run: --supplied-contents-hash does not match independently hashed reviewed-file contents\n");
|
|
414
|
+
return 1;
|
|
415
|
+
}
|
|
416
|
+
const d = submitReviewerReport(store, args.runId, {
|
|
417
|
+
phaseId: phase,
|
|
418
|
+
reviewedFileManifest: args.reviewedFiles,
|
|
419
|
+
suppliedContentsHash: args.suppliedContentsHash,
|
|
420
|
+
criteriaDigest: args.criteriaDigest ?? rec?.criteria.digest ?? "",
|
|
421
|
+
reviewerReportRef: args.reviewerReportRef,
|
|
422
|
+
controllerObservedHash: observed,
|
|
423
|
+
});
|
|
424
|
+
emit(args.json, d, d.message, !d.ok);
|
|
425
|
+
return d.ok ? 0 : 1;
|
|
426
|
+
}
|
|
427
|
+
if (args.evaluate) {
|
|
428
|
+
if (args.repo.length === 0 || args.baseSha.length === 0 || args.headSha.length === 0) {
|
|
429
|
+
process.stderr.write("pre_pr_run: --evaluate requires --repo --base-sha --head-sha\n");
|
|
430
|
+
return 2;
|
|
431
|
+
}
|
|
432
|
+
if (args.prBodyHash.length === 0) {
|
|
433
|
+
process.stderr.write("pre_pr_run: --evaluate requires --pr-body-hash\n");
|
|
434
|
+
return 2;
|
|
435
|
+
}
|
|
436
|
+
const record = resolveRecordFromStore(store, {
|
|
437
|
+
id: args.runId,
|
|
438
|
+
prNodeId: args.prNodeId,
|
|
439
|
+
});
|
|
440
|
+
const headSource = args.approvedRevision.length > 0
|
|
441
|
+
? args.approvedRevision
|
|
442
|
+
: (record?.criteria.sourceRevisionSha ?? args.headSha);
|
|
443
|
+
const liveApproved = digestApprovedCriteria({
|
|
444
|
+
sourceRevisionSha: headSource,
|
|
445
|
+
scopePaths: args.scope,
|
|
446
|
+
acceptanceText: args.acceptance,
|
|
447
|
+
generation: args.generation,
|
|
448
|
+
});
|
|
449
|
+
const d = evaluateLivePrePrCheck({
|
|
450
|
+
store,
|
|
451
|
+
liveBinding: {
|
|
452
|
+
repo: args.repo,
|
|
453
|
+
baseSha: args.baseSha,
|
|
454
|
+
headSha: args.headSha,
|
|
455
|
+
prNodeId: args.prNodeId,
|
|
456
|
+
prBodyHash: args.prBodyHash,
|
|
457
|
+
},
|
|
458
|
+
presentedRunId: args.runId,
|
|
459
|
+
approvedCriteria: liveApproved,
|
|
460
|
+
currentGeneration: args.generation,
|
|
461
|
+
headCriteria: liveApproved,
|
|
462
|
+
});
|
|
463
|
+
emit(args.json, d, d.message, !d.ok);
|
|
464
|
+
return d.ok ? 0 : 1;
|
|
465
|
+
}
|
|
466
|
+
if (args.complete) {
|
|
467
|
+
if (args.runId === null || args.runId.length === 0) {
|
|
468
|
+
process.stderr.write("pre_pr_run: --complete requires --run-id\n");
|
|
469
|
+
return 2;
|
|
470
|
+
}
|
|
471
|
+
const d = completeRun(store, controllerPublisher(), args.runId);
|
|
472
|
+
emit(args.json, d, d.message, !d.ok);
|
|
473
|
+
return d.ok ? 0 : 1;
|
|
474
|
+
}
|
|
475
|
+
if (args.repo.length === 0 ||
|
|
476
|
+
args.baseSha.length === 0 ||
|
|
477
|
+
args.headSha.length === 0 ||
|
|
478
|
+
args.treeHash.length === 0 ||
|
|
479
|
+
args.prBodyHash.length === 0 ||
|
|
480
|
+
args.approvedRevision.length === 0) {
|
|
481
|
+
process.stderr.write("pre_pr_run: start requires --repo --base-sha --head-sha --tree-hash --pr-body-hash --approved-revision\n");
|
|
482
|
+
return 2;
|
|
483
|
+
}
|
|
484
|
+
const criteria = digestApprovedCriteria({
|
|
485
|
+
sourceRevisionSha: args.approvedRevision,
|
|
486
|
+
scopePaths: args.scope,
|
|
487
|
+
acceptanceText: args.acceptance,
|
|
488
|
+
generation: args.generation,
|
|
489
|
+
});
|
|
490
|
+
const started = startControllerRun(store, {
|
|
491
|
+
repo: args.repo,
|
|
492
|
+
baseSha: args.baseSha,
|
|
493
|
+
headSha: args.headSha,
|
|
494
|
+
treeHash: args.treeHash,
|
|
495
|
+
prBodyHash: args.prBodyHash,
|
|
496
|
+
prNodeId: args.prNodeId,
|
|
497
|
+
criteria,
|
|
498
|
+
skillVersion: args.skillVersion,
|
|
499
|
+
policyVersion: args.policyVersion,
|
|
500
|
+
approvedRevisionSha: args.approvedRevision,
|
|
501
|
+
runId: args.runId ?? undefined,
|
|
502
|
+
});
|
|
503
|
+
if (!started.ok) {
|
|
504
|
+
emit(args.json, started.decision, started.decision.message, true);
|
|
505
|
+
return 1;
|
|
506
|
+
}
|
|
507
|
+
const payload = { ok: started.ok, runId: started.runId, hint: "run id is a lookup hint only" };
|
|
508
|
+
emit(args.json, payload, `started ${started.runId} (lookup hint only; private store is authoritative)`, false);
|
|
509
|
+
return 0;
|
|
510
|
+
}
|
|
511
|
+
if (isDirectEntrypoint(import.meta.url)) {
|
|
512
|
+
process.exit(run(process.argv.slice(2)));
|
|
513
|
+
}
|
|
514
|
+
//# sourceMappingURL=pre-pr-run.js.map
|