@rsaglobaltech/specgate 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1016 -0
- package/README.md +148 -0
- package/bin/specgate.js +2 -0
- package/bin/specgate.ts +383 -0
- package/dist/bin/specgate.js +342 -0
- package/dist/bin/specgate.js.map +1 -0
- package/dist/packages/core/src/application/AddRequirementUseCase.js +24 -0
- package/dist/packages/core/src/application/AddRequirementUseCase.js.map +1 -0
- package/dist/packages/core/src/application/ArchiveChangeUseCase.js +185 -0
- package/dist/packages/core/src/application/ArchiveChangeUseCase.js.map +1 -0
- package/dist/packages/core/src/application/CheckAgainstLockUseCase.js +134 -0
- package/dist/packages/core/src/application/CheckAgainstLockUseCase.js.map +1 -0
- package/dist/packages/core/src/application/GenerateAgentPromptUseCase.js +25 -0
- package/dist/packages/core/src/application/GenerateAgentPromptUseCase.js.map +1 -0
- package/dist/packages/core/src/application/GeneratePlanUseCase.js +135 -0
- package/dist/packages/core/src/application/GeneratePlanUseCase.js.map +1 -0
- package/dist/packages/core/src/application/LinkRequirementUseCase.js +25 -0
- package/dist/packages/core/src/application/LinkRequirementUseCase.js.map +1 -0
- package/dist/packages/core/src/application/RemovePackUseCase.js +28 -0
- package/dist/packages/core/src/application/RemovePackUseCase.js.map +1 -0
- package/dist/packages/core/src/application/UpdateRequirementStatusUseCase.js +37 -0
- package/dist/packages/core/src/application/UpdateRequirementStatusUseCase.js.map +1 -0
- package/dist/packages/core/src/application/ValidateChangeUseCase.js +86 -0
- package/dist/packages/core/src/application/ValidateChangeUseCase.js.map +1 -0
- package/dist/packages/core/src/application/ValidateProjectUseCase.js +101 -0
- package/dist/packages/core/src/application/ValidateProjectUseCase.js.map +1 -0
- package/dist/packages/core/src/application/ports/IDomainPackRepository.js +3 -0
- package/dist/packages/core/src/application/ports/IDomainPackRepository.js.map +1 -0
- package/dist/packages/core/src/application/ports/IHarnessConfigRepository.js +3 -0
- package/dist/packages/core/src/application/ports/IHarnessConfigRepository.js.map +1 -0
- package/dist/packages/core/src/application/ports/ILockfileRepository.js +3 -0
- package/dist/packages/core/src/application/ports/ILockfileRepository.js.map +1 -0
- package/dist/packages/core/src/application/ports/IManifestRepository.js +3 -0
- package/dist/packages/core/src/application/ports/IManifestRepository.js.map +1 -0
- package/dist/packages/core/src/application/ports/IProjectRepository.js +3 -0
- package/dist/packages/core/src/application/ports/IProjectRepository.js.map +1 -0
- package/dist/packages/core/src/application/ports/IRequirementGraphRepository.js +3 -0
- package/dist/packages/core/src/application/ports/IRequirementGraphRepository.js.map +1 -0
- package/dist/packages/core/src/application/ports/ITraceabilityRepository.js +3 -0
- package/dist/packages/core/src/application/ports/ITraceabilityRepository.js.map +1 -0
- package/dist/packages/core/src/domain/AgentPrompt.js +79 -0
- package/dist/packages/core/src/domain/AgentPrompt.js.map +1 -0
- package/dist/packages/core/src/domain/ArchivePlan.js +26 -0
- package/dist/packages/core/src/domain/ArchivePlan.js.map +1 -0
- package/dist/packages/core/src/domain/AuthoringScope.js +48 -0
- package/dist/packages/core/src/domain/AuthoringScope.js.map +1 -0
- package/dist/packages/core/src/domain/ChangeTemplates.js +133 -0
- package/dist/packages/core/src/domain/ChangeTemplates.js.map +1 -0
- package/dist/packages/core/src/domain/CucumberMessages.js +256 -0
- package/dist/packages/core/src/domain/CucumberMessages.js.map +1 -0
- package/dist/packages/core/src/domain/DeclaredArtifacts.js +117 -0
- package/dist/packages/core/src/domain/DeclaredArtifacts.js.map +1 -0
- package/dist/packages/core/src/domain/DeltaSpec.js +219 -0
- package/dist/packages/core/src/domain/DeltaSpec.js.map +1 -0
- package/dist/packages/core/src/domain/Diagnostic.js +75 -0
- package/dist/packages/core/src/domain/Diagnostic.js.map +1 -0
- package/dist/packages/core/src/domain/DomainPack.js +62 -0
- package/dist/packages/core/src/domain/DomainPack.js.map +1 -0
- package/dist/packages/core/src/domain/EmptyAttempt.js +60 -0
- package/dist/packages/core/src/domain/EmptyAttempt.js.map +1 -0
- package/dist/packages/core/src/domain/FileChangeSet.js +37 -0
- package/dist/packages/core/src/domain/FileChangeSet.js.map +1 -0
- package/dist/packages/core/src/domain/Gherkin.js +272 -0
- package/dist/packages/core/src/domain/Gherkin.js.map +1 -0
- package/dist/packages/core/src/domain/GherkinDialects.js +97 -0
- package/dist/packages/core/src/domain/GherkinDialects.js.map +1 -0
- package/dist/packages/core/src/domain/GherkinQuality.js +160 -0
- package/dist/packages/core/src/domain/GherkinQuality.js.map +1 -0
- package/dist/packages/core/src/domain/GherkinTags.js +119 -0
- package/dist/packages/core/src/domain/GherkinTags.js.map +1 -0
- package/dist/packages/core/src/domain/GitSafety.js +77 -0
- package/dist/packages/core/src/domain/GitSafety.js.map +1 -0
- package/dist/packages/core/src/domain/HarnessConfig.js +58 -0
- package/dist/packages/core/src/domain/HarnessConfig.js.map +1 -0
- package/dist/packages/core/src/domain/HarnessReport.js +162 -0
- package/dist/packages/core/src/domain/HarnessReport.js.map +1 -0
- package/dist/packages/core/src/domain/HarnessRun.js +154 -0
- package/dist/packages/core/src/domain/HarnessRun.js.map +1 -0
- package/dist/packages/core/src/domain/InboundChange.js +127 -0
- package/dist/packages/core/src/domain/InboundChange.js.map +1 -0
- package/dist/packages/core/src/domain/Language.js +112 -0
- package/dist/packages/core/src/domain/Language.js.map +1 -0
- package/dist/packages/core/src/domain/Lockfile.js +64 -0
- package/dist/packages/core/src/domain/Lockfile.js.map +1 -0
- package/dist/packages/core/src/domain/PackContribution.js +106 -0
- package/dist/packages/core/src/domain/PackContribution.js.map +1 -0
- package/dist/packages/core/src/domain/PackDelta.js +298 -0
- package/dist/packages/core/src/domain/PackDelta.js.map +1 -0
- package/dist/packages/core/src/domain/PackSpec.js +481 -0
- package/dist/packages/core/src/domain/PackSpec.js.map +1 -0
- package/dist/packages/core/src/domain/ProfileMatch.js +87 -0
- package/dist/packages/core/src/domain/ProfileMatch.js.map +1 -0
- package/dist/packages/core/src/domain/Reconciliation.js +72 -0
- package/dist/packages/core/src/domain/Reconciliation.js.map +1 -0
- package/dist/packages/core/src/domain/RequirementGraph.js +197 -0
- package/dist/packages/core/src/domain/RequirementGraph.js.map +1 -0
- package/dist/packages/core/src/domain/RequirementPlan.js +85 -0
- package/dist/packages/core/src/domain/RequirementPlan.js.map +1 -0
- package/dist/packages/core/src/domain/RequirementReadiness.js +115 -0
- package/dist/packages/core/src/domain/RequirementReadiness.js.map +1 -0
- package/dist/packages/core/src/domain/RequirementSyntax.js +91 -0
- package/dist/packages/core/src/domain/RequirementSyntax.js.map +1 -0
- package/dist/packages/core/src/domain/ResumeState.js +115 -0
- package/dist/packages/core/src/domain/ResumeState.js.map +1 -0
- package/dist/packages/core/src/domain/RunBudget.js +103 -0
- package/dist/packages/core/src/domain/RunBudget.js.map +1 -0
- package/dist/packages/core/src/domain/SpecDiff.js +48 -0
- package/dist/packages/core/src/domain/SpecDiff.js.map +1 -0
- package/dist/packages/core/src/domain/SpecParser.js +406 -0
- package/dist/packages/core/src/domain/SpecParser.js.map +1 -0
- package/dist/packages/core/src/domain/SpecopsManifest.js +90 -0
- package/dist/packages/core/src/domain/SpecopsManifest.js.map +1 -0
- package/dist/packages/core/src/domain/TraceabilityFormat.js +317 -0
- package/dist/packages/core/src/domain/TraceabilityFormat.js.map +1 -0
- package/dist/packages/core/src/domain/TraceabilityMatrix.js +200 -0
- package/dist/packages/core/src/domain/TraceabilityMatrix.js.map +1 -0
- package/dist/packages/core/src/domain/TraceabilityMerge.js +180 -0
- package/dist/packages/core/src/domain/TraceabilityMerge.js.map +1 -0
- package/dist/packages/core/src/domain/ValidationReport.js +53 -0
- package/dist/packages/core/src/domain/ValidationReport.js.map +1 -0
- package/dist/packages/core/src/domain/ValueAnnotations.js +138 -0
- package/dist/packages/core/src/domain/ValueAnnotations.js.map +1 -0
- package/dist/packages/core/src/domain/WriteScope.js +155 -0
- package/dist/packages/core/src/domain/WriteScope.js.map +1 -0
- package/dist/packages/core/src/domain/YamlLite.js +226 -0
- package/dist/packages/core/src/domain/YamlLite.js.map +1 -0
- package/dist/packages/core/src/index.js +120 -0
- package/dist/packages/core/src/index.js.map +1 -0
- package/dist/packages/core/src/infrastructure/ChangeWorkspace.js +276 -0
- package/dist/packages/core/src/infrastructure/ChangeWorkspace.js.map +1 -0
- package/dist/packages/core/src/infrastructure/ConsoleReporter.js +19 -0
- package/dist/packages/core/src/infrastructure/ConsoleReporter.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DirectorySnapshot.js +106 -0
- package/dist/packages/core/src/infrastructure/DirectorySnapshot.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskDomainPackRepository.js +57 -0
- package/dist/packages/core/src/infrastructure/DiskDomainPackRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskHarnessConfigRepository.js +58 -0
- package/dist/packages/core/src/infrastructure/DiskHarnessConfigRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskLanguageRepository.js +69 -0
- package/dist/packages/core/src/infrastructure/DiskLanguageRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskLockfileRepository.js +64 -0
- package/dist/packages/core/src/infrastructure/DiskLockfileRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskManifestRepository.js +88 -0
- package/dist/packages/core/src/infrastructure/DiskManifestRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskPackDeltaRepository.js +138 -0
- package/dist/packages/core/src/infrastructure/DiskPackDeltaRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskPackRepository.js +130 -0
- package/dist/packages/core/src/infrastructure/DiskPackRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskProjectRepository.js +127 -0
- package/dist/packages/core/src/infrastructure/DiskProjectRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskRequirementGraphRepository.js +124 -0
- package/dist/packages/core/src/infrastructure/DiskRequirementGraphRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/DiskTraceabilityRepository.js +53 -0
- package/dist/packages/core/src/infrastructure/DiskTraceabilityRepository.js.map +1 -0
- package/dist/packages/core/src/infrastructure/GitContributionStager.js +99 -0
- package/dist/packages/core/src/infrastructure/GitContributionStager.js.map +1 -0
- package/dist/packages/core/src/infrastructure/GitMergeDriver.js +103 -0
- package/dist/packages/core/src/infrastructure/GitMergeDriver.js.map +1 -0
- package/dist/packages/core/src/infrastructure/HarnessConfigFile.js +348 -0
- package/dist/packages/core/src/infrastructure/HarnessConfigFile.js.map +1 -0
- package/dist/packages/core/src/infrastructure/PackChangeDeposit.js +106 -0
- package/dist/packages/core/src/infrastructure/PackChangeDeposit.js.map +1 -0
- package/dist/packages/core/src/infrastructure/RemotePackResolver.js +181 -0
- package/dist/packages/core/src/infrastructure/RemotePackResolver.js.map +1 -0
- package/dist/packages/core/src/infrastructure/SpecopsConfigFile.js +94 -0
- package/dist/packages/core/src/infrastructure/SpecopsConfigFile.js.map +1 -0
- package/dist/packages/core/test/unit/authoring-scope.test.js +102 -0
- package/dist/packages/core/test/unit/authoring-scope.test.js.map +1 -0
- package/dist/packages/core/test/unit/change-templates.test.js +96 -0
- package/dist/packages/core/test/unit/change-templates.test.js.map +1 -0
- package/dist/packages/core/test/unit/cucumber-messages.test.js +232 -0
- package/dist/packages/core/test/unit/cucumber-messages.test.js.map +1 -0
- package/dist/packages/core/test/unit/declared-artifacts.test.js +124 -0
- package/dist/packages/core/test/unit/declared-artifacts.test.js.map +1 -0
- package/dist/packages/core/test/unit/empty-attempt.test.js +79 -0
- package/dist/packages/core/test/unit/empty-attempt.test.js.map +1 -0
- package/dist/packages/core/test/unit/gherkin-dialects.test.js +115 -0
- package/dist/packages/core/test/unit/gherkin-dialects.test.js.map +1 -0
- package/dist/packages/core/test/unit/gherkin-keyword-case.test.js +110 -0
- package/dist/packages/core/test/unit/gherkin-keyword-case.test.js.map +1 -0
- package/dist/packages/core/test/unit/gherkin-quality.test.js +151 -0
- package/dist/packages/core/test/unit/gherkin-quality.test.js.map +1 -0
- package/dist/packages/core/test/unit/gherkin-tags.test.js +127 -0
- package/dist/packages/core/test/unit/gherkin-tags.test.js.map +1 -0
- package/dist/packages/core/test/unit/git-safety.test.js +104 -0
- package/dist/packages/core/test/unit/git-safety.test.js.map +1 -0
- package/dist/packages/core/test/unit/harness-report.test.js +192 -0
- package/dist/packages/core/test/unit/harness-report.test.js.map +1 -0
- package/dist/packages/core/test/unit/harness-roles.test.js +86 -0
- package/dist/packages/core/test/unit/harness-roles.test.js.map +1 -0
- package/dist/packages/core/test/unit/inbound-change.test.js +145 -0
- package/dist/packages/core/test/unit/inbound-change.test.js.map +1 -0
- package/dist/packages/core/test/unit/matrix-dependencies.test.js +100 -0
- package/dist/packages/core/test/unit/matrix-dependencies.test.js.map +1 -0
- package/dist/packages/core/test/unit/profile-match.test.js +115 -0
- package/dist/packages/core/test/unit/profile-match.test.js.map +1 -0
- package/dist/packages/core/test/unit/reconciliation.test.js +112 -0
- package/dist/packages/core/test/unit/reconciliation.test.js.map +1 -0
- package/dist/packages/core/test/unit/requirement-readiness.test.js +161 -0
- package/dist/packages/core/test/unit/requirement-readiness.test.js.map +1 -0
- package/dist/packages/core/test/unit/resume-state.test.js +124 -0
- package/dist/packages/core/test/unit/resume-state.test.js.map +1 -0
- package/dist/packages/core/test/unit/run-budget.test.js +113 -0
- package/dist/packages/core/test/unit/run-budget.test.js.map +1 -0
- package/dist/packages/core/test/unit/traceability-merge.test.js +159 -0
- package/dist/packages/core/test/unit/traceability-merge.test.js.map +1 -0
- package/dist/packages/core/test/unit/validate-project.test.js +156 -0
- package/dist/packages/core/test/unit/validate-project.test.js.map +1 -0
- package/dist/packages/core/test/unit/value-annotations.test.js +149 -0
- package/dist/packages/core/test/unit/value-annotations.test.js.map +1 -0
- package/dist/packages/core/test/unit/write-scope.test.js +165 -0
- package/dist/packages/core/test/unit/write-scope.test.js.map +1 -0
- package/dist/packages/core/test/unit/yaml-lite.test.js +78 -0
- package/dist/packages/core/test/unit/yaml-lite.test.js.map +1 -0
- package/dist/scripts/adopt_project.js +11 -0
- package/dist/scripts/adopt_project.js.map +1 -0
- package/dist/scripts/agents/commands.js +100 -0
- package/dist/scripts/agents/commands.js.map +1 -0
- package/dist/scripts/agents/init.js +482 -0
- package/dist/scripts/agents/init.js.map +1 -0
- package/dist/scripts/alm/cli.js +154 -0
- package/dist/scripts/alm/cli.js.map +1 -0
- package/dist/scripts/alm/clients.js +30 -0
- package/dist/scripts/alm/clients.js.map +1 -0
- package/dist/scripts/alm/core.js +258 -0
- package/dist/scripts/alm/core.js.map +1 -0
- package/dist/scripts/alm/port.js +116 -0
- package/dist/scripts/alm/port.js.map +1 -0
- package/dist/scripts/alm/providers/azure.js +79 -0
- package/dist/scripts/alm/providers/azure.js.map +1 -0
- package/dist/scripts/alm/providers/github.js +124 -0
- package/dist/scripts/alm/providers/github.js.map +1 -0
- package/dist/scripts/alm/providers/http-client.js +47 -0
- package/dist/scripts/alm/providers/http-client.js.map +1 -0
- package/dist/scripts/alm/providers/index.js +107 -0
- package/dist/scripts/alm/providers/index.js.map +1 -0
- package/dist/scripts/alm/providers/jira.js +129 -0
- package/dist/scripts/alm/providers/jira.js.map +1 -0
- package/dist/scripts/bundle_pack.js +10 -0
- package/dist/scripts/bundle_pack.js.map +1 -0
- package/dist/scripts/change/archive.js +68 -0
- package/dist/scripts/change/archive.js.map +1 -0
- package/dist/scripts/change/artifacts.js +143 -0
- package/dist/scripts/change/artifacts.js.map +1 -0
- package/dist/scripts/change/cli.js +39 -0
- package/dist/scripts/change/cli.js.map +1 -0
- package/dist/scripts/change/delta.js +20 -0
- package/dist/scripts/change/delta.js.map +1 -0
- package/dist/scripts/change/instructions.js +339 -0
- package/dist/scripts/change/instructions.js.map +1 -0
- package/dist/scripts/ci_init.js +12 -0
- package/dist/scripts/ci_init.js.map +1 -0
- package/dist/scripts/cli/commands/alm/PullCommand.js +238 -0
- package/dist/scripts/cli/commands/alm/PullCommand.js.map +1 -0
- package/dist/scripts/cli/commands/change/ChangeCommand.js +867 -0
- package/dist/scripts/cli/commands/change/ChangeCommand.js.map +1 -0
- package/dist/scripts/cli/commands/config/CiInitCommand.js +144 -0
- package/dist/scripts/cli/commands/config/CiInitCommand.js.map +1 -0
- package/dist/scripts/cli/commands/config/CompletionCommand.js +160 -0
- package/dist/scripts/cli/commands/config/CompletionCommand.js.map +1 -0
- package/dist/scripts/cli/commands/config/ConfigInitCommand.js +108 -0
- package/dist/scripts/cli/commands/config/ConfigInitCommand.js.map +1 -0
- package/dist/scripts/cli/commands/config/ConfigSetCommand.js +166 -0
- package/dist/scripts/cli/commands/config/ConfigSetCommand.js.map +1 -0
- package/dist/scripts/cli/commands/config/GenAgentContractCommand.js +212 -0
- package/dist/scripts/cli/commands/config/GenAgentContractCommand.js.map +1 -0
- package/dist/scripts/cli/commands/harness/RunCommand.js +1922 -0
- package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -0
- package/dist/scripts/cli/commands/mcp/McpInstallCommand.js +114 -0
- package/dist/scripts/cli/commands/mcp/McpInstallCommand.js.map +1 -0
- package/dist/scripts/cli/commands/mcp/index.js +29 -0
- package/dist/scripts/cli/commands/mcp/index.js.map +1 -0
- package/dist/scripts/cli/commands/pack/BundlePackCommand.js +59 -0
- package/dist/scripts/cli/commands/pack/BundlePackCommand.js.map +1 -0
- package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js +559 -0
- package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js.map +1 -0
- package/dist/scripts/cli/commands/pack/InferPackCommand.js +304 -0
- package/dist/scripts/cli/commands/pack/InferPackCommand.js.map +1 -0
- package/dist/scripts/cli/commands/pack/InitPackCommand.js +368 -0
- package/dist/scripts/cli/commands/pack/InitPackCommand.js.map +1 -0
- package/dist/scripts/cli/commands/pack/LintPackCommand.js +631 -0
- package/dist/scripts/cli/commands/pack/LintPackCommand.js.map +1 -0
- package/dist/scripts/cli/commands/pack/pack-args.js +83 -0
- package/dist/scripts/cli/commands/pack/pack-args.js.map +1 -0
- package/dist/scripts/cli/commands/project/AdoptCommand.js +414 -0
- package/dist/scripts/cli/commands/project/AdoptCommand.js.map +1 -0
- package/dist/scripts/cli/commands/project/InitFromPackCommand.js +188 -0
- package/dist/scripts/cli/commands/project/InitFromPackCommand.js.map +1 -0
- package/dist/scripts/cli/commands/project/InitProjectCommand.js +791 -0
- package/dist/scripts/cli/commands/project/InitProjectCommand.js.map +1 -0
- package/dist/scripts/cli/commands/project/OnboardCommand.js +655 -0
- package/dist/scripts/cli/commands/project/OnboardCommand.js.map +1 -0
- package/dist/scripts/cli/commands/project/UpdateCommand.js +206 -0
- package/dist/scripts/cli/commands/project/UpdateCommand.js.map +1 -0
- package/dist/scripts/cli/commands/project/WizardCommand.js +166 -0
- package/dist/scripts/cli/commands/project/WizardCommand.js.map +1 -0
- package/dist/scripts/cli/commands/quality/DoctorCommand.js +553 -0
- package/dist/scripts/cli/commands/quality/DoctorCommand.js.map +1 -0
- package/dist/scripts/cli/commands/quality/FixCommand.js +201 -0
- package/dist/scripts/cli/commands/quality/FixCommand.js.map +1 -0
- package/dist/scripts/cli/commands/quality/LicenseCheckCommand.js +187 -0
- package/dist/scripts/cli/commands/quality/LicenseCheckCommand.js.map +1 -0
- package/dist/scripts/cli/commands/quality/ReportCommand.js +557 -0
- package/dist/scripts/cli/commands/quality/ReportCommand.js.map +1 -0
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js +764 -0
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/DoneCommand.js +116 -0
- package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/PlanCommand.js +397 -0
- package/dist/scripts/cli/commands/spec/PlanCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/ReqCommand.js +303 -0
- package/dist/scripts/cli/commands/spec/ReqCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/StatusCommand.js +206 -0
- package/dist/scripts/cli/commands/spec/StatusCommand.js.map +1 -0
- package/dist/scripts/cli/commands/spec/StudioCommand.js +241 -0
- package/dist/scripts/cli/commands/spec/StudioCommand.js.map +1 -0
- package/dist/scripts/cli/commands/specops/ContributeCommand.js +313 -0
- package/dist/scripts/cli/commands/specops/ContributeCommand.js.map +1 -0
- package/dist/scripts/cli/commands/specops/DiffCommand.js +394 -0
- package/dist/scripts/cli/commands/specops/DiffCommand.js.map +1 -0
- package/dist/scripts/cli/commands/specops/SyncCommand.js +380 -0
- package/dist/scripts/cli/commands/specops/SyncCommand.js.map +1 -0
- package/dist/scripts/completion.js +24 -0
- package/dist/scripts/completion.js.map +1 -0
- package/dist/scripts/config_init.js +12 -0
- package/dist/scripts/config_init.js.map +1 -0
- package/dist/scripts/config_set.js +20 -0
- package/dist/scripts/config_set.js.map +1 -0
- package/dist/scripts/docs/blocks.js +137 -0
- package/dist/scripts/docs/blocks.js.map +1 -0
- package/dist/scripts/docs/build-site.js +425 -0
- package/dist/scripts/docs/build-site.js.map +1 -0
- package/dist/scripts/docs/nav.js +198 -0
- package/dist/scripts/docs/nav.js.map +1 -0
- package/dist/scripts/docs/record-terminal.js +477 -0
- package/dist/scripts/docs/record-terminal.js.map +1 -0
- package/dist/scripts/docs/terminal-storyboard.js +121 -0
- package/dist/scripts/docs/terminal-storyboard.js.map +1 -0
- package/dist/scripts/doctor.js +14 -0
- package/dist/scripts/doctor.js.map +1 -0
- package/dist/scripts/done.js +17 -0
- package/dist/scripts/done.js.map +1 -0
- package/dist/scripts/expand_domain_pack.js +18 -0
- package/dist/scripts/expand_domain_pack.js.map +1 -0
- package/dist/scripts/fix.js +12 -0
- package/dist/scripts/fix.js.map +1 -0
- package/dist/scripts/gen_agent_contract.js +14 -0
- package/dist/scripts/gen_agent_contract.js.map +1 -0
- package/dist/scripts/gen_mcp_tools.js +264 -0
- package/dist/scripts/gen_mcp_tools.js.map +1 -0
- package/dist/scripts/harness/init.js +358 -0
- package/dist/scripts/harness/init.js.map +1 -0
- package/dist/scripts/harness/prompt.js +18 -0
- package/dist/scripts/harness/prompt.js.map +1 -0
- package/dist/scripts/harness/report.js +323 -0
- package/dist/scripts/harness/report.js.map +1 -0
- package/dist/scripts/harness/run.js +33 -0
- package/dist/scripts/harness/run.js.map +1 -0
- package/dist/scripts/infer_pack.js +17 -0
- package/dist/scripts/infer_pack.js.map +1 -0
- package/dist/scripts/init_from_pack.js +16 -0
- package/dist/scripts/init_from_pack.js.map +1 -0
- package/dist/scripts/init_pack.js +16 -0
- package/dist/scripts/init_pack.js.map +1 -0
- package/dist/scripts/init_project.js +17 -0
- package/dist/scripts/init_project.js.map +1 -0
- package/dist/scripts/lib/agent.js +99 -0
- package/dist/scripts/lib/agent.js.map +1 -0
- package/dist/scripts/lib/capability-specs.js +80 -0
- package/dist/scripts/lib/capability-specs.js.map +1 -0
- package/dist/scripts/lib/command.js +17 -0
- package/dist/scripts/lib/command.js.map +1 -0
- package/dist/scripts/lib/diagnostics.js +62 -0
- package/dist/scripts/lib/diagnostics.js.map +1 -0
- package/dist/scripts/lib/monorepo-fanout.js +118 -0
- package/dist/scripts/lib/monorepo-fanout.js.map +1 -0
- package/dist/scripts/lib/placeholders.js +190 -0
- package/dist/scripts/lib/placeholders.js.map +1 -0
- package/dist/scripts/lib/project-root.js +124 -0
- package/dist/scripts/lib/project-root.js.map +1 -0
- package/dist/scripts/lib/requirement-graph.js +31 -0
- package/dist/scripts/lib/requirement-graph.js.map +1 -0
- package/dist/scripts/lib/surface.js +609 -0
- package/dist/scripts/lib/surface.js.map +1 -0
- package/dist/scripts/license_check.js +15 -0
- package/dist/scripts/license_check.js.map +1 -0
- package/dist/scripts/lint_pack.js +18 -0
- package/dist/scripts/lint_pack.js.map +1 -0
- package/dist/scripts/merge-traceability.js +106 -0
- package/dist/scripts/merge-traceability.js.map +1 -0
- package/dist/scripts/onboard.js +22 -0
- package/dist/scripts/onboard.js.map +1 -0
- package/dist/scripts/plan.js +17 -0
- package/dist/scripts/plan.js.map +1 -0
- package/dist/scripts/plugin/gate-hook.js +171 -0
- package/dist/scripts/plugin/gate-hook.js.map +1 -0
- package/dist/scripts/report.js +17 -0
- package/dist/scripts/report.js.map +1 -0
- package/dist/scripts/req.js +22 -0
- package/dist/scripts/req.js.map +1 -0
- package/dist/scripts/schema/cli.js +215 -0
- package/dist/scripts/schema/cli.js.map +1 -0
- package/dist/scripts/schema/registry.js +264 -0
- package/dist/scripts/schema/registry.js.map +1 -0
- package/dist/scripts/specops/add.js +180 -0
- package/dist/scripts/specops/add.js.map +1 -0
- package/dist/scripts/specops/against_lock.js +100 -0
- package/dist/scripts/specops/against_lock.js.map +1 -0
- package/dist/scripts/specops/as_change.js +49 -0
- package/dist/scripts/specops/as_change.js.map +1 -0
- package/dist/scripts/specops/contribute.js +24 -0
- package/dist/scripts/specops/contribute.js.map +1 -0
- package/dist/scripts/specops/diff.js +32 -0
- package/dist/scripts/specops/diff.js.map +1 -0
- package/dist/scripts/specops/lock.js +39 -0
- package/dist/scripts/specops/lock.js.map +1 -0
- package/dist/scripts/specops/manifest.js +90 -0
- package/dist/scripts/specops/manifest.js.map +1 -0
- package/dist/scripts/specops/remove.js +102 -0
- package/dist/scripts/specops/remove.js.map +1 -0
- package/dist/scripts/specops/sync.js +27 -0
- package/dist/scripts/specops/sync.js.map +1 -0
- package/dist/scripts/specops/verify.js +149 -0
- package/dist/scripts/specops/verify.js.map +1 -0
- package/dist/scripts/status.js +17 -0
- package/dist/scripts/status.js.map +1 -0
- package/dist/scripts/studio.js +14 -0
- package/dist/scripts/studio.js.map +1 -0
- package/dist/scripts/update.js +17 -0
- package/dist/scripts/update.js.map +1 -0
- package/dist/scripts/validate_specs.js +10 -0
- package/dist/scripts/validate_specs.js.map +1 -0
- package/examples/project.config.example +19 -0
- package/examples/project.yaml.example +17 -0
- package/package.json +105 -0
- package/templates/adopt/AI_RULES.md.tpl +27 -0
- package/templates/adopt/adr-readme.md.tpl +5 -0
- package/templates/adopt/baseline.feature.tpl +9 -0
- package/templates/adopt/spec.md.tpl +25 -0
- package/templates/adopt/traceability.md.tpl +11 -0
- package/templates/backend/AI_RULES.md.tpl +35 -0
- package/templates/backend/features/core/health.feature.tpl +7 -0
- package/templates/base/.devcontainer/devcontainer.json.tpl +18 -0
- package/templates/base/.dockerignore.tpl +11 -0
- package/templates/base/.env.dev.app.tpl +13 -0
- package/templates/base/.env.dev.infra.tpl +6 -0
- package/templates/base/.env.dev.tpl +16 -0
- package/templates/base/.env.example.tpl +17 -0
- package/templates/base/.env.feature.app.tpl +11 -0
- package/templates/base/.env.feature.infra.tpl +4 -0
- package/templates/base/.env.feature.tpl +16 -0
- package/templates/base/.env.prod.app.tpl +13 -0
- package/templates/base/.env.prod.infra.tpl +6 -0
- package/templates/base/.env.prod.tpl +16 -0
- package/templates/base/.github/workflows/specs.yml.tpl +26 -0
- package/templates/base/.gitignore.tpl +9 -0
- package/templates/base/.pre-commit-config.yaml.tpl +10 -0
- package/templates/base/AGENTS.md.tpl +32 -0
- package/templates/base/README.md.tpl +32 -0
- package/templates/base/docker-compose.yml.tpl +13 -0
- package/templates/base/docs/specs/adr/README.md.tpl +10 -0
- package/templates/base/docs/specs/aggregates.md.tpl +5 -0
- package/templates/base/docs/specs/commands.md.tpl +13 -0
- package/templates/base/docs/specs/domain-model.md.tpl +30 -0
- package/templates/base/docs/specs/events.md.tpl +5 -0
- package/templates/base/docs/specs/review-checklist.md.tpl +18 -0
- package/templates/base/docs/specs/runtime-environments.md.tpl +26 -0
- package/templates/base/docs/specs/status-model.md.tpl +16 -0
- package/templates/base/docs/specs/traceability.md.tpl +7 -0
- package/templates/base/docs/specs/use-cases.md.tpl +5 -0
- package/templates/base/spec.md.tpl +63 -0
- package/templates/ci/azure.yml.tpl +40 -0
- package/templates/ci/github.yml.tpl +40 -0
- package/templates/ci/gitlab.yml.tpl +21 -0
- package/templates/ci/jenkins.tpl +35 -0
- package/templates/contracts/AI_RULES.md.tpl +55 -0
- package/templates/contracts/asyncapi-stub.yaml.tpl +24 -0
- package/templates/contracts/contract-traceability.md.tpl +10 -0
- package/templates/contracts/openapi-stub.yaml.tpl +29 -0
- package/templates/contracts/pacts-gitkeep.tpl +0 -0
- package/templates/contracts/test-strategy.md.tpl +94 -0
- package/templates/frontend/AI_RULES.md.tpl +34 -0
- package/templates/frontend/features/core/health.feature.tpl +6 -0
- package/templates/harness/harness.config.yaml.tpl +74 -0
- package/templates/harness/prompt-prefix.md.tpl +60 -0
- package/templates/mobile/AI_RULES.md.tpl +56 -0
- package/templates/mobile/features/core/health.feature.tpl +7 -0
- package/templates/modules/auth/backend/registration_and_login.feature.tpl +10 -0
- package/templates/modules/auth/frontend/login.feature.tpl +5 -0
- package/templates/modules/billing/backend/billing_settlement.feature.tpl +5 -0
- package/templates/modules/billing/frontend/billing_summary.feature.tpl +5 -0
- package/templates/modules/dashboard/backend/dashboard_kpi.feature.tpl +5 -0
- package/templates/modules/dashboard/frontend/dashboard.feature.tpl +5 -0
- package/vendor/mermaid.min.js +3636 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitPackCommand.js","sourceRoot":"","sources":["../../../../../scripts/cli/commands/pack/InitPackCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,8BAuBC;AAED,0BAKC;AAED,wEAwFC;AAED,wDAkEC;AAED,sCAGC;AAED,oCAwBC;AA5QD,4EAA4E;AAC5E,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,0BAA0B;AAC1B,4CAA8B;AAC9B,gDAAkC;AAClC,wDAA0C;AAC1C,kDAAmD;AAEnD,MAAM,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AAC5F,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,aAAa,CAAC,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YACrD,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACpC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,OAAO,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,KAAK,IAAI;YACnC,wBAAwB,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,KAAK,iBAAiB;YAC/D,yBAAyB;YACzB,YAAY,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,mCAAmC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAI,CAAC,WAAW,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;YACzH,iCAAiC;YACjC,YAAY,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,gCAAgC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAI,CAAC,WAAW,IAAI,IAAI,IAAI,CAAC,IAAI,8FAA8F,CACnN,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF;AAnED,0CAmEC"}
|
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.LintPackCommand = exports.isGenericTitle = void 0;
|
|
37
|
+
exports.parseArgs = parseArgs;
|
|
38
|
+
exports.parseFeature = parseFeature;
|
|
39
|
+
exports.lintScenarioQuality = lintScenarioQuality;
|
|
40
|
+
exports.runLint = runLint;
|
|
41
|
+
exports.buildPackGraph = buildPackGraph;
|
|
42
|
+
exports.renderMermaid = renderMermaid;
|
|
43
|
+
exports.renderDot = renderDot;
|
|
44
|
+
const fs = __importStar(require("node:fs"));
|
|
45
|
+
const path = __importStar(require("node:path"));
|
|
46
|
+
const DiskPackRepository_1 = require("../../../../packages/core/src/infrastructure/DiskPackRepository");
|
|
47
|
+
const PackSpec_1 = require("../../../../packages/core/src/domain/PackSpec");
|
|
48
|
+
const command_1 = require("../../../lib/command");
|
|
49
|
+
const Gherkin_1 = require("../../../../packages/core/src/domain/Gherkin");
|
|
50
|
+
const GherkinQuality_1 = require("../../../../packages/core/src/domain/GherkinQuality");
|
|
51
|
+
const agent_1 = require("../../../lib/agent");
|
|
52
|
+
const diagnostics_1 = require("../../../lib/diagnostics");
|
|
53
|
+
function logInfo(msg) {
|
|
54
|
+
process.stdout.write(`ℹ️ [INFO] ${msg}\n`);
|
|
55
|
+
}
|
|
56
|
+
function logWarn(msg) {
|
|
57
|
+
process.stdout.write(`⚠️ [WARN] ${msg}\n`);
|
|
58
|
+
}
|
|
59
|
+
function logError(msg) {
|
|
60
|
+
process.stderr.write(`❌ [ERROR] ${msg}\n`);
|
|
61
|
+
}
|
|
62
|
+
function usage() {
|
|
63
|
+
process.stdout.write("Usage:\n" +
|
|
64
|
+
" specgate pack lint --pack-root <path> --pack <domain/type> [--strict]\n" +
|
|
65
|
+
" specgate pack lint --pack-root <path> --pack <domain/type> --graph [--graph-format mermaid|dot]\n\n" +
|
|
66
|
+
"Options:\n" +
|
|
67
|
+
" --pack-root Root directory containing domain packs (required)\n" +
|
|
68
|
+
" --pack Pack identifier, e.g. parking-management/backend (required)\n" +
|
|
69
|
+
" --strict Promote scenario-quality warnings to errors. Use in CI and\n" +
|
|
70
|
+
" before a pack feeds `harness run` — a weak scenario is a\n" +
|
|
71
|
+
" weak reward signal.\n" +
|
|
72
|
+
" --graph Print the REQ→UC→AGG/EVT/CMD reference graph instead of the\n" +
|
|
73
|
+
" lint report. Broken references are highlighted and listed;\n" +
|
|
74
|
+
" exits non-zero when any reference is dangling.\n" +
|
|
75
|
+
" --graph-format Graph output format: mermaid (default) or dot.\n");
|
|
76
|
+
}
|
|
77
|
+
function parseArgs(argv) {
|
|
78
|
+
const opts = {
|
|
79
|
+
packRoot: null,
|
|
80
|
+
packId: null,
|
|
81
|
+
strict: false,
|
|
82
|
+
graph: false,
|
|
83
|
+
graphFormat: "mermaid",
|
|
84
|
+
json: (0, agent_1.wantsJson)(argv),
|
|
85
|
+
};
|
|
86
|
+
for (let i = 0; i < argv.length; i++) {
|
|
87
|
+
const a = argv[i];
|
|
88
|
+
if (a === "--pack-root" && argv[i + 1]) {
|
|
89
|
+
opts.packRoot = argv[++i];
|
|
90
|
+
}
|
|
91
|
+
else if (a === "--pack" && argv[i + 1]) {
|
|
92
|
+
opts.packId = argv[++i];
|
|
93
|
+
}
|
|
94
|
+
else if (a === "--strict") {
|
|
95
|
+
opts.strict = true;
|
|
96
|
+
}
|
|
97
|
+
else if (a === "--graph") {
|
|
98
|
+
opts.graph = true;
|
|
99
|
+
}
|
|
100
|
+
else if (a === "--graph-format" && argv[i + 1]) {
|
|
101
|
+
opts.graphFormat = argv[++i];
|
|
102
|
+
}
|
|
103
|
+
else if (a === "--json") {
|
|
104
|
+
opts.json = true;
|
|
105
|
+
}
|
|
106
|
+
else if (a === "--format" && argv[i + 1] === "json") {
|
|
107
|
+
opts.json = true;
|
|
108
|
+
i++;
|
|
109
|
+
}
|
|
110
|
+
else if (a === "--help" || a === "-h") {
|
|
111
|
+
usage();
|
|
112
|
+
process.exit(0);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (!["mermaid", "dot"].includes(opts.graphFormat)) {
|
|
116
|
+
logError(`Invalid --graph-format: ${opts.graphFormat}. Expected: mermaid | dot.`);
|
|
117
|
+
process.exit(2);
|
|
118
|
+
}
|
|
119
|
+
return opts;
|
|
120
|
+
}
|
|
121
|
+
const NULL_SHAPE = { pack: null, packRoot: null, graph: null };
|
|
122
|
+
function lintTodos(pack, errors, warnings) {
|
|
123
|
+
const yaml = JSON.stringify(pack);
|
|
124
|
+
const count = (yaml.match(/TODO/g) || []).length;
|
|
125
|
+
if (count > 0) {
|
|
126
|
+
warnings.push(`Pack contains ${count} TODO placeholder(s). Replace before shipping.`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function lintRequirementsCoverage(pack, errors, _warnings) {
|
|
130
|
+
const reqIds = new Set((0, PackSpec_1.asArray)(pack.requirements).map((r) => r.id));
|
|
131
|
+
const usedInUC = new Set((0, PackSpec_1.asArray)(pack.use_cases).flatMap((uc) => (0, PackSpec_1.asArray)(uc.requirements || (uc.requirement ? [uc.requirement] : []))));
|
|
132
|
+
const usedInSCN = new Set((0, PackSpec_1.asArray)(pack.scenarios)
|
|
133
|
+
.map((s) => s.requirement)
|
|
134
|
+
.filter(Boolean));
|
|
135
|
+
const usedInAC = new Set((0, PackSpec_1.asArray)(pack.api_contracts)
|
|
136
|
+
.map((ac) => ac.requirement)
|
|
137
|
+
.filter(Boolean));
|
|
138
|
+
const usedInCDT = new Set((0, PackSpec_1.asArray)(pack.consumer_driven_tests)
|
|
139
|
+
.map((cdt) => cdt.requirement)
|
|
140
|
+
.filter(Boolean));
|
|
141
|
+
const usedInBCR = new Set((0, PackSpec_1.asArray)(pack.breaking_change_rules)
|
|
142
|
+
.map((bcr) => bcr.requirement)
|
|
143
|
+
.filter(Boolean));
|
|
144
|
+
for (const id of reqIds) {
|
|
145
|
+
if (!usedInUC.has(id) &&
|
|
146
|
+
!usedInSCN.has(id) &&
|
|
147
|
+
!usedInAC.has(id) &&
|
|
148
|
+
!usedInCDT.has(id) &&
|
|
149
|
+
!usedInBCR.has(id)) {
|
|
150
|
+
errors.push(`REQ ${id} is not referenced by any use case, scenario, api_contract, consumer_driven_test, or breaking_change_rules entry.`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function lintUseCaseActors(pack, _errors, warnings) {
|
|
155
|
+
for (const uc of (0, PackSpec_1.asArray)(pack.use_cases)) {
|
|
156
|
+
if (!uc.actor || uc.actor.trim() === "") {
|
|
157
|
+
warnings.push(`UC ${uc.id} has no actor defined.`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function lintBoundedContextAggregates(pack, errors, _warnings) {
|
|
162
|
+
const bcIds = new Set((0, PackSpec_1.asArray)(pack.bounded_contexts).map((bc) => bc.id));
|
|
163
|
+
for (const agg of (0, PackSpec_1.asArray)(pack.aggregates)) {
|
|
164
|
+
if (agg.bounded_context && !bcIds.has(agg.bounded_context)) {
|
|
165
|
+
errors.push(`Aggregate ${agg.id || agg.name} references unknown bounded_context: ${agg.bounded_context}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function lintEventAggregates(pack, errors, _warnings) {
|
|
170
|
+
const aggNames = new Set((0, PackSpec_1.asArray)(pack.aggregates).map((a) => a.name));
|
|
171
|
+
for (const evt of (0, PackSpec_1.asArray)(pack.events)) {
|
|
172
|
+
if (evt.aggregate && aggNames.size > 0 && !aggNames.has(evt.aggregate)) {
|
|
173
|
+
errors.push(`Event ${evt.id || evt.name} references unknown aggregate: ${evt.aggregate}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function lintScenarioRefs(pack, errors, _warnings) {
|
|
178
|
+
const reqIds = new Set((0, PackSpec_1.asArray)(pack.requirements).map((r) => r.id));
|
|
179
|
+
const ucIds = new Set((0, PackSpec_1.asArray)(pack.use_cases).map((uc) => uc.id));
|
|
180
|
+
for (const scn of (0, PackSpec_1.asArray)(pack.scenarios)) {
|
|
181
|
+
if (scn.requirement && !reqIds.has(scn.requirement)) {
|
|
182
|
+
errors.push(`Scenario ${scn.id} references unknown requirement: ${scn.requirement}`);
|
|
183
|
+
}
|
|
184
|
+
if (scn.use_case && !ucIds.has(scn.use_case)) {
|
|
185
|
+
errors.push(`Scenario ${scn.id} references unknown use_case: ${scn.use_case}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function lintRuleContextRefs(pack, _errors, warnings) {
|
|
190
|
+
const bcIds = new Set((0, PackSpec_1.asArray)(pack.bounded_contexts).map((bc) => bc.id));
|
|
191
|
+
for (const rule of (0, PackSpec_1.asArray)(pack.rules)) {
|
|
192
|
+
if (rule.context && bcIds.size > 0 && !bcIds.has(rule.context)) {
|
|
193
|
+
warnings.push(`Rule ${rule.id} context '${rule.context}' does not match any bounded_context id.`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function lintIdUniqueness(pack, errors, _warnings) {
|
|
198
|
+
const sections = [
|
|
199
|
+
"requirements",
|
|
200
|
+
"use_cases",
|
|
201
|
+
"bounded_contexts",
|
|
202
|
+
"aggregates",
|
|
203
|
+
"value_objects",
|
|
204
|
+
"events",
|
|
205
|
+
"rules",
|
|
206
|
+
"scenarios",
|
|
207
|
+
"commands",
|
|
208
|
+
];
|
|
209
|
+
for (const section of sections) {
|
|
210
|
+
const items = (0, PackSpec_1.asArray)(pack[section]);
|
|
211
|
+
const seen = new Set();
|
|
212
|
+
for (const item of items) {
|
|
213
|
+
if (!item.id)
|
|
214
|
+
continue;
|
|
215
|
+
if (seen.has(item.id)) {
|
|
216
|
+
errors.push(`Duplicate id '${item.id}' in ${section}.`);
|
|
217
|
+
}
|
|
218
|
+
seen.add(item.id);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function lintVariables(pack, errors, _warnings) {
|
|
223
|
+
const required = (0, PackSpec_1.asArray)(pack.variables && pack.variables.required);
|
|
224
|
+
for (const v of required) {
|
|
225
|
+
if (typeof v !== "string" || !/^[A-Z][A-Z0-9_]*$/.test(v)) {
|
|
226
|
+
errors.push(`Variable '${v}' must be UPPER_SNAKE_CASE.`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* What `pack lint` reads out of a `.feature` template.
|
|
232
|
+
*
|
|
233
|
+
* Delegates to `parseGherkin`, the one reader in this repository (F1). This is
|
|
234
|
+
* the parser that shipped H14: it matched keywords case-insensitively, so it
|
|
235
|
+
* saw three steps in a scenario where Cucumber saw none and reported the pack
|
|
236
|
+
* as fine. A linter that approves what the runner ignores is worse than no
|
|
237
|
+
* linter, because it grants a guarantee that does not exist.
|
|
238
|
+
*
|
|
239
|
+
* Reading through the shared parser makes the linter case-sensitive, which is
|
|
240
|
+
* the whole point: it now judges the file the runner will actually execute.
|
|
241
|
+
*/
|
|
242
|
+
function parseFeature(content) {
|
|
243
|
+
return (0, Gherkin_1.parseGherkin)(content).scenarios.map((scenario) => ({
|
|
244
|
+
outline: scenario.outline,
|
|
245
|
+
title: scenario.name,
|
|
246
|
+
steps: scenario.steps.map((step) => ({ keyword: step.keyword, text: step.text })),
|
|
247
|
+
hasExamples: scenario.hasExamples,
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
/** Re-exported so `pack lint`'s public surface is unchanged; the rule is in the domain. */
|
|
251
|
+
exports.isGenericTitle = GherkinQuality_1.isGenericTitle;
|
|
252
|
+
/**
|
|
253
|
+
* The eight quality rules, applied to one scenario.
|
|
254
|
+
*
|
|
255
|
+
* The rules themselves moved to `GherkinQuality` in the domain (A3) so that
|
|
256
|
+
* `validate`, `doctor` and `harness run` judge a scenario the same way this
|
|
257
|
+
* does. What stays here is delivery: which bucket a finding lands in and how
|
|
258
|
+
* the line reads. `errors` fail the lint; `scenarioIssues` are reported and
|
|
259
|
+
* only fail under `--strict`.
|
|
260
|
+
*
|
|
261
|
+
* Severity comes from the rule, never from the caller — `scenario_has_no_steps`
|
|
262
|
+
* is an error wherever it is raised, which is the correction H14 forced.
|
|
263
|
+
*/
|
|
264
|
+
function checkGherkin(where, gherkin, errors, scenarioIssues) {
|
|
265
|
+
const findings = (0, GherkinQuality_1.analyseScenario)({
|
|
266
|
+
name: gherkin.title || "",
|
|
267
|
+
steps: gherkin.steps,
|
|
268
|
+
outline: Boolean(gherkin.outline),
|
|
269
|
+
hasExamples: Boolean(gherkin.hasExamples),
|
|
270
|
+
}, where);
|
|
271
|
+
for (const finding of findings) {
|
|
272
|
+
// The message carries its own code where the code is worth reading aloud
|
|
273
|
+
// (`scenario_has_no_steps`); the rest read as prose. Preserved verbatim:
|
|
274
|
+
// this extraction changes where the rules live, not what a user sees.
|
|
275
|
+
const line = `${where}: ${finding.message}`;
|
|
276
|
+
if (finding.severity === "error")
|
|
277
|
+
errors.push(line);
|
|
278
|
+
else
|
|
279
|
+
scenarioIssues.push(line);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function inlineGherkin(scn) {
|
|
283
|
+
const steps = [];
|
|
284
|
+
for (const keyword of ["given", "when", "then"]) {
|
|
285
|
+
for (const text of (0, PackSpec_1.asArray)(scn[keyword])) {
|
|
286
|
+
if (typeof text === "string" && text.trim())
|
|
287
|
+
steps.push({ keyword, text: text.trim() });
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return { title: scn.title || scn.scenario || "", steps, outline: false, hasExamples: true };
|
|
291
|
+
}
|
|
292
|
+
function lintScenarioQuality(pack, packRoot, errors, scenarioIssues) {
|
|
293
|
+
for (const scn of (0, PackSpec_1.asArray)(pack.scenarios)) {
|
|
294
|
+
const label = scn.id || scn.title || scn.scenario || "(unnamed scenario)";
|
|
295
|
+
if (!scn.template && (scn.given || scn.when || scn.then)) {
|
|
296
|
+
checkGherkin(`${label} → "${scn.title || "(no title)"}"`, inlineGherkin(scn), errors, scenarioIssues);
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (!scn.template) {
|
|
300
|
+
scenarioIssues.push(`Scenario ${label} declares no scenario content (template file or given/when/then).`);
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
const templatePath = path.resolve(packRoot, scn.template);
|
|
304
|
+
if (!fs.existsSync(templatePath)) {
|
|
305
|
+
errors.push(`Scenario ${label} template not found: ${scn.template}`);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
const templateSource = fs.readFileSync(templatePath, "utf8");
|
|
309
|
+
// `keyword_case_invalid` — an error, always. Cucumber discards these lines
|
|
310
|
+
// in silence, which is precisely what makes them dangerous: the file looks
|
|
311
|
+
// like it has steps and behaves as if it has none. Named with the literal
|
|
312
|
+
// correction, because "it must be `Given`" is a fix and "no steps found" is
|
|
313
|
+
// a riddle.
|
|
314
|
+
for (const finding of (0, GherkinQuality_1.analyseKeywordCase)(templateSource, scn.template)) {
|
|
315
|
+
errors.push(`${finding.file}:${finding.line}: ${finding.code} — ${finding.message}`);
|
|
316
|
+
}
|
|
317
|
+
const parsed = parseFeature(templateSource);
|
|
318
|
+
if (parsed.length === 0) {
|
|
319
|
+
scenarioIssues.push(`Scenario ${label} (${scn.template}) contains no Gherkin scenario.`);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
for (const gherkin of parsed) {
|
|
323
|
+
checkGherkin(`${label} → "${gherkin.title || "(no title)"}"`, gherkin, errors, scenarioIssues);
|
|
324
|
+
}
|
|
325
|
+
if (scn.scenario &&
|
|
326
|
+
parsed.length === 1 &&
|
|
327
|
+
parsed[0].title &&
|
|
328
|
+
scn.scenario.trim() !== parsed[0].title.trim()) {
|
|
329
|
+
scenarioIssues.push(`${label}: pack.yaml scenario "${scn.scenario}" does not match template title "${parsed[0].title}".`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function lintInstallable(pack, packRoot, errors, _warnings) {
|
|
334
|
+
try {
|
|
335
|
+
(0, DiskPackRepository_1.validatePackModel)(pack, packRoot);
|
|
336
|
+
}
|
|
337
|
+
catch (err) {
|
|
338
|
+
errors.push(`Pack cannot be installed: ${err.message} ` +
|
|
339
|
+
"(`expand` enforces this, so lint has to as well)");
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function runLint(pack, packRoot, opts = {}) {
|
|
343
|
+
const errors = [];
|
|
344
|
+
const warnings = [];
|
|
345
|
+
const scenarioIssues = [];
|
|
346
|
+
lintInstallable(pack, packRoot, errors, warnings);
|
|
347
|
+
lintTodos(pack, errors, warnings);
|
|
348
|
+
lintIdUniqueness(pack, errors, warnings);
|
|
349
|
+
lintVariables(pack, errors, warnings);
|
|
350
|
+
lintRequirementsCoverage(pack, errors, warnings);
|
|
351
|
+
lintUseCaseActors(pack, errors, warnings);
|
|
352
|
+
lintBoundedContextAggregates(pack, errors, warnings);
|
|
353
|
+
lintEventAggregates(pack, errors, warnings);
|
|
354
|
+
lintScenarioRefs(pack, errors, warnings);
|
|
355
|
+
lintRuleContextRefs(pack, errors, warnings);
|
|
356
|
+
lintScenarioQuality(pack, packRoot, errors, scenarioIssues);
|
|
357
|
+
if (opts.strict) {
|
|
358
|
+
errors.push(...scenarioIssues);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
warnings.push(...scenarioIssues);
|
|
362
|
+
}
|
|
363
|
+
return { errors, warnings };
|
|
364
|
+
}
|
|
365
|
+
function buildPackGraph(pack) {
|
|
366
|
+
const nodes = [];
|
|
367
|
+
const edges = [];
|
|
368
|
+
const broken = [];
|
|
369
|
+
const seen = new Set();
|
|
370
|
+
function addNode(id, type, label) {
|
|
371
|
+
if (seen.has(id))
|
|
372
|
+
return;
|
|
373
|
+
seen.add(id);
|
|
374
|
+
nodes.push({ id, type, label });
|
|
375
|
+
}
|
|
376
|
+
function addEdge(from, to, kind) {
|
|
377
|
+
edges.push({ from, to, kind });
|
|
378
|
+
}
|
|
379
|
+
function missingNode(kind, ref) {
|
|
380
|
+
const id = `MISSING:${kind}:${ref}`;
|
|
381
|
+
addNode(id, "missing", ref);
|
|
382
|
+
return id;
|
|
383
|
+
}
|
|
384
|
+
const requirements = (0, PackSpec_1.asArray)(pack.requirements);
|
|
385
|
+
const useCases = (0, PackSpec_1.asArray)(pack.use_cases);
|
|
386
|
+
const commands = (0, PackSpec_1.asArray)(pack.commands);
|
|
387
|
+
const queries = (0, PackSpec_1.asArray)(pack.queries);
|
|
388
|
+
const aggregates = (0, PackSpec_1.asArray)(pack.aggregates);
|
|
389
|
+
const events = (0, PackSpec_1.asArray)(pack.events);
|
|
390
|
+
const reqById = new Map(requirements.filter((r) => r.id).map((r) => [r.id, r]));
|
|
391
|
+
const cmdByKey = new Map();
|
|
392
|
+
for (const c of commands) {
|
|
393
|
+
if (c.id)
|
|
394
|
+
cmdByKey.set(c.id, c);
|
|
395
|
+
if (c.name)
|
|
396
|
+
cmdByKey.set(c.name, c);
|
|
397
|
+
}
|
|
398
|
+
const queryByKey = new Map();
|
|
399
|
+
for (const q of queries) {
|
|
400
|
+
if (q.id)
|
|
401
|
+
queryByKey.set(q.id, q);
|
|
402
|
+
if (q.name)
|
|
403
|
+
queryByKey.set(q.name, q);
|
|
404
|
+
}
|
|
405
|
+
const aggByKey = new Map();
|
|
406
|
+
for (const a of aggregates) {
|
|
407
|
+
if (a.id)
|
|
408
|
+
aggByKey.set(a.id, a);
|
|
409
|
+
if (a.name)
|
|
410
|
+
aggByKey.set(a.name, a);
|
|
411
|
+
}
|
|
412
|
+
const evtByKey = new Map();
|
|
413
|
+
for (const e of events) {
|
|
414
|
+
if (e.id)
|
|
415
|
+
evtByKey.set(e.id, e);
|
|
416
|
+
if (e.name)
|
|
417
|
+
evtByKey.set(e.name, e);
|
|
418
|
+
}
|
|
419
|
+
const nodeId = {
|
|
420
|
+
req: (r) => `REQ:${r.id}`,
|
|
421
|
+
uc: (u) => `UC:${u.id}`,
|
|
422
|
+
cmd: (c) => `CMD:${c.id || c.name}`,
|
|
423
|
+
query: (q) => `QUERY:${q.id || q.name}`,
|
|
424
|
+
agg: (a) => `AGG:${a.id || a.name}`,
|
|
425
|
+
evt: (e) => `EVT:${e.id || e.name}`,
|
|
426
|
+
};
|
|
427
|
+
const labelOf = (entity, fallback) => {
|
|
428
|
+
if (entity.id && entity.name)
|
|
429
|
+
return `${entity.id} ${entity.name}`;
|
|
430
|
+
return entity.id || entity.name || fallback;
|
|
431
|
+
};
|
|
432
|
+
for (const r of requirements)
|
|
433
|
+
addNode(nodeId.req(r), "requirement", r.id || "(no id)");
|
|
434
|
+
for (const u of useCases)
|
|
435
|
+
addNode(nodeId.uc(u), "use_case", labelOf(u, "(use case)"));
|
|
436
|
+
for (const c of commands)
|
|
437
|
+
addNode(nodeId.cmd(c), "command", labelOf(c, "(command)"));
|
|
438
|
+
for (const q of queries)
|
|
439
|
+
addNode(nodeId.query(q), "query", labelOf(q, "(query)"));
|
|
440
|
+
for (const a of aggregates)
|
|
441
|
+
addNode(nodeId.agg(a), "aggregate", labelOf(a, "(aggregate)"));
|
|
442
|
+
for (const e of events)
|
|
443
|
+
addNode(nodeId.evt(e), "event", labelOf(e, "(event)"));
|
|
444
|
+
for (const u of useCases) {
|
|
445
|
+
const from = nodeId.uc(u);
|
|
446
|
+
const label = u.id || u.name || "(use case)";
|
|
447
|
+
const reqRefs = (0, PackSpec_1.asArray)(u.requirements || (u.requirement ? [u.requirement] : []));
|
|
448
|
+
for (const ref of reqRefs) {
|
|
449
|
+
const target = reqById.get(ref);
|
|
450
|
+
if (target) {
|
|
451
|
+
addEdge(nodeId.req(target), from, "implements");
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
broken.push({ from: label, kind: "requirement", ref });
|
|
455
|
+
addEdge(missingNode("requirement", ref), from, "implements");
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
if (u.command) {
|
|
459
|
+
const target = cmdByKey.get(u.command);
|
|
460
|
+
if (target) {
|
|
461
|
+
addEdge(from, nodeId.cmd(target), "dispatches");
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
broken.push({ from: label, kind: "command", ref: u.command });
|
|
465
|
+
addEdge(from, missingNode("command", u.command), "dispatches");
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (u.query) {
|
|
469
|
+
const target = queryByKey.get(u.query);
|
|
470
|
+
if (target) {
|
|
471
|
+
addEdge(from, nodeId.query(target), "runs");
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
broken.push({ from: label, kind: "query", ref: u.query });
|
|
475
|
+
addEdge(from, missingNode("query", u.query), "runs");
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (u.aggregate) {
|
|
479
|
+
const target = aggByKey.get(u.aggregate);
|
|
480
|
+
if (target) {
|
|
481
|
+
addEdge(from, nodeId.agg(target), "handled by");
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
broken.push({ from: label, kind: "aggregate", ref: u.aggregate });
|
|
485
|
+
addEdge(from, missingNode("aggregate", u.aggregate), "handled by");
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
for (const ref of (0, PackSpec_1.asArray)(u.emits)) {
|
|
489
|
+
const target = evtByKey.get(ref);
|
|
490
|
+
if (target) {
|
|
491
|
+
addEdge(from, nodeId.evt(target), "emits");
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
broken.push({ from: label, kind: "event", ref });
|
|
495
|
+
addEdge(from, missingNode("event", ref), "emits");
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return { nodes, edges, broken };
|
|
500
|
+
}
|
|
501
|
+
function sanitizeId(id) {
|
|
502
|
+
return id.replace(/[^A-Za-z0-9]/g, "_");
|
|
503
|
+
}
|
|
504
|
+
function renderMermaid(graph) {
|
|
505
|
+
const lines = ["graph LR"];
|
|
506
|
+
for (const node of graph.nodes) {
|
|
507
|
+
const safe = sanitizeId(node.id);
|
|
508
|
+
const label = node.label.replace(/"/g, "'");
|
|
509
|
+
lines.push(` ${safe}["${label}"]:::${node.type}`);
|
|
510
|
+
}
|
|
511
|
+
for (const edge of graph.edges) {
|
|
512
|
+
lines.push(` ${sanitizeId(edge.from)} -->|${edge.kind}| ${sanitizeId(edge.to)}`);
|
|
513
|
+
}
|
|
514
|
+
lines.push("");
|
|
515
|
+
lines.push(" classDef requirement fill:#e7f5ff,stroke:#1c7ed6;");
|
|
516
|
+
lines.push(" classDef use_case fill:#fff9db,stroke:#f08c00;");
|
|
517
|
+
lines.push(" classDef command fill:#f3f0ff,stroke:#7048e8;");
|
|
518
|
+
lines.push(" classDef query fill:#f3f0ff,stroke:#7048e8;");
|
|
519
|
+
lines.push(" classDef aggregate fill:#ebfbee,stroke:#2f9e44;");
|
|
520
|
+
lines.push(" classDef event fill:#fff0f6,stroke:#c2255c;");
|
|
521
|
+
lines.push(" classDef missing fill:#ff6b6b,stroke:#c92a2a,color:#fff;");
|
|
522
|
+
return lines.join("\n");
|
|
523
|
+
}
|
|
524
|
+
function renderDot(graph) {
|
|
525
|
+
const lines = ["digraph pack {", " rankdir=LR;", " node [shape=box, style=rounded];"];
|
|
526
|
+
const fill = {
|
|
527
|
+
requirement: "#e7f5ff",
|
|
528
|
+
use_case: "#fff9db",
|
|
529
|
+
command: "#f3f0ff",
|
|
530
|
+
query: "#f3f0ff",
|
|
531
|
+
aggregate: "#ebfbee",
|
|
532
|
+
event: "#fff0f6",
|
|
533
|
+
missing: "#ff6b6b",
|
|
534
|
+
};
|
|
535
|
+
for (const node of graph.nodes) {
|
|
536
|
+
const label = node.label.replace(/"/g, "'");
|
|
537
|
+
lines.push(` "${node.id}" [label="${label}", style="rounded,filled", fillcolor="${fill[node.type] || "#ffffff"}"];`);
|
|
538
|
+
}
|
|
539
|
+
for (const edge of graph.edges) {
|
|
540
|
+
lines.push(` "${edge.from}" -> "${edge.to}" [label="${edge.kind}"];`);
|
|
541
|
+
}
|
|
542
|
+
lines.push("}");
|
|
543
|
+
return lines.join("\n");
|
|
544
|
+
}
|
|
545
|
+
function emitGraph(pack, opts) {
|
|
546
|
+
const graph = buildPackGraph(pack);
|
|
547
|
+
const rendered = opts.graphFormat === "dot" ? renderDot(graph) : renderMermaid(graph);
|
|
548
|
+
process.stdout.write(rendered + "\n");
|
|
549
|
+
if (graph.broken.length > 0) {
|
|
550
|
+
logError(`Pack '${opts.packId}' has ${graph.broken.length} dangling reference(s):`);
|
|
551
|
+
for (const b of graph.broken) {
|
|
552
|
+
logError(` ${b.from} references unknown ${b.kind}: ${b.ref}`);
|
|
553
|
+
}
|
|
554
|
+
process.exit(1);
|
|
555
|
+
}
|
|
556
|
+
process.exit(0);
|
|
557
|
+
}
|
|
558
|
+
class LintPackCommand extends command_1.BaseCommand {
|
|
559
|
+
execute() {
|
|
560
|
+
const rawArgs = this.args[0] === "pack" ? this.args.slice(1) : this.args;
|
|
561
|
+
const args = rawArgs[0] === "lint" ? rawArgs.slice(1) : rawArgs;
|
|
562
|
+
const opts = parseArgs(args);
|
|
563
|
+
const io = (0, agent_1.agentIo)(opts.json);
|
|
564
|
+
if (!opts.packRoot || !opts.packId) {
|
|
565
|
+
if (!io.json)
|
|
566
|
+
usage();
|
|
567
|
+
io.usage(NULL_SHAPE, [
|
|
568
|
+
(0, diagnostics_1.error)("pack_args_required", "--pack-root and --pack are required.", {
|
|
569
|
+
fix: "specgate pack lint --pack-root <path> --pack <domain/type>",
|
|
570
|
+
}),
|
|
571
|
+
]);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
let loadResult;
|
|
575
|
+
try {
|
|
576
|
+
loadResult = (0, DiskPackRepository_1.loadPack)(opts.packRoot, opts.packId);
|
|
577
|
+
}
|
|
578
|
+
catch (err) {
|
|
579
|
+
io.fail({ ...NULL_SHAPE, pack: opts.packId }, [
|
|
580
|
+
(0, diagnostics_1.error)("pack_load_failed", `Failed to load pack: ${err.message}`, {
|
|
581
|
+
target: opts.packId,
|
|
582
|
+
fix: "Check --pack-root points at the directory that contains the pack, and --pack at its id.",
|
|
583
|
+
}),
|
|
584
|
+
]);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const { pack, packRoot } = loadResult;
|
|
588
|
+
if (opts.graph) {
|
|
589
|
+
if (io.json) {
|
|
590
|
+
const graph = buildPackGraph(pack);
|
|
591
|
+
const rendered = opts.graphFormat === "dot" ? renderDot(graph) : renderMermaid(graph);
|
|
592
|
+
io.emitAndGate({
|
|
593
|
+
pack: opts.packId,
|
|
594
|
+
packRoot,
|
|
595
|
+
format: opts.graphFormat,
|
|
596
|
+
graph: rendered,
|
|
597
|
+
status: graph.broken.map((b) => (0, diagnostics_1.error)("pack_graph_dangling_reference", `${b.from} references unknown ${b.kind}: ${b.ref}`, {
|
|
598
|
+
target: b.from,
|
|
599
|
+
fix: `Define ${b.ref}, or remove the reference from ${b.from}.`,
|
|
600
|
+
})),
|
|
601
|
+
});
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
emitGraph(pack, opts);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const { errors, warnings } = runLint(pack, packRoot, { strict: opts.strict });
|
|
608
|
+
const status = [
|
|
609
|
+
...warnings.map((w) => (0, diagnostics_1.warning)("pack_lint_warning", w, { target: opts.packId })),
|
|
610
|
+
...errors.map((e) => (0, diagnostics_1.error)("pack_lint_error", e, { target: opts.packId })),
|
|
611
|
+
];
|
|
612
|
+
io.emitAndGate({ pack: opts.packId, packRoot, graph: null, status }, () => {
|
|
613
|
+
for (const w of warnings)
|
|
614
|
+
logWarn(w);
|
|
615
|
+
for (const e of errors)
|
|
616
|
+
logError(e);
|
|
617
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
618
|
+
logInfo(`Pack '${opts.packId}' passed all lint checks.`);
|
|
619
|
+
}
|
|
620
|
+
else if (errors.length === 0) {
|
|
621
|
+
logInfo(`Pack '${opts.packId}' has ${warnings.length} warning(s) but no errors.`);
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
logError(`Pack '${opts.packId}' failed lint with ${errors.length} error(s).`);
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
process.exit(0);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
exports.LintPackCommand = LintPackCommand;
|
|
631
|
+
//# sourceMappingURL=LintPackCommand.js.map
|