@matteeh/osq 0.2.0 → 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-capability.d.ts +17 -0
- package/dist/core/spec/digest-capability.d.ts.map +1 -0
- package/dist/core/spec/digest-capability.js +89 -0
- package/dist/core/spec/digest-capability.js.map +1 -0
- 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-flags.d.ts +1 -0
- package/dist/core/spec/digest-flags.d.ts.map +1 -1
- package/dist/core/spec/digest-flags.js +16 -16
- package/dist/core/spec/digest-flags.js.map +1 -1
- 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 +6 -3
- package/dist/core/spec/digest.d.ts.map +1 -1
- package/dist/core/spec/digest.js +18 -32
- 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 +114 -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/build-project.d.ts +11 -0
- package/dist/watcher/build-project.d.ts.map +1 -0
- package/dist/watcher/build-project.js +36 -0
- package/dist/watcher/build-project.js.map +1 -0
- package/dist/watcher/build.d.ts +8 -5
- package/dist/watcher/build.d.ts.map +1 -1
- package/dist/watcher/build.js +35 -39
- package/dist/watcher/build.js.map +1 -1
- 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/fingerprint.d.ts +2 -2
- package/dist/watcher/fingerprint.d.ts.map +1 -1
- package/dist/watcher/fingerprint.js +31 -2
- package/dist/watcher/fingerprint.js.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 +37 -51
- 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/outcome.d.ts +2 -0
- package/dist/watcher/outcome.d.ts.map +1 -1
- package/dist/watcher/outcome.js +5 -1
- package/dist/watcher/outcome.js.map +1 -1
- package/dist/watcher/regression.d.ts +10 -5
- package/dist/watcher/regression.d.ts.map +1 -1
- package/dist/watcher/regression.js +29 -19
- 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 +11 -1
- 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,111 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { parseSpecMdFromFolder } from '../spec/parser.js';
|
|
4
|
+
import { compareNumericPrefix } from './state.js';
|
|
5
|
+
const EMPTY = {
|
|
6
|
+
required: false,
|
|
7
|
+
afterLanding: false,
|
|
8
|
+
check: null,
|
|
9
|
+
outcome: null,
|
|
10
|
+
checkRanSinceArchive: false,
|
|
11
|
+
};
|
|
12
|
+
function asRecord(value) {
|
|
13
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
14
|
+
? value
|
|
15
|
+
: null;
|
|
16
|
+
}
|
|
17
|
+
/** Parse append-only jsonl, skipping blank and malformed lines. */
|
|
18
|
+
function parseEventLines(content) {
|
|
19
|
+
const events = [];
|
|
20
|
+
for (const line of content.split('\n')) {
|
|
21
|
+
const trimmed = line.trim();
|
|
22
|
+
if (!trimmed)
|
|
23
|
+
continue;
|
|
24
|
+
try {
|
|
25
|
+
const parsed = JSON.parse(trimmed);
|
|
26
|
+
if (parsed !== null && typeof parsed === 'object')
|
|
27
|
+
events.push(parsed);
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
30
|
+
}
|
|
31
|
+
return events;
|
|
32
|
+
}
|
|
33
|
+
function readRequirement(value) {
|
|
34
|
+
const record = asRecord(value);
|
|
35
|
+
if (!record || typeof record.afterLanding !== 'boolean')
|
|
36
|
+
return null;
|
|
37
|
+
const check = record.check;
|
|
38
|
+
if (check !== null && typeof check !== 'string')
|
|
39
|
+
return null;
|
|
40
|
+
return { afterLanding: record.afterLanding, check: check ?? null };
|
|
41
|
+
}
|
|
42
|
+
async function readArchivedTitle(folderPath, fallback) {
|
|
43
|
+
const spec = await parseSpecMdFromFolder(folderPath).catch(() => null);
|
|
44
|
+
return spec?.title || fallback;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read an archived change's verification state from its change-level event
|
|
48
|
+
* stream. The latest `archived` event decides whether verification is required;
|
|
49
|
+
* the latest `verification_recorded` event supplies the outcome; a check counts
|
|
50
|
+
* only when it follows the archive event.
|
|
51
|
+
*/
|
|
52
|
+
export async function readVerification(folderPath) {
|
|
53
|
+
const content = await fs
|
|
54
|
+
.readFile(path.join(folderPath, '.run', 'events', 'change.jsonl'), 'utf8')
|
|
55
|
+
.catch(() => null);
|
|
56
|
+
if (content === null)
|
|
57
|
+
return EMPTY;
|
|
58
|
+
const events = parseEventLines(content);
|
|
59
|
+
let requirement = null;
|
|
60
|
+
let archivedIndex = -1;
|
|
61
|
+
let outcome = null;
|
|
62
|
+
for (let index = 0; index < events.length; index++) {
|
|
63
|
+
const event = events[index];
|
|
64
|
+
if (event.type === 'archived') {
|
|
65
|
+
requirement = readRequirement(asRecord(event.data)?.verification);
|
|
66
|
+
archivedIndex = index;
|
|
67
|
+
}
|
|
68
|
+
else if (event.type === 'verification_recorded') {
|
|
69
|
+
const value = asRecord(event.data)?.outcome;
|
|
70
|
+
if (value === 'passed' || value === 'failed')
|
|
71
|
+
outcome = value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
required: requirement !== null,
|
|
76
|
+
afterLanding: requirement?.afterLanding ?? false,
|
|
77
|
+
check: requirement?.check ?? null,
|
|
78
|
+
outcome,
|
|
79
|
+
checkRanSinceArchive: events.some((event, index) => index > archivedIndex && event.type === 'check_ran'),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** Every archived change that requires verification and is not passed. */
|
|
83
|
+
export async function listPendingVerifications(archiveDir) {
|
|
84
|
+
let entries = [];
|
|
85
|
+
try {
|
|
86
|
+
entries = await fs.readdir(archiveDir);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
const folders = [];
|
|
92
|
+
for (const entry of entries) {
|
|
93
|
+
if (entry.startsWith('.') || entry.startsWith('_'))
|
|
94
|
+
continue;
|
|
95
|
+
const stat = await fs.stat(path.join(archiveDir, entry)).catch(() => null);
|
|
96
|
+
if (stat?.isDirectory())
|
|
97
|
+
folders.push(entry);
|
|
98
|
+
}
|
|
99
|
+
folders.sort(compareNumericPrefix);
|
|
100
|
+
const pending = [];
|
|
101
|
+
for (const folderName of folders) {
|
|
102
|
+
const folderPath = path.join(archiveDir, folderName);
|
|
103
|
+
const verification = await readVerification(folderPath);
|
|
104
|
+
if (!verification.required || verification.outcome === 'passed')
|
|
105
|
+
continue;
|
|
106
|
+
const title = await readArchivedTitle(folderPath, folderName);
|
|
107
|
+
pending.push({ folderName, folderPath, title, verification });
|
|
108
|
+
}
|
|
109
|
+
return pending;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=verification.js.map
|
|
@@ -0,0 +1 @@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M,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC3E,IAAI,IAAI,EAAE,WAAW,EAAE;YAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAEnC,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACrD,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,YAAY,CAAC,OAAO,KAAK,QAAQ;YAAE,SAAS;QAC1E,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A top-level function declaration and its line range. */
|
|
2
|
+
export interface TopLevelFunction {
|
|
3
|
+
readonly file: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/** 1-based declaration line. */
|
|
6
|
+
readonly line: number;
|
|
7
|
+
/** 1-based last line of the range. */
|
|
8
|
+
readonly endLine: number;
|
|
9
|
+
readonly exported: boolean;
|
|
10
|
+
/** False when the range text's `(`, `[`, and `{` do not balance. */
|
|
11
|
+
readonly known: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Every top-level function in `text`, in declaration order. */
|
|
14
|
+
export declare function findTopLevelFunctions(file: string, text: string): TopLevelFunction[];
|
|
15
|
+
/**
|
|
16
|
+
* A covered function's mutation ranges: its own range plus the range of every
|
|
17
|
+
* non-exported top-level function in the same file it reaches through such
|
|
18
|
+
* functions. Sorted by start line and written `<file>:<start>-<end>`. Unknown
|
|
19
|
+
* when the function or any range is not known.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mutationRanges(file: string, text: string, name: string): string[] | null;
|
|
22
|
+
/** `sha256:` of a function's own range text, or null when it is absent or unknown. */
|
|
23
|
+
export declare function hashFunctionRange(file: string, text: string, name: string): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* The `functionHashes` baseline: for each exported function with a `@scenario`
|
|
26
|
+
* tag in a scoped JavaScript or TypeScript file, `<file>#<name>` to the hash of
|
|
27
|
+
* its own range, or null when that range is unknown.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readScopedFunctionHashes(projectRoot: string, scope: readonly string[]): Promise<Record<string, string | null>>;
|
|
30
|
+
//# sourceMappingURL=function-ranges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-ranges.d.ts","sourceRoot":"","sources":["../../../src/core/trace/function-ranges.ts"],"names":[],"mappings":"AAWA,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAwID,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAkBpF;AAUD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAoBxF;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzF;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAmBxC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function ranges for mutation checks: each top-level function's range, the
|
|
3
|
+
* ranges a covered function's mutants may touch, and a function's own hash.
|
|
4
|
+
* A line-based scan is used; no TypeScript parser is involved.
|
|
5
|
+
*/
|
|
6
|
+
import crypto from 'node:crypto';
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { resolveScope } from '../run/scope.js';
|
|
10
|
+
import { scanSource } from './tag-scan.js';
|
|
11
|
+
const FUNCTION_DECL = /^(export\s+)?(?:async\s+)?function\s+([A-Za-z_$][\w$]*)/;
|
|
12
|
+
const CONST_DECL = /^(export\s+)?const\s+([A-Za-z_$][\w$]*)(?::(?:=>|[^=])*)?\s*=\s*(?:async\s*)?(?:function\b|(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;
|
|
13
|
+
const JS_TS = new Set(['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs']);
|
|
14
|
+
/** The declaration a column-0 line opens, or null. */
|
|
15
|
+
function declaration(line) {
|
|
16
|
+
const match = FUNCTION_DECL.exec(line) ?? CONST_DECL.exec(line);
|
|
17
|
+
return match === null ? null : { name: match[2] ?? '', exported: match[1] !== undefined };
|
|
18
|
+
}
|
|
19
|
+
function isRangeBoundary(line) {
|
|
20
|
+
if (line === '')
|
|
21
|
+
return false;
|
|
22
|
+
const first = line[0] ?? '';
|
|
23
|
+
if (first === ' ' || first === '\t' || first === '\r')
|
|
24
|
+
return false;
|
|
25
|
+
return first !== '}' && first !== ')' && first !== ']' && first !== ';';
|
|
26
|
+
}
|
|
27
|
+
function lastNonBlank(lines, start, end) {
|
|
28
|
+
for (let index = end; index >= start; index -= 1) {
|
|
29
|
+
if ((lines[index] ?? '').trim() !== '')
|
|
30
|
+
return index;
|
|
31
|
+
}
|
|
32
|
+
return start;
|
|
33
|
+
}
|
|
34
|
+
function endLineFor(lines, start) {
|
|
35
|
+
for (let index = start + 1; index < lines.length; index += 1) {
|
|
36
|
+
if (isRangeBoundary(lines[index] ?? ''))
|
|
37
|
+
return lastNonBlank(lines, start, index - 1) + 1;
|
|
38
|
+
}
|
|
39
|
+
return lastNonBlank(lines, start, lines.length - 1) + 1;
|
|
40
|
+
}
|
|
41
|
+
function skipLine(text, at) {
|
|
42
|
+
const end = text.indexOf('\n', at);
|
|
43
|
+
return end === -1 ? text.length : end;
|
|
44
|
+
}
|
|
45
|
+
function skipBlock(text, at) {
|
|
46
|
+
const end = text.indexOf('*/', at + 2);
|
|
47
|
+
return end === -1 ? text.length : end + 2;
|
|
48
|
+
}
|
|
49
|
+
function skipQuoted(text, at, quote) {
|
|
50
|
+
let index = at + 1;
|
|
51
|
+
while (index < text.length && text[index] !== quote)
|
|
52
|
+
index += text[index] === '\\' ? 2 : 1;
|
|
53
|
+
return index < text.length ? index + 1 : text.length;
|
|
54
|
+
}
|
|
55
|
+
function skipTemplate(text, at) {
|
|
56
|
+
let index = at + 1;
|
|
57
|
+
while (index < text.length) {
|
|
58
|
+
const char = text[index];
|
|
59
|
+
if (char === '\\')
|
|
60
|
+
index += 2;
|
|
61
|
+
else if (char === '`')
|
|
62
|
+
return index + 1;
|
|
63
|
+
else if (char === '$' && text[index + 1] === '{')
|
|
64
|
+
index = skipInterpolation(text, index + 2);
|
|
65
|
+
else
|
|
66
|
+
index += 1;
|
|
67
|
+
}
|
|
68
|
+
return text.length;
|
|
69
|
+
}
|
|
70
|
+
function skipInterpolation(text, at) {
|
|
71
|
+
let depth = 1;
|
|
72
|
+
let index = at;
|
|
73
|
+
while (index < text.length) {
|
|
74
|
+
const char = text[index];
|
|
75
|
+
if (char === '\\')
|
|
76
|
+
index += 2;
|
|
77
|
+
else if (char === '`')
|
|
78
|
+
index = skipTemplate(text, index);
|
|
79
|
+
else if (char === "'" || char === '"')
|
|
80
|
+
index = skipQuoted(text, index, char);
|
|
81
|
+
else if (char === '/' && text[index + 1] === '/')
|
|
82
|
+
index = skipLine(text, index);
|
|
83
|
+
else if (char === '/' && text[index + 1] === '*')
|
|
84
|
+
index = skipBlock(text, index);
|
|
85
|
+
else if (char === '{') {
|
|
86
|
+
depth += 1;
|
|
87
|
+
index += 1;
|
|
88
|
+
}
|
|
89
|
+
else if (char === '}') {
|
|
90
|
+
depth -= 1;
|
|
91
|
+
if (depth === 0)
|
|
92
|
+
return index + 1;
|
|
93
|
+
index += 1;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
index += 1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return text.length;
|
|
100
|
+
}
|
|
101
|
+
const isIdent = (char) => char !== undefined && /[\w$]/.test(char);
|
|
102
|
+
/** Balance delimiters and collect `name(` calls in one pass, skipping literals and comments. */
|
|
103
|
+
function scanCode(text, candidates) {
|
|
104
|
+
let paren = 0;
|
|
105
|
+
let bracket = 0;
|
|
106
|
+
let brace = 0;
|
|
107
|
+
const called = new Set();
|
|
108
|
+
let index = 0;
|
|
109
|
+
while (index < text.length) {
|
|
110
|
+
const char = text[index];
|
|
111
|
+
if (char === '/' && text[index + 1] === '/') {
|
|
112
|
+
index = skipLine(text, index);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (char === '/' && text[index + 1] === '*') {
|
|
116
|
+
index = skipBlock(text, index);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (char === "'" || char === '"') {
|
|
120
|
+
index = skipQuoted(text, index, char);
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (char === '`') {
|
|
124
|
+
index = skipTemplate(text, index);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (!isIdent(text[index - 1])) {
|
|
128
|
+
for (const name of candidates) {
|
|
129
|
+
if (!text.startsWith(name, index) || isIdent(text[index + name.length]))
|
|
130
|
+
continue;
|
|
131
|
+
let after = index + name.length;
|
|
132
|
+
while (text[after] === ' ' || text[after] === '\t')
|
|
133
|
+
after += 1;
|
|
134
|
+
// A second `(` directly after the call's `(` is a parenthesized first
|
|
135
|
+
// argument; the traceability scenarios count only simple calls.
|
|
136
|
+
if (text[after] !== '(' || text[after + 1] === '(')
|
|
137
|
+
continue;
|
|
138
|
+
called.add(name);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (char === '(')
|
|
143
|
+
paren += 1;
|
|
144
|
+
else if (char === ')')
|
|
145
|
+
paren -= 1;
|
|
146
|
+
else if (char === '[')
|
|
147
|
+
bracket += 1;
|
|
148
|
+
else if (char === ']')
|
|
149
|
+
bracket -= 1;
|
|
150
|
+
else if (char === '{')
|
|
151
|
+
brace += 1;
|
|
152
|
+
else if (char === '}')
|
|
153
|
+
brace -= 1;
|
|
154
|
+
if (paren < 0 || bracket < 0 || brace < 0)
|
|
155
|
+
return { balanced: false, called };
|
|
156
|
+
index += 1;
|
|
157
|
+
}
|
|
158
|
+
return { balanced: paren === 0 && bracket === 0 && brace === 0, called };
|
|
159
|
+
}
|
|
160
|
+
/** Every top-level function in `text`, in declaration order. */
|
|
161
|
+
export function findTopLevelFunctions(file, text) {
|
|
162
|
+
const lines = text.split('\n');
|
|
163
|
+
const functions = [];
|
|
164
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
165
|
+
const decl = declaration(lines[index] ?? '');
|
|
166
|
+
if (decl === null)
|
|
167
|
+
continue;
|
|
168
|
+
const endLine = endLineFor(lines, index);
|
|
169
|
+
const body = lines.slice(index, endLine).join('\n');
|
|
170
|
+
functions.push({
|
|
171
|
+
file,
|
|
172
|
+
name: decl.name,
|
|
173
|
+
line: index + 1,
|
|
174
|
+
endLine,
|
|
175
|
+
exported: decl.exported,
|
|
176
|
+
known: scanCode(body, []).balanced,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return functions;
|
|
180
|
+
}
|
|
181
|
+
/** The exact range text of one function. */
|
|
182
|
+
function rangeText(text, fn) {
|
|
183
|
+
const lines = text.split('\n');
|
|
184
|
+
return lines.slice(fn.line - 1, fn.endLine).join('\n');
|
|
185
|
+
}
|
|
186
|
+
function hashText(text) {
|
|
187
|
+
return `sha256:${crypto.createHash('sha256').update(text, 'utf8').digest('hex')}`;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A covered function's mutation ranges: its own range plus the range of every
|
|
191
|
+
* non-exported top-level function in the same file it reaches through such
|
|
192
|
+
* functions. Sorted by start line and written `<file>:<start>-<end>`. Unknown
|
|
193
|
+
* when the function or any range is not known.
|
|
194
|
+
*/
|
|
195
|
+
export function mutationRanges(file, text, name) {
|
|
196
|
+
const functions = findTopLevelFunctions(file, text);
|
|
197
|
+
const target = functions.find((fn) => fn.name === name);
|
|
198
|
+
if (target === undefined)
|
|
199
|
+
return null;
|
|
200
|
+
const byName = new Map(functions.filter((fn) => !fn.exported).map((fn) => [fn.name, fn]));
|
|
201
|
+
const candidates = [...byName.keys()];
|
|
202
|
+
const selected = new Map([[target.line, target]]);
|
|
203
|
+
const queue = [target];
|
|
204
|
+
while (queue.length > 0) {
|
|
205
|
+
const current = queue.shift();
|
|
206
|
+
for (const callee of scanCode(rangeText(text, current), candidates).called) {
|
|
207
|
+
const fn = byName.get(callee);
|
|
208
|
+
if (fn === undefined || selected.has(fn.line))
|
|
209
|
+
continue;
|
|
210
|
+
selected.set(fn.line, fn);
|
|
211
|
+
queue.push(fn);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const ranges = [...selected.values()].sort((a, b) => a.line - b.line);
|
|
215
|
+
if (ranges.some((fn) => !fn.known))
|
|
216
|
+
return null;
|
|
217
|
+
return ranges.map((fn) => `${file}:${fn.line}-${fn.endLine}`);
|
|
218
|
+
}
|
|
219
|
+
/** `sha256:` of a function's own range text, or null when it is absent or unknown. */
|
|
220
|
+
export function hashFunctionRange(file, text, name) {
|
|
221
|
+
const fn = findTopLevelFunctions(file, text).find((entry) => entry.name === name);
|
|
222
|
+
return fn === undefined || !fn.known ? null : hashText(rangeText(text, fn));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The `functionHashes` baseline: for each exported function with a `@scenario`
|
|
226
|
+
* tag in a scoped JavaScript or TypeScript file, `<file>#<name>` to the hash of
|
|
227
|
+
* its own range, or null when that range is unknown.
|
|
228
|
+
*/
|
|
229
|
+
export async function readScopedFunctionHashes(projectRoot, scope) {
|
|
230
|
+
const hashes = {};
|
|
231
|
+
for (const entry of await resolveScope(projectRoot, scope)) {
|
|
232
|
+
if (entry.absolutePath === null || !JS_TS.has(path.extname(entry.relativePath)))
|
|
233
|
+
continue;
|
|
234
|
+
const text = await fs.readFile(entry.absolutePath, 'utf8').catch(() => null);
|
|
235
|
+
if (text === null)
|
|
236
|
+
continue;
|
|
237
|
+
const tagged = scanSource(entry.relativePath, text).functions.filter((fn) => fn.scenarios.length > 0);
|
|
238
|
+
if (tagged.length === 0)
|
|
239
|
+
continue;
|
|
240
|
+
const ranges = findTopLevelFunctions(entry.relativePath, text);
|
|
241
|
+
for (const fn of tagged) {
|
|
242
|
+
const match = ranges.find((range) => range.name === fn.name);
|
|
243
|
+
hashes[`${entry.relativePath}#${fn.name}`] = match?.known
|
|
244
|
+
? hashText(rangeText(text, match))
|
|
245
|
+
: null;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return hashes;
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=function-ranges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-ranges.js","sourceRoot":"","sources":["../../../src/core/trace/function-ranges.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAe3C,MAAM,aAAa,GAAG,yDAAyD,CAAC;AAChF,MAAM,UAAU,GACd,iIAAiI,CAAC;AACpI,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtF,sDAAsD;AACtD,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;AAC5F,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACnC,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,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YAAY,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAAE,SAAS;QAC1F,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC7E,IAAI,IAAI,KAAK,IAAI;YAAE,SAAS;QAC5B,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAClE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAChC,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAClC,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC/D,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK;gBACvD,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAClC,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation picks: the covered functions a passing task changed or newly tested.
|
|
3
|
+
* Built from the scenario index, the function ranges, and the task's latest
|
|
4
|
+
* start and end `measures` event data that the caller passes in. Nothing is
|
|
5
|
+
* persisted.
|
|
6
|
+
*/
|
|
7
|
+
import type { TraceabilityConfig } from '../foundation/config-traceability.js';
|
|
8
|
+
import type { ScenarioIndex } from './scenario-index.js';
|
|
9
|
+
/**
|
|
10
|
+
* The `measures` event fields a pick reads. It is structural so core needs no
|
|
11
|
+
* harness type import.
|
|
12
|
+
*/
|
|
13
|
+
export interface MeasuresView {
|
|
14
|
+
readonly functionHashes?: Record<string, string | null>;
|
|
15
|
+
readonly scopeHashes?: Record<string, {
|
|
16
|
+
before: string | null;
|
|
17
|
+
after: string | null;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/** One covered function picked for a mutation run. */
|
|
21
|
+
export interface MutationPick {
|
|
22
|
+
readonly file: string;
|
|
23
|
+
readonly function: string;
|
|
24
|
+
/** 1-based declaration line; picks order by file and then this line. */
|
|
25
|
+
readonly line: number;
|
|
26
|
+
/** The mutation ranges, or null when any is unknown. */
|
|
27
|
+
readonly ranges: readonly string[] | null;
|
|
28
|
+
/** The tagged opted-in scenarios as `<capability>: <name>`, sorted. */
|
|
29
|
+
readonly scenarios: readonly string[];
|
|
30
|
+
/** The sorted, distinct scenario test files naming those scenarios. */
|
|
31
|
+
readonly tests: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
/** Inputs for `pickMutations`. */
|
|
34
|
+
export interface MutationPickOptions {
|
|
35
|
+
readonly projectRoot: string;
|
|
36
|
+
readonly index: ScenarioIndex;
|
|
37
|
+
readonly traceability: TraceabilityConfig;
|
|
38
|
+
/** The task's raw scope entries; this resolves them exactly as the runner does. */
|
|
39
|
+
readonly scope: readonly string[];
|
|
40
|
+
/** The task's latest start `measures` data, or null. */
|
|
41
|
+
readonly start: MeasuresView | null;
|
|
42
|
+
/** The task's latest end `measures` data, or null. */
|
|
43
|
+
readonly end: MeasuresView | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Pick every covered function the task changed or newly tested. A covered
|
|
47
|
+
* function is an exported function with a `@scenario` tag naming an opted-in
|
|
48
|
+
* capability and at least one scenario test file naming that tagged scenario.
|
|
49
|
+
* It is picked when its scoped own range hash differs from the start event's
|
|
50
|
+
* `functionHashes` entry, a missing entry counting as different, or when a
|
|
51
|
+
* scenario test file the end event shows with a different before and after hash
|
|
52
|
+
* covers it. Picks order by file, then start line.
|
|
53
|
+
*/
|
|
54
|
+
export declare function pickMutations(options: MutationPickOptions): Promise<MutationPick[]>;
|
|
55
|
+
//# sourceMappingURL=mutation-pick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-pick.d.ts","sourceRoot":"","sources":["../../../src/core/trace/mutation-pick.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACxD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACxF;AAED,sDAAsD;AACtD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,sDAAsD;IACtD,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;CACnC;AAuED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CA0BzF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation picks: the covered functions a passing task changed or newly tested.
|
|
3
|
+
* Built from the scenario index, the function ranges, and the task's latest
|
|
4
|
+
* start and end `measures` event data that the caller passes in. Nothing is
|
|
5
|
+
* persisted.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { resolveScope } from '../run/scope.js';
|
|
10
|
+
import { hashFunctionRange, mutationRanges } from './function-ranges.js';
|
|
11
|
+
/** True when the configuration opts a capability into traceability. */
|
|
12
|
+
function isOptedIn(traceability, capability) {
|
|
13
|
+
return traceability.capabilities === 'all' || traceability.capabilities.includes(capability);
|
|
14
|
+
}
|
|
15
|
+
/** A function's `@scenario` tags whose capability is opted in, sorted. */
|
|
16
|
+
function optedScenarios(fn, traceability) {
|
|
17
|
+
return fn.scenarios
|
|
18
|
+
.filter((scenario) => isOptedIn(traceability, scenario.capability))
|
|
19
|
+
.sort((a, b) => a.capability.localeCompare(b.capability) || a.name.localeCompare(b.name));
|
|
20
|
+
}
|
|
21
|
+
/** The scenarios as `<capability>: <name>` strings. */
|
|
22
|
+
function scenarioLabels(scenarios) {
|
|
23
|
+
return scenarios.map((scenario) => `${scenario.capability}: ${scenario.name}`);
|
|
24
|
+
}
|
|
25
|
+
/** The sorted, distinct scenario test files naming any of `scenarios`. */
|
|
26
|
+
function pickTests(index, scenarios) {
|
|
27
|
+
const tests = new Set();
|
|
28
|
+
for (const scenario of scenarios) {
|
|
29
|
+
for (const file of index.testsNaming(scenario.capability, scenario.name))
|
|
30
|
+
tests.add(file);
|
|
31
|
+
}
|
|
32
|
+
return [...tests].sort();
|
|
33
|
+
}
|
|
34
|
+
/** True when a scoped function's own range hash differs from the stored baseline. */
|
|
35
|
+
function rangeChanged(file, name, text, start, scoped) {
|
|
36
|
+
if (!scoped)
|
|
37
|
+
return false;
|
|
38
|
+
const stored = start?.functionHashes?.[`${file}#${name}`];
|
|
39
|
+
return stored === undefined || stored !== hashFunctionRange(file, text, name);
|
|
40
|
+
}
|
|
41
|
+
/** True when a test file naming a tagged scenario changed and covers the function. */
|
|
42
|
+
function testChanged(index, fn, tests, end) {
|
|
43
|
+
const hashes = end?.scopeHashes;
|
|
44
|
+
if (hashes === undefined)
|
|
45
|
+
return false;
|
|
46
|
+
return tests.some((test) => {
|
|
47
|
+
const entry = hashes[test];
|
|
48
|
+
return (entry !== undefined && entry.before !== entry.after && index.covers(test, fn.file, fn.name));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Read a source file once, caching the text across functions in the same file. */
|
|
52
|
+
async function sourceText(projectRoot, file, cache) {
|
|
53
|
+
const cached = cache.get(file);
|
|
54
|
+
if (cached !== undefined)
|
|
55
|
+
return cached;
|
|
56
|
+
const text = await fs.readFile(path.join(projectRoot, file), 'utf8').catch(() => '');
|
|
57
|
+
cache.set(file, text);
|
|
58
|
+
return text;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Pick every covered function the task changed or newly tested. A covered
|
|
62
|
+
* function is an exported function with a `@scenario` tag naming an opted-in
|
|
63
|
+
* capability and at least one scenario test file naming that tagged scenario.
|
|
64
|
+
* It is picked when its scoped own range hash differs from the start event's
|
|
65
|
+
* `functionHashes` entry, a missing entry counting as different, or when a
|
|
66
|
+
* scenario test file the end event shows with a different before and after hash
|
|
67
|
+
* covers it. Picks order by file, then start line.
|
|
68
|
+
*/
|
|
69
|
+
export async function pickMutations(options) {
|
|
70
|
+
const scoped = new Set((await resolveScope(options.projectRoot, options.scope)).map((entry) => entry.relativePath));
|
|
71
|
+
const cache = new Map();
|
|
72
|
+
const picks = [];
|
|
73
|
+
for (const fn of options.index.functions) {
|
|
74
|
+
const scenarios = optedScenarios(fn, options.traceability);
|
|
75
|
+
if (scenarios.length === 0)
|
|
76
|
+
continue;
|
|
77
|
+
const tests = pickTests(options.index, scenarios);
|
|
78
|
+
if (tests.length === 0)
|
|
79
|
+
continue;
|
|
80
|
+
const text = await sourceText(options.projectRoot, fn.file, cache);
|
|
81
|
+
const changed = rangeChanged(fn.file, fn.name, text, options.start, scoped.has(fn.file)) ||
|
|
82
|
+
testChanged(options.index, fn, tests, options.end);
|
|
83
|
+
if (!changed)
|
|
84
|
+
continue;
|
|
85
|
+
picks.push({
|
|
86
|
+
file: fn.file,
|
|
87
|
+
function: fn.name,
|
|
88
|
+
line: fn.line,
|
|
89
|
+
ranges: mutationRanges(fn.file, text, fn.name),
|
|
90
|
+
scenarios: scenarioLabels(scenarios),
|
|
91
|
+
tests,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return picks.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=mutation-pick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-pick.js","sourceRoot":"","sources":["../../../src/core/trace/mutation-pick.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,kBAAkB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AAK,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,QAAQ,EAAE,EAAE,CAAC,IAAI;YACjB,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,MAAM,EAAE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;YAC9C,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;YACpC,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scenario index: every scenario call, every exported function with its
|
|
3
|
+
* tags, and every unreadable form, built once from the import graph's files.
|
|
4
|
+
* Nothing is persisted.
|
|
5
|
+
*/
|
|
6
|
+
import type { ImportGraph } from '../spec/import-graph.js';
|
|
7
|
+
import { type ScannedFunction, type ScenarioCall, type TaggedScenario, type UnreadableForm } from './tag-scan.js';
|
|
8
|
+
/** The scanner's results across a project, with the lookups lint, report, and show need. */
|
|
9
|
+
export interface ScenarioIndex {
|
|
10
|
+
readonly files: readonly string[];
|
|
11
|
+
/** Files that import `@matteeh/osq/testing`. */
|
|
12
|
+
readonly scenarioTestFiles: readonly string[];
|
|
13
|
+
readonly functions: readonly ScannedFunction[];
|
|
14
|
+
readonly calls: readonly ScenarioCall[];
|
|
15
|
+
readonly unreadable: readonly UnreadableForm[];
|
|
16
|
+
/** Distinct test files whose calls name the scenario, sorted. */
|
|
17
|
+
testsNaming(capability: string, name: string): readonly string[];
|
|
18
|
+
/** Distinct scenario pairs named by a file's calls, sorted by capability and name. */
|
|
19
|
+
scenariosInFile(file: string): readonly TaggedScenario[];
|
|
20
|
+
/** Test files directly importing `functionFile` with a call covering `name`, sorted. */
|
|
21
|
+
coveringTests(functionFile: string, name: string): readonly string[];
|
|
22
|
+
/** True when `testFile` imports `functionFile` directly and a call covers `name`. */
|
|
23
|
+
covers(testFile: string, functionFile: string, name: string): boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Read each of `graph.files` once and index its tags, scenario calls, and unreadable forms. */
|
|
26
|
+
export declare function buildScenarioIndex(projectRoot: string, graph: ImportGraph): ScenarioIndex;
|
|
27
|
+
//# sourceMappingURL=scenario-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-index.d.ts","sourceRoot":"","sources":["../../../src/core/trace/scenario-index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAEvB,4FAA4F;AAC5F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,gDAAgD;IAChD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,iEAAiE;IACjE,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACjE,sFAAsF;IACtF,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,cAAc,EAAE,CAAC;IACzD,wFAAwF;IACxF,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACrE,qFAAqF;IACrF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACvE;AA6DD,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,aAAa,CAwBzF"}
|