@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,190 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { evaluate, gitPorcelain, gitRevParseAbbrev, parseAllocationSection, } from "@deftai/directive-core/story-ready";
|
|
6
|
-
import { ROUTING_GATED_DISPATCH_PROVIDERS, resolveDispatchProvider, verifyRouting, } from "@deftai/directive-core/swarm";
|
|
7
|
-
/** Parse verify-story-ready CLI args, mirroring the Python argparse surface. */
|
|
8
|
-
export function parseArgs(argv) {
|
|
9
|
-
const parsed = {
|
|
10
|
-
vbriefPath: null,
|
|
11
|
-
projectRoot: ".",
|
|
12
|
-
allocationContext: null,
|
|
13
|
-
allowDirty: false,
|
|
14
|
-
emitJson: false,
|
|
15
|
-
skipRouting: false,
|
|
16
|
-
roles: [],
|
|
17
|
-
};
|
|
18
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
19
|
-
const arg = argv[i];
|
|
20
|
-
if (arg === "--allow-dirty") {
|
|
21
|
-
parsed.allowDirty = true;
|
|
22
|
-
}
|
|
23
|
-
else if (arg === "--json") {
|
|
24
|
-
parsed.emitJson = true;
|
|
25
|
-
}
|
|
26
|
-
else if (arg === "--vbrief-path") {
|
|
27
|
-
const value = argv[i + 1];
|
|
28
|
-
if (value === undefined) {
|
|
29
|
-
return { ...parsed, error: "argument --vbrief-path: expected one argument" };
|
|
30
|
-
}
|
|
31
|
-
parsed.vbriefPath = value;
|
|
32
|
-
i += 1;
|
|
33
|
-
}
|
|
34
|
-
else if (arg?.startsWith("--vbrief-path=")) {
|
|
35
|
-
parsed.vbriefPath = arg.slice("--vbrief-path=".length);
|
|
36
|
-
}
|
|
37
|
-
else if (arg === "--project-root") {
|
|
38
|
-
const value = argv[i + 1];
|
|
39
|
-
if (value === undefined) {
|
|
40
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
41
|
-
}
|
|
42
|
-
parsed.projectRoot = value;
|
|
43
|
-
i += 1;
|
|
44
|
-
}
|
|
45
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
46
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
47
|
-
}
|
|
48
|
-
else if (arg === "--allocation-context") {
|
|
49
|
-
const value = argv[i + 1];
|
|
50
|
-
if (value === undefined) {
|
|
51
|
-
return { ...parsed, error: "argument --allocation-context: expected one argument" };
|
|
52
|
-
}
|
|
53
|
-
parsed.allocationContext = value;
|
|
54
|
-
i += 1;
|
|
55
|
-
}
|
|
56
|
-
else if (arg?.startsWith("--allocation-context=")) {
|
|
57
|
-
parsed.allocationContext = arg.slice("--allocation-context=".length);
|
|
58
|
-
}
|
|
59
|
-
else if (arg === "--skip-routing") {
|
|
60
|
-
parsed.skipRouting = true;
|
|
61
|
-
}
|
|
62
|
-
else if (arg === "--roles") {
|
|
63
|
-
const value = argv[i + 1];
|
|
64
|
-
if (value === undefined) {
|
|
65
|
-
return { ...parsed, error: "argument --roles: expected one argument" };
|
|
66
|
-
}
|
|
67
|
-
for (const role of value.split(",")) {
|
|
68
|
-
if (role.trim().length > 0) {
|
|
69
|
-
parsed.roles.push(role.trim());
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
i += 1;
|
|
73
|
-
}
|
|
74
|
-
else if (arg?.startsWith("--roles=")) {
|
|
75
|
-
for (const role of arg.slice("--roles=".length).split(",")) {
|
|
76
|
-
if (role.trim().length > 0) {
|
|
77
|
-
parsed.roles.push(role.trim());
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else if (arg === "--help" || arg === "-h") {
|
|
82
|
-
return { ...parsed, help: true };
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (parsed.vbriefPath === null) {
|
|
89
|
-
return { ...parsed, error: "argument --vbrief-path is required" };
|
|
90
|
-
}
|
|
91
|
-
return parsed;
|
|
92
|
-
}
|
|
93
|
-
const HELP_TEXT = `usage: verify-story-ready [--vbrief-path PATH] [--project-root PATH]
|
|
94
|
-
[--allocation-context PATH] [--allow-dirty] [--json]
|
|
95
|
-
[--skip-routing] [--roles ROLE[,ROLE...]]
|
|
96
|
-
|
|
97
|
-
Deterministic story-start Gate 0 (#1378). When the active dispatch provider is
|
|
98
|
-
one of ROUTING_GATED_DISPATCH_PROVIDERS (claude, cursor, grok, grok-bot,
|
|
99
|
-
openclaw), chains verify:routing (#1877 / #3703). --skip-routing records a
|
|
100
|
-
silent opt-out. Session-start --advise remains additive disclosure only and
|
|
101
|
-
does not relieve honor-at-dispatch. Three-state exit: 0 ready / 1 not ready /
|
|
102
|
-
2 config error.
|
|
103
|
-
`;
|
|
104
|
-
function emitJson(vbriefPath, exitCode, message, dispatchKind) {
|
|
105
|
-
const payload = {
|
|
106
|
-
dispatch_kind: dispatchKind,
|
|
107
|
-
exit_code: exitCode,
|
|
108
|
-
message,
|
|
109
|
-
ready: exitCode === 0,
|
|
110
|
-
vbrief_path: vbriefPath,
|
|
111
|
-
};
|
|
112
|
-
const sorted = Object.fromEntries(Object.keys(payload)
|
|
113
|
-
.sort()
|
|
114
|
-
.map((k) => [k, payload[k]]));
|
|
115
|
-
return JSON.stringify(sorted);
|
|
116
|
-
}
|
|
117
|
-
/** Run the gate and return the process exit code. */
|
|
118
|
-
export function run(argv) {
|
|
119
|
-
const args = parseArgs(argv);
|
|
120
|
-
if (args.help) {
|
|
121
|
-
process.stdout.write(HELP_TEXT);
|
|
122
|
-
return 0;
|
|
123
|
-
}
|
|
124
|
-
if (args.error !== undefined) {
|
|
125
|
-
process.stderr.write(`verify_story_ready: ${args.error}\n`);
|
|
126
|
-
return 2;
|
|
127
|
-
}
|
|
128
|
-
const vbriefPath = resolve(args.vbriefPath);
|
|
129
|
-
const projectRoot = resolve(args.projectRoot);
|
|
130
|
-
let allocationContextText = null;
|
|
131
|
-
if (args.allocationContext !== null) {
|
|
132
|
-
const envelopePath = resolve(args.allocationContext);
|
|
133
|
-
try {
|
|
134
|
-
allocationContextText = readFileSync(envelopePath, "utf8");
|
|
135
|
-
}
|
|
136
|
-
catch (err) {
|
|
137
|
-
const message = `config error: could not read --allocation-context file ${envelopePath}: ${String(err.message ?? err)}.`;
|
|
138
|
-
if (args.emitJson) {
|
|
139
|
-
process.stdout.write(`${emitJson(vbriefPath, 2, message, null)}\n`);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
process.stderr.write(`${message}\n`);
|
|
143
|
-
}
|
|
144
|
-
return 2;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
const gitStatus = gitPorcelain(projectRoot);
|
|
148
|
-
const parsed = parseAllocationSection(allocationContextText);
|
|
149
|
-
const result = evaluate(vbriefPath, {
|
|
150
|
-
gitStatus,
|
|
151
|
-
allocationContext: allocationContextText,
|
|
152
|
-
allowDirty: args.allowDirty,
|
|
153
|
-
parsed,
|
|
154
|
-
projectRoot,
|
|
155
|
-
onePrUnitBranch: gitRevParseAbbrev(projectRoot),
|
|
156
|
-
});
|
|
157
|
-
if (result.exitCode === 0 && !args.skipRouting) {
|
|
158
|
-
const provider = resolveDispatchProvider(process.env);
|
|
159
|
-
if (ROUTING_GATED_DISPATCH_PROVIDERS.has(provider)) {
|
|
160
|
-
const routingResult = verifyRouting({
|
|
161
|
-
projectRoot,
|
|
162
|
-
environ: process.env,
|
|
163
|
-
roles: args.roles.length > 0 ? args.roles : undefined,
|
|
164
|
-
});
|
|
165
|
-
if (routingResult.exitCode !== 0) {
|
|
166
|
-
if (args.emitJson) {
|
|
167
|
-
process.stdout.write(`${emitJson(vbriefPath, routingResult.exitCode, routingResult.report, result.dispatchKind)}\n`);
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
process.stderr.write(`${routingResult.report}\n`);
|
|
171
|
-
}
|
|
172
|
-
return routingResult.exitCode;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
if (args.emitJson) {
|
|
177
|
-
process.stdout.write(`${emitJson(vbriefPath, result.exitCode, result.message, result.dispatchKind)}\n`);
|
|
178
|
-
}
|
|
179
|
-
else if (result.exitCode === 0) {
|
|
180
|
-
process.stdout.write(`${result.message}\n`);
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
process.stderr.write(`${result.message}\n`);
|
|
184
|
-
}
|
|
185
|
-
return result.exitCode;
|
|
186
|
-
}
|
|
187
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
188
|
-
process.exit(run(process.argv.slice(2)));
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=verify-story-ready.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export declare const SUBAGENT_ALIVE_HELP = "verify:subagent-alive \u2014 fail-closed worker liveness gate (#2824)\n\nUsage:\n task verify:subagent-alive -- [options]\n task agent:monitor -- [options] (alias: raw heartbeat sweep)\n\nOptions:\n --scratch-dir PATH Heartbeat directory (repeatable; default: .deft-scratch/subagent-status)\n --require-agent ID In-flight worker that MUST have a fresh heartbeat (repeatable)\n --threshold-minutes N Staleness threshold (default: 30)\n --json Machine-readable output\n\nExit codes:\n 0 All required agents fresh (or no required agents and sweep clean)\n 1 Missing/STALE/malformed heartbeat \u2014 prints REDISPATCH_OK for takeover\n 2 Config error (invalid args, missing scratch dir with no records)\n";
|
|
3
|
-
export interface VerifySubagentAliveArgs {
|
|
4
|
-
scratchDirs: string[];
|
|
5
|
-
requireAgents: string[];
|
|
6
|
-
thresholdMinutes: number;
|
|
7
|
-
emitJson: boolean;
|
|
8
|
-
help: boolean;
|
|
9
|
-
error?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function parseVerifySubagentAliveArgs(argv: readonly string[]): VerifySubagentAliveArgs;
|
|
12
|
-
export interface SubagentAliveVerdict {
|
|
13
|
-
exitCode: number;
|
|
14
|
-
redispatchOk: boolean;
|
|
15
|
-
message: string;
|
|
16
|
-
json?: Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
/** Evaluate liveness for required in-flight workers. */
|
|
19
|
-
export declare function evaluateSubagentAliveGate(args: VerifySubagentAliveArgs, cwd?: string): SubagentAliveVerdict;
|
|
20
|
-
export declare function run(argv: readonly string[]): number;
|
|
21
|
-
//# sourceMappingURL=verify-subagent-alive.d.ts.map
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Fail-closed worker liveness gate (#2824). Wraps subagent-monitor with
|
|
4
|
-
* REDISPATCH_OK on missing/STALE heartbeats for registered in-flight workers.
|
|
5
|
-
*/
|
|
6
|
-
import { resolve } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { DEFAULT_THRESHOLD_MINUTES, defaultScratchDir, EXIT_EXTERNAL_ERROR, EXIT_OK, EXIT_STALE, recordOk, sweepAllOk, sweepScratchDirs, } from "@deftai/directive-core/orchestration";
|
|
9
|
-
export const SUBAGENT_ALIVE_HELP = `verify:subagent-alive — fail-closed worker liveness gate (#2824)
|
|
10
|
-
|
|
11
|
-
Usage:
|
|
12
|
-
task verify:subagent-alive -- [options]
|
|
13
|
-
task agent:monitor -- [options] (alias: raw heartbeat sweep)
|
|
14
|
-
|
|
15
|
-
Options:
|
|
16
|
-
--scratch-dir PATH Heartbeat directory (repeatable; default: .deft-scratch/subagent-status)
|
|
17
|
-
--require-agent ID In-flight worker that MUST have a fresh heartbeat (repeatable)
|
|
18
|
-
--threshold-minutes N Staleness threshold (default: 30)
|
|
19
|
-
--json Machine-readable output
|
|
20
|
-
|
|
21
|
-
Exit codes:
|
|
22
|
-
0 All required agents fresh (or no required agents and sweep clean)
|
|
23
|
-
1 Missing/STALE/malformed heartbeat — prints REDISPATCH_OK for takeover
|
|
24
|
-
2 Config error (invalid args, missing scratch dir with no records)
|
|
25
|
-
`;
|
|
26
|
-
export function parseVerifySubagentAliveArgs(argv) {
|
|
27
|
-
const acc = {
|
|
28
|
-
scratchDirs: [],
|
|
29
|
-
requireAgents: [],
|
|
30
|
-
thresholdMinutes: DEFAULT_THRESHOLD_MINUTES,
|
|
31
|
-
emitJson: false,
|
|
32
|
-
help: false,
|
|
33
|
-
};
|
|
34
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
35
|
-
const arg = argv[i];
|
|
36
|
-
if (arg === "--help" || arg === "-h") {
|
|
37
|
-
return { ...acc, help: true };
|
|
38
|
-
}
|
|
39
|
-
if (arg === "--json") {
|
|
40
|
-
acc.emitJson = true;
|
|
41
|
-
}
|
|
42
|
-
else if (arg === "--scratch-dir") {
|
|
43
|
-
const value = argv[i + 1];
|
|
44
|
-
if (value === undefined) {
|
|
45
|
-
return { ...acc, error: "argument --scratch-dir: expected one argument" };
|
|
46
|
-
}
|
|
47
|
-
acc.scratchDirs.push(value);
|
|
48
|
-
i += 1;
|
|
49
|
-
}
|
|
50
|
-
else if (arg?.startsWith("--scratch-dir=")) {
|
|
51
|
-
acc.scratchDirs.push(arg.slice("--scratch-dir=".length));
|
|
52
|
-
}
|
|
53
|
-
else if (arg === "--threshold-minutes") {
|
|
54
|
-
const value = argv[i + 1];
|
|
55
|
-
if (value === undefined) {
|
|
56
|
-
return { ...acc, error: "argument --threshold-minutes: expected one argument" };
|
|
57
|
-
}
|
|
58
|
-
acc.thresholdMinutes = Number(value);
|
|
59
|
-
i += 1;
|
|
60
|
-
}
|
|
61
|
-
else if (arg?.startsWith("--threshold-minutes=")) {
|
|
62
|
-
acc.thresholdMinutes = Number(arg.slice("--threshold-minutes=".length));
|
|
63
|
-
}
|
|
64
|
-
else if (arg === "--require-agent") {
|
|
65
|
-
const value = argv[i + 1];
|
|
66
|
-
if (value === undefined) {
|
|
67
|
-
return { ...acc, error: "argument --require-agent: expected one argument" };
|
|
68
|
-
}
|
|
69
|
-
acc.requireAgents.push(value);
|
|
70
|
-
i += 1;
|
|
71
|
-
}
|
|
72
|
-
else if (arg?.startsWith("--require-agent=")) {
|
|
73
|
-
acc.requireAgents.push(arg.slice("--require-agent=".length));
|
|
74
|
-
}
|
|
75
|
-
else if (arg?.startsWith("-")) {
|
|
76
|
-
return { ...acc, error: `unrecognized argument: ${arg}` };
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
return { ...acc, error: `unrecognized argument: ${arg}` };
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return acc;
|
|
83
|
-
}
|
|
84
|
-
function scratchEntries(scratchDirs, cwd) {
|
|
85
|
-
if (scratchDirs.length > 0) {
|
|
86
|
-
return scratchDirs.map((p) => ({ readPath: resolve(cwd, p), label: p }));
|
|
87
|
-
}
|
|
88
|
-
const defaultDir = defaultScratchDir(cwd);
|
|
89
|
-
return [{ readPath: defaultDir, label: defaultDir }];
|
|
90
|
-
}
|
|
91
|
-
/** Evaluate liveness for required in-flight workers. */
|
|
92
|
-
export function evaluateSubagentAliveGate(args, cwd = process.cwd()) {
|
|
93
|
-
if (args.error !== undefined) {
|
|
94
|
-
return {
|
|
95
|
-
exitCode: EXIT_EXTERNAL_ERROR,
|
|
96
|
-
redispatchOk: false,
|
|
97
|
-
message: `verify_subagent_alive: ${args.error}`,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
if (Number.isNaN(args.thresholdMinutes) || args.thresholdMinutes <= 0) {
|
|
101
|
-
return {
|
|
102
|
-
exitCode: EXIT_EXTERNAL_ERROR,
|
|
103
|
-
redispatchOk: false,
|
|
104
|
-
message: `verify_subagent_alive: --threshold-minutes must be positive, got ${args.thresholdMinutes}`,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const entries = scratchEntries(args.scratchDirs, cwd);
|
|
108
|
-
const sweep = sweepScratchDirs(entries, { thresholdMinutes: args.thresholdMinutes });
|
|
109
|
-
const configError = sweep.sweep_errors.length > 0 && sweep.records.length === 0;
|
|
110
|
-
const missingAgents = [];
|
|
111
|
-
for (const agentId of args.requireAgents) {
|
|
112
|
-
const rec = sweep.records.find((r) => r.agent_id === agentId);
|
|
113
|
-
if (rec === undefined || !recordOk(rec)) {
|
|
114
|
-
missingAgents.push(agentId);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
const requiredUnhealthy = missingAgents.length > 0;
|
|
118
|
-
// When --require-agent is set, only named workers gate the verdict; unrelated
|
|
119
|
-
// stale records in a shared scratch dir must not trigger REDISPATCH_OK (#2824).
|
|
120
|
-
const sweepUnhealthy = args.requireAgents.length === 0 && !sweepAllOk(sweep);
|
|
121
|
-
const unhealthy = sweepUnhealthy || requiredUnhealthy;
|
|
122
|
-
if (args.emitJson) {
|
|
123
|
-
return {
|
|
124
|
-
exitCode: configError ? EXIT_EXTERNAL_ERROR : unhealthy ? EXIT_STALE : EXIT_OK,
|
|
125
|
-
redispatchOk: unhealthy && !configError,
|
|
126
|
-
message: "",
|
|
127
|
-
json: {
|
|
128
|
-
all_ok: !unhealthy && !configError,
|
|
129
|
-
redispatch_ok: unhealthy && !configError,
|
|
130
|
-
required_agents: [...args.requireAgents],
|
|
131
|
-
missing_or_stale_agents: missingAgents,
|
|
132
|
-
// Flat per-agent records including wait_kind (#5278 P2).
|
|
133
|
-
records: sweep.records.map((r) => ({
|
|
134
|
-
agent_id: r.agent_id,
|
|
135
|
-
phase: r.phase,
|
|
136
|
-
wait_kind: r.wait_kind,
|
|
137
|
-
head_sha: r.head_sha,
|
|
138
|
-
pr_number: r.pr_number,
|
|
139
|
-
last_heartbeat_at: r.last_heartbeat_at_iso,
|
|
140
|
-
age_seconds: r.age_seconds,
|
|
141
|
-
is_stale: r.is_stale,
|
|
142
|
-
is_terminal: r.is_terminal,
|
|
143
|
-
failures: [...r.failures],
|
|
144
|
-
ok: recordOk(r),
|
|
145
|
-
})),
|
|
146
|
-
sweep: {
|
|
147
|
-
scratch_dirs: sweep.scratch_dirs,
|
|
148
|
-
threshold_minutes: sweep.threshold_minutes,
|
|
149
|
-
stale_count: sweep.records.filter((r) => r.is_stale).length,
|
|
150
|
-
malformed_count: sweep.records.filter((r) => r.failures.length > 0).length,
|
|
151
|
-
sweep_errors: sweep.sweep_errors,
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (configError) {
|
|
157
|
-
const detail = sweep.sweep_errors.join("; ");
|
|
158
|
-
return {
|
|
159
|
-
exitCode: EXIT_EXTERNAL_ERROR,
|
|
160
|
-
redispatchOk: false,
|
|
161
|
-
message: `verify_subagent_alive: config error — ${detail}`,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
if (!unhealthy) {
|
|
165
|
-
const count = args.requireAgents.length > 0 ? args.requireAgents.length : sweep.records.length;
|
|
166
|
-
return {
|
|
167
|
-
exitCode: EXIT_OK,
|
|
168
|
-
redispatchOk: false,
|
|
169
|
-
message: `verify_subagent_alive: all ${count} monitored worker(s) alive`,
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
const lines = ["verify_subagent_alive: worker liveness gate FAILED"];
|
|
173
|
-
if (requiredUnhealthy) {
|
|
174
|
-
lines.push(` Missing or STALE required agent(s): ${missingAgents.join(", ")}`);
|
|
175
|
-
}
|
|
176
|
-
if (sweepUnhealthy && args.requireAgents.length === 0) {
|
|
177
|
-
const stale = sweep.records.filter((r) => r.is_stale).length;
|
|
178
|
-
const malformed = sweep.records.filter((r) => r.failures.length > 0).length;
|
|
179
|
-
lines.push(` Sweep: ${stale} stale, ${malformed} malformed record(s)`);
|
|
180
|
-
}
|
|
181
|
-
lines.push("");
|
|
182
|
-
lines.push("REDISPATCH_OK: host-reported running + missing/STALE heartbeat authorizes takeover.");
|
|
183
|
-
lines.push("A killed worker's delivery attempt stays running until cancelled.");
|
|
184
|
-
lines.push("Takeover: task subagent:pre-cancel -- --agent <id> --canceller-id <id> --target-id <worktree>");
|
|
185
|
-
lines.push("then: task swarm:pre-dispatch -- --scope-id <id> --target-id <worktree> --action cancel --agent <id>");
|
|
186
|
-
lines.push("then: task swarm:pre-dispatch -- --scope-id <id> --target-id <worktree>");
|
|
187
|
-
lines.push("If verify:session-ritual --tier=gated fails, run session:start --rearm --session-id=<same> first.");
|
|
188
|
-
lines.push("Do not wait on Cursor false-alive state. Do not spawn while DENY_DUPLICATE_ACTIVE.");
|
|
189
|
-
lines.push("⊗ bare ledger cancel while pre-cancel is red (#5278).");
|
|
190
|
-
return {
|
|
191
|
-
exitCode: EXIT_STALE,
|
|
192
|
-
redispatchOk: true,
|
|
193
|
-
message: lines.join("\n"),
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
export function run(argv) {
|
|
197
|
-
const args = parseVerifySubagentAliveArgs(argv);
|
|
198
|
-
if (args.help) {
|
|
199
|
-
process.stdout.write(SUBAGENT_ALIVE_HELP);
|
|
200
|
-
return EXIT_OK;
|
|
201
|
-
}
|
|
202
|
-
const verdict = evaluateSubagentAliveGate(args);
|
|
203
|
-
if (args.emitJson && verdict.json !== undefined) {
|
|
204
|
-
process.stdout.write(`${JSON.stringify(verdict.json, null, 2)}\n`);
|
|
205
|
-
}
|
|
206
|
-
else if (verdict.message.length > 0) {
|
|
207
|
-
if (verdict.exitCode === EXIT_OK) {
|
|
208
|
-
process.stdout.write(`${verdict.message}\n`);
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
process.stderr.write(`${verdict.message}\n`);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return verdict.exitCode;
|
|
215
|
-
}
|
|
216
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
217
|
-
process.exit(run(process.argv.slice(2)));
|
|
218
|
-
}
|
|
219
|
-
//# sourceMappingURL=verify-subagent-alive.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export declare const SUBAGENT_STEER_HELP = "verify:subagent-steer \u2014 parent-visible unread steer flag (#4286)\n\nUsage:\n task verify:subagent-steer -- [options]\n\nOptions:\n --steer-dir PATH Inbox directory (default: .deft-scratch/subagent-steer)\n --agent ID Agent whose inbox to inspect (repeatable; default: all)\n --json Machine-readable output\n\nExit codes:\n 0 No unread unexpired steer\n 1 STEER_PENDING \u2014 unread inbox; not REDISPATCH_OK / takeover\n 2 Config error (invalid args, steer path is not a directory)\n";
|
|
3
|
-
export interface VerifySubagentSteerArgs {
|
|
4
|
-
steerDir: string | null;
|
|
5
|
-
agentIds: string[];
|
|
6
|
-
emitJson: boolean;
|
|
7
|
-
help: boolean;
|
|
8
|
-
error?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function parseVerifySubagentSteerArgs(argv: readonly string[]): VerifySubagentSteerArgs;
|
|
11
|
-
export interface SubagentSteerVerdict {
|
|
12
|
-
exitCode: number;
|
|
13
|
-
redispatchOk: false;
|
|
14
|
-
message: string;
|
|
15
|
-
json?: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
export declare function evaluateSubagentSteerGate(args: VerifySubagentSteerArgs, cwd?: string): SubagentSteerVerdict;
|
|
18
|
-
export declare function run(argv: readonly string[]): number;
|
|
19
|
-
//# sourceMappingURL=verify-subagent-steer.d.ts.map
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Parent-visible unread steer flag (#4286). Exit 1 is STEER_PENDING.
|
|
4
|
-
* Never prints REDISPATCH_OK — unread steer is not missing heartbeat.
|
|
5
|
-
*/
|
|
6
|
-
import { resolve } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { defaultSteerDir, EXIT_STEER_CONFIG, EXIT_STEER_OK, EXIT_STEER_PENDING, renderSteerPendingText, steerPendingConfigError, sweepSteerPending, } from "@deftai/directive-core/orchestration";
|
|
9
|
-
export const SUBAGENT_STEER_HELP = `verify:subagent-steer — parent-visible unread steer flag (#4286)
|
|
10
|
-
|
|
11
|
-
Usage:
|
|
12
|
-
task verify:subagent-steer -- [options]
|
|
13
|
-
|
|
14
|
-
Options:
|
|
15
|
-
--steer-dir PATH Inbox directory (default: .deft-scratch/subagent-steer)
|
|
16
|
-
--agent ID Agent whose inbox to inspect (repeatable; default: all)
|
|
17
|
-
--json Machine-readable output
|
|
18
|
-
|
|
19
|
-
Exit codes:
|
|
20
|
-
0 No unread unexpired steer
|
|
21
|
-
1 STEER_PENDING — unread inbox; not REDISPATCH_OK / takeover
|
|
22
|
-
2 Config error (invalid args, steer path is not a directory)
|
|
23
|
-
`;
|
|
24
|
-
export function parseVerifySubagentSteerArgs(argv) {
|
|
25
|
-
const acc = {
|
|
26
|
-
steerDir: null,
|
|
27
|
-
agentIds: [],
|
|
28
|
-
emitJson: false,
|
|
29
|
-
help: false,
|
|
30
|
-
};
|
|
31
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
32
|
-
const arg = argv[i];
|
|
33
|
-
if (arg === "--help" || arg === "-h") {
|
|
34
|
-
return { ...acc, help: true };
|
|
35
|
-
}
|
|
36
|
-
if (arg === "--json") {
|
|
37
|
-
acc.emitJson = true;
|
|
38
|
-
}
|
|
39
|
-
else if (arg === "--steer-dir") {
|
|
40
|
-
const value = argv[i + 1];
|
|
41
|
-
if (value === undefined) {
|
|
42
|
-
return { ...acc, error: "argument --steer-dir: expected one argument" };
|
|
43
|
-
}
|
|
44
|
-
acc.steerDir = value;
|
|
45
|
-
i += 1;
|
|
46
|
-
}
|
|
47
|
-
else if (arg?.startsWith("--steer-dir=")) {
|
|
48
|
-
acc.steerDir = arg.slice("--steer-dir=".length);
|
|
49
|
-
}
|
|
50
|
-
else if (arg === "--agent") {
|
|
51
|
-
const value = argv[i + 1];
|
|
52
|
-
if (value === undefined) {
|
|
53
|
-
return { ...acc, error: "argument --agent: expected one argument" };
|
|
54
|
-
}
|
|
55
|
-
acc.agentIds.push(value);
|
|
56
|
-
i += 1;
|
|
57
|
-
}
|
|
58
|
-
else if (arg?.startsWith("--agent=")) {
|
|
59
|
-
acc.agentIds.push(arg.slice("--agent=".length));
|
|
60
|
-
}
|
|
61
|
-
else if (arg?.startsWith("-")) {
|
|
62
|
-
return { ...acc, error: `unrecognized argument: ${arg}` };
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return { ...acc, error: `unrecognized argument: ${arg}` };
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return acc;
|
|
69
|
-
}
|
|
70
|
-
export function evaluateSubagentSteerGate(args, cwd = process.cwd()) {
|
|
71
|
-
if (args.error !== undefined) {
|
|
72
|
-
return {
|
|
73
|
-
exitCode: EXIT_STEER_CONFIG,
|
|
74
|
-
redispatchOk: false,
|
|
75
|
-
message: `verify_subagent_steer: ${args.error}`,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
const steerDir = resolve(cwd, args.steerDir ?? defaultSteerDir(cwd));
|
|
79
|
-
const sweep = sweepSteerPending(steerDir, {
|
|
80
|
-
agentIds: args.agentIds.length > 0 ? args.agentIds : undefined,
|
|
81
|
-
});
|
|
82
|
-
const configError = steerPendingConfigError(sweep);
|
|
83
|
-
const pending = sweep.pending.length > 0 || sweep.parse_failures.length > 0;
|
|
84
|
-
if (args.emitJson) {
|
|
85
|
-
return {
|
|
86
|
-
exitCode: configError ? EXIT_STEER_CONFIG : pending ? EXIT_STEER_PENDING : EXIT_STEER_OK,
|
|
87
|
-
redispatchOk: false,
|
|
88
|
-
message: "",
|
|
89
|
-
json: {
|
|
90
|
-
all_ok: !pending && !configError,
|
|
91
|
-
steer_pending: pending,
|
|
92
|
-
redispatch_ok: false,
|
|
93
|
-
pending_agents: sweep.pending.map((p) => p.agent_id),
|
|
94
|
-
pending: sweep.pending,
|
|
95
|
-
parse_failures: sweep.parse_failures,
|
|
96
|
-
sweep_errors: sweep.sweep_errors,
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
if (configError) {
|
|
101
|
-
return {
|
|
102
|
-
exitCode: EXIT_STEER_CONFIG,
|
|
103
|
-
redispatchOk: false,
|
|
104
|
-
message: renderSteerPendingText(sweep),
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
exitCode: pending ? EXIT_STEER_PENDING : EXIT_STEER_OK,
|
|
109
|
-
redispatchOk: false,
|
|
110
|
-
message: renderSteerPendingText(sweep),
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
export function run(argv) {
|
|
114
|
-
const args = parseVerifySubagentSteerArgs(argv);
|
|
115
|
-
if (args.help) {
|
|
116
|
-
process.stdout.write(SUBAGENT_STEER_HELP);
|
|
117
|
-
return EXIT_STEER_OK;
|
|
118
|
-
}
|
|
119
|
-
const verdict = evaluateSubagentSteerGate(args);
|
|
120
|
-
if (args.emitJson && verdict.json !== undefined) {
|
|
121
|
-
process.stdout.write(`${JSON.stringify(verdict.json, null, 2)}\n`);
|
|
122
|
-
}
|
|
123
|
-
else if (verdict.message.length > 0) {
|
|
124
|
-
if (verdict.exitCode === EXIT_STEER_OK) {
|
|
125
|
-
process.stdout.write(`${verdict.message}\n`);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
process.stderr.write(`${verdict.message}\n`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return verdict.exitCode;
|
|
132
|
-
}
|
|
133
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
134
|
-
process.exit(run(process.argv.slice(2)));
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=verify-subagent-steer.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
policyPath: string | null;
|
|
5
|
-
enforce: boolean | undefined;
|
|
6
|
-
quiet: boolean;
|
|
7
|
-
error?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
10
|
-
export declare function run(argv: string[]): number;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=verify-test-boundary.d.ts.map
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CLI for verify:test-boundary (#3145).
|
|
4
|
-
*/
|
|
5
|
-
import { resolve } from "node:path";
|
|
6
|
-
import { testBoundary } from "@deftai/directive-core";
|
|
7
|
-
import { isDirectEntrypoint } from "./entrypoint.js";
|
|
8
|
-
export function parseArgs(argv) {
|
|
9
|
-
const parsed = {
|
|
10
|
-
projectRoot: ".",
|
|
11
|
-
policyPath: null,
|
|
12
|
-
enforce: undefined,
|
|
13
|
-
quiet: false,
|
|
14
|
-
};
|
|
15
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
16
|
-
const arg = argv[i];
|
|
17
|
-
if (arg === "--quiet") {
|
|
18
|
-
parsed.quiet = true;
|
|
19
|
-
}
|
|
20
|
-
else if (arg === "--enforce") {
|
|
21
|
-
parsed.enforce = true;
|
|
22
|
-
}
|
|
23
|
-
else if (arg === "--warn") {
|
|
24
|
-
parsed.enforce = false;
|
|
25
|
-
}
|
|
26
|
-
else if (arg === "--project-root") {
|
|
27
|
-
const value = argv[i + 1];
|
|
28
|
-
if (value === undefined) {
|
|
29
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
30
|
-
}
|
|
31
|
-
parsed.projectRoot = value;
|
|
32
|
-
i += 1;
|
|
33
|
-
}
|
|
34
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
35
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
36
|
-
}
|
|
37
|
-
else if (arg === "--policy") {
|
|
38
|
-
const value = argv[i + 1];
|
|
39
|
-
if (value === undefined) {
|
|
40
|
-
return { ...parsed, error: "argument --policy: expected one argument" };
|
|
41
|
-
}
|
|
42
|
-
parsed.policyPath = value;
|
|
43
|
-
i += 1;
|
|
44
|
-
}
|
|
45
|
-
else if (arg?.startsWith("--policy=")) {
|
|
46
|
-
parsed.policyPath = arg.slice("--policy=".length);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return parsed;
|
|
53
|
-
}
|
|
54
|
-
export function run(argv) {
|
|
55
|
-
const args = parseArgs(argv);
|
|
56
|
-
if (args.error !== undefined) {
|
|
57
|
-
process.stderr.write(`verify_test_boundary: ${args.error}\n`);
|
|
58
|
-
return 2;
|
|
59
|
-
}
|
|
60
|
-
const projectRoot = resolve(args.projectRoot);
|
|
61
|
-
const policyPath = args.policyPath !== null ? resolve(args.policyPath) : null;
|
|
62
|
-
const result = testBoundary.evaluateTestBoundary(projectRoot, {
|
|
63
|
-
policyPath,
|
|
64
|
-
enforce: args.enforce,
|
|
65
|
-
quiet: args.quiet,
|
|
66
|
-
});
|
|
67
|
-
if (result.exitCode === 0) {
|
|
68
|
-
if (!args.quiet) {
|
|
69
|
-
process.stdout.write(`${result.message}\n`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
process.stderr.write(`${result.message}\n`);
|
|
74
|
-
}
|
|
75
|
-
return result.exitCode;
|
|
76
|
-
}
|
|
77
|
-
if (isDirectEntrypoint(import.meta.url)) {
|
|
78
|
-
process.exit(run(process.argv.slice(2)));
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=verify-test-boundary.js.map
|