@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,39 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { readCapabilityOwnership, undeclaredReadFindings, writeWithoutDeltaFindings, } from './capability-impact.js';
|
|
4
|
+
import { frozenTestFindings, verifyWithoutScopeFindings, } from './test-impact.js';
|
|
5
|
+
/** Capability names with a delta spec directory in the change folder. */
|
|
6
|
+
async function readDeltaCapabilities(folderPath) {
|
|
7
|
+
let entries;
|
|
8
|
+
try {
|
|
9
|
+
entries = await fs.readdir(path.join(folderPath, 'specs'), { withFileTypes: true });
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return new Set();
|
|
13
|
+
}
|
|
14
|
+
return new Set(entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name));
|
|
15
|
+
}
|
|
16
|
+
/** Run every impact check and return the change's own import-graph warnings. */
|
|
17
|
+
export async function collectImpactFindings(input) {
|
|
18
|
+
const deltaCapabilities = await readDeltaCapabilities(input.folderPath);
|
|
19
|
+
const ownerships = await readCapabilityOwnership(input.projectRoot, input.config.paths.openspecRoot);
|
|
20
|
+
const scopedFiles = [...new Set(input.tasks.flatMap((task) => [...task.existingPaths]))].sort();
|
|
21
|
+
const declared = new Set([...input.reads, ...deltaCapabilities]);
|
|
22
|
+
return [
|
|
23
|
+
...frozenTestFindings(input.tasks, input.importGraph, {
|
|
24
|
+
maxDepth: input.config.limits.importGraphDepth,
|
|
25
|
+
maxListed: input.config.limits.maxListedImporters,
|
|
26
|
+
}),
|
|
27
|
+
...(await verifyWithoutScopeFindings(input.projectRoot, input.tasks, input.importGraph)),
|
|
28
|
+
...undeclaredReadFindings({
|
|
29
|
+
proposalPath: input.proposalPath,
|
|
30
|
+
scopedFiles,
|
|
31
|
+
importsOf: (file) => input.importGraph.importsOf(file),
|
|
32
|
+
filesInScope: new Set(scopedFiles),
|
|
33
|
+
ownerships,
|
|
34
|
+
declared,
|
|
35
|
+
}),
|
|
36
|
+
...writeWithoutDeltaFindings(input.tasks, ownerships, deltaCapabilities),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=impact-lint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact-lint.js","sourceRoot":"","sources":["../../../src/core/spec/impact-lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAEL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAsB1B,yEAAyE;AACzE,KAAK,UAAU,qBAAqB,CAAC,UAAkB;IACrD,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACtF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAsB;IAChE,MAAM,iBAAiB,GAAG,MAAM,qBAAqB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxE,MAAM,UAAU,GAAG,MAAM,uBAAuB,CAC9C,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAChC,CAAC;IACF,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChG,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC;IAEjE,OAAO;QACL,GAAG,kBAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE;YACpD,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB;YAC9C,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB;SAClD,CAAC;QACF,GAAG,CAAC,MAAM,0BAA0B,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;QACxF,GAAG,sBAAsB,CAAC;YACxB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,WAAW;YACX,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC;YACtD,YAAY,EAAE,IAAI,GAAG,CAAC,WAAW,CAAC;YAClC,UAAU;YACV,QAAQ;SACT,CAAC;QACF,GAAG,yBAAyB,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,iBAAiB,CAAC;KACzE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory names never walked by the import graph, and by the watcher's
|
|
3
|
+
* repository counts.
|
|
4
|
+
*/
|
|
5
|
+
export declare const IGNORED_DIRS: ReadonlySet<string>;
|
|
6
|
+
/** The files of one repository and the relative imports between them. */
|
|
7
|
+
export interface ImportGraph {
|
|
8
|
+
/** Sorted project-relative POSIX paths of every JavaScript and TypeScript file. */
|
|
9
|
+
readonly files: readonly string[];
|
|
10
|
+
/** Sorted project-relative files this file imports. */
|
|
11
|
+
importsOf(file: string): readonly string[];
|
|
12
|
+
/** Sorted project-relative files that import this file. */
|
|
13
|
+
importersOf(file: string): readonly string[];
|
|
14
|
+
}
|
|
15
|
+
/** One importing file and its distance from the files it reaches. */
|
|
16
|
+
export interface ReachingFile {
|
|
17
|
+
readonly file: string;
|
|
18
|
+
readonly depth: number;
|
|
19
|
+
}
|
|
20
|
+
/** Options for `buildImportGraph`. */
|
|
21
|
+
export interface BuildImportGraphOptions {
|
|
22
|
+
/** Extra repository-relative folders to leave out of the graph. */
|
|
23
|
+
readonly skip?: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the relative import graph of every JavaScript and TypeScript file
|
|
27
|
+
* outside ignored folders and `options.skip`. Bare and aliased specifiers are
|
|
28
|
+
* never resolved.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildImportGraph(projectRoot: string, options?: BuildImportGraphOptions): Promise<ImportGraph>;
|
|
31
|
+
/** Every file `files` import at any depth, sorted. */
|
|
32
|
+
export declare function reachImports(graph: ImportGraph, files: readonly string[]): string[];
|
|
33
|
+
/** Every file importing one of `files` within `maxDepth` levels, nearest first. */
|
|
34
|
+
export declare function reachImporters(graph: ImportGraph, files: readonly string[], maxDepth: number): ReachingFile[];
|
|
35
|
+
//# sourceMappingURL=import-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-graph.d.ts","sourceRoot":"","sources":["../../../src/core/spec/import-graph.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAS3C,CAAC;AAYH,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,uDAAuD;IACvD,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IAC3C,2DAA2D;IAC3D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,sCAAsC;AACtC,MAAM,WAAW,uBAAuB;IACtC,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AA6DD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,WAAW,CAAC,CA4BtB;AAED,sDAAsD;AACtD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAWnF;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,GACf,YAAY,EAAE,CAoBhB"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Directory names never walked by the import graph, and by the watcher's
|
|
5
|
+
* repository counts.
|
|
6
|
+
*/
|
|
7
|
+
export const IGNORED_DIRS = new Set([
|
|
8
|
+
'node_modules',
|
|
9
|
+
'dist',
|
|
10
|
+
'.git',
|
|
11
|
+
'.run',
|
|
12
|
+
'coverage',
|
|
13
|
+
'.nyc_output',
|
|
14
|
+
'.vscode',
|
|
15
|
+
'.idea',
|
|
16
|
+
]);
|
|
17
|
+
/** Every script extension the graph records, in resolution preference order. */
|
|
18
|
+
const GRAPH_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs'];
|
|
19
|
+
/** Extensions TypeScript rewrites to a TypeScript stem. */
|
|
20
|
+
const JS_EXTENSIONS = ['.js', '.jsx', '.mjs', '.cjs'];
|
|
21
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts'];
|
|
22
|
+
/** One pass over file text; captures import, export, and require specifiers. */
|
|
23
|
+
const SPECIFIER_REGEX = /(?:\bfrom\b|\bimport\b|\brequire\b)\s*(?:\(\s*)?['"]([^'"]+)['"]/g;
|
|
24
|
+
function toPosix(value) {
|
|
25
|
+
return value.split(path.sep).join('/');
|
|
26
|
+
}
|
|
27
|
+
/** True for a JavaScript or TypeScript file the graph records; declarations do not count. */
|
|
28
|
+
function isGraphFile(name) {
|
|
29
|
+
if (name.endsWith('.d.ts'))
|
|
30
|
+
return false;
|
|
31
|
+
return GRAPH_EXTENSIONS.some((extension) => name.endsWith(extension));
|
|
32
|
+
}
|
|
33
|
+
/** Candidate project-relative targets for a relative specifier, in resolve order. */
|
|
34
|
+
function importCandidates(fromDir, specifier) {
|
|
35
|
+
const base = toPosix(path.normalize(path.join(fromDir, specifier)));
|
|
36
|
+
const candidates = [base];
|
|
37
|
+
const lower = base.toLowerCase();
|
|
38
|
+
const jsExtension = JS_EXTENSIONS.find((extension) => lower.endsWith(extension));
|
|
39
|
+
if (jsExtension !== undefined) {
|
|
40
|
+
const stem = base.slice(0, -jsExtension.length);
|
|
41
|
+
candidates.push(...TS_EXTENSIONS.map((extension) => `${stem}${extension}`));
|
|
42
|
+
}
|
|
43
|
+
candidates.push(...GRAPH_EXTENSIONS.map((extension) => `${base}${extension}`));
|
|
44
|
+
candidates.push(...GRAPH_EXTENSIONS.map((extension) => `${base}/index${extension}`));
|
|
45
|
+
return candidates;
|
|
46
|
+
}
|
|
47
|
+
/** The graph file a relative specifier resolves to, or null. */
|
|
48
|
+
function resolveGraphSpecifier(files, fromFile, specifier) {
|
|
49
|
+
if (!specifier.startsWith('.'))
|
|
50
|
+
return null;
|
|
51
|
+
for (const candidate of importCandidates(toPosix(path.dirname(fromFile)), specifier)) {
|
|
52
|
+
if (!candidate.endsWith('.d.ts') && files.has(candidate))
|
|
53
|
+
return candidate;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
/** Recursively list graph files outside ignored folders and `skip`. */
|
|
58
|
+
async function listGraphFiles(projectRoot, skip) {
|
|
59
|
+
const excluded = new Set(skip.map((entry) => entry.replace(/\\/g, '/').replace(/\/+$/, '')));
|
|
60
|
+
const files = [];
|
|
61
|
+
const walk = async (dir) => {
|
|
62
|
+
const entries = await fs.readdir(dir, { withFileTypes: true }).catch(() => []);
|
|
63
|
+
for (const entry of entries) {
|
|
64
|
+
const fullPath = path.join(dir, entry.name);
|
|
65
|
+
if (entry.isDirectory()) {
|
|
66
|
+
if (IGNORED_DIRS.has(entry.name))
|
|
67
|
+
continue;
|
|
68
|
+
if (excluded.has(toPosix(path.relative(projectRoot, fullPath))))
|
|
69
|
+
continue;
|
|
70
|
+
await walk(fullPath);
|
|
71
|
+
}
|
|
72
|
+
else if (entry.isFile() && isGraphFile(entry.name)) {
|
|
73
|
+
files.push(toPosix(path.relative(projectRoot, fullPath)));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
await walk(projectRoot);
|
|
78
|
+
return files.sort();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Build the relative import graph of every JavaScript and TypeScript file
|
|
82
|
+
* outside ignored folders and `options.skip`. Bare and aliased specifiers are
|
|
83
|
+
* never resolved.
|
|
84
|
+
*/
|
|
85
|
+
export async function buildImportGraph(projectRoot, options = {}) {
|
|
86
|
+
const files = await listGraphFiles(projectRoot, options.skip ?? []);
|
|
87
|
+
const known = new Set(files);
|
|
88
|
+
const imports = new Map();
|
|
89
|
+
const importers = new Map();
|
|
90
|
+
for (const file of files) {
|
|
91
|
+
const content = await fs.readFile(path.join(projectRoot, file), 'utf8').catch(() => '');
|
|
92
|
+
const targets = new Set();
|
|
93
|
+
for (const match of content.matchAll(SPECIFIER_REGEX)) {
|
|
94
|
+
const specifier = match[1];
|
|
95
|
+
const resolved = specifier === undefined ? null : resolveGraphSpecifier(known, file, specifier);
|
|
96
|
+
if (resolved !== null)
|
|
97
|
+
targets.add(resolved);
|
|
98
|
+
}
|
|
99
|
+
const sorted = [...targets].sort();
|
|
100
|
+
imports.set(file, sorted);
|
|
101
|
+
for (const target of sorted) {
|
|
102
|
+
const list = importers.get(target);
|
|
103
|
+
if (list === undefined)
|
|
104
|
+
importers.set(target, [file]);
|
|
105
|
+
else
|
|
106
|
+
list.push(file);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
for (const list of importers.values())
|
|
110
|
+
list.sort();
|
|
111
|
+
return {
|
|
112
|
+
files,
|
|
113
|
+
importsOf: (file) => imports.get(file) ?? [],
|
|
114
|
+
importersOf: (file) => importers.get(file) ?? [],
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/** Every file `files` import at any depth, sorted. */
|
|
118
|
+
export function reachImports(graph, files) {
|
|
119
|
+
const reached = new Set();
|
|
120
|
+
const queue = [...files];
|
|
121
|
+
for (let index = 0; index < queue.length; index += 1) {
|
|
122
|
+
for (const target of graph.importsOf(queue[index] ?? '')) {
|
|
123
|
+
if (reached.has(target))
|
|
124
|
+
continue;
|
|
125
|
+
reached.add(target);
|
|
126
|
+
queue.push(target);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return [...reached].sort();
|
|
130
|
+
}
|
|
131
|
+
/** Every file importing one of `files` within `maxDepth` levels, nearest first. */
|
|
132
|
+
export function reachImporters(graph, files, maxDepth) {
|
|
133
|
+
const roots = new Set(files);
|
|
134
|
+
const depth = new Map();
|
|
135
|
+
for (const file of roots)
|
|
136
|
+
depth.set(file, 0);
|
|
137
|
+
let frontier = [...roots];
|
|
138
|
+
for (let level = 1; level <= maxDepth && frontier.length > 0; level += 1) {
|
|
139
|
+
const next = [];
|
|
140
|
+
for (const file of frontier) {
|
|
141
|
+
for (const importer of graph.importersOf(file)) {
|
|
142
|
+
if (depth.has(importer))
|
|
143
|
+
continue;
|
|
144
|
+
depth.set(importer, level);
|
|
145
|
+
next.push(importer);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
frontier = next;
|
|
149
|
+
}
|
|
150
|
+
return [...depth.entries()]
|
|
151
|
+
.filter(([file]) => !roots.has(file))
|
|
152
|
+
.map(([file, level]) => ({ file, depth: level }))
|
|
153
|
+
.sort((a, b) => a.depth - b.depth || (a.file < b.file ? -1 : a.file > b.file ? 1 : 0));
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=import-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-graph.js","sourceRoot":"","sources":["../../../src/core/spec/import-graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IACvD,cAAc;IACd,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,aAAa;IACb,SAAS;IACT,OAAO;CACR,CAAC,CAAC;AAEH,gFAAgF;AAChF,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAEjG,2DAA2D;AAC3D,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC/D,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAA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IAAI,QAAQ,EAAE,CAAC;YAC5B,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;oBAAE,SAAS;gBAClC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACpC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;SAChD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared lint finding shape.
|
|
3
|
+
*
|
|
4
|
+
* Every diagnostic lint produces carries the severity that decides whether it
|
|
5
|
+
* blocks, the repository-relative file it concerns, the requirement or section
|
|
6
|
+
* within that file when one applies, and the human-readable message. The
|
|
7
|
+
* change's own findings decide validity; repository findings are reported but
|
|
8
|
+
* never block.
|
|
9
|
+
*/
|
|
10
|
+
/** A finding either fails the change (`error`) or merely informs (`warning`). */
|
|
11
|
+
export type LintSeverity = 'error' | 'warning';
|
|
12
|
+
/** Classify an OpenSpec level; `WARNING` and `INFO` are lint warnings. */
|
|
13
|
+
export declare function openSpecSeverity(level: string): LintSeverity;
|
|
14
|
+
export interface LintFinding {
|
|
15
|
+
readonly severity: LintSeverity;
|
|
16
|
+
readonly file: string;
|
|
17
|
+
readonly requirement: string | null;
|
|
18
|
+
readonly section: string | null;
|
|
19
|
+
readonly message: string;
|
|
20
|
+
}
|
|
21
|
+
/** The location fields of a finding; the requirement and section default to null. */
|
|
22
|
+
export interface FindingLocation {
|
|
23
|
+
readonly file: string;
|
|
24
|
+
readonly requirement?: string | null;
|
|
25
|
+
readonly section?: string | null;
|
|
26
|
+
}
|
|
27
|
+
export declare function makeFinding(severity: LintSeverity, location: FindingLocation, message: string): LintFinding;
|
|
28
|
+
/**
|
|
29
|
+
* Accumulates the change's own findings apart from repository findings and
|
|
30
|
+
* derives the legacy message arrays from the change's own findings in order.
|
|
31
|
+
*/
|
|
32
|
+
export declare class LintFindingSet {
|
|
33
|
+
private readonly ownFindings;
|
|
34
|
+
private readonly repositoryFindings;
|
|
35
|
+
get findings(): readonly LintFinding[];
|
|
36
|
+
get repository(): readonly LintFinding[];
|
|
37
|
+
error(location: FindingLocation, message: string): void;
|
|
38
|
+
warning(location: FindingLocation, message: string): void;
|
|
39
|
+
addOwn(finding: LintFinding): void;
|
|
40
|
+
addRepository(finding: LintFinding): void;
|
|
41
|
+
errors(): string[];
|
|
42
|
+
warnings(): string[];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=lint-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-findings.d.ts","sourceRoot":"","sources":["../../../src/core/spec/lint-findings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,OAAO,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}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared lint finding shape.
|
|
3
|
+
*
|
|
4
|
+
* Every diagnostic lint produces carries the severity that decides whether it
|
|
5
|
+
* blocks, the repository-relative file it concerns, the requirement or section
|
|
6
|
+
* within that file when one applies, and the human-readable message. The
|
|
7
|
+
* change's own findings decide validity; repository findings are reported but
|
|
8
|
+
* never block.
|
|
9
|
+
*/
|
|
10
|
+
/** Classify an OpenSpec level; `WARNING` and `INFO` are lint warnings. */
|
|
11
|
+
export function openSpecSeverity(level) {
|
|
12
|
+
const lowered = level.toLowerCase();
|
|
13
|
+
return lowered.includes('warn') || lowered.includes('info') ? 'warning' : 'error';
|
|
14
|
+
}
|
|
15
|
+
export function makeFinding(severity, location, message) {
|
|
16
|
+
return {
|
|
17
|
+
severity,
|
|
18
|
+
file: location.file,
|
|
19
|
+
requirement: location.requirement ?? null,
|
|
20
|
+
section: location.section ?? null,
|
|
21
|
+
message,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Accumulates the change's own findings apart from repository findings and
|
|
26
|
+
* derives the legacy message arrays from the change's own findings in order.
|
|
27
|
+
*/
|
|
28
|
+
export class LintFindingSet {
|
|
29
|
+
ownFindings = [];
|
|
30
|
+
repositoryFindings = [];
|
|
31
|
+
get findings() {
|
|
32
|
+
return this.ownFindings;
|
|
33
|
+
}
|
|
34
|
+
get repository() {
|
|
35
|
+
return this.repositoryFindings;
|
|
36
|
+
}
|
|
37
|
+
error(location, message) {
|
|
38
|
+
this.ownFindings.push(makeFinding('error', location, message));
|
|
39
|
+
}
|
|
40
|
+
warning(location, message) {
|
|
41
|
+
this.ownFindings.push(makeFinding('warning', location, message));
|
|
42
|
+
}
|
|
43
|
+
addOwn(finding) {
|
|
44
|
+
this.ownFindings.push(finding);
|
|
45
|
+
}
|
|
46
|
+
addRepository(finding) {
|
|
47
|
+
this.repositoryFindings.push(finding);
|
|
48
|
+
}
|
|
49
|
+
errors() {
|
|
50
|
+
return this.ownFindings.filter((f) => f.severity === 'error').map((f) => f.message);
|
|
51
|
+
}
|
|
52
|
+
warnings() {
|
|
53
|
+
return this.ownFindings.filter((f) => f.severity === 'warning').map((f) => f.message);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=lint-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-findings.js","sourceRoot":"","sources":["../../../src/core/spec/lint-findings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AACpF,CAAC;AAiBD,MAAM,UAAU,WAAW,CACzB,QAAsB,EACtB,QAAyB,EACzB,OAAe;IAEf,OAAO;QACL,QAAQ;QACR,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,IAAI;QACzC,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,IAAI;QACjC,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,cAAc;IACR,WAAW,GAAkB,EAAE,CAAC;IAChC,kBAAkB,GAAkB,EAAE,CAAC;IAExD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,QAAyB,EAAE,OAAe;QAC9C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,CAAC,QAAyB,EAAE,OAAe;QAChD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,OAAoB;QACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,aAAa,CAAC,OAAoB;QAChC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACxF,CAAC;CACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text and JSON rendering for `osq lint`.
|
|
3
|
+
*
|
|
4
|
+
* A change's own findings print under the change name, repository findings
|
|
5
|
+
* print once in their own group, and `--json` carries the same fields as one
|
|
6
|
+
* document. Formatting, deduplication, and document building live here so the
|
|
7
|
+
* command stays small.
|
|
8
|
+
*/
|
|
9
|
+
import type { LintFinding } from './lint-findings.js';
|
|
10
|
+
/** The repository group header printed once after every change. */
|
|
11
|
+
export declare const REPOSITORY_HEADER = "repository: findings about other changes and living specs; they do not affect the exit code";
|
|
12
|
+
/** The minimal logger surface finding printing needs. */
|
|
13
|
+
export interface FindingLogger {
|
|
14
|
+
info(message: string): void;
|
|
15
|
+
warn(message: string): void;
|
|
16
|
+
error(message: string): void;
|
|
17
|
+
}
|
|
18
|
+
/** The JSON document `osq lint --json` writes to stdout. */
|
|
19
|
+
export interface LintJsonDocument {
|
|
20
|
+
readonly valid: boolean;
|
|
21
|
+
readonly changes: LintJsonChange[];
|
|
22
|
+
readonly repository: LintFinding[];
|
|
23
|
+
}
|
|
24
|
+
export interface LintJsonChange {
|
|
25
|
+
readonly change: string;
|
|
26
|
+
readonly valid: boolean;
|
|
27
|
+
readonly findings: LintFinding[];
|
|
28
|
+
}
|
|
29
|
+
/** One linted change as the JSON builder consumes it. */
|
|
30
|
+
export interface LintJsonEntry {
|
|
31
|
+
readonly change: string;
|
|
32
|
+
readonly valid: boolean;
|
|
33
|
+
readonly findings: readonly LintFinding[];
|
|
34
|
+
readonly repository: readonly LintFinding[];
|
|
35
|
+
}
|
|
36
|
+
/** Format one finding as `<prefix>: <severity> <file><qualifier>: <message>`. */
|
|
37
|
+
export declare function formatFinding(prefix: string, finding: LintFinding): string;
|
|
38
|
+
/** Format one change's own finding under the change name. */
|
|
39
|
+
export declare function formatChangeFinding(change: string, finding: LintFinding): string;
|
|
40
|
+
/** Format one repository finding under the fixed `repository` prefix. */
|
|
41
|
+
export declare function formatRepositoryFinding(finding: LintFinding): string;
|
|
42
|
+
/** Drop findings equal in every field, keeping the first occurrence's order. */
|
|
43
|
+
export declare function dedupeFindings(findings: readonly LintFinding[]): LintFinding[];
|
|
44
|
+
/** Print a change's findings and, when valid, its validity line. */
|
|
45
|
+
export declare function printChangeFindings(logger: FindingLogger, change: string, result: {
|
|
46
|
+
readonly valid: boolean;
|
|
47
|
+
readonly findings: readonly LintFinding[];
|
|
48
|
+
}): void;
|
|
49
|
+
/** Print the repository group, one line per unique finding, or nothing. */
|
|
50
|
+
export declare function printRepositoryFindings(logger: FindingLogger, findings: readonly LintFinding[]): void;
|
|
51
|
+
/** Build the `osq lint --json` document from every linted change. */
|
|
52
|
+
export declare function buildLintJson(valid: boolean, entries: readonly LintJsonEntry[]): LintJsonDocument;
|
|
53
|
+
//# sourceMappingURL=lint-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-output.d.ts","sourceRoot":"","sources":["../../../src/core/spec/lint-output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,gGACiE,CAAC;AAEhG,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;CAClC;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,SAAS,WAAW,EAAE,CAAC;CAC7C;AAQD,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAE1E;AAED,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAEhF;AAED,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAEpE;AAaD,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,WAAW,EAAE,CAQ9E;AAYD,oEAAoE;AACpE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;CAAE,GAC7E,IAAI,CAON;AAED,2EAA2E;AAC3E,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC/B,IAAI,CAQN;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,gBAAgB,CAUjG"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text and JSON rendering for `osq lint`.
|
|
3
|
+
*
|
|
4
|
+
* A change's own findings print under the change name, repository findings
|
|
5
|
+
* print once in their own group, and `--json` carries the same fields as one
|
|
6
|
+
* document. Formatting, deduplication, and document building live here so the
|
|
7
|
+
* command stays small.
|
|
8
|
+
*/
|
|
9
|
+
/** The repository group header printed once after every change. */
|
|
10
|
+
export const REPOSITORY_HEADER = 'repository: findings about other changes and living specs; they do not affect the exit code';
|
|
11
|
+
/** The requirement-or-section qualifier, preferring the requirement. */
|
|
12
|
+
function qualifier(finding) {
|
|
13
|
+
const name = finding.requirement ?? finding.section;
|
|
14
|
+
return name === null ? '' : ` (${name})`;
|
|
15
|
+
}
|
|
16
|
+
/** Format one finding as `<prefix>: <severity> <file><qualifier>: <message>`. */
|
|
17
|
+
export function formatFinding(prefix, finding) {
|
|
18
|
+
return `${prefix}: ${finding.severity} ${finding.file}${qualifier(finding)}: ${finding.message}`;
|
|
19
|
+
}
|
|
20
|
+
/** Format one change's own finding under the change name. */
|
|
21
|
+
export function formatChangeFinding(change, finding) {
|
|
22
|
+
return formatFinding(change, finding);
|
|
23
|
+
}
|
|
24
|
+
/** Format one repository finding under the fixed `repository` prefix. */
|
|
25
|
+
export function formatRepositoryFinding(finding) {
|
|
26
|
+
return formatFinding('repository', finding);
|
|
27
|
+
}
|
|
28
|
+
/** True when two findings are equal in every field. */
|
|
29
|
+
function sameFinding(left, right) {
|
|
30
|
+
return (left.severity === right.severity &&
|
|
31
|
+
left.file === right.file &&
|
|
32
|
+
left.requirement === right.requirement &&
|
|
33
|
+
left.section === right.section &&
|
|
34
|
+
left.message === right.message);
|
|
35
|
+
}
|
|
36
|
+
/** Drop findings equal in every field, keeping the first occurrence's order. */
|
|
37
|
+
export function dedupeFindings(findings) {
|
|
38
|
+
const unique = [];
|
|
39
|
+
for (const finding of findings) {
|
|
40
|
+
if (!unique.some((existing) => sameFinding(existing, finding))) {
|
|
41
|
+
unique.push(finding);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return unique;
|
|
45
|
+
}
|
|
46
|
+
/** Print one finding at the logger level that matches its severity. */
|
|
47
|
+
function printFinding(logger, prefix, finding) {
|
|
48
|
+
const line = formatFinding(prefix, finding);
|
|
49
|
+
if (finding.severity === 'error') {
|
|
50
|
+
logger.error(line);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
logger.warn(line);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Print a change's findings and, when valid, its validity line. */
|
|
57
|
+
export function printChangeFindings(logger, change, result) {
|
|
58
|
+
for (const finding of result.findings) {
|
|
59
|
+
printFinding(logger, change, finding);
|
|
60
|
+
}
|
|
61
|
+
if (result.valid) {
|
|
62
|
+
logger.info(`${change}: valid`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Print the repository group, one line per unique finding, or nothing. */
|
|
66
|
+
export function printRepositoryFindings(logger, findings) {
|
|
67
|
+
if (findings.length === 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
logger.info(REPOSITORY_HEADER);
|
|
71
|
+
for (const finding of findings) {
|
|
72
|
+
printFinding(logger, 'repository', finding);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Build the `osq lint --json` document from every linted change. */
|
|
76
|
+
export function buildLintJson(valid, entries) {
|
|
77
|
+
return {
|
|
78
|
+
valid,
|
|
79
|
+
changes: entries.map((entry) => ({
|
|
80
|
+
change: entry.change,
|
|
81
|
+
valid: entry.valid,
|
|
82
|
+
findings: [...entry.findings],
|
|
83
|
+
})),
|
|
84
|
+
repository: dedupeFindings(entries.flatMap((entry) => [...entry.repository])),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=lint-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-output.js","sourceRoot":"","sources":["../../../src/core/spec/lint-output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,6FAA6F,CAAC;AA8BhG,wEAAwE;AACxE,SAAS,SAAS,CAAC,OAAoB;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IACpD,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC;AAC3C,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,OAAoB;IAChE,OAAO,GAAG,MAAM,KAAK,OAAO,CAA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AE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { OsqConfig } from '../foundation/config.js';
|
|
2
|
+
import { type ImportGraph } from './import-graph.js';
|
|
3
|
+
import { type LintFinding } from './lint-findings.js';
|
|
4
|
+
import { OPENSPEC_ERROR_PREFIX } from './openspec-issues.js';
|
|
2
5
|
import { OPENSPEC_EXPECTED_VERSION } from './openspec-version.js';
|
|
3
|
-
export { OPENSPEC_EXPECTED_VERSION };
|
|
4
|
-
/** Prefix applied to every finding surfaced by the OpenSpec validator. */
|
|
5
|
-
export declare const OPENSPEC_ERROR_PREFIX = "openspec:";
|
|
6
|
+
export { OPENSPEC_EXPECTED_VERSION, OPENSPEC_ERROR_PREFIX };
|
|
6
7
|
export interface LintLogger {
|
|
7
8
|
info(msg: string): void;
|
|
8
9
|
verbose(msg: string): void;
|
|
@@ -32,9 +33,15 @@ export interface LintResult {
|
|
|
32
33
|
readonly valid: boolean;
|
|
33
34
|
readonly errors: string[];
|
|
34
35
|
readonly warnings: string[];
|
|
36
|
+
readonly findings: LintFinding[];
|
|
37
|
+
readonly repository: LintFinding[];
|
|
35
38
|
}
|
|
36
39
|
export interface LintOptions {
|
|
37
40
|
readonly logger?: LintLogger;
|
|
41
|
+
/** The change folder being linted, used to attribute OpenSpec issues. */
|
|
42
|
+
readonly changeFolder?: string;
|
|
43
|
+
/** A graph built once per lint run; built here when absent. */
|
|
44
|
+
readonly importGraph?: ImportGraph;
|
|
38
45
|
}
|
|
39
46
|
export interface OpenSpecFindings {
|
|
40
47
|
readonly errors: string[];
|
|
@@ -44,6 +51,8 @@ export interface OpenSpecValidationOutcome extends OpenSpecFindings {
|
|
|
44
51
|
readonly ran: boolean;
|
|
45
52
|
readonly bin: string | null;
|
|
46
53
|
readonly version: string | null;
|
|
54
|
+
readonly findings: LintFinding[];
|
|
55
|
+
readonly repository: LintFinding[];
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
58
|
* Resolves the project-local OpenSpec binary. Only a binary inside the
|
|
@@ -73,7 +82,8 @@ export declare function validateWithOpenSpec(projectRoot: string, config: OsqCon
|
|
|
73
82
|
* the living base spec at `openspec/specs/<capability>/spec.md`. Applying the
|
|
74
83
|
* delta through the deterministic merge engine reports unmatched MODIFIED,
|
|
75
84
|
* REMOVED, or RENAMED targets; ADDED-only deltas may create a new capability.
|
|
85
|
+
* Merged results are validated against their living spec's repository findings.
|
|
76
86
|
*/
|
|
77
|
-
export declare function verifyDeltaTargets(projectRoot: string, folderPath: string, config: OsqConfig): Promise<
|
|
87
|
+
export declare function verifyDeltaTargets(projectRoot: string, folderPath: string, config: OsqConfig, repositoryFindings?: readonly LintFinding[]): Promise<LintFinding[]>;
|
|
78
88
|
export declare function lintChangeFolder(projectRoot: string, folderPath: string, config: OsqConfig, options?: LintOptions): Promise<LintResult>;
|
|
79
89
|
//# sourceMappingURL=linter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../../src/core/spec/linter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../../src/core/spec/linter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAQzD,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EAKtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EAI1B,MAAM,uBAAuB,CAAC;AAsB/B,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,CAAC;AAM5D,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;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