@matteeh/osq 0.2.1 → 0.2.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/README.md +234 -15
- package/dist/cli/approve.d.ts +7 -0
- package/dist/cli/approve.d.ts.map +1 -1
- package/dist/cli/approve.js +34 -0
- package/dist/cli/approve.js.map +1 -1
- package/dist/cli/bin.js +2 -3
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/check.d.ts +15 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/check.js +65 -0
- package/dist/cli/check.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +6 -1
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/lint.d.ts +3 -0
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +33 -14
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/plan-queue.d.ts +10 -4
- package/dist/cli/plan-queue.d.ts.map +1 -1
- package/dist/cli/plan-queue.js +20 -19
- package/dist/cli/plan-queue.js.map +1 -1
- package/dist/cli/plan-sections.d.ts +15 -0
- package/dist/cli/plan-sections.d.ts.map +1 -0
- package/dist/cli/plan-sections.js +47 -0
- package/dist/cli/plan-sections.js.map +1 -0
- package/dist/cli/plan.d.ts +1 -0
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +14 -4
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +73 -1
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/run.d.ts +7 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +22 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/verified.d.ts +15 -0
- package/dist/cli/verified.d.ts.map +1 -0
- package/dist/cli/verified.js +34 -0
- package/dist/cli/verified.js.map +1 -0
- package/dist/core/foundation/config-agents.d.ts +16 -0
- package/dist/core/foundation/config-agents.d.ts.map +1 -0
- package/dist/core/foundation/config-agents.js +2 -0
- package/dist/core/foundation/config-agents.js.map +1 -0
- package/dist/core/foundation/config-claude.d.ts +48 -0
- package/dist/core/foundation/config-claude.d.ts.map +1 -0
- package/dist/core/foundation/config-claude.js +106 -0
- package/dist/core/foundation/config-claude.js.map +1 -0
- package/dist/core/foundation/config-codex-resolve.d.ts +10 -0
- package/dist/core/foundation/config-codex-resolve.d.ts.map +1 -0
- package/dist/core/foundation/config-codex-resolve.js +24 -0
- package/dist/core/foundation/config-codex-resolve.js.map +1 -0
- package/dist/core/foundation/config-file.d.ts +18 -0
- package/dist/core/foundation/config-file.d.ts.map +1 -0
- package/dist/core/foundation/config-file.js +46 -0
- package/dist/core/foundation/config-file.js.map +1 -0
- package/dist/core/foundation/config-gates.d.ts +2 -0
- package/dist/core/foundation/config-gates.d.ts.map +1 -1
- package/dist/core/foundation/config-gates.js +8 -0
- package/dist/core/foundation/config-gates.js.map +1 -1
- package/dist/core/foundation/config-opencode.d.ts +25 -0
- package/dist/core/foundation/config-opencode.d.ts.map +1 -0
- package/dist/core/foundation/config-opencode.js +55 -0
- package/dist/core/foundation/config-opencode.js.map +1 -0
- package/dist/core/foundation/config-pi.d.ts +10 -0
- package/dist/core/foundation/config-pi.d.ts.map +1 -1
- package/dist/core/foundation/config-pi.js +13 -0
- package/dist/core/foundation/config-pi.js.map +1 -1
- package/dist/core/foundation/config-planning.d.ts +12 -1
- package/dist/core/foundation/config-planning.d.ts.map +1 -1
- package/dist/core/foundation/config-planning.js +29 -1
- package/dist/core/foundation/config-planning.js.map +1 -1
- package/dist/core/foundation/config-traceability.d.ts +28 -0
- package/dist/core/foundation/config-traceability.d.ts.map +1 -0
- package/dist/core/foundation/config-traceability.js +63 -0
- package/dist/core/foundation/config-traceability.js.map +1 -0
- package/dist/core/foundation/config-user.d.ts +32 -0
- package/dist/core/foundation/config-user.d.ts.map +1 -0
- package/dist/core/foundation/config-user.js +2 -0
- package/dist/core/foundation/config-user.js.map +1 -0
- package/dist/core/foundation/config-vcs.d.ts +29 -0
- package/dist/core/foundation/config-vcs.d.ts.map +1 -0
- package/dist/core/foundation/config-vcs.js +57 -0
- package/dist/core/foundation/config-vcs.js.map +1 -0
- package/dist/core/foundation/config.d.ts +23 -24
- package/dist/core/foundation/config.d.ts.map +1 -1
- package/dist/core/foundation/config.js +29 -36
- package/dist/core/foundation/config.js.map +1 -1
- package/dist/core/foundation/decisions-validate.d.ts +16 -0
- package/dist/core/foundation/decisions-validate.d.ts.map +1 -0
- package/dist/core/foundation/decisions-validate.js +74 -0
- package/dist/core/foundation/decisions-validate.js.map +1 -0
- package/dist/core/foundation/decisions.d.ts +34 -0
- package/dist/core/foundation/decisions.d.ts.map +1 -0
- package/dist/core/foundation/decisions.js +152 -0
- package/dist/core/foundation/decisions.js.map +1 -0
- package/dist/core/foundation/doctor-decisions.d.ts +9 -0
- package/dist/core/foundation/doctor-decisions.d.ts.map +1 -0
- package/dist/core/foundation/doctor-decisions.js +49 -0
- package/dist/core/foundation/doctor-decisions.js.map +1 -0
- package/dist/core/foundation/doctor-managed.d.ts.map +1 -1
- package/dist/core/foundation/doctor-managed.js +3 -0
- package/dist/core/foundation/doctor-managed.js.map +1 -1
- package/dist/core/foundation/doctor-prices.d.ts +8 -0
- package/dist/core/foundation/doctor-prices.d.ts.map +1 -0
- package/dist/core/foundation/doctor-prices.js +25 -0
- package/dist/core/foundation/doctor-prices.js.map +1 -0
- package/dist/core/foundation/doctor.d.ts.map +1 -1
- package/dist/core/foundation/doctor.js +20 -30
- package/dist/core/foundation/doctor.js.map +1 -1
- package/dist/core/foundation/harness-catalog.d.ts +7 -8
- package/dist/core/foundation/harness-catalog.d.ts.map +1 -1
- package/dist/core/foundation/harness-catalog.js +26 -41
- package/dist/core/foundation/harness-catalog.js.map +1 -1
- package/dist/core/foundation/init-blocks.d.ts +1 -1
- package/dist/core/foundation/init-blocks.d.ts.map +1 -1
- package/dist/core/foundation/init-blocks.js +51 -14
- package/dist/core/foundation/init-blocks.js.map +1 -1
- package/dist/core/foundation/init.d.ts +4 -0
- package/dist/core/foundation/init.d.ts.map +1 -1
- package/dist/core/foundation/init.js +7 -0
- package/dist/core/foundation/init.js.map +1 -1
- package/dist/core/foundation/new.d.ts +4 -1
- package/dist/core/foundation/new.d.ts.map +1 -1
- package/dist/core/foundation/new.js +18 -8
- package/dist/core/foundation/new.js.map +1 -1
- package/dist/core/foundation/package-root.d.ts +6 -0
- package/dist/core/foundation/package-root.d.ts.map +1 -1
- package/dist/core/foundation/package-root.js +6 -0
- package/dist/core/foundation/package-root.js.map +1 -1
- package/dist/core/foundation/rules-block.d.ts +11 -0
- package/dist/core/foundation/rules-block.d.ts.map +1 -0
- package/dist/core/foundation/rules-block.js +90 -0
- package/dist/core/foundation/rules-block.js.map +1 -0
- package/dist/core/foundation/traceability-block.d.ts +13 -0
- package/dist/core/foundation/traceability-block.d.ts.map +1 -0
- package/dist/core/foundation/traceability-block.js +124 -0
- package/dist/core/foundation/traceability-block.js.map +1 -0
- package/dist/core/lifecycle/done.d.ts.map +1 -1
- package/dist/core/lifecycle/done.js +2 -4
- package/dist/core/lifecycle/done.js.map +1 -1
- package/dist/core/lifecycle/recertify.d.ts +9 -0
- package/dist/core/lifecycle/recertify.d.ts.map +1 -0
- package/dist/core/lifecycle/recertify.js +27 -0
- package/dist/core/lifecycle/recertify.js.map +1 -0
- package/dist/core/lifecycle/reject.d.ts.map +1 -1
- package/dist/core/lifecycle/reject.js +3 -4
- package/dist/core/lifecycle/reject.js.map +1 -1
- package/dist/core/lifecycle/retry.d.ts.map +1 -1
- package/dist/core/lifecycle/retry.js +6 -20
- package/dist/core/lifecycle/retry.js.map +1 -1
- package/dist/core/lifecycle/verification-record.d.ts +42 -0
- package/dist/core/lifecycle/verification-record.d.ts.map +1 -0
- package/dist/core/lifecycle/verification-record.js +76 -0
- package/dist/core/lifecycle/verification-record.js.map +1 -0
- package/dist/core/report/approval-flags.d.ts +16 -3
- package/dist/core/report/approval-flags.d.ts.map +1 -1
- package/dist/core/report/approval-flags.js +59 -22
- package/dist/core/report/approval-flags.js.map +1 -1
- package/dist/core/report/brief-to-approval.d.ts +7 -0
- package/dist/core/report/brief-to-approval.d.ts.map +1 -0
- package/dist/core/report/brief-to-approval.js +43 -0
- package/dist/core/report/brief-to-approval.js.map +1 -0
- package/dist/core/report/planning-price-gaps.d.ts +10 -0
- package/dist/core/report/planning-price-gaps.d.ts.map +1 -0
- package/dist/core/report/planning-price-gaps.js +37 -0
- package/dist/core/report/planning-price-gaps.js.map +1 -0
- package/dist/core/report/planning-slice-lookup.d.ts.map +1 -1
- package/dist/core/report/planning-slice-lookup.js +3 -9
- package/dist/core/report/planning-slice-lookup.js.map +1 -1
- package/dist/core/report/recent-disclosures.d.ts +18 -0
- package/dist/core/report/recent-disclosures.d.ts.map +1 -0
- package/dist/core/report/recent-disclosures.js +105 -0
- package/dist/core/report/recent-disclosures.js.map +1 -0
- package/dist/core/report/record-disclosures.d.ts +14 -0
- package/dist/core/report/record-disclosures.d.ts.map +1 -0
- package/dist/core/report/record-disclosures.js +30 -0
- package/dist/core/report/record-disclosures.js.map +1 -0
- package/dist/core/report/record-estimates.d.ts +25 -0
- package/dist/core/report/record-estimates.d.ts.map +1 -0
- package/dist/core/report/record-estimates.js +83 -0
- package/dist/core/report/record-estimates.js.map +1 -0
- package/dist/core/report/record-rework.d.ts +19 -0
- package/dist/core/report/record-rework.d.ts.map +1 -0
- package/dist/core/report/record-rework.js +50 -0
- package/dist/core/report/record-rework.js.map +1 -0
- package/dist/core/report/record-verification.d.ts +16 -0
- package/dist/core/report/record-verification.d.ts.map +1 -0
- package/dist/core/report/record-verification.js +33 -0
- package/dist/core/report/record-verification.js.map +1 -0
- package/dist/core/report/report-dependencies.d.ts +29 -0
- package/dist/core/report/report-dependencies.d.ts.map +1 -0
- package/dist/core/report/report-dependencies.js +92 -0
- package/dist/core/report/report-dependencies.js.map +1 -0
- package/dist/core/report/report-events.d.ts +1 -0
- package/dist/core/report/report-events.d.ts.map +1 -1
- package/dist/core/report/report-events.js +8 -26
- package/dist/core/report/report-events.js.map +1 -1
- package/dist/core/report/report-mutation.d.ts +34 -0
- package/dist/core/report/report-mutation.d.ts.map +1 -0
- package/dist/core/report/report-mutation.js +191 -0
- package/dist/core/report/report-mutation.js.map +1 -0
- package/dist/core/report/report-scope.d.ts +21 -0
- package/dist/core/report/report-scope.d.ts.map +1 -0
- package/dist/core/report/report-scope.js +61 -0
- package/dist/core/report/report-scope.js.map +1 -0
- package/dist/core/report/report-traceability.d.ts +29 -0
- package/dist/core/report/report-traceability.d.ts.map +1 -0
- package/dist/core/report/report-traceability.js +94 -0
- package/dist/core/report/report-traceability.js.map +1 -0
- package/dist/core/report/report.d.ts +35 -1
- package/dist/core/report/report.d.ts.map +1 -1
- package/dist/core/report/report.js +130 -111
- package/dist/core/report/report.js.map +1 -1
- package/dist/core/report/result-sections.d.ts +30 -0
- package/dist/core/report/result-sections.d.ts.map +1 -0
- package/dist/core/report/result-sections.js +125 -0
- package/dist/core/report/result-sections.js.map +1 -0
- package/dist/core/report/scope-size.d.ts +7 -0
- package/dist/core/report/scope-size.d.ts.map +1 -0
- package/dist/core/report/scope-size.js +22 -0
- package/dist/core/report/scope-size.js.map +1 -0
- package/dist/core/run/commit-message.d.ts +24 -0
- package/dist/core/run/commit-message.d.ts.map +1 -0
- package/dist/core/run/commit-message.js +76 -0
- package/dist/core/run/commit-message.js.map +1 -0
- package/dist/core/run/dead-commit.d.ts +10 -0
- package/dist/core/run/dead-commit.d.ts.map +1 -0
- package/dist/core/run/dead-commit.js +70 -0
- package/dist/core/run/dead-commit.js.map +1 -0
- package/dist/core/run/focused-tests.d.ts +43 -0
- package/dist/core/run/focused-tests.d.ts.map +1 -0
- package/dist/core/run/focused-tests.js +116 -0
- package/dist/core/run/focused-tests.js.map +1 -0
- package/dist/core/run/manifest-approval.d.ts +7 -0
- package/dist/core/run/manifest-approval.d.ts.map +1 -0
- package/dist/core/run/manifest-approval.js +30 -0
- package/dist/core/run/manifest-approval.js.map +1 -0
- package/dist/core/run/manifest.d.ts +11 -1
- package/dist/core/run/manifest.d.ts.map +1 -1
- package/dist/core/run/manifest.js +52 -11
- package/dist/core/run/manifest.js.map +1 -1
- package/dist/core/run/mutation-report.d.ts +29 -0
- package/dist/core/run/mutation-report.d.ts.map +1 -0
- package/dist/core/run/mutation-report.js +107 -0
- package/dist/core/run/mutation-report.js.map +1 -0
- package/dist/core/run/mutation-run.d.ts +32 -0
- package/dist/core/run/mutation-run.d.ts.map +1 -0
- package/dist/core/run/mutation-run.js +80 -0
- package/dist/core/run/mutation-run.js.map +1 -0
- package/dist/core/run/verification.d.ts +12 -1
- package/dist/core/run/verification.d.ts.map +1 -1
- package/dist/core/run/verification.js +24 -2
- package/dist/core/run/verification.js.map +1 -1
- package/dist/core/spec/approve-worktree-shared.d.ts +33 -0
- package/dist/core/spec/approve-worktree-shared.d.ts.map +1 -0
- package/dist/core/spec/approve-worktree-shared.js +59 -0
- package/dist/core/spec/approve-worktree-shared.js.map +1 -0
- package/dist/core/spec/approve-worktree.d.ts +21 -0
- package/dist/core/spec/approve-worktree.d.ts.map +1 -0
- package/dist/core/spec/approve-worktree.js +153 -0
- package/dist/core/spec/approve-worktree.js.map +1 -0
- package/dist/core/spec/approve.d.ts +20 -10
- package/dist/core/spec/approve.d.ts.map +1 -1
- package/dist/core/spec/approve.js +57 -54
- package/dist/core/spec/approve.js.map +1 -1
- package/dist/core/spec/capability-impact.d.ts +43 -0
- package/dist/core/spec/capability-impact.d.ts.map +1 -0
- package/dist/core/spec/capability-impact.js +85 -0
- package/dist/core/spec/capability-impact.js.map +1 -0
- package/dist/core/spec/decisions-lint.d.ts +18 -0
- package/dist/core/spec/decisions-lint.d.ts.map +1 -0
- package/dist/core/spec/decisions-lint.js +127 -0
- package/dist/core/spec/decisions-lint.js.map +1 -0
- package/dist/core/spec/delta.d.ts +6 -0
- package/dist/core/spec/delta.d.ts.map +1 -1
- package/dist/core/spec/delta.js +73 -5
- package/dist/core/spec/delta.js.map +1 -1
- package/dist/core/spec/digest-decisions.d.ts +27 -0
- package/dist/core/spec/digest-decisions.d.ts.map +1 -0
- package/dist/core/spec/digest-decisions.js +86 -0
- package/dist/core/spec/digest-decisions.js.map +1 -0
- package/dist/core/spec/digest-format.d.ts +4 -0
- package/dist/core/spec/digest-format.d.ts.map +1 -0
- package/dist/core/spec/digest-format.js +44 -0
- package/dist/core/spec/digest-format.js.map +1 -0
- package/dist/core/spec/digest.d.ts +5 -3
- package/dist/core/spec/digest.d.ts.map +1 -1
- package/dist/core/spec/digest.js +14 -33
- package/dist/core/spec/digest.js.map +1 -1
- package/dist/core/spec/human-steps.d.ts +20 -0
- package/dist/core/spec/human-steps.d.ts.map +1 -0
- package/dist/core/spec/human-steps.js +52 -0
- package/dist/core/spec/human-steps.js.map +1 -0
- package/dist/core/spec/impact-lint.d.ts +24 -0
- package/dist/core/spec/impact-lint.d.ts.map +1 -0
- package/dist/core/spec/impact-lint.js +39 -0
- package/dist/core/spec/impact-lint.js.map +1 -0
- package/dist/core/spec/import-graph.d.ts +35 -0
- package/dist/core/spec/import-graph.d.ts.map +1 -0
- package/dist/core/spec/import-graph.js +155 -0
- package/dist/core/spec/import-graph.js.map +1 -0
- package/dist/core/spec/lint-findings.d.ts +44 -0
- package/dist/core/spec/lint-findings.d.ts.map +1 -0
- package/dist/core/spec/lint-findings.js +56 -0
- package/dist/core/spec/lint-findings.js.map +1 -0
- package/dist/core/spec/lint-output.d.ts +53 -0
- package/dist/core/spec/lint-output.d.ts.map +1 -0
- package/dist/core/spec/lint-output.js +87 -0
- package/dist/core/spec/lint-output.js.map +1 -0
- package/dist/core/spec/linter.d.ts +14 -4
- package/dist/core/spec/linter.d.ts.map +1 -1
- package/dist/core/spec/linter.js +271 -111
- package/dist/core/spec/linter.js.map +1 -1
- package/dist/core/spec/merged-spec-check.d.ts +24 -0
- package/dist/core/spec/merged-spec-check.d.ts.map +1 -0
- package/dist/core/spec/merged-spec-check.js +95 -0
- package/dist/core/spec/merged-spec-check.js.map +1 -0
- package/dist/core/spec/openspec-issues.d.ts +58 -0
- package/dist/core/spec/openspec-issues.d.ts.map +1 -0
- package/dist/core/spec/openspec-issues.js +166 -0
- package/dist/core/spec/openspec-issues.js.map +1 -0
- package/dist/core/spec/parser.d.ts +1 -0
- package/dist/core/spec/parser.d.ts.map +1 -1
- package/dist/core/spec/parser.js +16 -6
- package/dist/core/spec/parser.js.map +1 -1
- package/dist/core/spec/scenario-impact.d.ts +47 -0
- package/dist/core/spec/scenario-impact.d.ts.map +1 -0
- package/dist/core/spec/scenario-impact.js +130 -0
- package/dist/core/spec/scenario-impact.js.map +1 -0
- package/dist/core/spec/test-impact.d.ts +28 -0
- package/dist/core/spec/test-impact.d.ts.map +1 -0
- package/dist/core/spec/test-impact.js +119 -0
- package/dist/core/spec/test-impact.js.map +1 -0
- package/dist/core/spec/traceability-links.d.ts +50 -0
- package/dist/core/spec/traceability-links.d.ts.map +1 -0
- package/dist/core/spec/traceability-links.js +120 -0
- package/dist/core/spec/traceability-links.js.map +1 -0
- package/dist/core/spec/traceability-lint.d.ts +29 -0
- package/dist/core/spec/traceability-lint.d.ts.map +1 -0
- package/dist/core/spec/traceability-lint.js +143 -0
- package/dist/core/spec/traceability-lint.js.map +1 -0
- package/dist/core/status/blocked-item.d.ts +8 -0
- package/dist/core/status/blocked-item.d.ts.map +1 -0
- package/dist/core/status/blocked-item.js +45 -0
- package/dist/core/status/blocked-item.js.map +1 -0
- package/dist/core/status/change-locations.d.ts +44 -0
- package/dist/core/status/change-locations.d.ts.map +1 -0
- package/dist/core/status/change-locations.js +138 -0
- package/dist/core/status/change-locations.js.map +1 -0
- package/dist/core/status/dependency-readiness.d.ts +11 -0
- package/dist/core/status/dependency-readiness.d.ts.map +1 -0
- package/dist/core/status/dependency-readiness.js +39 -0
- package/dist/core/status/dependency-readiness.js.map +1 -0
- package/dist/core/status/inbox-projection.d.ts.map +1 -1
- package/dist/core/status/inbox-projection.js +23 -4
- package/dist/core/status/inbox-projection.js.map +1 -1
- package/dist/core/status/inbox-text.d.ts.map +1 -1
- package/dist/core/status/inbox-text.js +34 -3
- package/dist/core/status/inbox-text.js.map +1 -1
- package/dist/core/status/inbox.d.ts +10 -1
- package/dist/core/status/inbox.d.ts.map +1 -1
- package/dist/core/status/inbox.js +19 -1
- package/dist/core/status/inbox.js.map +1 -1
- package/dist/core/status/layout.d.ts +6 -0
- package/dist/core/status/layout.d.ts.map +1 -1
- package/dist/core/status/layout.js +8 -0
- package/dist/core/status/layout.js.map +1 -1
- package/dist/core/status/next-step.d.ts +17 -0
- package/dist/core/status/next-step.d.ts.map +1 -0
- package/dist/core/status/next-step.js +85 -0
- package/dist/core/status/next-step.js.map +1 -0
- package/dist/core/status/pre-spawn-words.d.ts +13 -0
- package/dist/core/status/pre-spawn-words.d.ts.map +1 -0
- package/dist/core/status/pre-spawn-words.js +26 -0
- package/dist/core/status/pre-spawn-words.js.map +1 -0
- package/dist/core/status/queue-parser.d.ts +1 -0
- package/dist/core/status/queue-parser.d.ts.map +1 -1
- package/dist/core/status/queue-parser.js +41 -2
- package/dist/core/status/queue-parser.js.map +1 -1
- package/dist/core/status/queue-planning.d.ts +1 -0
- package/dist/core/status/queue-planning.d.ts.map +1 -1
- package/dist/core/status/queue-planning.js +24 -12
- package/dist/core/status/queue-planning.js.map +1 -1
- package/dist/core/status/queue-report-detail.d.ts.map +1 -1
- package/dist/core/status/queue-report-detail.js +5 -3
- package/dist/core/status/queue-report-detail.js.map +1 -1
- package/dist/core/status/queue-state.d.ts +1 -1
- package/dist/core/status/queue-state.d.ts.map +1 -1
- package/dist/core/status/queue-state.js +27 -41
- package/dist/core/status/queue-state.js.map +1 -1
- package/dist/core/status/show.d.ts +25 -0
- package/dist/core/status/show.d.ts.map +1 -1
- package/dist/core/status/show.js +354 -91
- package/dist/core/status/show.js.map +1 -1
- package/dist/core/status/state.d.ts.map +1 -1
- package/dist/core/status/state.js +1 -23
- package/dist/core/status/state.js.map +1 -1
- package/dist/core/status/status.d.ts +18 -0
- package/dist/core/status/status.d.ts.map +1 -1
- package/dist/core/status/status.js +59 -80
- package/dist/core/status/status.js.map +1 -1
- package/dist/core/status/verification.d.ts +27 -0
- package/dist/core/status/verification.d.ts.map +1 -0
- package/dist/core/status/verification.js +111 -0
- package/dist/core/status/verification.js.map +1 -0
- package/dist/core/trace/function-ranges.d.ts +30 -0
- package/dist/core/trace/function-ranges.d.ts.map +1 -0
- package/dist/core/trace/function-ranges.js +250 -0
- package/dist/core/trace/function-ranges.js.map +1 -0
- package/dist/core/trace/mutation-pick.d.ts +55 -0
- package/dist/core/trace/mutation-pick.d.ts.map +1 -0
- package/dist/core/trace/mutation-pick.js +96 -0
- package/dist/core/trace/mutation-pick.js.map +1 -0
- package/dist/core/trace/scenario-index.d.ts +27 -0
- package/dist/core/trace/scenario-index.d.ts.map +1 -0
- package/dist/core/trace/scenario-index.js +76 -0
- package/dist/core/trace/scenario-index.js.map +1 -0
- package/dist/core/trace/scenario-lookup.d.ts +14 -0
- package/dist/core/trace/scenario-lookup.d.ts.map +1 -0
- package/dist/core/trace/scenario-lookup.js +179 -0
- package/dist/core/trace/scenario-lookup.js.map +1 -0
- package/dist/core/trace/tag-scan.d.ts +44 -0
- package/dist/core/trace/tag-scan.d.ts.map +1 -0
- package/dist/core/trace/tag-scan.js +200 -0
- package/dist/core/trace/tag-scan.js.map +1 -0
- package/dist/core/vcs/doctor-git.d.ts +13 -0
- package/dist/core/vcs/doctor-git.d.ts.map +1 -0
- package/dist/core/vcs/doctor-git.js +114 -0
- package/dist/core/vcs/doctor-git.js.map +1 -0
- package/dist/core/vcs/git-vcs-write.d.ts +47 -0
- package/dist/core/vcs/git-vcs-write.d.ts.map +1 -0
- package/dist/core/vcs/git-vcs-write.js +210 -0
- package/dist/core/vcs/git-vcs-write.js.map +1 -0
- package/dist/core/vcs/git-vcs.d.ts +40 -0
- package/dist/core/vcs/git-vcs.d.ts.map +1 -0
- package/dist/core/vcs/git-vcs.js +170 -0
- package/dist/core/vcs/git-vcs.js.map +1 -0
- package/dist/core/vcs/no-vcs.d.ts +26 -0
- package/dist/core/vcs/no-vcs.d.ts.map +1 -0
- package/dist/core/vcs/no-vcs.js +62 -0
- package/dist/core/vcs/no-vcs.js.map +1 -0
- package/dist/core/vcs/select.d.ts +11 -0
- package/dist/core/vcs/select.d.ts.map +1 -0
- package/dist/core/vcs/select.js +33 -0
- package/dist/core/vcs/select.js.map +1 -0
- package/dist/core/vcs/snapshot.d.ts +34 -0
- package/dist/core/vcs/snapshot.d.ts.map +1 -0
- package/dist/core/vcs/snapshot.js +71 -0
- package/dist/core/vcs/snapshot.js.map +1 -0
- package/dist/core/vcs/vcs.d.ts +55 -0
- package/dist/core/vcs/vcs.d.ts.map +1 -0
- package/dist/core/vcs/vcs.js +2 -0
- package/dist/core/vcs/vcs.js.map +1 -0
- package/dist/core/vcs/worktree.d.ts +10 -0
- package/dist/core/vcs/worktree.d.ts.map +1 -0
- package/dist/core/vcs/worktree.js +25 -0
- package/dist/core/vcs/worktree.js.map +1 -0
- package/dist/core/web/web-data-folders.d.ts.map +1 -1
- package/dist/core/web/web-data-folders.js +18 -33
- package/dist/core/web/web-data-folders.js.map +1 -1
- package/dist/core/web/web-data-lifecycle.d.ts.map +1 -1
- package/dist/core/web/web-data-lifecycle.js +2 -1
- package/dist/core/web/web-data-lifecycle.js.map +1 -1
- package/dist/core/web/web-events.d.ts +8 -6
- package/dist/core/web/web-events.d.ts.map +1 -1
- package/dist/core/web/web-events.js +7 -31
- package/dist/core/web/web-events.js.map +1 -1
- package/dist/core/web/web-server.d.ts.map +1 -1
- package/dist/core/web/web-server.js +3 -0
- package/dist/core/web/web-server.js.map +1 -1
- package/dist/core/web/web-trees.d.ts +27 -0
- package/dist/core/web/web-trees.d.ts.map +1 -0
- package/dist/core/web/web-trees.js +82 -0
- package/dist/core/web/web-trees.js.map +1 -0
- package/dist/harness/claude/claude-exec-args.d.ts +13 -0
- package/dist/harness/claude/claude-exec-args.d.ts.map +1 -0
- package/dist/harness/claude/claude-exec-args.js +61 -0
- package/dist/harness/claude/claude-exec-args.js.map +1 -0
- package/dist/harness/claude/claude-exec.d.ts +12 -0
- package/dist/harness/claude/claude-exec.d.ts.map +1 -0
- package/dist/harness/claude/claude-exec.js +79 -0
- package/dist/harness/claude/claude-exec.js.map +1 -0
- package/dist/harness/claude/claude-stream.d.ts +31 -0
- package/dist/harness/claude/claude-stream.d.ts.map +1 -0
- package/dist/harness/claude/claude-stream.js +150 -0
- package/dist/harness/claude/claude-stream.js.map +1 -0
- package/dist/harness/claude/claude-tools.d.ts +5 -0
- package/dist/harness/claude/claude-tools.d.ts.map +1 -0
- package/dist/harness/claude/claude-tools.js +30 -0
- package/dist/harness/claude/claude-tools.js.map +1 -0
- package/dist/harness/index.d.ts +1 -0
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +3 -0
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/opencode/opencode-session.d.ts +42 -0
- package/dist/harness/opencode/opencode-session.d.ts.map +1 -0
- package/dist/harness/opencode/opencode-session.js +123 -0
- package/dist/harness/opencode/opencode-session.js.map +1 -0
- package/dist/harness/opencode/opencode.d.ts +2 -1
- package/dist/harness/opencode/opencode.d.ts.map +1 -1
- package/dist/harness/opencode/opencode.js +52 -28
- package/dist/harness/opencode/opencode.js.map +1 -1
- package/dist/harness/prompt.js +1 -1
- package/dist/harness/prompt.js.map +1 -1
- package/dist/harness/types.d.ts +112 -1
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/scenario.d.ts +29 -0
- package/dist/testing/scenario.d.ts.map +1 -0
- package/dist/testing/scenario.js +157 -0
- package/dist/testing/scenario.js.map +1 -0
- package/dist/watcher/archiver.d.ts +2 -1
- package/dist/watcher/archiver.d.ts.map +1 -1
- package/dist/watcher/archiver.js +27 -2
- package/dist/watcher/archiver.js.map +1 -1
- package/dist/watcher/auto-recertify.d.ts +27 -0
- package/dist/watcher/auto-recertify.d.ts.map +1 -0
- package/dist/watcher/auto-recertify.js +113 -0
- package/dist/watcher/auto-recertify.js.map +1 -0
- package/dist/watcher/auto-retry.d.ts +1 -1
- package/dist/watcher/auto-retry.d.ts.map +1 -1
- package/dist/watcher/auto-retry.js +3 -11
- package/dist/watcher/auto-retry.js.map +1 -1
- package/dist/watcher/baseline-key.d.ts +17 -0
- package/dist/watcher/baseline-key.d.ts.map +1 -0
- package/dist/watcher/baseline-key.js +31 -0
- package/dist/watcher/baseline-key.js.map +1 -0
- package/dist/watcher/baseline.d.ts +32 -0
- package/dist/watcher/baseline.d.ts.map +1 -0
- package/dist/watcher/baseline.js +166 -0
- package/dist/watcher/baseline.js.map +1 -0
- package/dist/watcher/blocked.d.ts +12 -0
- package/dist/watcher/blocked.d.ts.map +1 -0
- package/dist/watcher/blocked.js +24 -0
- package/dist/watcher/blocked.js.map +1 -0
- package/dist/watcher/dependencies.d.ts +28 -0
- package/dist/watcher/dependencies.d.ts.map +1 -0
- package/dist/watcher/dependencies.js +152 -0
- package/dist/watcher/dependencies.js.map +1 -0
- package/dist/watcher/done-metadata.d.ts +4 -0
- package/dist/watcher/done-metadata.d.ts.map +1 -0
- package/dist/watcher/done-metadata.js +20 -0
- package/dist/watcher/done-metadata.js.map +1 -0
- package/dist/watcher/failure-reason.d.ts +1 -1
- package/dist/watcher/failure-reason.d.ts.map +1 -1
- package/dist/watcher/focused-verify.d.ts +17 -0
- package/dist/watcher/focused-verify.d.ts.map +1 -0
- package/dist/watcher/focused-verify.js +54 -0
- package/dist/watcher/focused-verify.js.map +1 -0
- package/dist/watcher/git-guard.d.ts +24 -0
- package/dist/watcher/git-guard.d.ts.map +1 -0
- package/dist/watcher/git-guard.js +95 -0
- package/dist/watcher/git-guard.js.map +1 -0
- package/dist/watcher/instructions-drift.d.ts +21 -0
- package/dist/watcher/instructions-drift.d.ts.map +1 -0
- package/dist/watcher/instructions-drift.js +115 -0
- package/dist/watcher/instructions-drift.js.map +1 -0
- package/dist/watcher/loop.d.ts.map +1 -1
- package/dist/watcher/loop.js +36 -50
- package/dist/watcher/loop.js.map +1 -1
- package/dist/watcher/measures.d.ts.map +1 -1
- package/dist/watcher/measures.js +22 -39
- package/dist/watcher/measures.js.map +1 -1
- package/dist/watcher/mutation-check.d.ts +42 -0
- package/dist/watcher/mutation-check.d.ts.map +1 -0
- package/dist/watcher/mutation-check.js +147 -0
- package/dist/watcher/mutation-check.js.map +1 -0
- package/dist/watcher/regression.d.ts +10 -5
- package/dist/watcher/regression.d.ts.map +1 -1
- package/dist/watcher/regression.js +29 -22
- package/dist/watcher/regression.js.map +1 -1
- package/dist/watcher/runner.d.ts.map +1 -1
- package/dist/watcher/runner.js +12 -14
- package/dist/watcher/runner.js.map +1 -1
- package/dist/watcher/spawn.d.ts.map +1 -1
- package/dist/watcher/spawn.js +5 -0
- package/dist/watcher/spawn.js.map +1 -1
- package/dist/watcher/task-verify.d.ts +7 -2
- package/dist/watcher/task-verify.d.ts.map +1 -1
- package/dist/watcher/task-verify.js +33 -8
- package/dist/watcher/task-verify.js.map +1 -1
- package/dist/watcher/verify.d.ts +1 -5
- package/dist/watcher/verify.d.ts.map +1 -1
- package/dist/watcher/verify.js +2 -6
- package/dist/watcher/verify.js.map +1 -1
- package/package.json +5 -1
- package/templates/PLANNER.md +35 -9
- package/templates/openspec/config.yaml +1 -1
- package/templates/openspec/schemas/osq/schema.yaml +4 -2
- package/templates/openspec/schemas/osq/templates/proposal.md +9 -2
- package/templates/proposal.md +9 -2
- package/ui/dist/assets/{index-CZYeQ8la.js → index-D39uYbbL.js} +1 -1
- package/ui/dist/index.html +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { getChangeRunDir, getDeadMarkerPath, getEventsPath } from '../status/layout.js';
|
|
4
|
+
import { formatCommitMessage, readCommitTrailers } from './commit-message.js';
|
|
5
|
+
/** The worktree-root-relative POSIX path of one absolute path. */
|
|
6
|
+
function relativeToRoot(root, target) {
|
|
7
|
+
return path.relative(root, target).split(path.sep).join('/');
|
|
8
|
+
}
|
|
9
|
+
/** Whether a status path is the change folder or a file below it. */
|
|
10
|
+
function insideChange(candidate, changeRel) {
|
|
11
|
+
if (changeRel === '' || changeRel === '.')
|
|
12
|
+
return true;
|
|
13
|
+
return candidate === changeRel || candidate.startsWith(`${changeRel}/`);
|
|
14
|
+
}
|
|
15
|
+
/** The change folder's numeric prefix, else its whole base name. */
|
|
16
|
+
function changeId(changeFolder) {
|
|
17
|
+
const base = path.basename(changeFolder);
|
|
18
|
+
return /^(\d+)/.exec(base)?.[1] ?? base;
|
|
19
|
+
}
|
|
20
|
+
/** Every status path outside the change folder, a rename's source included. */
|
|
21
|
+
function outsideChange(entries, changeRel) {
|
|
22
|
+
const paths = [];
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
for (const candidate of [entry.path, entry.from]) {
|
|
25
|
+
if (candidate === undefined || insideChange(candidate, changeRel))
|
|
26
|
+
continue;
|
|
27
|
+
paths.push(candidate);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return [...new Set(paths)];
|
|
31
|
+
}
|
|
32
|
+
/** Whether a file exists, without surfacing the error. */
|
|
33
|
+
async function exists(file) {
|
|
34
|
+
return fs.access(file).then(() => true, () => false);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Record a dead task in its osq worktree: write the agent's patch, discard
|
|
38
|
+
* everything the agent changed outside the change folder, then commit whichever
|
|
39
|
+
* `.run/` records exist. Fails before writing anything when `vcs.author` is
|
|
40
|
+
* unset. Returns the new commit.
|
|
41
|
+
*/
|
|
42
|
+
export async function commitDeadTask(vcs, config, changeFolder, taskNumber, reason, title, outcomeLine) {
|
|
43
|
+
const author = config.vcs?.author;
|
|
44
|
+
if (author === undefined || author.trim() === '') {
|
|
45
|
+
throw new Error('vcs.author is required to commit a dead task');
|
|
46
|
+
}
|
|
47
|
+
const root = await vcs.root();
|
|
48
|
+
if (root === null)
|
|
49
|
+
throw new Error('a dead task requires a git worktree');
|
|
50
|
+
const changeRaw = path.isAbsolute(changeFolder) ? changeFolder : path.resolve(root, changeFolder);
|
|
51
|
+
const changeAbs = await fs.realpath(changeRaw).catch(() => changeRaw);
|
|
52
|
+
const changeRel = relativeToRoot(root, changeAbs);
|
|
53
|
+
const task = String(taskNumber);
|
|
54
|
+
const deadMarker = getDeadMarkerPath(changeAbs, task);
|
|
55
|
+
const deadPatch = path.join(getChangeRunDir(changeAbs), 'dead', `${task}.patch`);
|
|
56
|
+
const events = getEventsPath(changeAbs, task);
|
|
57
|
+
await fs.mkdir(path.dirname(deadPatch), { recursive: true });
|
|
58
|
+
await fs.writeFile(deadPatch, await vcs.patch(), 'utf8');
|
|
59
|
+
await vcs.discard(outsideChange(await vcs.status(), changeRel));
|
|
60
|
+
const committed = [];
|
|
61
|
+
for (const file of [deadMarker, deadPatch, events]) {
|
|
62
|
+
if (await exists(file))
|
|
63
|
+
committed.push(relativeToRoot(root, file));
|
|
64
|
+
}
|
|
65
|
+
const subject = `osq: ${changeId(changeAbs)} task ${task} dead, reason ${reason}`;
|
|
66
|
+
const trailers = await readCommitTrailers(changeAbs, task);
|
|
67
|
+
const message = formatCommitMessage({ subject, title, outcomeLine, trailers });
|
|
68
|
+
return vcs.commit(committed, message, author);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=dead-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dead-commit.js","sourceRoot":"","sources":["../../../src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|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focused scenario tests: collect the scenario test files that name a task's
|
|
3
|
+
* opted-in scenarios and run only those files, classifying the TAP result. The
|
|
4
|
+
* full verify still decides completion; this only buys fast feedback.
|
|
5
|
+
*
|
|
6
|
+
* The scenario index is the only source of tests. Nothing is persisted.
|
|
7
|
+
*/
|
|
8
|
+
import type { OsqConfig } from '../foundation/config.js';
|
|
9
|
+
import type { TaggedScenario } from '../trace/tag-scan.js';
|
|
10
|
+
/** How a focused run ended. */
|
|
11
|
+
export type FocusedOutcome = 'passed' | 'problem' | 'failed';
|
|
12
|
+
/** The scenarios and test files a task's focused run covers. */
|
|
13
|
+
export interface FocusedCollection {
|
|
14
|
+
readonly scenarios: readonly TaggedScenario[];
|
|
15
|
+
readonly files: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/** One focused run's command, inputs, and classified outcome. */
|
|
18
|
+
export interface FocusedRunResult {
|
|
19
|
+
readonly command: string;
|
|
20
|
+
readonly files: readonly string[];
|
|
21
|
+
readonly scenarios: readonly string[];
|
|
22
|
+
readonly outcome: FocusedOutcome;
|
|
23
|
+
readonly exitCode: number;
|
|
24
|
+
readonly duration: number;
|
|
25
|
+
readonly timedOut: boolean;
|
|
26
|
+
readonly output: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Collect the task's focused scenarios and files. The scenarios are the
|
|
30
|
+
* opted-in capability and name pairs named by `scenario(...)` calls in scenario
|
|
31
|
+
* test files inside the resolved scope, and the files are every scenario test
|
|
32
|
+
* file in the repository naming one of them. With the focused command unset, no
|
|
33
|
+
* capability opted in, or no collected scenario, the collection is empty.
|
|
34
|
+
*/
|
|
35
|
+
export declare function collectFocusedTests(projectRoot: string, config: OsqConfig, scope: readonly string[]): Promise<FocusedCollection>;
|
|
36
|
+
/**
|
|
37
|
+
* Run the focused command with `{files}` replaced by the collected files, each
|
|
38
|
+
* single-quoted for the shell. It runs through `runVerificationCommand` with
|
|
39
|
+
* the task's change folder and the verify timeout, so it inherits the verify
|
|
40
|
+
* environment, `OSQ_CHANGE` included. Returns null when there is nothing to run.
|
|
41
|
+
*/
|
|
42
|
+
export declare function runFocusedTests(collection: FocusedCollection, projectRoot: string, changeFolder: string, config: OsqConfig): Promise<FocusedRunResult | null>;
|
|
43
|
+
//# sourceMappingURL=focused-tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focused-tests.d.ts","sourceRoot":"","sources":["../../../src/core/run/focused-tests.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,+BAA+B;AAC/B,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7D,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AA0CD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,iBAAiB,CAAC,CA0B5B;AAYD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,iBAAiB,EAC7B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAuBlC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focused scenario tests: collect the scenario test files that name a task's
|
|
3
|
+
* opted-in scenarios and run only those files, classifying the TAP result. The
|
|
4
|
+
* full verify still decides completion; this only buys fast feedback.
|
|
5
|
+
*
|
|
6
|
+
* The scenario index is the only source of tests. Nothing is persisted.
|
|
7
|
+
*/
|
|
8
|
+
import { DEFAULT_TRACEABILITY_CONFIG, } from '../foundation/config-traceability.js';
|
|
9
|
+
import { buildImportGraph } from '../spec/import-graph.js';
|
|
10
|
+
import { buildScenarioIndex } from '../trace/scenario-index.js';
|
|
11
|
+
import { resolveScope } from './scope.js';
|
|
12
|
+
import { runVerificationCommand } from './verification.js';
|
|
13
|
+
const EMPTY_COLLECTION = { scenarios: [], files: [] };
|
|
14
|
+
/** True when the configuration opts a capability into traceability. */
|
|
15
|
+
function isOptedIn(traceability, capability) {
|
|
16
|
+
return traceability.capabilities === 'all' || traceability.capabilities.includes(capability);
|
|
17
|
+
}
|
|
18
|
+
/** Scenario pairs sorted by capability and then name. */
|
|
19
|
+
function sortScenarios(scenarios) {
|
|
20
|
+
return [...scenarios].sort((a, b) => a.capability.localeCompare(b.capability) || a.name.localeCompare(b.name));
|
|
21
|
+
}
|
|
22
|
+
/** One TAP failure line, at any indentation. */
|
|
23
|
+
const NOT_OK_LINE = /^\s*not ok \d+ - (.*)$/;
|
|
24
|
+
/** A trailing TAP directive, such as ` # TODO`. */
|
|
25
|
+
const DIRECTIVE = / # .*$/;
|
|
26
|
+
/** The title prefix every scenario test carries. */
|
|
27
|
+
const SCENARIO_PREFIX = 'Scenario: ';
|
|
28
|
+
/** The title with a trailing directive removed and TAP escaping undone. */
|
|
29
|
+
function scenarioTitle(raw) {
|
|
30
|
+
const directive = DIRECTIVE.exec(raw);
|
|
31
|
+
const stripped = directive === null ? raw : raw.slice(0, directive.index);
|
|
32
|
+
return stripped.replace(/\\([#\\])/g, '$1');
|
|
33
|
+
}
|
|
34
|
+
/** True when the output fails a test titled `Scenario: <name>` for `names`. */
|
|
35
|
+
function hasFailedScenario(output, names) {
|
|
36
|
+
for (const line of output.split('\n')) {
|
|
37
|
+
const raw = NOT_OK_LINE.exec(line)?.[1];
|
|
38
|
+
if (raw === undefined)
|
|
39
|
+
continue;
|
|
40
|
+
const title = scenarioTitle(raw);
|
|
41
|
+
if (!title.startsWith(SCENARIO_PREFIX))
|
|
42
|
+
continue;
|
|
43
|
+
if (names.has(title.slice(SCENARIO_PREFIX.length)))
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Collect the task's focused scenarios and files. The scenarios are the
|
|
50
|
+
* opted-in capability and name pairs named by `scenario(...)` calls in scenario
|
|
51
|
+
* test files inside the resolved scope, and the files are every scenario test
|
|
52
|
+
* file in the repository naming one of them. With the focused command unset, no
|
|
53
|
+
* capability opted in, or no collected scenario, the collection is empty.
|
|
54
|
+
*/
|
|
55
|
+
export async function collectFocusedTests(projectRoot, config, scope) {
|
|
56
|
+
const traceability = config.traceability ?? DEFAULT_TRACEABILITY_CONFIG;
|
|
57
|
+
if (traceability.focusedTests === undefined)
|
|
58
|
+
return EMPTY_COLLECTION;
|
|
59
|
+
const resolved = await resolveScope(projectRoot, scope);
|
|
60
|
+
const scoped = new Set(resolved.map((entry) => entry.relativePath));
|
|
61
|
+
const graph = await buildImportGraph(projectRoot, { skip: [config.paths.openspecRoot] });
|
|
62
|
+
const index = buildScenarioIndex(projectRoot, graph);
|
|
63
|
+
const collected = new Map();
|
|
64
|
+
for (const file of index.scenarioTestFiles) {
|
|
65
|
+
if (!scoped.has(file))
|
|
66
|
+
continue;
|
|
67
|
+
for (const scenario of index.scenariosInFile(file)) {
|
|
68
|
+
if (!isOptedIn(traceability, scenario.capability))
|
|
69
|
+
continue;
|
|
70
|
+
collected.set(`${scenario.capability}\u0000${scenario.name}`, scenario);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (collected.size === 0)
|
|
74
|
+
return EMPTY_COLLECTION;
|
|
75
|
+
const files = new Set();
|
|
76
|
+
for (const scenario of collected.values()) {
|
|
77
|
+
for (const file of index.testsNaming(scenario.capability, scenario.name)) {
|
|
78
|
+
files.add(file);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { scenarios: sortScenarios(collected.values()), files: [...files].sort() };
|
|
82
|
+
}
|
|
83
|
+
/** Classify a run as `failed`, `problem`, or `passed`, in that precedence. */
|
|
84
|
+
function classify(result, names) {
|
|
85
|
+
if (hasFailedScenario(result.output, names))
|
|
86
|
+
return 'failed';
|
|
87
|
+
if (result.exitCode !== 0 || result.timedOut || result.error !== undefined)
|
|
88
|
+
return 'problem';
|
|
89
|
+
return 'passed';
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Run the focused command with `{files}` replaced by the collected files, each
|
|
93
|
+
* single-quoted for the shell. It runs through `runVerificationCommand` with
|
|
94
|
+
* the task's change folder and the verify timeout, so it inherits the verify
|
|
95
|
+
* environment, `OSQ_CHANGE` included. Returns null when there is nothing to run.
|
|
96
|
+
*/
|
|
97
|
+
export async function runFocusedTests(collection, projectRoot, changeFolder, config) {
|
|
98
|
+
const command = config.traceability?.focusedTests;
|
|
99
|
+
if (command === undefined || collection.files.length === 0)
|
|
100
|
+
return null;
|
|
101
|
+
const files = [...collection.files];
|
|
102
|
+
const resolvedCommand = command.replace(/\{files\}/g, files.map((file) => `'${file}'`).join(' '));
|
|
103
|
+
const result = await runVerificationCommand(projectRoot, resolvedCommand, config.timeouts.verifyTimeoutSeconds, changeFolder);
|
|
104
|
+
const names = new Set(collection.scenarios.map((scenario) => scenario.name));
|
|
105
|
+
return {
|
|
106
|
+
command: resolvedCommand,
|
|
107
|
+
files,
|
|
108
|
+
scenarios: collection.scenarios.map((scenario) => `${scenario.capability}: ${scenario.name}`),
|
|
109
|
+
outcome: classify(result, names),
|
|
110
|
+
exitCode: result.exitCode,
|
|
111
|
+
duration: result.duration,
|
|
112
|
+
timedOut: result.timedOut,
|
|
113
|
+
output: result.output,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=focused-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focused-tests.js","sourceRoot":"","sources":["../../../src/core/run/focused-tests.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,2BAA2B,GAE5B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAuB3D,MAAM,gBAAgB,GAAsB,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAEzE,uEAAuE;AACvE,SAAS,SAAS,CAAC,YAAgC,EAAE,UAAkB;IACrE,OAAO,YAAY,CAAC,YAAY,KAAK,KAAK,IAAI,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC/F,CAAC;AAED,yDAAyD;AACzD,SAAS,aAAa,CAAC,SAAmC;IACxD,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CACxB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,a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AW,EACX,eAAe,EACf,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EACpC,YAAY,CACb,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7E,OAAO;QACL,OAAO,EAAE,eAAe;QACxB,KAAK;QACL,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC7F,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;QAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trusted manifest approval time: the manifest's `approvedAt` counts only when
|
|
3
|
+
* the change folder holds `.run/approved` and the value parses as a date.
|
|
4
|
+
* Records are never rewritten; readers stop trusting an unmarked time.
|
|
5
|
+
*/
|
|
6
|
+
export declare function readManifestApprovedAt(changeFolder: string): Promise<string | null>;
|
|
7
|
+
//# sourceMappingURL=manifest-approval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-approval.d.ts","sourceRoot":"","sources":["../../../src/core/run/manifest-approval.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqBzF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { getApprovedMarkerPath } from '../status/layout.js';
|
|
4
|
+
/**
|
|
5
|
+
* Trusted manifest approval time: the manifest's `approvedAt` counts only when
|
|
6
|
+
* the change folder holds `.run/approved` and the value parses as a date.
|
|
7
|
+
* Records are never rewritten; readers stop trusting an unmarked time.
|
|
8
|
+
*/
|
|
9
|
+
export async function readManifestApprovedAt(changeFolder) {
|
|
10
|
+
const marked = await fs.access(getApprovedMarkerPath(changeFolder)).then(() => true, () => false);
|
|
11
|
+
if (!marked)
|
|
12
|
+
return null;
|
|
13
|
+
const raw = await fs
|
|
14
|
+
.readFile(path.join(changeFolder, '.run', 'manifest.json'), 'utf8')
|
|
15
|
+
.catch(() => null);
|
|
16
|
+
if (raw === null)
|
|
17
|
+
return null;
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = JSON.parse(raw);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const value = parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
26
|
+
? parsed.approvedAt
|
|
27
|
+
: null;
|
|
28
|
+
return typeof value === 'string' && Number.isFinite(Date.parse(value)) ? value : null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=manifest-approval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-approval.js","sourceRoot":"","sources":["../../../src/core/run/manifest-approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,YAAoB;IAC/D,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CACtE,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;IACF,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,GAAG,GAAG,MAAM,EAAE;SACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,CAAC;SAClE,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GACT,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAC5D,CAAC,CAAE,MAAmC,CAAC,UAAU;QACjD,CAAC,CAAC,IAAI,CAAC;IACX,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC"}
|
|
@@ -13,7 +13,10 @@ export interface ManifestData {
|
|
|
13
13
|
planner: string | null;
|
|
14
14
|
effort: string | null;
|
|
15
15
|
createdAt: string;
|
|
16
|
-
|
|
16
|
+
/** Set only when `createdAt` is the change folder's creation time. */
|
|
17
|
+
createdAtSource?: 'created';
|
|
18
|
+
/** Only the approval path records it; a planning-only manifest omits it. */
|
|
19
|
+
approvedAt?: string;
|
|
17
20
|
/** Count of valid `plan_started` records present at manifest build time. */
|
|
18
21
|
planningSessions: number;
|
|
19
22
|
/**
|
|
@@ -22,7 +25,14 @@ export interface ManifestData {
|
|
|
22
25
|
* report can tell an approval apart from a queued plan.
|
|
23
26
|
*/
|
|
24
27
|
approvalFlags?: ApprovalFlagsData;
|
|
28
|
+
/**
|
|
29
|
+
* Number of each accepted ADR governing the change to its content hash. Only
|
|
30
|
+
* the approval path records it; an approval with no governing ADR records an
|
|
31
|
+
* empty object and a planning-only manifest omits the field.
|
|
32
|
+
*/
|
|
33
|
+
decisions?: Record<string, string>;
|
|
25
34
|
}
|
|
35
|
+
export declare function hashFileContent(filePath: string): Promise<string | null>;
|
|
26
36
|
/** First existing `osq.config.{ts,js,mjs}` under `projectRoot`, or `null`. */
|
|
27
37
|
export declare function resolveConfigPath(projectRoot: string): Promise<string | null>;
|
|
28
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/core/run/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/core/run/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAQzD,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC;CAC7B;AAED,oFAAoF;AACpF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ9E;AAED,8EAA8E;AAC9E,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYnF;AA2FD;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE;IAAE,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CAAA;CAAE,GACtE,OAAO,CAAC,YAAY,CAAC,CAuDvB;AAED,8DAA8D;AAC9D,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzF"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { governingAdrs, readDecisions } from '../foundation/decisions.js';
|
|
4
5
|
import { resolveExecutorIdentity } from '../foundation/harness-catalog.js';
|
|
5
6
|
import { PACKAGE_ROOT } from '../foundation/package-root.js';
|
|
6
7
|
import { planningRecordSource, readPlanRecords } from '../report/planning.js';
|
|
7
|
-
import { parseSpecMdFromFolder
|
|
8
|
+
import { parseSpecMdFromFolder } from '../spec/parser.js';
|
|
8
9
|
import { getSpecsDir } from '../status/layout.js';
|
|
9
|
-
async function hashFileContent(filePath) {
|
|
10
|
+
export async function hashFileContent(filePath) {
|
|
10
11
|
try {
|
|
11
12
|
const content = await fs.readFile(filePath, 'utf8');
|
|
12
13
|
const digest = crypto.createHash('sha256').update(content, 'utf8').digest('hex');
|
|
@@ -48,14 +49,44 @@ async function resolveOsqVersion() {
|
|
|
48
49
|
const version = await readPackageVersion(path.join(PACKAGE_ROOT, 'package.json'));
|
|
49
50
|
return version ?? 'unknown';
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
function validIso(value) {
|
|
53
|
+
if (typeof value !== 'string')
|
|
54
|
+
return null;
|
|
55
|
+
return Number.isFinite(Date.parse(value)) ? value : null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The manifest's creation time, in order: an existing manifest's valid
|
|
59
|
+
* `createdAt` (kept together with its `createdAtSource` when present), the
|
|
60
|
+
* change folder's valid birth time, then the current time. The creation marker
|
|
61
|
+
* is added only for a genuine creation time, and for the current-time fallback
|
|
62
|
+
* only when `osq plan` (no approval flags) writes the manifest.
|
|
63
|
+
*/
|
|
64
|
+
async function resolveCreation(specFolderPath, hasApproval) {
|
|
65
|
+
try {
|
|
66
|
+
const raw = await fs.readFile(path.join(specFolderPath, '.run', 'manifest.json'), 'utf8');
|
|
67
|
+
const existing = JSON.parse(raw);
|
|
68
|
+
const createdAt = validIso(existing.createdAt);
|
|
69
|
+
if (createdAt !== null) {
|
|
70
|
+
return existing.createdAtSource === 'created'
|
|
71
|
+
? { createdAt, createdAtSource: 'created' }
|
|
72
|
+
: { createdAt };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Missing or malformed manifest.
|
|
56
77
|
}
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
try {
|
|
79
|
+
const stat = await fs.stat(specFolderPath);
|
|
80
|
+
const birth = stat.birthtime;
|
|
81
|
+
if (birth && Number.isFinite(birth.getTime()) && birth.getTime() > 0) {
|
|
82
|
+
return { createdAt: birth.toISOString(), createdAtSource: 'created' };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// Unreadable folder.
|
|
87
|
+
}
|
|
88
|
+
const now = new Date().toISOString();
|
|
89
|
+
return hasApproval ? { createdAt: now } : { createdAt: now, createdAtSource: 'created' };
|
|
59
90
|
}
|
|
60
91
|
/**
|
|
61
92
|
* Manifest planner attribution: the model from the most recent observed session
|
|
@@ -110,6 +141,7 @@ export async function buildManifest(projectRoot, specFolderPath, config, approva
|
|
|
110
141
|
const identity = resolveExecutorIdentity(config);
|
|
111
142
|
const planRecords = await readPlanRecords(specFolderPath);
|
|
112
143
|
const planningSessions = planRecords.filter((record) => record.type === 'plan_started').length;
|
|
144
|
+
const creation = await resolveCreation(specFolderPath, approvalFlags !== undefined);
|
|
113
145
|
const manifest = {
|
|
114
146
|
hashes,
|
|
115
147
|
osqVersion: await resolveOsqVersion(),
|
|
@@ -117,15 +149,24 @@ export async function buildManifest(projectRoot, specFolderPath, config, approva
|
|
|
117
149
|
model: identity.model,
|
|
118
150
|
planner: resolvePlanningAttribution(planRecords),
|
|
119
151
|
effort: identity.effort,
|
|
120
|
-
createdAt:
|
|
121
|
-
approvedAt: new Date().toISOString(),
|
|
152
|
+
createdAt: creation.createdAt,
|
|
122
153
|
planningSessions,
|
|
123
154
|
};
|
|
155
|
+
if (creation.createdAtSource) {
|
|
156
|
+
manifest.createdAtSource = creation.createdAtSource;
|
|
157
|
+
}
|
|
124
158
|
if (approvalFlags) {
|
|
159
|
+
manifest.approvedAt = new Date().toISOString();
|
|
125
160
|
manifest.approvalFlags = {
|
|
126
161
|
ids: [...new Set(approvalFlags.ids)].sort(),
|
|
127
162
|
mode: approvalFlags.mode,
|
|
128
163
|
};
|
|
164
|
+
const records = await readDecisions(projectRoot, config);
|
|
165
|
+
const decisions = {};
|
|
166
|
+
for (const adr of governingAdrs(records, writtenCapabilities)) {
|
|
167
|
+
decisions[adr.number] = adr.hash;
|
|
168
|
+
}
|
|
169
|
+
manifest.decisions = decisions;
|
|
129
170
|
}
|
|
130
171
|
return manifest;
|
|
131
172
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/core/run/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAmB,oBAAoB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/core/run/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAmB,oBAAoB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAqClD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAA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C,IAAI;SACzB,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACzD,MAAM,SAAS,GAA2B,EAAE,CAAC;QAC7C,KAAK,MAAM,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAC9D,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;QACnC,CAAC;QACD,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;IACjC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,QAAsB;IACxE,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation report reading: turn one run's untrusted JSON report into the
|
|
3
|
+
* killed, survived, and invalid counts plus the survivors of the pick's file
|
|
4
|
+
* and ranges. Nothing is trusted; every field is checked before use.
|
|
5
|
+
*/
|
|
6
|
+
/** One mutant that survived a pick's mutation run. */
|
|
7
|
+
export interface MutationSurvivor {
|
|
8
|
+
readonly file: string;
|
|
9
|
+
readonly line: number;
|
|
10
|
+
readonly column: number;
|
|
11
|
+
readonly mutator: string;
|
|
12
|
+
readonly replacement: string;
|
|
13
|
+
}
|
|
14
|
+
/** Counts and survivors read from one report. */
|
|
15
|
+
export interface MutationCounts {
|
|
16
|
+
readonly killed: number;
|
|
17
|
+
readonly survived: number;
|
|
18
|
+
readonly invalid: number;
|
|
19
|
+
readonly survivors: readonly MutationSurvivor[];
|
|
20
|
+
}
|
|
21
|
+
/** The longest replacement a survivor keeps. */
|
|
22
|
+
export declare const MUTATION_REPLACEMENT_LIMIT = 200;
|
|
23
|
+
/**
|
|
24
|
+
* Read `files[<file>].mutants[]` from the report at `reportPath`. Returns null
|
|
25
|
+
* when the report is missing, isn't JSON, or has no `files` object; otherwise
|
|
26
|
+
* counts only the mutants whose start line falls in one of `ranges`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function readMutationReport(reportPath: string, file: string, ranges: readonly string[]): MutationCounts | null;
|
|
29
|
+
//# sourceMappingURL=mutation-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-report.d.ts","sourceRoot":"","sources":["../../../src/core/run/mutation-report.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACjD;AAED,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAsF9C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,cAAc,GAAG,IAAI,CAgBvB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation report reading: turn one run's untrusted JSON report into the
|
|
3
|
+
* killed, survived, and invalid counts plus the survivors of the pick's file
|
|
4
|
+
* and ranges. Nothing is trusted; every field is checked before use.
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
/** The longest replacement a survivor keeps. */
|
|
8
|
+
export const MUTATION_REPLACEMENT_LIMIT = 200;
|
|
9
|
+
const KILLED = new Set(['Killed', 'Timeout']);
|
|
10
|
+
const SURVIVED = new Set(['Survived', 'NoCoverage']);
|
|
11
|
+
/** Inclusive line intervals parsed from `<file>:<start>-<end>` ranges. */
|
|
12
|
+
function intervals(file, ranges) {
|
|
13
|
+
const prefix = `${file}:`;
|
|
14
|
+
const parsed = [];
|
|
15
|
+
for (const range of ranges) {
|
|
16
|
+
if (!range.startsWith(prefix))
|
|
17
|
+
continue;
|
|
18
|
+
const [start, end] = range.slice(prefix.length).split('-');
|
|
19
|
+
const first = Number(start);
|
|
20
|
+
const last = Number(end);
|
|
21
|
+
if (Number.isFinite(first) && Number.isFinite(last))
|
|
22
|
+
parsed.push([first, last]);
|
|
23
|
+
}
|
|
24
|
+
return parsed;
|
|
25
|
+
}
|
|
26
|
+
/** True when `line` falls in one of the intervals. */
|
|
27
|
+
function inRanges(line, parsed) {
|
|
28
|
+
return parsed.some(([start, end]) => line >= start && line <= end);
|
|
29
|
+
}
|
|
30
|
+
/** A non-null, non-array object, or null. */
|
|
31
|
+
function asRecord(value) {
|
|
32
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
33
|
+
? value
|
|
34
|
+
: null;
|
|
35
|
+
}
|
|
36
|
+
/** One mutant's extracted fields, or null when a field is missing or mistyped. */
|
|
37
|
+
function mutantFields(mutant) {
|
|
38
|
+
const record = asRecord(mutant);
|
|
39
|
+
if (record === null)
|
|
40
|
+
return null;
|
|
41
|
+
const start = asRecord(asRecord(record.location)?.start);
|
|
42
|
+
const line = start?.line;
|
|
43
|
+
const column = start?.column;
|
|
44
|
+
const status = record.status;
|
|
45
|
+
const mutator = record.mutatorName;
|
|
46
|
+
const replacement = record.replacement;
|
|
47
|
+
if (typeof line !== 'number' ||
|
|
48
|
+
typeof column !== 'number' ||
|
|
49
|
+
typeof status !== 'string' ||
|
|
50
|
+
typeof mutator !== 'string' ||
|
|
51
|
+
typeof replacement !== 'string') {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return { line, column, status, mutator, replacement };
|
|
55
|
+
}
|
|
56
|
+
/** Fold one mutant into the counts, according to "Mutation report reading". */
|
|
57
|
+
function countMutant(mutant, file, parsed, counts) {
|
|
58
|
+
const fields = mutantFields(mutant);
|
|
59
|
+
if (fields === null) {
|
|
60
|
+
counts.invalid += 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!inRanges(fields.line, parsed))
|
|
64
|
+
return;
|
|
65
|
+
if (KILLED.has(fields.status)) {
|
|
66
|
+
counts.killed += 1;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (SURVIVED.has(fields.status)) {
|
|
70
|
+
counts.survived += 1;
|
|
71
|
+
counts.survivors.push({
|
|
72
|
+
file,
|
|
73
|
+
line: fields.line,
|
|
74
|
+
column: fields.column,
|
|
75
|
+
mutator: fields.mutator,
|
|
76
|
+
replacement: fields.replacement.slice(0, MUTATION_REPLACEMENT_LIMIT),
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
counts.invalid += 1;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Read `files[<file>].mutants[]` from the report at `reportPath`. Returns null
|
|
84
|
+
* when the report is missing, isn't JSON, or has no `files` object; otherwise
|
|
85
|
+
* counts only the mutants whose start line falls in one of `ranges`.
|
|
86
|
+
*/
|
|
87
|
+
export function readMutationReport(reportPath, file, ranges) {
|
|
88
|
+
let parsed;
|
|
89
|
+
try {
|
|
90
|
+
parsed = JSON.parse(readFileSync(reportPath, 'utf8'));
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const files = asRecord(asRecord(parsed)?.files);
|
|
96
|
+
if (files === null)
|
|
97
|
+
return null;
|
|
98
|
+
const mutants = asRecord(files[file])?.mutants;
|
|
99
|
+
const counts = { killed: 0, survived: 0, invalid: 0, survivors: [] };
|
|
100
|
+
const parsedRanges = intervals(file, ranges);
|
|
101
|
+
if (Array.isArray(mutants)) {
|
|
102
|
+
for (const mutant of mutants)
|
|
103
|
+
countMutant(mutant, file, parsedRanges, counts);
|
|
104
|
+
}
|
|
105
|
+
return counts;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=mutation-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-report.js","sourceRoot":"","sources":["../../../src/core/run/mutation-report.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAmBvC,gDAAgD;AAChD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAE9C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;AAErD,0EAA0E;AAC1E,SAAS,SAAS,CAAC,IAAY,EAAE,MAAyB;IACxD,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC;IAC1B,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,SAAS;QACxC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,KA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