@deftai/directive 0.125.2 → 0.126.0-beta.2
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 +4333 -3
- package/package.json +12 -23
- 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 -18
- package/dist/coverage-hotspots.js +0 -158
- 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 -3082
- 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 -18
- package/dist/occupancy-release.js +0 -94
- 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 -13
- package/dist/plan-sequence.js +0 -196
- package/dist/policy-fixtures.d.ts +0 -33
- package/dist/policy-fixtures.js +0 -118
- package/dist/policy.d.ts +0 -35
- package/dist/policy.js +0 -738
- 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 -554
- 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 -225
- 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 -15
- package/dist/verify-intent-constraint.js +0 -86
- 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 -15
- package/dist/verify-observable-scope.js +0 -86
- 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 -25
- package/dist/verify-review-monitor.js +0 -341
- 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,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
xbriefPath: string | null;
|
|
5
|
-
quiet: boolean;
|
|
6
|
-
captureOnly: boolean;
|
|
7
|
-
error?: string;
|
|
8
|
-
}
|
|
9
|
-
/** Parse verify-literal-ac CLI args. */
|
|
10
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
11
|
-
/** Run the gate and return the process exit code. */
|
|
12
|
-
export declare function run(argv: string[]): number;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=verify-literal-ac.d.ts.map
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CLI: task verify:literal-ac — run stored literal acceptance commands verbatim (#3267).
|
|
4
|
-
*/
|
|
5
|
-
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
6
|
-
import { join, resolve } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { evaluateLiteralAcceptanceFromPath, formatRejectedLedger, resolveLiteralAcceptanceDetailed, } from "@deftai/directive-core/literal-acceptance";
|
|
9
|
-
/** Parse verify-literal-ac CLI args. */
|
|
10
|
-
export function parseArgs(argv) {
|
|
11
|
-
const parsed = {
|
|
12
|
-
projectRoot: ".",
|
|
13
|
-
xbriefPath: null,
|
|
14
|
-
quiet: false,
|
|
15
|
-
captureOnly: false,
|
|
16
|
-
};
|
|
17
|
-
const positionals = [];
|
|
18
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
19
|
-
const arg = argv[i];
|
|
20
|
-
if (arg === "--quiet") {
|
|
21
|
-
parsed.quiet = true;
|
|
22
|
-
}
|
|
23
|
-
else if (arg === "--capture-only") {
|
|
24
|
-
parsed.captureOnly = true;
|
|
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 === "--xbrief" || arg === "--vbrief") {
|
|
38
|
-
const value = argv[i + 1];
|
|
39
|
-
if (value === undefined) {
|
|
40
|
-
return { ...parsed, error: `argument ${arg}: expected one argument` };
|
|
41
|
-
}
|
|
42
|
-
parsed.xbriefPath = value;
|
|
43
|
-
i += 1;
|
|
44
|
-
}
|
|
45
|
-
else if (arg?.startsWith("--xbrief=") || arg?.startsWith("--vbrief=")) {
|
|
46
|
-
parsed.xbriefPath = arg.slice(arg.indexOf("=") + 1);
|
|
47
|
-
}
|
|
48
|
-
else if (arg?.startsWith("-")) {
|
|
49
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
50
|
-
}
|
|
51
|
-
else if (arg !== undefined) {
|
|
52
|
-
positionals.push(arg);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (parsed.xbriefPath === null && positionals.length > 0) {
|
|
56
|
-
parsed.xbriefPath = positionals[0] ?? null;
|
|
57
|
-
}
|
|
58
|
-
return parsed;
|
|
59
|
-
}
|
|
60
|
-
function findActiveXbrief(projectRoot) {
|
|
61
|
-
for (const dirName of ["xbrief", "vbrief"]) {
|
|
62
|
-
const active = join(projectRoot, dirName, "active");
|
|
63
|
-
if (!existsSync(active))
|
|
64
|
-
continue;
|
|
65
|
-
let names = [];
|
|
66
|
-
try {
|
|
67
|
-
names = readdirSync(active).filter((n) => n.endsWith(".xbrief.json") || n.endsWith(".vbrief.json"));
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
if (names.length === 1) {
|
|
73
|
-
return join(active, names[0]);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
function asRecord(value) {
|
|
79
|
-
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
/** Run the gate and return the process exit code. */
|
|
85
|
-
export function run(argv) {
|
|
86
|
-
const args = parseArgs(argv);
|
|
87
|
-
if (args.error !== undefined) {
|
|
88
|
-
process.stderr.write(`verify_literal_ac: ${args.error}\n`);
|
|
89
|
-
return 2;
|
|
90
|
-
}
|
|
91
|
-
const projectRoot = resolve(args.projectRoot);
|
|
92
|
-
let xbriefPath = args.xbriefPath !== null ? resolve(projectRoot, args.xbriefPath) : null;
|
|
93
|
-
if (xbriefPath === null) {
|
|
94
|
-
xbriefPath = findActiveXbrief(projectRoot);
|
|
95
|
-
}
|
|
96
|
-
if (xbriefPath === null) {
|
|
97
|
-
process.stderr.write("verify_literal_ac: pass an xBRIEF path or ensure exactly one artifact in xbrief/active/\n" +
|
|
98
|
-
" Usage: task verify:literal-ac -- <path-to-active.xbrief.json>\n" +
|
|
99
|
-
" Refs #3267 literal acceptance-command verification\n");
|
|
100
|
-
return 2;
|
|
101
|
-
}
|
|
102
|
-
if (args.captureOnly) {
|
|
103
|
-
try {
|
|
104
|
-
const data = asRecord(JSON.parse(readFileSync(xbriefPath, "utf8")));
|
|
105
|
-
if (data === null) {
|
|
106
|
-
process.stderr.write("verify_literal_ac: xBRIEF top-level is not an object\n");
|
|
107
|
-
return 2;
|
|
108
|
-
}
|
|
109
|
-
const plan = asRecord(data.plan);
|
|
110
|
-
if (plan === null) {
|
|
111
|
-
process.stderr.write("verify_literal_ac: xBRIEF missing plan object\n");
|
|
112
|
-
return 2;
|
|
113
|
-
}
|
|
114
|
-
const resolved = resolveLiteralAcceptanceDetailed(plan, { captureFromNarratives: true });
|
|
115
|
-
const payload = {
|
|
116
|
-
xbrief: xbriefPath,
|
|
117
|
-
count: resolved.commands.length,
|
|
118
|
-
rejected_count: resolved.rejected.length,
|
|
119
|
-
commands: resolved.commands.map((c) => ({
|
|
120
|
-
command: c.command,
|
|
121
|
-
source: c.source,
|
|
122
|
-
sourceSpan: c.sourceSpan ?? null,
|
|
123
|
-
cwd: c.cwd ?? null,
|
|
124
|
-
expectedExitCode: c.expectedExitCode ?? 0,
|
|
125
|
-
})),
|
|
126
|
-
rejected: resolved.rejected.map((r) => ({
|
|
127
|
-
command: r.command,
|
|
128
|
-
reason: r.reason,
|
|
129
|
-
sourceSpan: r.sourceSpan ?? null,
|
|
130
|
-
})),
|
|
131
|
-
// Prose-derived captures demoted by structured acceptance commands (#3484).
|
|
132
|
-
advisory_rejected_count: resolved.advisoryRejected.length,
|
|
133
|
-
advisory_rejected: resolved.advisoryRejected.map((r) => ({
|
|
134
|
-
command: r.command,
|
|
135
|
-
reason: r.reason,
|
|
136
|
-
sourceSpan: r.sourceSpan ?? null,
|
|
137
|
-
})),
|
|
138
|
-
};
|
|
139
|
-
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
140
|
-
if (resolved.rejected.length > 0) {
|
|
141
|
-
process.stderr.write(`${formatRejectedLedger(resolved.rejected)}\n`);
|
|
142
|
-
}
|
|
143
|
-
return 0;
|
|
144
|
-
}
|
|
145
|
-
catch (err) {
|
|
146
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
147
|
-
process.stderr.write(`verify_literal_ac: ${msg}\n`);
|
|
148
|
-
return 2;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const result = evaluateLiteralAcceptanceFromPath(xbriefPath, {
|
|
152
|
-
projectRoot,
|
|
153
|
-
quiet: args.quiet,
|
|
154
|
-
});
|
|
155
|
-
if (result.message.length > 0) {
|
|
156
|
-
if (result.ok) {
|
|
157
|
-
process.stdout.write(`${result.message}\n`);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
process.stderr.write(`${result.message}\n`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return result.code;
|
|
164
|
-
}
|
|
165
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
166
|
-
process.exit(run(process.argv.slice(2)));
|
|
167
|
-
}
|
|
168
|
-
//# sourceMappingURL=verify-literal-ac.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { formatScanResult, scan } from "@deftai/directive-core/verify-env";
|
|
4
|
-
export function run() {
|
|
5
|
-
const findings = scan();
|
|
6
|
-
const result = formatScanResult(findings);
|
|
7
|
-
if (result.stdout.length > 0)
|
|
8
|
-
process.stdout.write(result.stdout);
|
|
9
|
-
if (result.stderr.length > 0)
|
|
10
|
-
process.stderr.write(result.stderr);
|
|
11
|
-
return result.exitCode;
|
|
12
|
-
}
|
|
13
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
14
|
-
process.exit(run());
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=verify-no-task-runtime.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
originRef?: string;
|
|
5
|
-
staged: boolean;
|
|
6
|
-
quiet: boolean;
|
|
7
|
-
planId?: string;
|
|
8
|
-
error?: string;
|
|
9
|
-
}
|
|
10
|
-
/** Parse verify-observable-scope CLI args. */
|
|
11
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
12
|
-
/** Run the gate and return the process exit code. */
|
|
13
|
-
export declare function run(argv: string[]): number;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=verify-observable-scope.d.ts.map
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { evaluateObservableScope } from "@deftai/directive-core/observable-scope";
|
|
5
|
-
/** Parse verify-observable-scope CLI args. */
|
|
6
|
-
export function parseArgs(argv) {
|
|
7
|
-
const parsed = { projectRoot: ".", staged: false, quiet: false };
|
|
8
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
-
const arg = argv[i];
|
|
10
|
-
if (arg === "--quiet") {
|
|
11
|
-
parsed.quiet = true;
|
|
12
|
-
}
|
|
13
|
-
else if (arg === "--staged") {
|
|
14
|
-
parsed.staged = true;
|
|
15
|
-
}
|
|
16
|
-
else if (arg === "--project-root") {
|
|
17
|
-
const value = argv[i + 1];
|
|
18
|
-
if (value === undefined) {
|
|
19
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
20
|
-
}
|
|
21
|
-
parsed.projectRoot = value;
|
|
22
|
-
i += 1;
|
|
23
|
-
}
|
|
24
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
25
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
26
|
-
}
|
|
27
|
-
else if (arg === "--origin-ref") {
|
|
28
|
-
const value = argv[i + 1];
|
|
29
|
-
if (value === undefined) {
|
|
30
|
-
return { ...parsed, error: "argument --origin-ref: expected one argument" };
|
|
31
|
-
}
|
|
32
|
-
parsed.originRef = value;
|
|
33
|
-
i += 1;
|
|
34
|
-
}
|
|
35
|
-
else if (arg?.startsWith("--origin-ref=")) {
|
|
36
|
-
parsed.originRef = arg.slice("--origin-ref=".length);
|
|
37
|
-
}
|
|
38
|
-
else if (arg === "--plan-id") {
|
|
39
|
-
const value = argv[i + 1];
|
|
40
|
-
if (value === undefined) {
|
|
41
|
-
return { ...parsed, error: "argument --plan-id: expected one argument" };
|
|
42
|
-
}
|
|
43
|
-
parsed.planId = value;
|
|
44
|
-
i += 1;
|
|
45
|
-
}
|
|
46
|
-
else if (arg?.startsWith("--plan-id=")) {
|
|
47
|
-
parsed.planId = arg.slice("--plan-id=".length);
|
|
48
|
-
}
|
|
49
|
-
else if (arg === "--base-ref") {
|
|
50
|
-
return {
|
|
51
|
-
...parsed,
|
|
52
|
-
error: "unrecognized argument: --base-ref (baseline is the computed merge base; use --origin-ref to name the origin default)",
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return parsed;
|
|
60
|
-
}
|
|
61
|
-
/** Run the gate and return the process exit code. */
|
|
62
|
-
export function run(argv) {
|
|
63
|
-
const args = parseArgs(argv);
|
|
64
|
-
if (args.error !== undefined) {
|
|
65
|
-
process.stderr.write(`verify_observable_scope: ${args.error}\n`);
|
|
66
|
-
return 2;
|
|
67
|
-
}
|
|
68
|
-
const result = evaluateObservableScope({
|
|
69
|
-
projectRoot: resolve(args.projectRoot),
|
|
70
|
-
originRef: args.originRef,
|
|
71
|
-
staged: args.staged,
|
|
72
|
-
quiet: args.quiet,
|
|
73
|
-
planId: args.planId,
|
|
74
|
-
});
|
|
75
|
-
if (result.message.length > 0) {
|
|
76
|
-
if (result.stream === "stdout")
|
|
77
|
-
process.stdout.write(`${result.message}\n`);
|
|
78
|
-
else if (result.stream === "stderr")
|
|
79
|
-
process.stderr.write(`${result.message}\n`);
|
|
80
|
-
}
|
|
81
|
-
return result.code;
|
|
82
|
-
}
|
|
83
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
84
|
-
process.exit(run(process.argv.slice(2)));
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=verify-observable-scope.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
promptFile?: string;
|
|
4
|
-
prompt?: string;
|
|
5
|
-
surfacesFile?: string;
|
|
6
|
-
briefOut?: string;
|
|
7
|
-
artifactOut?: string;
|
|
8
|
-
projectRoot: string;
|
|
9
|
-
quiet: boolean;
|
|
10
|
-
error?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Parse verify-operator-scope-limit CLI args. */
|
|
13
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
14
|
-
/** Run the gate and return the process exit code (0 clean/warn, 2 config). */
|
|
15
|
-
export declare function run(argv: string[]): number;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=verify-operator-scope-limit.d.ts.map
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Warn-first operator scope-limit check (#4545).
|
|
4
|
-
*
|
|
5
|
-
* Seeds a hard ceiling from an operator prompt (closed lexicon) and lists
|
|
6
|
-
* shipped surfaces not traceable to a recorded requirement line. Warn-first:
|
|
7
|
-
* untraceable surfaces print WARN and exit 0; config errors exit 2.
|
|
8
|
-
*
|
|
9
|
-
* Default path always persists a durable ceiling artifact (or merges into
|
|
10
|
-
* --brief-out). Without --surfaces-file, runs a default app/actions inventory;
|
|
11
|
-
* empty inventory warns that surfaces were not checked (does not silent-skip).
|
|
12
|
-
*/
|
|
13
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
|
-
import { dirname, resolve } from "node:path";
|
|
15
|
-
import { fileURLToPath } from "node:url";
|
|
16
|
-
import { applyCeilingToBrief, evaluateUntraceableSurfaces, inventoryDefaultSurfaces, OPERATOR_SCOPE_CEILING_ARTIFACT_REL, SURFACES_NOT_CHECKED_REMEDIATION, seedOperatorScopeCeiling, UNTRACEABLE_SURFACE_REMEDIATION, } from "@deftai/directive-core/operator-scope-limit";
|
|
17
|
-
/** Parse verify-operator-scope-limit CLI args. */
|
|
18
|
-
export function parseArgs(argv) {
|
|
19
|
-
const parsed = { quiet: false, projectRoot: "." };
|
|
20
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
21
|
-
const arg = argv[i];
|
|
22
|
-
if (arg === "--quiet") {
|
|
23
|
-
parsed.quiet = true;
|
|
24
|
-
}
|
|
25
|
-
else if (arg === "--prompt-file") {
|
|
26
|
-
const value = argv[i + 1];
|
|
27
|
-
if (value === undefined) {
|
|
28
|
-
return { ...parsed, error: "argument --prompt-file: expected one argument" };
|
|
29
|
-
}
|
|
30
|
-
parsed.promptFile = value;
|
|
31
|
-
i += 1;
|
|
32
|
-
}
|
|
33
|
-
else if (arg?.startsWith("--prompt-file=")) {
|
|
34
|
-
parsed.promptFile = arg.slice("--prompt-file=".length);
|
|
35
|
-
}
|
|
36
|
-
else if (arg === "--prompt") {
|
|
37
|
-
const value = argv[i + 1];
|
|
38
|
-
if (value === undefined) {
|
|
39
|
-
return { ...parsed, error: "argument --prompt: expected one argument" };
|
|
40
|
-
}
|
|
41
|
-
parsed.prompt = value;
|
|
42
|
-
i += 1;
|
|
43
|
-
}
|
|
44
|
-
else if (arg?.startsWith("--prompt=")) {
|
|
45
|
-
parsed.prompt = arg.slice("--prompt=".length);
|
|
46
|
-
}
|
|
47
|
-
else if (arg === "--surfaces-file") {
|
|
48
|
-
const value = argv[i + 1];
|
|
49
|
-
if (value === undefined) {
|
|
50
|
-
return { ...parsed, error: "argument --surfaces-file: expected one argument" };
|
|
51
|
-
}
|
|
52
|
-
parsed.surfacesFile = value;
|
|
53
|
-
i += 1;
|
|
54
|
-
}
|
|
55
|
-
else if (arg?.startsWith("--surfaces-file=")) {
|
|
56
|
-
parsed.surfacesFile = arg.slice("--surfaces-file=".length);
|
|
57
|
-
}
|
|
58
|
-
else if (arg === "--brief-out") {
|
|
59
|
-
const value = argv[i + 1];
|
|
60
|
-
if (value === undefined) {
|
|
61
|
-
return { ...parsed, error: "argument --brief-out: expected one argument" };
|
|
62
|
-
}
|
|
63
|
-
parsed.briefOut = value;
|
|
64
|
-
i += 1;
|
|
65
|
-
}
|
|
66
|
-
else if (arg?.startsWith("--brief-out=")) {
|
|
67
|
-
parsed.briefOut = arg.slice("--brief-out=".length);
|
|
68
|
-
}
|
|
69
|
-
else if (arg === "--artifact-out") {
|
|
70
|
-
const value = argv[i + 1];
|
|
71
|
-
if (value === undefined) {
|
|
72
|
-
return { ...parsed, error: "argument --artifact-out: expected one argument" };
|
|
73
|
-
}
|
|
74
|
-
parsed.artifactOut = value;
|
|
75
|
-
i += 1;
|
|
76
|
-
}
|
|
77
|
-
else if (arg?.startsWith("--artifact-out=")) {
|
|
78
|
-
parsed.artifactOut = arg.slice("--artifact-out=".length);
|
|
79
|
-
}
|
|
80
|
-
else if (arg === "--project-root") {
|
|
81
|
-
const value = argv[i + 1];
|
|
82
|
-
if (value === undefined) {
|
|
83
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
84
|
-
}
|
|
85
|
-
parsed.projectRoot = value;
|
|
86
|
-
i += 1;
|
|
87
|
-
}
|
|
88
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
89
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return parsed;
|
|
96
|
-
}
|
|
97
|
-
function loadPrompt(args) {
|
|
98
|
-
if (typeof args.prompt === "string") {
|
|
99
|
-
return { ok: true, prompt: args.prompt };
|
|
100
|
-
}
|
|
101
|
-
if (typeof args.promptFile === "string" && args.promptFile.length > 0) {
|
|
102
|
-
try {
|
|
103
|
-
return { ok: true, prompt: readFileSync(resolve(args.promptFile), "utf8") };
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
106
|
-
return {
|
|
107
|
-
ok: false,
|
|
108
|
-
detail: `failed to read --prompt-file: ${err instanceof Error ? err.message : String(err)}`,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
ok: false,
|
|
114
|
-
detail: "required: --prompt <text> or --prompt-file <path>",
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function loadSurfacesFile(surfacesFile) {
|
|
118
|
-
try {
|
|
119
|
-
const raw = readFileSync(resolve(surfacesFile), "utf8");
|
|
120
|
-
const parsed = JSON.parse(raw);
|
|
121
|
-
if (!Array.isArray(parsed)) {
|
|
122
|
-
return { ok: false, detail: "--surfaces-file must be a JSON array" };
|
|
123
|
-
}
|
|
124
|
-
const surfaces = [];
|
|
125
|
-
for (const entry of parsed) {
|
|
126
|
-
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
127
|
-
return { ok: false, detail: "--surfaces-file entries must be objects" };
|
|
128
|
-
}
|
|
129
|
-
const obj = entry;
|
|
130
|
-
if ((obj.kind !== "server-action" && obj.kind !== "route" && obj.kind !== "page") ||
|
|
131
|
-
typeof obj.id !== "string" ||
|
|
132
|
-
obj.id.trim().length === 0) {
|
|
133
|
-
return {
|
|
134
|
-
ok: false,
|
|
135
|
-
detail: "--surfaces-file entries need kind (server-action|route|page) and id",
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
surfaces.push({
|
|
139
|
-
kind: obj.kind,
|
|
140
|
-
id: obj.id,
|
|
141
|
-
path: typeof obj.path === "string" ? obj.path : undefined,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
return { ok: true, surfaces };
|
|
145
|
-
}
|
|
146
|
-
catch (err) {
|
|
147
|
-
return {
|
|
148
|
-
ok: false,
|
|
149
|
-
detail: `failed to read --surfaces-file: ${err instanceof Error ? err.message : String(err)}`,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function writeJsonFile(path, value) {
|
|
154
|
-
try {
|
|
155
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
156
|
-
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
157
|
-
return { ok: true };
|
|
158
|
-
}
|
|
159
|
-
catch (err) {
|
|
160
|
-
return {
|
|
161
|
-
ok: false,
|
|
162
|
-
detail: `failed to write ${path}: ${err instanceof Error ? err.message : String(err)}`,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function loadExistingBrief(path) {
|
|
167
|
-
if (!existsSync(path))
|
|
168
|
-
return null;
|
|
169
|
-
try {
|
|
170
|
-
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
171
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
172
|
-
return null;
|
|
173
|
-
return raw;
|
|
174
|
-
}
|
|
175
|
-
catch {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
/** Persist ceiling: explicit outs, else default durable artifact under project root. */
|
|
180
|
-
function persistCeiling(input) {
|
|
181
|
-
const { projectRoot, ceiling, artifactOut, briefOut } = input;
|
|
182
|
-
let durablePath = null;
|
|
183
|
-
if (typeof artifactOut === "string" && artifactOut.length > 0) {
|
|
184
|
-
const path = resolve(artifactOut);
|
|
185
|
-
const wrote = writeJsonFile(path, ceiling);
|
|
186
|
-
if (!wrote.ok)
|
|
187
|
-
return wrote;
|
|
188
|
-
durablePath = path;
|
|
189
|
-
}
|
|
190
|
-
if (typeof briefOut === "string" && briefOut.length > 0) {
|
|
191
|
-
const path = resolve(briefOut);
|
|
192
|
-
const existing = loadExistingBrief(path);
|
|
193
|
-
const base = existing ??
|
|
194
|
-
{
|
|
195
|
-
xBRIEFInfo: { version: "0.8" },
|
|
196
|
-
plan: { status: "draft", metadata: {} },
|
|
197
|
-
};
|
|
198
|
-
// Merge/add ceiling onto existing proposed/active brief — never replace scope.
|
|
199
|
-
const merged = applyCeilingToBrief(base, ceiling);
|
|
200
|
-
const wrote = writeJsonFile(path, merged);
|
|
201
|
-
if (!wrote.ok)
|
|
202
|
-
return wrote;
|
|
203
|
-
durablePath = path;
|
|
204
|
-
}
|
|
205
|
-
if (durablePath === null) {
|
|
206
|
-
const path = resolve(projectRoot, OPERATOR_SCOPE_CEILING_ARTIFACT_REL);
|
|
207
|
-
const wrote = writeJsonFile(path, ceiling);
|
|
208
|
-
if (!wrote.ok)
|
|
209
|
-
return wrote;
|
|
210
|
-
durablePath = path;
|
|
211
|
-
}
|
|
212
|
-
return { ok: true, durablePath };
|
|
213
|
-
}
|
|
214
|
-
/** Run the gate and return the process exit code (0 clean/warn, 2 config). */
|
|
215
|
-
export function run(argv) {
|
|
216
|
-
const args = parseArgs(argv);
|
|
217
|
-
if (args.error !== undefined) {
|
|
218
|
-
process.stderr.write(`verify_operator_scope_limit: ${args.error}\n`);
|
|
219
|
-
return 2;
|
|
220
|
-
}
|
|
221
|
-
const projectRoot = resolve(args.projectRoot);
|
|
222
|
-
const promptLoad = loadPrompt(args);
|
|
223
|
-
if (!promptLoad.ok) {
|
|
224
|
-
process.stderr.write(`verify_operator_scope_limit: ${promptLoad.detail}\n`);
|
|
225
|
-
return 2;
|
|
226
|
-
}
|
|
227
|
-
const seeded = seedOperatorScopeCeiling(promptLoad.prompt, null);
|
|
228
|
-
if (!seeded.ok) {
|
|
229
|
-
process.stderr.write(`verify_operator_scope_limit: ${seeded.detail}\n`);
|
|
230
|
-
// No phrase is a returned miss — still exit 2 so callers know ceiling was not recorded.
|
|
231
|
-
return 2;
|
|
232
|
-
}
|
|
233
|
-
const persisted = persistCeiling({
|
|
234
|
-
projectRoot,
|
|
235
|
-
ceiling: seeded.ceiling,
|
|
236
|
-
artifactOut: args.artifactOut,
|
|
237
|
-
briefOut: args.briefOut,
|
|
238
|
-
});
|
|
239
|
-
if (!persisted.ok) {
|
|
240
|
-
process.stderr.write(`verify_operator_scope_limit: ${persisted.detail}\n`);
|
|
241
|
-
return 2;
|
|
242
|
-
}
|
|
243
|
-
let surfaces = [];
|
|
244
|
-
let surfacesSource = "default-inventory";
|
|
245
|
-
if (typeof args.surfacesFile === "string" && args.surfacesFile.length > 0) {
|
|
246
|
-
const surfacesLoad = loadSurfacesFile(args.surfacesFile);
|
|
247
|
-
if (!surfacesLoad.ok) {
|
|
248
|
-
process.stderr.write(`verify_operator_scope_limit: ${surfacesLoad.detail}\n`);
|
|
249
|
-
return 2;
|
|
250
|
-
}
|
|
251
|
-
surfaces = surfacesLoad.surfaces;
|
|
252
|
-
surfacesSource = "surfaces-file";
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
surfaces = inventoryDefaultSurfaces(projectRoot);
|
|
256
|
-
surfacesSource = "default-inventory";
|
|
257
|
-
}
|
|
258
|
-
if (surfaces.length === 0) {
|
|
259
|
-
if (!args.quiet) {
|
|
260
|
-
process.stdout.write(`operator-scope-limit WARN: surfaces were not checked ` +
|
|
261
|
-
`(source=${surfacesSource}; durable=${persisted.durablePath}; ` +
|
|
262
|
-
`phrase=${JSON.stringify(seeded.ceiling.matchedPhrase)}; ` +
|
|
263
|
-
`requirements=${seeded.ceiling.requirementLines.length}). ` +
|
|
264
|
-
`Remediation: ${SURFACES_NOT_CHECKED_REMEDIATION}\n`);
|
|
265
|
-
}
|
|
266
|
-
// Warn-first: missing inventory does not fail the process.
|
|
267
|
-
return 0;
|
|
268
|
-
}
|
|
269
|
-
const result = evaluateUntraceableSurfaces({
|
|
270
|
-
requirementLines: seeded.ceiling.requirementLines,
|
|
271
|
-
surfaces,
|
|
272
|
-
});
|
|
273
|
-
if (!args.quiet) {
|
|
274
|
-
process.stdout.write(`${result.message} (durable=${persisted.durablePath}; source=${surfacesSource})\n`);
|
|
275
|
-
if (result.severity === "warn") {
|
|
276
|
-
process.stdout.write(`Remediation: ${UNTRACEABLE_SURFACE_REMEDIATION}\n`);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
// Warn-first: untraceable surfaces do not fail the process.
|
|
280
|
-
return 0;
|
|
281
|
-
}
|
|
282
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
283
|
-
process.exit(run(process.argv.slice(2)));
|
|
284
|
-
}
|
|
285
|
-
//# sourceMappingURL=verify-operator-scope-limit.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
repo: string | null;
|
|
5
|
-
issue: number | null;
|
|
6
|
-
quiet: boolean;
|
|
7
|
-
skipGh: boolean;
|
|
8
|
-
changedOnly: boolean;
|
|
9
|
-
baseRef: string | null;
|
|
10
|
-
error?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Parse verify-orphan-active CLI args. */
|
|
13
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
14
|
-
/** Run the gate and return the process exit code. */
|
|
15
|
-
export declare function run(argv: string[]): number;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=verify-orphan-active.d.ts.map
|