@deftai/directive 0.126.0-beta.2 → 0.126.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents-refresh.d.ts +11 -0
- package/dist/agents-refresh.js +90 -0
- package/dist/authz.d.ts +7 -0
- package/dist/authz.js +732 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.js +3 -4333
- package/dist/branch-fixtures.d.ts +45 -0
- package/dist/branch-fixtures.js +156 -0
- package/dist/cache.d.ts +4 -0
- package/dist/cache.js +10 -0
- package/dist/capacity-backfill.d.ts +3 -0
- package/dist/capacity-backfill.js +9 -0
- package/dist/capacity-show.d.ts +3 -0
- package/dist/capacity-show.js +9 -0
- package/dist/change-init.d.ts +3 -0
- package/dist/change-init.js +59 -0
- package/dist/changelog-check.d.ts +3 -0
- package/dist/changelog-check.js +52 -0
- package/dist/check.d.ts +15 -0
- package/dist/check.js +150 -0
- package/dist/cli-package-version.d.ts +3 -0
- package/dist/cli-package-version.js +23 -0
- package/dist/cli-router/index.d.ts +8 -0
- package/dist/cli-router/index.js +44 -0
- package/dist/cli-router/route-argv.d.ts +40 -0
- package/dist/cli-router/route-argv.js +371 -0
- package/dist/codebase-default-extractor.d.ts +3 -0
- package/dist/codebase-default-extractor.js +9 -0
- package/dist/codebase-map-fresh.d.ts +3 -0
- package/dist/codebase-map-fresh.js +9 -0
- package/dist/codebase-map.d.ts +3 -0
- package/dist/codebase-map.js +9 -0
- package/dist/codebase-projection-registry.d.ts +3 -0
- package/dist/codebase-projection-registry.js +9 -0
- package/dist/codebase-provider.d.ts +3 -0
- package/dist/codebase-provider.js +9 -0
- package/dist/commit-lint.d.ts +3 -0
- package/dist/commit-lint.js +44 -0
- package/dist/content-validate-cli/validate-links.d.ts +11 -0
- package/dist/content-validate-cli/validate-links.js +37 -0
- package/dist/content-validate-cli/validate-strategy-output.d.ts +13 -0
- package/dist/content-validate-cli/validate-strategy-output.js +56 -0
- package/dist/content-validate-cli/verify-capacity.d.ts +12 -0
- package/dist/content-validate-cli/verify-capacity.js +54 -0
- package/dist/coverage-hotspots.d.ts +21 -0
- package/dist/coverage-hotspots.js +198 -0
- package/dist/design-critique-spend-resolve.d.ts +18 -0
- package/dist/design-critique-spend-resolve.js +191 -0
- package/dist/directive-finish-loop.d.ts +3 -0
- package/dist/directive-finish-loop.js +10 -0
- package/dist/dispatch.d.ts +193 -0
- package/dist/dispatch.js +3091 -0
- package/dist/doctor.d.ts +19 -0
- package/dist/doctor.js +155 -0
- package/dist/entrypoint.d.ts +6 -0
- package/dist/entrypoint.js +19 -0
- package/dist/escalation-cli.d.ts +4 -0
- package/dist/escalation-cli.js +301 -0
- package/dist/eval-health.d.ts +13 -0
- package/dist/eval-health.js +63 -0
- package/dist/eval-report.d.ts +15 -0
- package/dist/eval-report.js +97 -0
- package/dist/eval-run.d.ts +17 -0
- package/dist/eval-run.js +122 -0
- package/dist/eval-triggers.d.ts +12 -0
- package/dist/eval-triggers.js +56 -0
- package/dist/framework-check-updates.d.ts +10 -0
- package/dist/framework-check-updates.js +68 -0
- package/dist/gates-cli/_helpers.d.ts +24 -0
- package/dist/gates-cli/_helpers.js +115 -0
- package/dist/gates-cli/verify-bridge-drift.d.ts +11 -0
- package/dist/gates-cli/verify-bridge-drift.js +47 -0
- package/dist/gates-cli/verify-go-freeze.d.ts +11 -0
- package/dist/gates-cli/verify-go-freeze.js +48 -0
- package/dist/hook-bin.d.ts +3 -0
- package/dist/hook-bin.js +11 -0
- package/dist/hook-dispatch.d.ts +80 -0
- package/dist/hook-dispatch.js +186 -0
- package/dist/human-presence-mint.d.ts +70 -0
- package/dist/human-presence-mint.js +204 -0
- package/dist/identity-banner.d.ts +13 -0
- package/dist/identity-banner.js +19 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +14 -0
- package/dist/init-cli/constants.d.ts +42 -0
- package/dist/init-cli/constants.js +42 -0
- package/dist/init-cli/help.d.ts +9 -0
- package/dist/init-cli/help.js +43 -0
- package/dist/init-cli/init.d.ts +26 -0
- package/dist/init-cli/init.js +80 -0
- package/dist/init-cli/migrate.d.ts +3 -0
- package/dist/init-cli/migrate.js +51 -0
- package/dist/init-cli/resolve-binary.d.ts +34 -0
- package/dist/init-cli/resolve-binary.js +78 -0
- package/dist/init-cli/run-deft-install.d.ts +23 -0
- package/dist/init-cli/run-deft-install.js +71 -0
- package/dist/init-cli/update.d.ts +5 -0
- package/dist/init-cli/update.js +38 -0
- package/dist/install-cli/coverage-map.d.ts +14 -0
- package/dist/install-cli/coverage-map.js +113 -0
- package/dist/install-uninstall.d.ts +3 -0
- package/dist/install-uninstall.js +44 -0
- package/dist/install-upgrade.d.ts +41 -0
- package/dist/install-upgrade.js +86 -0
- package/dist/lifecycle-cli/coverage-map.d.ts +16 -0
- package/dist/lifecycle-cli/coverage-map.js +254 -0
- package/dist/lifecycle-cli/helpers.d.ts +8 -0
- package/dist/lifecycle-cli/helpers.js +20 -0
- package/dist/lifecycle-event.d.ts +11 -0
- package/dist/lifecycle-event.js +45 -0
- package/dist/lifecycle-stats.d.ts +12 -0
- package/dist/lifecycle-stats.js +100 -0
- package/dist/migrate-category-b.d.ts +9 -0
- package/dist/migrate-category-b.js +52 -0
- package/dist/migrate-preflight.d.ts +10 -0
- package/dist/migrate-preflight.js +85 -0
- package/dist/migrate-xbrief.d.ts +11 -0
- package/dist/migrate-xbrief.js +88 -0
- package/dist/occupancy-grant.d.ts +18 -0
- package/dist/occupancy-grant.js +121 -0
- package/dist/occupancy-heartbeat.d.ts +8 -0
- package/dist/occupancy-heartbeat.js +63 -0
- package/dist/occupancy-release.d.ts +23 -0
- package/dist/occupancy-release.js +102 -0
- package/dist/occupancy-steal.d.ts +10 -0
- package/dist/occupancy-steal.js +83 -0
- package/dist/occupancy-unrecognized.d.ts +3 -0
- package/dist/occupancy-unrecognized.js +5 -0
- package/dist/orchestration-cli/coverage-map.d.ts +21 -0
- package/dist/orchestration-cli/coverage-map.js +225 -0
- package/dist/orchestration-cli/helpers.d.ts +11 -0
- package/dist/orchestration-cli/helpers.js +35 -0
- package/dist/ownership-doctor.d.ts +10 -0
- package/dist/ownership-doctor.js +96 -0
- package/dist/ownership-fix.d.ts +10 -0
- package/dist/ownership-fix.js +93 -0
- package/dist/plan-sequence.d.ts +14 -0
- package/dist/plan-sequence.js +258 -0
- package/dist/policy-fixtures.d.ts +33 -0
- package/dist/policy-fixtures.js +118 -0
- package/dist/policy.d.ts +37 -0
- package/dist/policy.js +744 -0
- package/dist/pr-closing-keywords.d.ts +3 -0
- package/dist/pr-closing-keywords.js +10 -0
- package/dist/pr-finish-loop.d.ts +3 -0
- package/dist/pr-finish-loop.js +10 -0
- package/dist/pr-merge-readiness.d.ts +3 -0
- package/dist/pr-merge-readiness.js +10 -0
- package/dist/pr-monitor.d.ts +3 -0
- package/dist/pr-monitor.js +10 -0
- package/dist/pr-protected-issues.d.ts +3 -0
- package/dist/pr-protected-issues.js +10 -0
- package/dist/pr-wait-mergeable.d.ts +3 -0
- package/dist/pr-wait-mergeable.js +10 -0
- package/dist/pr-watch.d.ts +3 -0
- package/dist/pr-watch.js +10 -0
- package/dist/pre-pr-run.d.ts +39 -0
- package/dist/pre-pr-run.js +514 -0
- package/dist/preflight-cache.d.ts +18 -0
- package/dist/preflight-cache.js +113 -0
- package/dist/preflight-gh.d.ts +15 -0
- package/dist/preflight-gh.js +143 -0
- package/dist/probe-session.d.ts +3 -0
- package/dist/probe-session.js +10 -0
- package/dist/release-e2e-fixtures.d.ts +29 -0
- package/dist/release-e2e-fixtures.js +38 -0
- package/dist/release-e2e.d.ts +3 -0
- package/dist/release-e2e.js +10 -0
- package/dist/release-publish.d.ts +3 -0
- package/dist/release-publish.js +10 -0
- package/dist/release-rollback.d.ts +3 -0
- package/dist/release-rollback.js +10 -0
- package/dist/release-wait-npm.d.ts +3 -0
- package/dist/release-wait-npm.js +10 -0
- package/dist/release.d.ts +3 -0
- package/dist/release.js +10 -0
- package/dist/render-cli/deft-ts-runner.d.ts +17 -0
- package/dist/render-cli/deft-ts-runner.js +19 -0
- package/dist/render-cli/export-spec-cli.d.ts +2 -0
- package/dist/render-cli/export-spec-cli.js +6 -0
- package/dist/render-cli/prd-render-cli.d.ts +2 -0
- package/dist/render-cli/prd-render-cli.js +37 -0
- package/dist/render-cli/project-render-cli.d.ts +2 -0
- package/dist/render-cli/project-render-cli.js +6 -0
- package/dist/render-cli/rule-map-cli.d.ts +2 -0
- package/dist/render-cli/rule-map-cli.js +5 -0
- package/dist/render-cli/spec-reconstruct-cli.d.ts +3 -0
- package/dist/render-cli/spec-reconstruct-cli.js +15 -0
- package/dist/render-cli/spec-render-cli.d.ts +2 -0
- package/dist/render-cli/spec-render-cli.js +39 -0
- package/dist/render-cli/spec-validate-cli.d.ts +2 -0
- package/dist/render-cli/spec-validate-cli.js +38 -0
- package/dist/review-monitor-register.d.ts +19 -0
- package/dist/review-monitor-register.js +183 -0
- package/dist/review-monitor-release.d.ts +14 -0
- package/dist/review-monitor-release.js +123 -0
- package/dist/scm-sync-default.d.ts +34 -0
- package/dist/scm-sync-default.js +210 -0
- package/dist/scope-lifecycle.d.ts +4 -0
- package/dist/scope-lifecycle.js +34 -0
- package/dist/scope-record-approved-scope.d.ts +29 -0
- package/dist/scope-record-approved-scope.js +319 -0
- package/dist/scope-record-intent-constraint.d.ts +16 -0
- package/dist/scope-record-intent-constraint.js +202 -0
- package/dist/scope-record-observable-scope.d.ts +16 -0
- package/dist/scope-record-observable-scope.js +204 -0
- package/dist/session-ready.d.ts +15 -0
- package/dist/session-ready.js +144 -0
- package/dist/session-start.d.ts +56 -0
- package/dist/session-start.js +581 -0
- package/dist/slice.d.ts +4 -0
- package/dist/slice.js +34 -0
- package/dist/story-ready-fixtures.d.ts +47 -0
- package/dist/story-ready-fixtures.js +137 -0
- package/dist/subagent-monitor.d.ts +3 -0
- package/dist/subagent-monitor.js +10 -0
- package/dist/subagent-pre-cancel.d.ts +21 -0
- package/dist/subagent-pre-cancel.js +240 -0
- package/dist/subagent-steer-write.d.ts +41 -0
- package/dist/subagent-steer-write.js +333 -0
- package/dist/toolchain-check.d.ts +8 -0
- package/dist/toolchain-check.js +54 -0
- package/dist/triage-actions.d.ts +23 -0
- package/dist/triage-actions.js +233 -0
- package/dist/triage-aux-a-fixtures.d.ts +33 -0
- package/dist/triage-aux-a-fixtures.js +107 -0
- package/dist/triage-aux-b-fixtures.d.ts +30 -0
- package/dist/triage-aux-b-fixtures.js +167 -0
- package/dist/triage-bootstrap-fixtures.d.ts +42 -0
- package/dist/triage-bootstrap-fixtures.js +139 -0
- package/dist/triage-bootstrap.d.ts +24 -0
- package/dist/triage-bootstrap.js +175 -0
- package/dist/triage-bulk.d.ts +17 -0
- package/dist/triage-bulk.js +154 -0
- package/dist/triage-classify-fixtures.d.ts +38 -0
- package/dist/triage-classify-fixtures.js +137 -0
- package/dist/triage-classify.d.ts +45 -0
- package/dist/triage-classify.js +287 -0
- package/dist/triage-evaluate.d.ts +14 -0
- package/dist/triage-evaluate.js +153 -0
- package/dist/triage-help.d.ts +3 -0
- package/dist/triage-help.js +10 -0
- package/dist/triage-queue-fixtures.d.ts +59 -0
- package/dist/triage-queue-fixtures.js +284 -0
- package/dist/triage-queue.d.ts +38 -0
- package/dist/triage-queue.js +391 -0
- package/dist/triage-reconcile.d.ts +11 -0
- package/dist/triage-reconcile.js +76 -0
- package/dist/triage-refresh.d.ts +7 -0
- package/dist/triage-refresh.js +37 -0
- package/dist/triage-scope-drift.d.ts +12 -0
- package/dist/triage-scope-drift.js +117 -0
- package/dist/triage-scope-fixtures.d.ts +32 -0
- package/dist/triage-scope-fixtures.js +131 -0
- package/dist/triage-scope.d.ts +4 -0
- package/dist/triage-scope.js +34 -0
- package/dist/triage-smoketest.d.ts +3 -0
- package/dist/triage-smoketest.js +43 -0
- package/dist/triage-strip-withdrawn.d.ts +21 -0
- package/dist/triage-strip-withdrawn.js +102 -0
- package/dist/triage-subscribe.d.ts +15 -0
- package/dist/triage-subscribe.js +157 -0
- package/dist/triage-summary.d.ts +14 -0
- package/dist/triage-summary.js +83 -0
- package/dist/triage-welcome.d.ts +14 -0
- package/dist/triage-welcome.js +121 -0
- package/dist/ts-check-lane.d.ts +9 -0
- package/dist/ts-check-lane.js +49 -0
- package/dist/umbrella-current-shape.d.ts +9 -0
- package/dist/umbrella-current-shape.js +56 -0
- package/dist/vbrief-activate.d.ts +3 -0
- package/dist/vbrief-activate.js +7 -0
- package/dist/vbrief-build.d.ts +3 -0
- package/dist/vbrief-build.js +8 -0
- package/dist/vbrief-preflight-fixtures.d.ts +32 -0
- package/dist/vbrief-preflight-fixtures.js +79 -0
- package/dist/vbrief-preflight.d.ts +13 -0
- package/dist/vbrief-preflight.js +141 -0
- package/dist/vbrief-reconcile.d.ts +3 -0
- package/dist/vbrief-reconcile.js +7 -0
- package/dist/vbrief-validate.d.ts +3 -0
- package/dist/vbrief-validate.js +8 -0
- package/dist/vbrief-validation.d.ts +3 -0
- package/dist/vbrief-validation.js +8 -0
- package/dist/verify-ac.d.ts +28 -0
- package/dist/verify-ac.js +439 -0
- package/dist/verify-agents-md-advisory.d.ts +19 -0
- package/dist/verify-agents-md-advisory.js +65 -0
- package/dist/verify-agents-md-budget.d.ts +12 -0
- package/dist/verify-agents-md-budget.js +71 -0
- package/dist/verify-branch.d.ts +14 -0
- package/dist/verify-branch.js +81 -0
- package/dist/verify-class-checks.d.ts +11 -0
- package/dist/verify-class-checks.js +71 -0
- package/dist/verify-cohort-review-monitors.d.ts +5 -0
- package/dist/verify-cohort-review-monitors.js +11 -0
- package/dist/verify-completed-tracked.d.ts +19 -0
- package/dist/verify-completed-tracked.js +202 -0
- package/dist/verify-completed-write-guard.d.ts +13 -0
- package/dist/verify-completed-write-guard.js +84 -0
- package/dist/verify-consumer-check-contract.d.ts +12 -0
- package/dist/verify-consumer-check-contract.js +70 -0
- package/dist/verify-consumer-header-placeholder.d.ts +12 -0
- package/dist/verify-consumer-header-placeholder.js +73 -0
- package/dist/verify-consumer-test-lane.d.ts +12 -0
- package/dist/verify-consumer-test-lane.js +57 -0
- package/dist/verify-durable-effect-acquisition.d.ts +13 -0
- package/dist/verify-durable-effect-acquisition.js +70 -0
- package/dist/verify-encoding.d.ts +15 -0
- package/dist/verify-encoding.js +83 -0
- package/dist/verify-eval-health-relocation.d.ts +16 -0
- package/dist/verify-eval-health-relocation.js +93 -0
- package/dist/verify-eval-triggers-relocation.d.ts +14 -0
- package/dist/verify-eval-triggers-relocation.js +74 -0
- package/dist/verify-evaluator-surface.d.ts +15 -0
- package/dist/verify-evaluator-surface.js +87 -0
- package/dist/verify-forward-coverage.d.ts +19 -0
- package/dist/verify-forward-coverage.js +144 -0
- package/dist/verify-hooks-installed.d.ts +24 -0
- package/dist/verify-hooks-installed.js +140 -0
- package/dist/verify-intent-constraint.d.ts +15 -0
- package/dist/verify-intent-constraint.js +86 -0
- package/dist/verify-investigation.d.ts +3 -0
- package/dist/verify-investigation.js +10 -0
- package/dist/verify-judgment-gates.d.ts +3 -0
- package/dist/verify-judgment-gates.js +10 -0
- package/dist/verify-l4-owner.d.ts +15 -0
- package/dist/verify-l4-owner.js +132 -0
- package/dist/verify-lifecycle-visible.d.ts +13 -0
- package/dist/verify-lifecycle-visible.js +68 -0
- package/dist/verify-literal-ac.d.ts +14 -0
- package/dist/verify-literal-ac.js +168 -0
- package/dist/verify-no-task-runtime.d.ts +3 -0
- package/dist/verify-no-task-runtime.js +16 -0
- package/dist/verify-observable-scope.d.ts +15 -0
- package/dist/verify-observable-scope.js +86 -0
- package/dist/verify-operator-scope-limit.d.ts +17 -0
- package/dist/verify-operator-scope-limit.js +285 -0
- package/dist/verify-orphan-active.d.ts +17 -0
- package/dist/verify-orphan-active.js +135 -0
- package/dist/verify-ownership.d.ts +10 -0
- package/dist/verify-ownership.js +90 -0
- package/dist/verify-persisted-planning-narratives.d.ts +12 -0
- package/dist/verify-persisted-planning-narratives.js +82 -0
- package/dist/verify-plan-sequence.d.ts +14 -0
- package/dist/verify-plan-sequence.js +138 -0
- package/dist/verify-pr-closeout-attestable.d.ts +15 -0
- package/dist/verify-pr-closeout-attestable.js +114 -0
- package/dist/verify-presentation-ceiling.d.ts +11 -0
- package/dist/verify-presentation-ceiling.js +71 -0
- package/dist/verify-presentation-coverage.d.ts +14 -0
- package/dist/verify-presentation-coverage.js +90 -0
- package/dist/verify-review-monitor.d.ts +32 -0
- package/dist/verify-review-monitor.js +362 -0
- package/dist/verify-scope-provenance.d.ts +16 -0
- package/dist/verify-scope-provenance.js +91 -0
- package/dist/verify-session-ritual.d.ts +23 -0
- package/dist/verify-session-ritual.js +144 -0
- package/dist/verify-source-cli/rule-ownership-lint.d.ts +12 -0
- package/dist/verify-source-cli/rule-ownership-lint.js +61 -0
- package/dist/verify-source-cli/verify-biome-config.d.ts +11 -0
- package/dist/verify-source-cli/verify-biome-config.js +46 -0
- package/dist/verify-source-cli/verify-closing-keywords.d.ts +35 -0
- package/dist/verify-source-cli/verify-closing-keywords.js +139 -0
- package/dist/verify-source-cli/verify-consumer-hard-stops.d.ts +16 -0
- package/dist/verify-source-cli/verify-consumer-hard-stops.js +99 -0
- package/dist/verify-source-cli/verify-contained-writes.d.ts +13 -0
- package/dist/verify-source-cli/verify-contained-writes.js +67 -0
- package/dist/verify-source-cli/verify-content-manifest.d.ts +12 -0
- package/dist/verify-source-cli/verify-content-manifest.js +61 -0
- package/dist/verify-source-cli/verify-contract-drift.d.ts +11 -0
- package/dist/verify-source-cli/verify-contract-drift.js +47 -0
- package/dist/verify-source-cli/verify-cursor-tier1.d.ts +12 -0
- package/dist/verify-source-cli/verify-cursor-tier1.js +51 -0
- package/dist/verify-source-cli/verify-deposit-closure.d.ts +12 -0
- package/dist/verify-source-cli/verify-deposit-closure.js +52 -0
- package/dist/verify-source-cli/verify-openclaw-tier1.d.ts +12 -0
- package/dist/verify-source-cli/verify-openclaw-tier1.js +51 -0
- package/dist/verify-source-cli/verify-scm-boundary.d.ts +13 -0
- package/dist/verify-source-cli/verify-scm-boundary.js +66 -0
- package/dist/verify-source-cli/verify-semantic-single-source.d.ts +11 -0
- package/dist/verify-source-cli/verify-semantic-single-source.js +49 -0
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.d.ts +11 -0
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.js +46 -0
- package/dist/verify-source-cli/verify-spec-drift.d.ts +3 -0
- package/dist/verify-source-cli/verify-spec-drift.js +15 -0
- package/dist/verify-source-cli/verify-spec-prd-fresh.d.ts +3 -0
- package/dist/verify-source-cli/verify-spec-prd-fresh.js +15 -0
- package/dist/verify-source-cli/verify-stubs.d.ts +11 -0
- package/dist/verify-source-cli/verify-stubs.js +27 -0
- package/dist/verify-source-cli/verify-telemetry-coverage.d.ts +13 -0
- package/dist/verify-source-cli/verify-telemetry-coverage.js +67 -0
- package/dist/verify-source-cli/verify-xbrief-drift.d.ts +15 -0
- package/dist/verify-source-cli/verify-xbrief-drift.js +80 -0
- package/dist/verify-story-ready.d.ts +18 -0
- package/dist/verify-story-ready.js +190 -0
- package/dist/verify-subagent-alive.d.ts +21 -0
- package/dist/verify-subagent-alive.js +219 -0
- package/dist/verify-subagent-steer.d.ts +19 -0
- package/dist/verify-subagent-steer.js +136 -0
- package/dist/verify-test-boundary.d.ts +12 -0
- package/dist/verify-test-boundary.js +80 -0
- package/dist/verify-tools.d.ts +13 -0
- package/dist/verify-tools.js +67 -0
- package/dist/verify-wip-cap.d.ts +13 -0
- package/dist/verify-wip-cap.js +62 -0
- package/dist/windows-bin-ps1.d.ts +39 -0
- package/dist/windows-bin-ps1.js +226 -0
- package/dist/wip-cap-fixtures.d.ts +37 -0
- package/dist/wip-cap-fixtures.js +122 -0
- package/dist/wsl-ownership-guard.d.ts +2 -0
- package/dist/wsl-ownership-guard.js +15 -0
- package/dist/xbrief-create.d.ts +3 -0
- package/dist/xbrief-create.js +9 -0
- package/dist/xbrief-verify.d.ts +3 -0
- package/dist/xbrief-verify.js +9 -0
- package/package.json +23 -12
- package/scripts/remove-windows-ps1-shims.mjs +26 -0
- package/bin/deft-hook +0 -14
- package/bin/deft-hook.cmd +0 -14
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* triage:queue / triage:show CLI (#1128 / #2890).
|
|
4
|
+
*
|
|
5
|
+
* Subcommands:
|
|
6
|
+
* queue — ranked queue (default when first token is not show/audit)
|
|
7
|
+
* show — per-issue detail; --format=operator for Phase 3 brief backbone
|
|
8
|
+
*
|
|
9
|
+
* audit remains routed here by Taskfile; not reimplemented in this story.
|
|
10
|
+
*/
|
|
11
|
+
import { resolve } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { ensureTriageCacheHydrated } from "@deftai/directive-core/dist/cache/empty-populate.js";
|
|
14
|
+
import { findByIssue } from "@deftai/directive-core/dist/triage/actions/candidates-log.js";
|
|
15
|
+
import { resolveTriageCachePath } from "@deftai/directive-core/dist/triage/cache-path.js";
|
|
16
|
+
import { activeReferencedIssueNumbers, buildQueue, collectOrphanIssueNumbers, DEFAULT_QUEUE_LIMIT, formatAuthorFilterLine, loadCachedIssueDetail, loadCachedIssues, loadSliceRecords, partitionByAuthorFilter, readAuditEntries, reconcileLiveOpenState, renderOperatorBrief, renderQueue, renderShow, resolveAuthorFilter, resolveRankingLabels, resolveRepo, ShowQuarantineRefuseError, } from "@deftai/directive-core/dist/triage/queue/index.js";
|
|
17
|
+
import { resolveScopeIgnores } from "@deftai/directive-core/dist/triage/scope-drift/index.js";
|
|
18
|
+
function baseArgs() {
|
|
19
|
+
return {
|
|
20
|
+
projectRoot: process.env.DEFT_PROJECT_ROOT ?? ".",
|
|
21
|
+
repo: process.env.DEFT_TRIAGE_REPO ?? null,
|
|
22
|
+
cacheRoot: null,
|
|
23
|
+
auditLog: null,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function parseCommonFlag(arg, argv, i, parsed) {
|
|
27
|
+
if (arg === "--project-root") {
|
|
28
|
+
const value = argv[i + 1];
|
|
29
|
+
if (value === undefined) {
|
|
30
|
+
return { consumed: 0, error: "argument --project-root: expected one argument" };
|
|
31
|
+
}
|
|
32
|
+
parsed.projectRoot = value;
|
|
33
|
+
return { consumed: 1 };
|
|
34
|
+
}
|
|
35
|
+
if (arg?.startsWith("--project-root=")) {
|
|
36
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
37
|
+
return { consumed: 0 };
|
|
38
|
+
}
|
|
39
|
+
if (arg === "--repo") {
|
|
40
|
+
const value = argv[i + 1];
|
|
41
|
+
if (value === undefined) {
|
|
42
|
+
return { consumed: 0, error: "argument --repo: expected one argument" };
|
|
43
|
+
}
|
|
44
|
+
parsed.repo = value;
|
|
45
|
+
return { consumed: 1 };
|
|
46
|
+
}
|
|
47
|
+
if (arg?.startsWith("--repo=")) {
|
|
48
|
+
parsed.repo = arg.slice("--repo=".length);
|
|
49
|
+
return { consumed: 0 };
|
|
50
|
+
}
|
|
51
|
+
if (arg === "--cache-root") {
|
|
52
|
+
const value = argv[i + 1];
|
|
53
|
+
if (value === undefined) {
|
|
54
|
+
return { consumed: 0, error: "argument --cache-root: expected one argument" };
|
|
55
|
+
}
|
|
56
|
+
parsed.cacheRoot = value;
|
|
57
|
+
return { consumed: 1 };
|
|
58
|
+
}
|
|
59
|
+
if (arg?.startsWith("--cache-root=")) {
|
|
60
|
+
parsed.cacheRoot = arg.slice("--cache-root=".length);
|
|
61
|
+
return { consumed: 0 };
|
|
62
|
+
}
|
|
63
|
+
if (arg === "--audit-log") {
|
|
64
|
+
const value = argv[i + 1];
|
|
65
|
+
if (value === undefined) {
|
|
66
|
+
return { consumed: 0, error: "argument --audit-log: expected one argument" };
|
|
67
|
+
}
|
|
68
|
+
parsed.auditLog = value;
|
|
69
|
+
return { consumed: 1 };
|
|
70
|
+
}
|
|
71
|
+
if (arg?.startsWith("--audit-log=")) {
|
|
72
|
+
parsed.auditLog = arg.slice("--audit-log=".length);
|
|
73
|
+
return { consumed: 0 };
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
/** Parse triage-queue CLI args (queue subcommand — default). */
|
|
78
|
+
export function parseArgs(argv) {
|
|
79
|
+
const common = baseArgs();
|
|
80
|
+
const parsed = {
|
|
81
|
+
...common,
|
|
82
|
+
cmd: "queue",
|
|
83
|
+
limit: DEFAULT_QUEUE_LIMIT,
|
|
84
|
+
includeBlocked: false,
|
|
85
|
+
reconcile: true,
|
|
86
|
+
slicesLog: null,
|
|
87
|
+
author: null,
|
|
88
|
+
};
|
|
89
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
90
|
+
const arg = argv[i];
|
|
91
|
+
if (arg === "queue" || arg === "--") {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (arg === "--include-blocked") {
|
|
95
|
+
parsed.includeBlocked = true;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (arg === "--no-reconcile") {
|
|
99
|
+
parsed.reconcile = false;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (arg === "--author-mine") {
|
|
103
|
+
// #1318 Layer 1 optional alias for --author @me
|
|
104
|
+
parsed.author = "@me";
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (arg === "--author") {
|
|
108
|
+
const value = argv[i + 1];
|
|
109
|
+
if (value === undefined) {
|
|
110
|
+
return { ...parsed, error: "argument --author: expected one argument" };
|
|
111
|
+
}
|
|
112
|
+
// Reject adjacent flags (e.g. `--author --limit 10`) so they are not
|
|
113
|
+
// swallowed as logins (#3129 Greptile P1 adjacent-option).
|
|
114
|
+
if (value.startsWith("-")) {
|
|
115
|
+
return {
|
|
116
|
+
...parsed,
|
|
117
|
+
error: `argument --author: expected a login (or @me), got flag token '${value}'`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
parsed.author = value;
|
|
121
|
+
i += 1;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (arg?.startsWith("--author=")) {
|
|
125
|
+
const value = arg.slice("--author=".length);
|
|
126
|
+
if (value.startsWith("-") && value.length > 1) {
|
|
127
|
+
return {
|
|
128
|
+
...parsed,
|
|
129
|
+
error: `argument --author: expected a login (or @me), got flag token '${value}'`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
parsed.author = value;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const commonHit = parseCommonFlag(arg, argv, i, parsed);
|
|
136
|
+
if (commonHit !== null) {
|
|
137
|
+
if (commonHit.error !== undefined) {
|
|
138
|
+
return { ...parsed, error: commonHit.error };
|
|
139
|
+
}
|
|
140
|
+
i += commonHit.consumed;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (arg === "--limit") {
|
|
144
|
+
const value = argv[i + 1];
|
|
145
|
+
if (value === undefined) {
|
|
146
|
+
return { ...parsed, error: "argument --limit: expected one argument" };
|
|
147
|
+
}
|
|
148
|
+
const parsedLimit = Number.parseInt(value, 10);
|
|
149
|
+
if (!Number.isFinite(parsedLimit)) {
|
|
150
|
+
return { ...parsed, error: `argument --limit: invalid int value: '${value}'` };
|
|
151
|
+
}
|
|
152
|
+
parsed.limit = parsedLimit;
|
|
153
|
+
i += 1;
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (arg?.startsWith("--limit=")) {
|
|
157
|
+
const value = arg.slice("--limit=".length);
|
|
158
|
+
const parsedLimit = Number.parseInt(value, 10);
|
|
159
|
+
if (!Number.isFinite(parsedLimit)) {
|
|
160
|
+
return { ...parsed, error: `argument --limit: invalid int value: '${value}'` };
|
|
161
|
+
}
|
|
162
|
+
parsed.limit = parsedLimit;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (arg === "--slices-log") {
|
|
166
|
+
const value = argv[i + 1];
|
|
167
|
+
if (value === undefined) {
|
|
168
|
+
return { ...parsed, error: "argument --slices-log: expected one argument" };
|
|
169
|
+
}
|
|
170
|
+
parsed.slicesLog = value;
|
|
171
|
+
i += 1;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (arg?.startsWith("--slices-log=")) {
|
|
175
|
+
parsed.slicesLog = arg.slice("--slices-log=".length);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (arg?.startsWith("-")) {
|
|
179
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return parsed;
|
|
183
|
+
}
|
|
184
|
+
/** Parse show subcommand args. */
|
|
185
|
+
export function parseShowArgs(argv) {
|
|
186
|
+
const common = baseArgs();
|
|
187
|
+
const parsed = {
|
|
188
|
+
...common,
|
|
189
|
+
cmd: "show",
|
|
190
|
+
number: null,
|
|
191
|
+
format: "default",
|
|
192
|
+
};
|
|
193
|
+
// Skip leading "show" token if present
|
|
194
|
+
let start = 0;
|
|
195
|
+
if (argv[0] === "show") {
|
|
196
|
+
start = 1;
|
|
197
|
+
}
|
|
198
|
+
for (let i = start; i < argv.length; i += 1) {
|
|
199
|
+
const arg = argv[i];
|
|
200
|
+
if (arg === "--") {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const commonHit = parseCommonFlag(arg, argv, i, parsed);
|
|
204
|
+
if (commonHit !== null) {
|
|
205
|
+
if (commonHit.error !== undefined) {
|
|
206
|
+
return { ...parsed, error: commonHit.error };
|
|
207
|
+
}
|
|
208
|
+
i += commonHit.consumed;
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (arg === "--format") {
|
|
212
|
+
const value = argv[i + 1];
|
|
213
|
+
if (value === undefined) {
|
|
214
|
+
return { ...parsed, error: "argument --format: expected one argument" };
|
|
215
|
+
}
|
|
216
|
+
if (value !== "default" && value !== "operator" && value !== "plain" && value !== "text") {
|
|
217
|
+
return {
|
|
218
|
+
...parsed,
|
|
219
|
+
error: `argument --format: invalid choice: '${value}' (choose from default, operator)`,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
parsed.format = value === "operator" ? "operator" : "default";
|
|
223
|
+
i += 1;
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (arg?.startsWith("--format=")) {
|
|
227
|
+
const value = arg.slice("--format=".length);
|
|
228
|
+
if (value !== "default" && value !== "operator" && value !== "plain" && value !== "text") {
|
|
229
|
+
return {
|
|
230
|
+
...parsed,
|
|
231
|
+
error: `argument --format: invalid choice: '${value}' (choose from default, operator)`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
parsed.format = value === "operator" ? "operator" : "default";
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (arg?.startsWith("-")) {
|
|
238
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
239
|
+
}
|
|
240
|
+
// positional issue number — strict positive int (reject "42abc" / "42.5")
|
|
241
|
+
if (!/^[1-9]\d*$/u.test(arg ?? "")) {
|
|
242
|
+
return { ...parsed, error: `argument number: invalid int value: '${arg}'` };
|
|
243
|
+
}
|
|
244
|
+
parsed.number = Number(arg);
|
|
245
|
+
}
|
|
246
|
+
if (parsed.number === null && parsed.error === undefined) {
|
|
247
|
+
return { ...parsed, error: "triage:show: issue number is required (e.g. triage:show -- 42)" };
|
|
248
|
+
}
|
|
249
|
+
return parsed;
|
|
250
|
+
}
|
|
251
|
+
function runQueue(args, options = {}) {
|
|
252
|
+
if (args.error !== undefined) {
|
|
253
|
+
process.stderr.write(`triage_queue: ${args.error}\n`);
|
|
254
|
+
return 2;
|
|
255
|
+
}
|
|
256
|
+
const projectRoot = resolve(args.projectRoot);
|
|
257
|
+
const repo = resolveRepo(args.repo, projectRoot);
|
|
258
|
+
if (repo === null) {
|
|
259
|
+
process.stderr.write("triage:queue: --repo OWNER/NAME (or $DEFT_TRIAGE_REPO) is required.\n");
|
|
260
|
+
return 2;
|
|
261
|
+
}
|
|
262
|
+
let authorFilterLine = null;
|
|
263
|
+
let authorAllow;
|
|
264
|
+
// Flag present (including empty `--author=`) must resolve or fail closed — never
|
|
265
|
+
// silent no-op that would show the full queue (#3129 Greptile P1).
|
|
266
|
+
if (args.author !== null) {
|
|
267
|
+
const resolved = resolveAuthorFilter(args.author, options.resolveAuthenticatedLogin ?? undefined);
|
|
268
|
+
if (resolved.error !== undefined || resolved.filter === undefined) {
|
|
269
|
+
process.stderr.write(`triage:queue: ${resolved.error ?? "argument --author: expected a non-empty login (or @me)"}\n`);
|
|
270
|
+
return 2;
|
|
271
|
+
}
|
|
272
|
+
authorAllow = resolved.filter;
|
|
273
|
+
}
|
|
274
|
+
ensureTriageCacheHydrated(projectRoot, { repo });
|
|
275
|
+
const cachedForQueue = loadCachedIssues(repo, { projectRoot });
|
|
276
|
+
let issuesForQueue = args.reconcile
|
|
277
|
+
? reconcileLiveOpenState(cachedForQueue, repo, options.liveOpenReader)
|
|
278
|
+
: cachedForQueue;
|
|
279
|
+
if (authorAllow !== undefined) {
|
|
280
|
+
const partition = partitionByAuthorFilter(issuesForQueue, (row) => row.author ?? null, authorAllow);
|
|
281
|
+
issuesForQueue = [...partition.matched];
|
|
282
|
+
authorFilterLine = formatAuthorFilterLine(authorAllow, {
|
|
283
|
+
unknownCount: partition.unknownCount,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
const issuesWithClosed = loadCachedIssues(repo, { projectRoot, includeClosed: true });
|
|
287
|
+
const issuesByNumber = new Map(issuesWithClosed.map((row) => [row.number, row]));
|
|
288
|
+
const auditEntries = readAuditEntries(repo, {
|
|
289
|
+
auditLogPath: args.auditLog ?? resolveTriageCachePath(projectRoot, "candidates.jsonl"),
|
|
290
|
+
});
|
|
291
|
+
const rankingLabels = resolveRankingLabels(projectRoot);
|
|
292
|
+
const activeRefs = activeReferencedIssueNumbers(projectRoot);
|
|
293
|
+
const sliceRecords = loadSliceRecords({
|
|
294
|
+
slicesLogPath: args.slicesLog ?? resolveTriageCachePath(projectRoot, "slices.jsonl"),
|
|
295
|
+
});
|
|
296
|
+
const orphanNumbers = collectOrphanIssueNumbers(sliceRecords, issuesByNumber);
|
|
297
|
+
const limit = args.limit === 0 ? null : Math.max(0, args.limit);
|
|
298
|
+
const scopeIgnores = resolveScopeIgnores(projectRoot);
|
|
299
|
+
const items = buildQueue(issuesForQueue, auditEntries, {
|
|
300
|
+
repo,
|
|
301
|
+
queue: {
|
|
302
|
+
rankingLabels,
|
|
303
|
+
activeReferenced: activeRefs,
|
|
304
|
+
orphanIssueNumbers: orphanNumbers,
|
|
305
|
+
includeBlocked: args.includeBlocked,
|
|
306
|
+
limit,
|
|
307
|
+
scopeIgnores,
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
process.stdout.write(`${renderQueue({
|
|
311
|
+
items,
|
|
312
|
+
repo,
|
|
313
|
+
limit,
|
|
314
|
+
rankingLabels,
|
|
315
|
+
authorFilterLine,
|
|
316
|
+
})}\n`);
|
|
317
|
+
return 0;
|
|
318
|
+
}
|
|
319
|
+
function runShow(args) {
|
|
320
|
+
if (args.error !== undefined) {
|
|
321
|
+
process.stderr.write(`triage:show: ${args.error}\n`);
|
|
322
|
+
return 2;
|
|
323
|
+
}
|
|
324
|
+
const projectRoot = resolve(args.projectRoot);
|
|
325
|
+
const repo = resolveRepo(args.repo, projectRoot);
|
|
326
|
+
if (repo === null) {
|
|
327
|
+
process.stderr.write("triage:show: --repo OWNER/NAME (or $DEFT_TRIAGE_REPO) is required.\n");
|
|
328
|
+
return 2;
|
|
329
|
+
}
|
|
330
|
+
const number = args.number;
|
|
331
|
+
if (number === null) {
|
|
332
|
+
process.stderr.write("triage:show: issue number is required\n");
|
|
333
|
+
return 2;
|
|
334
|
+
}
|
|
335
|
+
const cacheRoot = args.cacheRoot !== null && args.cacheRoot.length > 0 ? resolve(args.cacheRoot) : null;
|
|
336
|
+
ensureTriageCacheHydrated(projectRoot, {
|
|
337
|
+
repo,
|
|
338
|
+
...(cacheRoot !== null ? { cacheRoot } : {}),
|
|
339
|
+
});
|
|
340
|
+
const loaded = loadCachedIssueDetail(repo, number, {
|
|
341
|
+
projectRoot,
|
|
342
|
+
cacheRoot,
|
|
343
|
+
});
|
|
344
|
+
// Typed quarantine refuse (#5367): returned-failure → exit 1 + stderr; never emit raw.json.
|
|
345
|
+
if (loaded instanceof ShowQuarantineRefuseError) {
|
|
346
|
+
process.stderr.write(`${loaded.message}\n`);
|
|
347
|
+
return 1;
|
|
348
|
+
}
|
|
349
|
+
const issue = loaded;
|
|
350
|
+
const logPath = args.auditLog ?? resolveTriageCachePath(projectRoot, "candidates.jsonl");
|
|
351
|
+
const history = findByIssue(number, repo, logPath)
|
|
352
|
+
.slice()
|
|
353
|
+
.sort((a, b) => String(a.timestamp ?? "").localeCompare(String(b.timestamp ?? "")));
|
|
354
|
+
const latest = history.length > 0 ? (history[history.length - 1] ?? null) : null;
|
|
355
|
+
const activeRefs = activeReferencedIssueNumbers(projectRoot);
|
|
356
|
+
const inActive = activeRefs.has(number);
|
|
357
|
+
if (args.format === "operator") {
|
|
358
|
+
process.stdout.write(`${renderOperatorBrief({
|
|
359
|
+
issue,
|
|
360
|
+
repo,
|
|
361
|
+
number,
|
|
362
|
+
latestDecision: latest,
|
|
363
|
+
inActiveXbrief: inActive,
|
|
364
|
+
})}\n`);
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
process.stdout.write(`${renderShow({
|
|
368
|
+
issue,
|
|
369
|
+
repo,
|
|
370
|
+
number,
|
|
371
|
+
latestDecision: latest,
|
|
372
|
+
history,
|
|
373
|
+
inActiveXbrief: inActive,
|
|
374
|
+
})}\n`);
|
|
375
|
+
}
|
|
376
|
+
return issue !== null ? 0 : 1;
|
|
377
|
+
}
|
|
378
|
+
/** Run triage:queue or triage:show and return process exit code. */
|
|
379
|
+
export function run(argv, options = {}) {
|
|
380
|
+
const first = argv[0];
|
|
381
|
+
if (first === "show") {
|
|
382
|
+
return runShow(parseShowArgs(argv));
|
|
383
|
+
}
|
|
384
|
+
// Other subcommands (e.g. audit) keep prior queue-module routing until
|
|
385
|
+
// separately ported; only `show` is specialized here (#2890).
|
|
386
|
+
return runQueue(parseArgs(argv), options);
|
|
387
|
+
}
|
|
388
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
389
|
+
process.exit(run(process.argv.slice(2)));
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=triage-queue.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export interface ParsedArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
repo?: string;
|
|
5
|
+
dryRun: boolean;
|
|
6
|
+
emitJson: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
10
|
+
export declare function run(argv: string[]): number;
|
|
11
|
+
//# sourceMappingURL=triage-reconcile.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { statSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { emitReconcileJson, reconcile, reconcileSummary, } from "@deftai/directive-core/dist/triage/reconcile/index.js";
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = {
|
|
8
|
+
projectRoot: process.env.DEFT_PROJECT_ROOT ?? ".",
|
|
9
|
+
dryRun: false,
|
|
10
|
+
emitJson: false,
|
|
11
|
+
};
|
|
12
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
13
|
+
const arg = argv[i];
|
|
14
|
+
if (arg === "--dry-run")
|
|
15
|
+
parsed.dryRun = true;
|
|
16
|
+
else if (arg === "--json")
|
|
17
|
+
parsed.emitJson = true;
|
|
18
|
+
else if (arg === "--project-root") {
|
|
19
|
+
const value = argv[i + 1];
|
|
20
|
+
if (value === undefined)
|
|
21
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
22
|
+
parsed.projectRoot = value;
|
|
23
|
+
i += 1;
|
|
24
|
+
}
|
|
25
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
26
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
27
|
+
}
|
|
28
|
+
else if (arg === "--repo") {
|
|
29
|
+
const value = argv[i + 1];
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
32
|
+
parsed.repo = value;
|
|
33
|
+
i += 1;
|
|
34
|
+
}
|
|
35
|
+
else if (arg?.startsWith("--repo=")) {
|
|
36
|
+
parsed.repo = arg.slice("--repo=".length);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return parsed;
|
|
43
|
+
}
|
|
44
|
+
export function run(argv) {
|
|
45
|
+
const args = parseArgs(argv);
|
|
46
|
+
if (args.error !== undefined) {
|
|
47
|
+
process.stderr.write(`triage:reconcile: ${args.error}\n`);
|
|
48
|
+
return 2;
|
|
49
|
+
}
|
|
50
|
+
const projectRoot = resolve(args.projectRoot);
|
|
51
|
+
try {
|
|
52
|
+
if (!statSync(projectRoot).isDirectory()) {
|
|
53
|
+
process.stderr.write(`❌ triage:reconcile: --project-root ${projectRoot} does not exist or is not a directory.\n`);
|
|
54
|
+
return 2;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
process.stderr.write(`❌ triage:reconcile: --project-root ${projectRoot} does not exist or is not a directory.\n`);
|
|
59
|
+
return 2;
|
|
60
|
+
}
|
|
61
|
+
const result = reconcile(projectRoot, {
|
|
62
|
+
repo: args.repo ?? process.env.DEFT_TRIAGE_REPO ?? null,
|
|
63
|
+
dryRun: args.dryRun,
|
|
64
|
+
});
|
|
65
|
+
if (args.emitJson) {
|
|
66
|
+
process.stdout.write(`${emitReconcileJson(result)}\n`);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
process.stdout.write(`${reconcileSummary(result)}\n`);
|
|
70
|
+
}
|
|
71
|
+
return result.exitCode;
|
|
72
|
+
}
|
|
73
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
74
|
+
process.exit(run(process.argv.slice(2)));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=triage-reconcile.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { refreshActive } from "@deftai/directive-core/dist/triage/refresh/index.js";
|
|
5
|
+
export function parseArgs(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
8
|
+
const arg = argv[i];
|
|
9
|
+
if (arg === "--project-root") {
|
|
10
|
+
const value = argv[i + 1];
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return { projectRoot, error: "argument --project-root: expected one argument" };
|
|
13
|
+
projectRoot = value;
|
|
14
|
+
i += 1;
|
|
15
|
+
}
|
|
16
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
17
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
18
|
+
}
|
|
19
|
+
else if (arg !== undefined) {
|
|
20
|
+
return { projectRoot, error: `unrecognized argument: ${arg}` };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { projectRoot };
|
|
24
|
+
}
|
|
25
|
+
export function run(argv) {
|
|
26
|
+
const args = parseArgs(argv);
|
|
27
|
+
if (args.error !== undefined) {
|
|
28
|
+
process.stderr.write(`triage:refresh-active: ${args.error}\n`);
|
|
29
|
+
return 2;
|
|
30
|
+
}
|
|
31
|
+
refreshActive(resolve(args.projectRoot));
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
35
|
+
process.exit(run(process.argv.slice(2)));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=triage-refresh.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export interface ParsedArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
cacheRoot?: string;
|
|
5
|
+
threshold?: number;
|
|
6
|
+
ignoreLabel?: string;
|
|
7
|
+
ignoreMilestone?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
11
|
+
export declare function run(argv: string[]): number;
|
|
12
|
+
//# sourceMappingURL=triage-scope-drift.d.ts.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { statSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { addIgnore, computeDrift, renderDriftReport, } from "@deftai/directive-core/dist/triage/scope-drift/index.js";
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = { projectRoot: process.env.DEFT_PROJECT_ROOT ?? "." };
|
|
8
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
+
const arg = argv[i];
|
|
10
|
+
if (arg === "--project-root") {
|
|
11
|
+
const value = argv[i + 1];
|
|
12
|
+
if (value === undefined)
|
|
13
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
14
|
+
parsed.projectRoot = value;
|
|
15
|
+
i += 1;
|
|
16
|
+
}
|
|
17
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
18
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
19
|
+
}
|
|
20
|
+
else if (arg === "--cache-root") {
|
|
21
|
+
const value = argv[i + 1];
|
|
22
|
+
if (value === undefined)
|
|
23
|
+
return { ...parsed, error: "argument --cache-root: expected one argument" };
|
|
24
|
+
parsed.cacheRoot = value;
|
|
25
|
+
i += 1;
|
|
26
|
+
}
|
|
27
|
+
else if (arg?.startsWith("--cache-root=")) {
|
|
28
|
+
parsed.cacheRoot = arg.slice("--cache-root=".length);
|
|
29
|
+
}
|
|
30
|
+
else if (arg === "--threshold") {
|
|
31
|
+
const value = argv[i + 1];
|
|
32
|
+
if (value === undefined)
|
|
33
|
+
return { ...parsed, error: "argument --threshold: expected one argument" };
|
|
34
|
+
parsed.threshold = Number(value);
|
|
35
|
+
i += 1;
|
|
36
|
+
}
|
|
37
|
+
else if (arg?.startsWith("--threshold=")) {
|
|
38
|
+
parsed.threshold = Number(arg.slice("--threshold=".length));
|
|
39
|
+
}
|
|
40
|
+
else if (arg === "--ignore-label") {
|
|
41
|
+
const value = argv[i + 1];
|
|
42
|
+
if (value === undefined)
|
|
43
|
+
return { ...parsed, error: "argument --ignore-label: expected one argument" };
|
|
44
|
+
parsed.ignoreLabel = value;
|
|
45
|
+
i += 1;
|
|
46
|
+
}
|
|
47
|
+
else if (arg?.startsWith("--ignore-label=")) {
|
|
48
|
+
parsed.ignoreLabel = arg.slice("--ignore-label=".length);
|
|
49
|
+
}
|
|
50
|
+
else if (arg === "--ignore-milestone") {
|
|
51
|
+
const value = argv[i + 1];
|
|
52
|
+
if (value === undefined)
|
|
53
|
+
return { ...parsed, error: "argument --ignore-milestone: expected one argument" };
|
|
54
|
+
parsed.ignoreMilestone = value;
|
|
55
|
+
i += 1;
|
|
56
|
+
}
|
|
57
|
+
else if (arg?.startsWith("--ignore-milestone=")) {
|
|
58
|
+
parsed.ignoreMilestone = arg.slice("--ignore-milestone=".length);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
export function run(argv) {
|
|
67
|
+
const args = parseArgs(argv);
|
|
68
|
+
if (args.error !== undefined) {
|
|
69
|
+
process.stderr.write(`triage:scope-drift: ${args.error}\n`);
|
|
70
|
+
return 2;
|
|
71
|
+
}
|
|
72
|
+
const projectRoot = resolve(args.projectRoot);
|
|
73
|
+
try {
|
|
74
|
+
if (!statSync(projectRoot).isDirectory()) {
|
|
75
|
+
process.stderr.write(`triage:scope-drift: --project-root ${projectRoot} does not exist or is not a directory.\n`);
|
|
76
|
+
return 2;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
process.stderr.write(`triage:scope-drift: --project-root ${projectRoot} does not exist or is not a directory.\n`);
|
|
81
|
+
return 2;
|
|
82
|
+
}
|
|
83
|
+
if (args.ignoreLabel !== undefined && args.ignoreMilestone !== undefined) {
|
|
84
|
+
process.stderr.write("triage:scope-drift: --ignore-label and --ignore-milestone are mutually exclusive (pick one per invocation).\n");
|
|
85
|
+
return 2;
|
|
86
|
+
}
|
|
87
|
+
if (args.ignoreLabel !== undefined || args.ignoreMilestone !== undefined) {
|
|
88
|
+
try {
|
|
89
|
+
const { changed, message } = addIgnore(projectRoot, {
|
|
90
|
+
label: args.ignoreLabel,
|
|
91
|
+
milestone: args.ignoreMilestone,
|
|
92
|
+
});
|
|
93
|
+
if (!changed) {
|
|
94
|
+
process.stderr.write(`triage:scope-drift: ${message} (no-op).\n`);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
process.stdout.write(`triage:scope-drift: ${message}.\n`);
|
|
98
|
+
process.stderr.write(" Next run of `task triage:scope-drift` will exclude this signal.\n");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
process.stderr.write(`triage:scope-drift: ${String(err)}\n`);
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
const report = computeDrift(projectRoot, {
|
|
108
|
+
cacheRoot: args.cacheRoot ? resolve(args.cacheRoot) : undefined,
|
|
109
|
+
threshold: args.threshold,
|
|
110
|
+
});
|
|
111
|
+
process.stdout.write(`${renderDriftReport(report)}\n`);
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
115
|
+
process.exit(run(process.argv.slice(2)));
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=triage-scope-drift.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface CommandCapture {
|
|
2
|
+
readonly exitCode: number;
|
|
3
|
+
readonly stdout: string;
|
|
4
|
+
readonly stderr: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ScopeFixtureOptions {
|
|
7
|
+
readonly policy?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface ParityCase {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly argv: string[];
|
|
12
|
+
readonly fixture?: ScopeFixtureOptions;
|
|
13
|
+
}
|
|
14
|
+
export interface ParityDiff {
|
|
15
|
+
readonly caseName: string;
|
|
16
|
+
readonly exitMismatch: boolean;
|
|
17
|
+
readonly stdoutMismatch: boolean;
|
|
18
|
+
readonly stderrMismatch: boolean;
|
|
19
|
+
readonly pythonExit: number;
|
|
20
|
+
readonly tsExit: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ParityResult {
|
|
23
|
+
readonly ok: boolean;
|
|
24
|
+
readonly diffs: ParityDiff[];
|
|
25
|
+
}
|
|
26
|
+
/** Strip volatile absolute paths before compare. */
|
|
27
|
+
export declare function normalizeOutput(text: string): string;
|
|
28
|
+
export declare function buildFixtureRepo(options?: ScopeFixtureOptions): string;
|
|
29
|
+
export declare function diffCase(python: CommandCapture, ts: CommandCapture, caseName: string): ParityDiff;
|
|
30
|
+
export declare const PARITY_CASES: readonly ParityCase[];
|
|
31
|
+
export declare function renderReport(result: ParityResult): string;
|
|
32
|
+
//# sourceMappingURL=triage-scope-fixtures.d.ts.map
|