@deftai/directive 0.126.2 → 0.128.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/bin/deft-hook +14 -0
- package/bin/deft-hook.cmd +14 -0
- package/dist/bin.js +4319 -3
- package/package.json +11 -21
- package/dist/agents-refresh.d.ts +0 -11
- package/dist/agents-refresh.js +0 -90
- package/dist/authz.d.ts +0 -7
- package/dist/authz.js +0 -732
- package/dist/bin.d.ts +0 -3
- package/dist/branch-fixtures.d.ts +0 -45
- package/dist/branch-fixtures.js +0 -156
- package/dist/cache.d.ts +0 -4
- package/dist/cache.js +0 -10
- package/dist/capacity-backfill.d.ts +0 -3
- package/dist/capacity-backfill.js +0 -9
- package/dist/capacity-show.d.ts +0 -3
- package/dist/capacity-show.js +0 -9
- package/dist/change-init.d.ts +0 -3
- package/dist/change-init.js +0 -59
- package/dist/changelog-check.d.ts +0 -3
- package/dist/changelog-check.js +0 -52
- package/dist/check.d.ts +0 -15
- package/dist/check.js +0 -150
- package/dist/cli-package-version.d.ts +0 -3
- package/dist/cli-package-version.js +0 -23
- package/dist/cli-router/index.d.ts +0 -8
- package/dist/cli-router/index.js +0 -44
- package/dist/cli-router/route-argv.d.ts +0 -40
- package/dist/cli-router/route-argv.js +0 -371
- package/dist/codebase-default-extractor.d.ts +0 -3
- package/dist/codebase-default-extractor.js +0 -9
- package/dist/codebase-map-fresh.d.ts +0 -3
- package/dist/codebase-map-fresh.js +0 -9
- package/dist/codebase-map.d.ts +0 -3
- package/dist/codebase-map.js +0 -9
- package/dist/codebase-projection-registry.d.ts +0 -3
- package/dist/codebase-projection-registry.js +0 -9
- package/dist/codebase-provider.d.ts +0 -3
- package/dist/codebase-provider.js +0 -9
- package/dist/commit-lint.d.ts +0 -3
- package/dist/commit-lint.js +0 -44
- package/dist/content-validate-cli/validate-links.d.ts +0 -11
- package/dist/content-validate-cli/validate-links.js +0 -37
- package/dist/content-validate-cli/validate-strategy-output.d.ts +0 -13
- package/dist/content-validate-cli/validate-strategy-output.js +0 -56
- package/dist/content-validate-cli/verify-capacity.d.ts +0 -12
- package/dist/content-validate-cli/verify-capacity.js +0 -54
- package/dist/coverage-hotspots.d.ts +0 -21
- package/dist/coverage-hotspots.js +0 -198
- package/dist/design-critique-spend-resolve.d.ts +0 -18
- package/dist/design-critique-spend-resolve.js +0 -191
- package/dist/directive-finish-loop.d.ts +0 -3
- package/dist/directive-finish-loop.js +0 -10
- package/dist/dispatch.d.ts +0 -193
- package/dist/dispatch.js +0 -3091
- package/dist/doctor.d.ts +0 -19
- package/dist/doctor.js +0 -155
- package/dist/entrypoint.d.ts +0 -6
- package/dist/entrypoint.js +0 -19
- package/dist/escalation-cli.d.ts +0 -4
- package/dist/escalation-cli.js +0 -301
- package/dist/eval-health.d.ts +0 -13
- package/dist/eval-health.js +0 -63
- package/dist/eval-report.d.ts +0 -15
- package/dist/eval-report.js +0 -97
- package/dist/eval-run.d.ts +0 -17
- package/dist/eval-run.js +0 -122
- package/dist/eval-triggers.d.ts +0 -12
- package/dist/eval-triggers.js +0 -56
- package/dist/framework-check-updates.d.ts +0 -10
- package/dist/framework-check-updates.js +0 -68
- package/dist/gates-cli/_helpers.d.ts +0 -24
- package/dist/gates-cli/_helpers.js +0 -115
- package/dist/gates-cli/verify-bridge-drift.d.ts +0 -11
- package/dist/gates-cli/verify-bridge-drift.js +0 -47
- package/dist/gates-cli/verify-go-freeze.d.ts +0 -11
- package/dist/gates-cli/verify-go-freeze.js +0 -48
- package/dist/hook-bin.d.ts +0 -3
- package/dist/hook-bin.js +0 -11
- package/dist/hook-dispatch.d.ts +0 -80
- package/dist/hook-dispatch.js +0 -186
- package/dist/human-presence-mint.d.ts +0 -70
- package/dist/human-presence-mint.js +0 -204
- package/dist/identity-banner.d.ts +0 -13
- package/dist/identity-banner.js +0 -19
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -14
- package/dist/init-cli/constants.d.ts +0 -42
- package/dist/init-cli/constants.js +0 -42
- package/dist/init-cli/help.d.ts +0 -9
- package/dist/init-cli/help.js +0 -43
- package/dist/init-cli/init.d.ts +0 -26
- package/dist/init-cli/init.js +0 -80
- package/dist/init-cli/migrate.d.ts +0 -3
- package/dist/init-cli/migrate.js +0 -51
- package/dist/init-cli/resolve-binary.d.ts +0 -34
- package/dist/init-cli/resolve-binary.js +0 -78
- package/dist/init-cli/run-deft-install.d.ts +0 -23
- package/dist/init-cli/run-deft-install.js +0 -71
- package/dist/init-cli/update.d.ts +0 -5
- package/dist/init-cli/update.js +0 -38
- package/dist/install-cli/coverage-map.d.ts +0 -14
- package/dist/install-cli/coverage-map.js +0 -113
- package/dist/install-uninstall.d.ts +0 -3
- package/dist/install-uninstall.js +0 -44
- package/dist/install-upgrade.d.ts +0 -41
- package/dist/install-upgrade.js +0 -86
- package/dist/lifecycle-cli/coverage-map.d.ts +0 -16
- package/dist/lifecycle-cli/coverage-map.js +0 -254
- package/dist/lifecycle-cli/helpers.d.ts +0 -8
- package/dist/lifecycle-cli/helpers.js +0 -20
- package/dist/lifecycle-event.d.ts +0 -11
- package/dist/lifecycle-event.js +0 -45
- package/dist/lifecycle-stats.d.ts +0 -12
- package/dist/lifecycle-stats.js +0 -100
- package/dist/migrate-category-b.d.ts +0 -9
- package/dist/migrate-category-b.js +0 -52
- package/dist/migrate-preflight.d.ts +0 -10
- package/dist/migrate-preflight.js +0 -85
- package/dist/migrate-xbrief.d.ts +0 -11
- package/dist/migrate-xbrief.js +0 -88
- package/dist/occupancy-grant.d.ts +0 -18
- package/dist/occupancy-grant.js +0 -121
- package/dist/occupancy-heartbeat.d.ts +0 -8
- package/dist/occupancy-heartbeat.js +0 -63
- package/dist/occupancy-release.d.ts +0 -23
- package/dist/occupancy-release.js +0 -102
- package/dist/occupancy-steal.d.ts +0 -10
- package/dist/occupancy-steal.js +0 -83
- package/dist/occupancy-unrecognized.d.ts +0 -3
- package/dist/occupancy-unrecognized.js +0 -5
- package/dist/orchestration-cli/coverage-map.d.ts +0 -21
- package/dist/orchestration-cli/coverage-map.js +0 -225
- package/dist/orchestration-cli/helpers.d.ts +0 -11
- package/dist/orchestration-cli/helpers.js +0 -35
- package/dist/ownership-doctor.d.ts +0 -10
- package/dist/ownership-doctor.js +0 -96
- package/dist/ownership-fix.d.ts +0 -10
- package/dist/ownership-fix.js +0 -93
- package/dist/plan-sequence.d.ts +0 -14
- package/dist/plan-sequence.js +0 -258
- package/dist/policy-fixtures.d.ts +0 -33
- package/dist/policy-fixtures.js +0 -118
- package/dist/policy.d.ts +0 -37
- package/dist/policy.js +0 -744
- package/dist/pr-closing-keywords.d.ts +0 -3
- package/dist/pr-closing-keywords.js +0 -10
- package/dist/pr-finish-loop.d.ts +0 -3
- package/dist/pr-finish-loop.js +0 -10
- package/dist/pr-merge-readiness.d.ts +0 -3
- package/dist/pr-merge-readiness.js +0 -10
- package/dist/pr-monitor.d.ts +0 -3
- package/dist/pr-monitor.js +0 -10
- package/dist/pr-protected-issues.d.ts +0 -3
- package/dist/pr-protected-issues.js +0 -10
- package/dist/pr-wait-mergeable.d.ts +0 -3
- package/dist/pr-wait-mergeable.js +0 -10
- package/dist/pr-watch.d.ts +0 -3
- package/dist/pr-watch.js +0 -10
- package/dist/pre-pr-run.d.ts +0 -39
- package/dist/pre-pr-run.js +0 -514
- package/dist/preflight-cache.d.ts +0 -18
- package/dist/preflight-cache.js +0 -113
- package/dist/preflight-gh.d.ts +0 -15
- package/dist/preflight-gh.js +0 -143
- package/dist/probe-session.d.ts +0 -3
- package/dist/probe-session.js +0 -10
- package/dist/release-e2e-fixtures.d.ts +0 -29
- package/dist/release-e2e-fixtures.js +0 -38
- package/dist/release-e2e.d.ts +0 -3
- package/dist/release-e2e.js +0 -10
- package/dist/release-publish.d.ts +0 -3
- package/dist/release-publish.js +0 -10
- package/dist/release-rollback.d.ts +0 -3
- package/dist/release-rollback.js +0 -10
- package/dist/release-wait-npm.d.ts +0 -3
- package/dist/release-wait-npm.js +0 -10
- package/dist/release.d.ts +0 -3
- package/dist/release.js +0 -10
- package/dist/render-cli/deft-ts-runner.d.ts +0 -17
- package/dist/render-cli/deft-ts-runner.js +0 -19
- package/dist/render-cli/export-spec-cli.d.ts +0 -2
- package/dist/render-cli/export-spec-cli.js +0 -6
- package/dist/render-cli/prd-render-cli.d.ts +0 -2
- package/dist/render-cli/prd-render-cli.js +0 -37
- package/dist/render-cli/project-render-cli.d.ts +0 -2
- package/dist/render-cli/project-render-cli.js +0 -6
- package/dist/render-cli/rule-map-cli.d.ts +0 -2
- package/dist/render-cli/rule-map-cli.js +0 -5
- package/dist/render-cli/spec-reconstruct-cli.d.ts +0 -3
- package/dist/render-cli/spec-reconstruct-cli.js +0 -15
- package/dist/render-cli/spec-render-cli.d.ts +0 -2
- package/dist/render-cli/spec-render-cli.js +0 -39
- package/dist/render-cli/spec-validate-cli.d.ts +0 -2
- package/dist/render-cli/spec-validate-cli.js +0 -38
- package/dist/review-monitor-register.d.ts +0 -19
- package/dist/review-monitor-register.js +0 -183
- package/dist/review-monitor-release.d.ts +0 -14
- package/dist/review-monitor-release.js +0 -123
- package/dist/scm-sync-default.d.ts +0 -34
- package/dist/scm-sync-default.js +0 -210
- package/dist/scope-lifecycle.d.ts +0 -4
- package/dist/scope-lifecycle.js +0 -34
- package/dist/scope-record-approved-scope.d.ts +0 -29
- package/dist/scope-record-approved-scope.js +0 -319
- package/dist/scope-record-intent-constraint.d.ts +0 -16
- package/dist/scope-record-intent-constraint.js +0 -202
- package/dist/scope-record-observable-scope.d.ts +0 -16
- package/dist/scope-record-observable-scope.js +0 -204
- package/dist/session-ready.d.ts +0 -15
- package/dist/session-ready.js +0 -144
- package/dist/session-start.d.ts +0 -56
- package/dist/session-start.js +0 -581
- package/dist/slice.d.ts +0 -4
- package/dist/slice.js +0 -34
- package/dist/story-ready-fixtures.d.ts +0 -47
- package/dist/story-ready-fixtures.js +0 -137
- package/dist/subagent-monitor.d.ts +0 -3
- package/dist/subagent-monitor.js +0 -10
- package/dist/subagent-pre-cancel.d.ts +0 -21
- package/dist/subagent-pre-cancel.js +0 -240
- package/dist/subagent-steer-write.d.ts +0 -41
- package/dist/subagent-steer-write.js +0 -333
- package/dist/toolchain-check.d.ts +0 -8
- package/dist/toolchain-check.js +0 -54
- package/dist/triage-actions.d.ts +0 -23
- package/dist/triage-actions.js +0 -233
- package/dist/triage-aux-a-fixtures.d.ts +0 -33
- package/dist/triage-aux-a-fixtures.js +0 -107
- package/dist/triage-aux-b-fixtures.d.ts +0 -30
- package/dist/triage-aux-b-fixtures.js +0 -167
- package/dist/triage-bootstrap-fixtures.d.ts +0 -42
- package/dist/triage-bootstrap-fixtures.js +0 -139
- package/dist/triage-bootstrap.d.ts +0 -24
- package/dist/triage-bootstrap.js +0 -175
- package/dist/triage-bulk.d.ts +0 -17
- package/dist/triage-bulk.js +0 -154
- package/dist/triage-classify-fixtures.d.ts +0 -38
- package/dist/triage-classify-fixtures.js +0 -137
- package/dist/triage-classify.d.ts +0 -45
- package/dist/triage-classify.js +0 -287
- package/dist/triage-evaluate.d.ts +0 -14
- package/dist/triage-evaluate.js +0 -153
- package/dist/triage-help.d.ts +0 -3
- package/dist/triage-help.js +0 -10
- package/dist/triage-queue-fixtures.d.ts +0 -59
- package/dist/triage-queue-fixtures.js +0 -284
- package/dist/triage-queue.d.ts +0 -38
- package/dist/triage-queue.js +0 -391
- package/dist/triage-reconcile.d.ts +0 -11
- package/dist/triage-reconcile.js +0 -76
- package/dist/triage-refresh.d.ts +0 -7
- package/dist/triage-refresh.js +0 -37
- package/dist/triage-scope-drift.d.ts +0 -12
- package/dist/triage-scope-drift.js +0 -117
- package/dist/triage-scope-fixtures.d.ts +0 -32
- package/dist/triage-scope-fixtures.js +0 -131
- package/dist/triage-scope.d.ts +0 -4
- package/dist/triage-scope.js +0 -34
- package/dist/triage-smoketest.d.ts +0 -3
- package/dist/triage-smoketest.js +0 -43
- package/dist/triage-strip-withdrawn.d.ts +0 -21
- package/dist/triage-strip-withdrawn.js +0 -102
- package/dist/triage-subscribe.d.ts +0 -15
- package/dist/triage-subscribe.js +0 -157
- package/dist/triage-summary.d.ts +0 -14
- package/dist/triage-summary.js +0 -83
- package/dist/triage-welcome.d.ts +0 -14
- package/dist/triage-welcome.js +0 -121
- package/dist/ts-check-lane.d.ts +0 -9
- package/dist/ts-check-lane.js +0 -49
- package/dist/umbrella-current-shape.d.ts +0 -9
- package/dist/umbrella-current-shape.js +0 -56
- package/dist/vbrief-activate.d.ts +0 -3
- package/dist/vbrief-activate.js +0 -7
- package/dist/vbrief-build.d.ts +0 -3
- package/dist/vbrief-build.js +0 -8
- package/dist/vbrief-preflight-fixtures.d.ts +0 -32
- package/dist/vbrief-preflight-fixtures.js +0 -79
- package/dist/vbrief-preflight.d.ts +0 -13
- package/dist/vbrief-preflight.js +0 -141
- package/dist/vbrief-reconcile.d.ts +0 -3
- package/dist/vbrief-reconcile.js +0 -7
- package/dist/vbrief-validate.d.ts +0 -3
- package/dist/vbrief-validate.js +0 -8
- package/dist/vbrief-validation.d.ts +0 -3
- package/dist/vbrief-validation.js +0 -8
- package/dist/verify-ac.d.ts +0 -28
- package/dist/verify-ac.js +0 -439
- package/dist/verify-agents-md-advisory.d.ts +0 -19
- package/dist/verify-agents-md-advisory.js +0 -65
- package/dist/verify-agents-md-budget.d.ts +0 -12
- package/dist/verify-agents-md-budget.js +0 -71
- package/dist/verify-branch.d.ts +0 -14
- package/dist/verify-branch.js +0 -81
- package/dist/verify-class-checks.d.ts +0 -11
- package/dist/verify-class-checks.js +0 -71
- package/dist/verify-cohort-review-monitors.d.ts +0 -5
- package/dist/verify-cohort-review-monitors.js +0 -11
- package/dist/verify-completed-tracked.d.ts +0 -19
- package/dist/verify-completed-tracked.js +0 -202
- package/dist/verify-completed-write-guard.d.ts +0 -13
- package/dist/verify-completed-write-guard.js +0 -84
- package/dist/verify-consumer-check-contract.d.ts +0 -12
- package/dist/verify-consumer-check-contract.js +0 -70
- package/dist/verify-consumer-header-placeholder.d.ts +0 -12
- package/dist/verify-consumer-header-placeholder.js +0 -73
- package/dist/verify-consumer-test-lane.d.ts +0 -12
- package/dist/verify-consumer-test-lane.js +0 -57
- package/dist/verify-durable-effect-acquisition.d.ts +0 -13
- package/dist/verify-durable-effect-acquisition.js +0 -70
- package/dist/verify-encoding.d.ts +0 -15
- package/dist/verify-encoding.js +0 -83
- package/dist/verify-eval-health-relocation.d.ts +0 -16
- package/dist/verify-eval-health-relocation.js +0 -93
- package/dist/verify-eval-triggers-relocation.d.ts +0 -14
- package/dist/verify-eval-triggers-relocation.js +0 -74
- package/dist/verify-evaluator-surface.d.ts +0 -15
- package/dist/verify-evaluator-surface.js +0 -87
- package/dist/verify-forward-coverage.d.ts +0 -19
- package/dist/verify-forward-coverage.js +0 -144
- package/dist/verify-hooks-installed.d.ts +0 -24
- package/dist/verify-hooks-installed.js +0 -140
- package/dist/verify-intent-constraint.d.ts +0 -17
- package/dist/verify-intent-constraint.js +0 -110
- package/dist/verify-investigation.d.ts +0 -3
- package/dist/verify-investigation.js +0 -10
- package/dist/verify-judgment-gates.d.ts +0 -3
- package/dist/verify-judgment-gates.js +0 -10
- package/dist/verify-l4-owner.d.ts +0 -15
- package/dist/verify-l4-owner.js +0 -132
- package/dist/verify-lifecycle-visible.d.ts +0 -13
- package/dist/verify-lifecycle-visible.js +0 -68
- package/dist/verify-literal-ac.d.ts +0 -14
- package/dist/verify-literal-ac.js +0 -168
- package/dist/verify-no-task-runtime.d.ts +0 -3
- package/dist/verify-no-task-runtime.js +0 -16
- package/dist/verify-observable-scope.d.ts +0 -17
- package/dist/verify-observable-scope.js +0 -110
- package/dist/verify-operator-scope-limit.d.ts +0 -17
- package/dist/verify-operator-scope-limit.js +0 -285
- package/dist/verify-orphan-active.d.ts +0 -17
- package/dist/verify-orphan-active.js +0 -135
- package/dist/verify-ownership.d.ts +0 -10
- package/dist/verify-ownership.js +0 -90
- package/dist/verify-persisted-planning-narratives.d.ts +0 -12
- package/dist/verify-persisted-planning-narratives.js +0 -82
- package/dist/verify-plan-sequence.d.ts +0 -14
- package/dist/verify-plan-sequence.js +0 -138
- package/dist/verify-pr-closeout-attestable.d.ts +0 -15
- package/dist/verify-pr-closeout-attestable.js +0 -114
- package/dist/verify-presentation-ceiling.d.ts +0 -11
- package/dist/verify-presentation-ceiling.js +0 -71
- package/dist/verify-presentation-coverage.d.ts +0 -14
- package/dist/verify-presentation-coverage.js +0 -90
- package/dist/verify-review-monitor.d.ts +0 -32
- package/dist/verify-review-monitor.js +0 -362
- package/dist/verify-scope-provenance.d.ts +0 -16
- package/dist/verify-scope-provenance.js +0 -91
- package/dist/verify-session-ritual.d.ts +0 -23
- package/dist/verify-session-ritual.js +0 -144
- package/dist/verify-source-cli/rule-ownership-lint.d.ts +0 -12
- package/dist/verify-source-cli/rule-ownership-lint.js +0 -61
- package/dist/verify-source-cli/verify-biome-config.d.ts +0 -11
- package/dist/verify-source-cli/verify-biome-config.js +0 -46
- package/dist/verify-source-cli/verify-closing-keywords.d.ts +0 -35
- package/dist/verify-source-cli/verify-closing-keywords.js +0 -139
- package/dist/verify-source-cli/verify-consumer-hard-stops.d.ts +0 -16
- package/dist/verify-source-cli/verify-consumer-hard-stops.js +0 -99
- package/dist/verify-source-cli/verify-contained-writes.d.ts +0 -13
- package/dist/verify-source-cli/verify-contained-writes.js +0 -67
- package/dist/verify-source-cli/verify-content-manifest.d.ts +0 -12
- package/dist/verify-source-cli/verify-content-manifest.js +0 -61
- package/dist/verify-source-cli/verify-contract-drift.d.ts +0 -11
- package/dist/verify-source-cli/verify-contract-drift.js +0 -47
- package/dist/verify-source-cli/verify-cursor-tier1.d.ts +0 -12
- package/dist/verify-source-cli/verify-cursor-tier1.js +0 -51
- package/dist/verify-source-cli/verify-deposit-closure.d.ts +0 -12
- package/dist/verify-source-cli/verify-deposit-closure.js +0 -52
- package/dist/verify-source-cli/verify-openclaw-tier1.d.ts +0 -12
- package/dist/verify-source-cli/verify-openclaw-tier1.js +0 -51
- package/dist/verify-source-cli/verify-scm-boundary.d.ts +0 -13
- package/dist/verify-source-cli/verify-scm-boundary.js +0 -66
- package/dist/verify-source-cli/verify-semantic-single-source.d.ts +0 -11
- package/dist/verify-source-cli/verify-semantic-single-source.js +0 -49
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.d.ts +0 -11
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.js +0 -46
- package/dist/verify-source-cli/verify-spec-drift.d.ts +0 -3
- package/dist/verify-source-cli/verify-spec-drift.js +0 -15
- package/dist/verify-source-cli/verify-spec-prd-fresh.d.ts +0 -3
- package/dist/verify-source-cli/verify-spec-prd-fresh.js +0 -15
- package/dist/verify-source-cli/verify-stubs.d.ts +0 -11
- package/dist/verify-source-cli/verify-stubs.js +0 -27
- package/dist/verify-source-cli/verify-telemetry-coverage.d.ts +0 -13
- package/dist/verify-source-cli/verify-telemetry-coverage.js +0 -67
- package/dist/verify-source-cli/verify-xbrief-drift.d.ts +0 -15
- package/dist/verify-source-cli/verify-xbrief-drift.js +0 -80
- package/dist/verify-story-ready.d.ts +0 -18
- package/dist/verify-story-ready.js +0 -190
- package/dist/verify-subagent-alive.d.ts +0 -21
- package/dist/verify-subagent-alive.js +0 -219
- package/dist/verify-subagent-steer.d.ts +0 -19
- package/dist/verify-subagent-steer.js +0 -136
- package/dist/verify-test-boundary.d.ts +0 -12
- package/dist/verify-test-boundary.js +0 -80
- package/dist/verify-tools.d.ts +0 -13
- package/dist/verify-tools.js +0 -67
- package/dist/verify-wip-cap.d.ts +0 -13
- package/dist/verify-wip-cap.js +0 -62
- package/dist/windows-bin-ps1.d.ts +0 -39
- package/dist/windows-bin-ps1.js +0 -226
- package/dist/wip-cap-fixtures.d.ts +0 -37
- package/dist/wip-cap-fixtures.js +0 -122
- package/dist/wsl-ownership-guard.d.ts +0 -2
- package/dist/wsl-ownership-guard.js +0 -15
- package/dist/xbrief-create.d.ts +0 -3
- package/dist/xbrief-create.js +0 -9
- package/dist/xbrief-verify.d.ts +0 -3
- package/dist/xbrief-verify.js +0 -9
- package/scripts/remove-windows-ps1-shims.mjs +0 -26
|
@@ -1,10 +0,0 @@
|
|
|
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
|
package/dist/pr-finish-loop.d.ts
DELETED
package/dist/pr-finish-loop.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
package/dist/pr-monitor.d.ts
DELETED
package/dist/pr-monitor.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1,10 +0,0 @@
|
|
|
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.d.ts
DELETED
package/dist/pr-watch.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
package/dist/pre-pr-run.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
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
|
package/dist/pre-pr-run.js
DELETED
|
@@ -1,514 +0,0 @@
|
|
|
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
|