@paths.design/caws-cli 10.1.0 → 11.0.0
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 +125 -374
- package/dist/index.js +43 -756
- package/dist/shell/binding/resolve-binding.d.ts +4 -0
- package/dist/shell/binding/resolve-binding.d.ts.map +1 -0
- package/dist/shell/binding/resolve-binding.js +228 -0
- package/dist/shell/binding/resolve-binding.js.map +1 -0
- package/dist/shell/binding/types.d.ts +42 -0
- package/dist/shell/binding/types.d.ts.map +1 -0
- package/dist/shell/binding/types.js +21 -0
- package/dist/shell/binding/types.js.map +1 -0
- package/dist/shell/commands/claim.d.ts +14 -0
- package/dist/shell/commands/claim.d.ts.map +1 -0
- package/dist/shell/commands/claim.js +197 -0
- package/dist/shell/commands/claim.js.map +1 -0
- package/dist/shell/commands/doctor.d.ts +13 -0
- package/dist/shell/commands/doctor.d.ts.map +1 -0
- package/dist/shell/commands/doctor.js +97 -0
- package/dist/shell/commands/doctor.js.map +1 -0
- package/dist/shell/commands/evidence.d.ts +28 -0
- package/dist/shell/commands/evidence.d.ts.map +1 -0
- package/dist/shell/commands/evidence.js +166 -0
- package/dist/shell/commands/evidence.js.map +1 -0
- package/dist/shell/commands/gates.d.ts +19 -0
- package/dist/shell/commands/gates.d.ts.map +1 -0
- package/dist/shell/commands/gates.js +181 -0
- package/dist/shell/commands/gates.js.map +1 -0
- package/dist/shell/commands/init.d.ts +8 -0
- package/dist/shell/commands/init.d.ts.map +1 -0
- package/dist/shell/commands/init.js +64 -0
- package/dist/shell/commands/init.js.map +1 -0
- package/dist/shell/commands/scope.d.ts +11 -0
- package/dist/shell/commands/scope.d.ts.map +1 -0
- package/dist/shell/commands/scope.js +92 -0
- package/dist/shell/commands/scope.js.map +1 -0
- package/dist/shell/commands/status.d.ts +15 -0
- package/dist/shell/commands/status.d.ts.map +1 -0
- package/dist/shell/commands/status.js +106 -0
- package/dist/shell/commands/status.js.map +1 -0
- package/dist/shell/commands/waiver.d.ts +38 -0
- package/dist/shell/commands/waiver.d.ts.map +1 -0
- package/dist/shell/commands/waiver.js +240 -0
- package/dist/shell/commands/waiver.js.map +1 -0
- package/dist/shell/gates/disposition.d.ts +23 -0
- package/dist/shell/gates/disposition.d.ts.map +1 -0
- package/dist/shell/gates/disposition.js +87 -0
- package/dist/shell/gates/disposition.js.map +1 -0
- package/dist/shell/gates/gate-result-contract.d.ts +39 -0
- package/dist/shell/gates/gate-result-contract.d.ts.map +1 -0
- package/dist/shell/gates/gate-result-contract.js +150 -0
- package/dist/shell/gates/gate-result-contract.js.map +1 -0
- package/dist/shell/gates/quality-gates-adapter.d.ts +55 -0
- package/dist/shell/gates/quality-gates-adapter.d.ts.map +1 -0
- package/dist/shell/gates/quality-gates-adapter.js +161 -0
- package/dist/shell/gates/quality-gates-adapter.js.map +1 -0
- package/dist/shell/gates/waiver-filter.d.ts +58 -0
- package/dist/shell/gates/waiver-filter.d.ts.map +1 -0
- package/dist/shell/gates/waiver-filter.js +119 -0
- package/dist/shell/gates/waiver-filter.js.map +1 -0
- package/dist/shell/index.d.ts +50 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +73 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/register.d.ts +11 -0
- package/dist/shell/register.d.ts.map +1 -0
- package/dist/shell/register.js +274 -0
- package/dist/shell/register.js.map +1 -0
- package/dist/shell/render/claim.d.ts +22 -0
- package/dist/shell/render/claim.d.ts.map +1 -0
- package/dist/shell/render/claim.js +75 -0
- package/dist/shell/render/claim.js.map +1 -0
- package/dist/shell/render/decision.d.ts +15 -0
- package/dist/shell/render/decision.d.ts.map +1 -0
- package/dist/shell/render/decision.js +66 -0
- package/dist/shell/render/decision.js.map +1 -0
- package/dist/shell/render/diagnostic.d.ts +19 -0
- package/dist/shell/render/diagnostic.d.ts.map +1 -0
- package/dist/shell/render/diagnostic.js +76 -0
- package/dist/shell/render/diagnostic.js.map +1 -0
- package/dist/shell/render/finding.d.ts +15 -0
- package/dist/shell/render/finding.d.ts.map +1 -0
- package/dist/shell/render/finding.js +57 -0
- package/dist/shell/render/finding.js.map +1 -0
- package/dist/shell/render/gates.d.ts +3 -0
- package/dist/shell/render/gates.d.ts.map +1 -0
- package/dist/shell/render/gates.js +56 -0
- package/dist/shell/render/gates.js.map +1 -0
- package/dist/shell/render/init.d.ts +11 -0
- package/dist/shell/render/init.d.ts.map +1 -0
- package/dist/shell/render/init.js +32 -0
- package/dist/shell/render/init.js.map +1 -0
- package/dist/shell/render/status.d.ts +26 -0
- package/dist/shell/render/status.d.ts.map +1 -0
- package/dist/shell/render/status.js +143 -0
- package/dist/shell/render/status.js.map +1 -0
- package/dist/shell/render/waiver.d.ts +21 -0
- package/dist/shell/render/waiver.d.ts.map +1 -0
- package/dist/shell/render/waiver.js +94 -0
- package/dist/shell/render/waiver.js.map +1 -0
- package/dist/shell/rules.d.ts +37 -0
- package/dist/shell/rules.d.ts.map +1 -0
- package/dist/shell/rules.js +51 -0
- package/dist/shell/rules.js.map +1 -0
- package/dist/shell/session/actor.d.ts +14 -0
- package/dist/shell/session/actor.d.ts.map +1 -0
- package/dist/shell/session/actor.js +34 -0
- package/dist/shell/session/actor.js.map +1 -0
- package/dist/shell/session/resolve-session.d.ts +5 -0
- package/dist/shell/session/resolve-session.d.ts.map +1 -0
- package/dist/shell/session/resolve-session.js +239 -0
- package/dist/shell/session/resolve-session.js.map +1 -0
- package/dist/shell/session/types.d.ts +56 -0
- package/dist/shell/session/types.d.ts.map +1 -0
- package/dist/shell/session/types.js +15 -0
- package/dist/shell/session/types.js.map +1 -0
- package/dist/store/agents-store.d.ts +3 -0
- package/dist/store/agents-store.d.ts.map +1 -0
- package/dist/store/agents-store.js +63 -0
- package/dist/store/agents-store.js.map +1 -0
- package/dist/store/apply-patch.d.ts +16 -0
- package/dist/store/apply-patch.d.ts.map +1 -0
- package/dist/store/apply-patch.js +191 -0
- package/dist/store/apply-patch.js.map +1 -0
- package/dist/store/atomic-write.d.ts +16 -0
- package/dist/store/atomic-write.d.ts.map +1 -0
- package/dist/store/atomic-write.js +132 -0
- package/dist/store/atomic-write.js.map +1 -0
- package/dist/store/doctor-snapshot.d.ts +20 -0
- package/dist/store/doctor-snapshot.d.ts.map +1 -0
- package/dist/store/doctor-snapshot.js +176 -0
- package/dist/store/doctor-snapshot.js.map +1 -0
- package/dist/store/events-store.d.ts +33 -0
- package/dist/store/events-store.d.ts.map +1 -0
- package/dist/store/events-store.js +297 -0
- package/dist/store/events-store.js.map +1 -0
- package/dist/store/index.d.ts +21 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +47 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/init-store.d.ts +21 -0
- package/dist/store/init-store.d.ts.map +1 -0
- package/dist/store/init-store.js +295 -0
- package/dist/store/init-store.js.map +1 -0
- package/dist/store/json-store.d.ts +3 -0
- package/dist/store/json-store.d.ts.map +1 -0
- package/dist/store/json-store.js +65 -0
- package/dist/store/json-store.js.map +1 -0
- package/dist/store/policy-store.d.ts +3 -0
- package/dist/store/policy-store.d.ts.map +1 -0
- package/dist/store/policy-store.js +65 -0
- package/dist/store/policy-store.js.map +1 -0
- package/dist/store/repo-root.d.ts +46 -0
- package/dist/store/repo-root.d.ts.map +1 -0
- package/dist/store/repo-root.js +145 -0
- package/dist/store/repo-root.js.map +1 -0
- package/dist/store/rules.d.ts +53 -0
- package/dist/store/rules.d.ts.map +1 -0
- package/dist/store/rules.js +78 -0
- package/dist/store/rules.js.map +1 -0
- package/dist/store/specs-store.d.ts +3 -0
- package/dist/store/specs-store.d.ts.map +1 -0
- package/dist/store/specs-store.js +131 -0
- package/dist/store/specs-store.js.map +1 -0
- package/dist/store/types.d.ts +84 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +14 -0
- package/dist/store/types.js.map +1 -0
- package/dist/store/waivers-store.d.ts +25 -0
- package/dist/store/waivers-store.d.ts.map +1 -0
- package/dist/store/waivers-store.js +232 -0
- package/dist/store/waivers-store.js.map +1 -0
- package/dist/store/worktrees-store.d.ts +3 -0
- package/dist/store/worktrees-store.d.ts.map +1 -0
- package/dist/store/worktrees-store.js +62 -0
- package/dist/store/worktrees-store.js.map +1 -0
- package/dist/store/yaml-store.d.ts +9 -0
- package/dist/store/yaml-store.d.ts.map +1 -0
- package/dist/store/yaml-store.js +121 -0
- package/dist/store/yaml-store.js.map +1 -0
- package/package.json +15 -13
- package/dist/budget-derivation.js +0 -751
- package/dist/cicd-optimizer.js +0 -504
- package/dist/commands/archive.js +0 -500
- package/dist/commands/burnup.js +0 -198
- package/dist/commands/diagnose.js +0 -525
- package/dist/commands/evaluate.js +0 -314
- package/dist/commands/gates.js +0 -149
- package/dist/commands/init.js +0 -857
- package/dist/commands/iterate.js +0 -417
- package/dist/commands/mode.js +0 -269
- package/dist/commands/parallel.js +0 -242
- package/dist/commands/plan.js +0 -438
- package/dist/commands/provenance.js +0 -1143
- package/dist/commands/quality-monitor.js +0 -284
- package/dist/commands/scope.js +0 -264
- package/dist/commands/session.js +0 -312
- package/dist/commands/sidecar.js +0 -74
- package/dist/commands/specs.js +0 -1448
- package/dist/commands/status.js +0 -1151
- package/dist/commands/templates.js +0 -237
- package/dist/commands/tool.js +0 -136
- package/dist/commands/tutorial.js +0 -480
- package/dist/commands/validate.js +0 -357
- package/dist/commands/verify-acs.js +0 -443
- package/dist/commands/waivers.js +0 -599
- package/dist/commands/workflow.js +0 -243
- package/dist/commands/worktree.js +0 -386
- package/dist/config/lite-scope.js +0 -158
- package/dist/config/modes.js +0 -347
- package/dist/constants/spec-types.js +0 -65
- package/dist/gates/budget-limit.js +0 -121
- package/dist/gates/feedback.js +0 -260
- package/dist/gates/format.js +0 -179
- package/dist/gates/god-object.js +0 -117
- package/dist/gates/pipeline.js +0 -167
- package/dist/gates/scope-boundary.js +0 -93
- package/dist/gates/spec-completeness.js +0 -109
- package/dist/gates/todo-detection.js +0 -205
- package/dist/generators/jest-config-generator.js +0 -242
- package/dist/generators/working-spec.js +0 -237
- package/dist/minimal-cli.js +0 -88
- package/dist/parallel/parallel-manager.js +0 -433
- package/dist/policy/PolicyManager.js +0 -465
- package/dist/scaffold/claude-hooks.js +0 -443
- package/dist/scaffold/cursor-hooks.js +0 -177
- package/dist/scaffold/git-hooks.js +0 -928
- package/dist/scaffold/index.js +0 -794
- package/dist/session/session-manager.js +0 -653
- package/dist/sidecars/index.js +0 -33
- package/dist/sidecars/listeners.js +0 -40
- package/dist/sidecars/provenance-summary.js +0 -238
- package/dist/sidecars/quality-gaps.js +0 -258
- package/dist/sidecars/schema.js +0 -149
- package/dist/sidecars/spec-drift.js +0 -151
- package/dist/sidecars/waiver-draft.js +0 -176
- package/dist/spec/SpecFileManager.js +0 -419
- package/dist/templates/.caws/schemas/policy.schema.json +0 -112
- package/dist/templates/.caws/schemas/scope.schema.json +0 -52
- package/dist/templates/.caws/schemas/waivers.schema.json +0 -106
- package/dist/templates/.caws/schemas/working-spec.schema.json +0 -340
- package/dist/templates/.caws/schemas/worktrees.schema.json +0 -38
- package/dist/templates/.caws/templates/working-spec.template.yml +0 -80
- package/dist/templates/.caws/tools/README.md +0 -18
- package/dist/templates/.caws/tools/scope-guard.js +0 -203
- package/dist/templates/.caws/tools-allow.json +0 -331
- package/dist/templates/.caws/waivers.yml +0 -19
- package/dist/templates/.claude/README.md +0 -190
- package/dist/templates/.claude/hooks/audit.sh +0 -121
- package/dist/templates/.claude/hooks/block-dangerous.sh +0 -203
- package/dist/templates/.claude/hooks/classify_command.py +0 -592
- package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
- package/dist/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
- package/dist/templates/.claude/hooks/naming-check.sh +0 -100
- package/dist/templates/.claude/hooks/protected-paths.sh +0 -39
- package/dist/templates/.claude/hooks/quality-check.sh +0 -81
- package/dist/templates/.claude/hooks/scan-secrets.sh +0 -85
- package/dist/templates/.claude/hooks/scope-guard.sh +0 -381
- package/dist/templates/.claude/hooks/session-caws-status.sh +0 -117
- package/dist/templates/.claude/hooks/session-log.sh +0 -634
- package/dist/templates/.claude/hooks/simplification-guard.sh +0 -92
- package/dist/templates/.claude/hooks/stop-worktree-check.sh +0 -46
- package/dist/templates/.claude/hooks/test_classify_command.py +0 -370
- package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
- package/dist/templates/.claude/hooks/validate-spec.sh +0 -76
- package/dist/templates/.claude/hooks/worktree-guard.sh +0 -220
- package/dist/templates/.claude/hooks/worktree-write-guard.sh +0 -190
- package/dist/templates/.claude/rules/git-safety.md +0 -26
- package/dist/templates/.claude/rules/worktree-isolation.md +0 -83
- package/dist/templates/.claude/settings.json +0 -141
- package/dist/templates/.cursor/README.md +0 -299
- package/dist/templates/.cursor/hooks/audit.sh +0 -55
- package/dist/templates/.cursor/hooks/block-dangerous.sh +0 -84
- package/dist/templates/.cursor/hooks/caws-quality-check.sh +0 -52
- package/dist/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
- package/dist/templates/.cursor/hooks/format.sh +0 -38
- package/dist/templates/.cursor/hooks/naming-check.sh +0 -64
- package/dist/templates/.cursor/hooks/scan-secrets.sh +0 -51
- package/dist/templates/.cursor/hooks/scope-guard.sh +0 -52
- package/dist/templates/.cursor/hooks/session-log.sh +0 -924
- package/dist/templates/.cursor/hooks/validate-spec.sh +0 -83
- package/dist/templates/.cursor/hooks.json +0 -76
- package/dist/templates/.cursor/rules/00-claims-verification.mdc +0 -144
- package/dist/templates/.cursor/rules/01-working-style.mdc +0 -50
- package/dist/templates/.cursor/rules/02-quality-gates.mdc +0 -368
- package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
- package/dist/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
- package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
- package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
- package/dist/templates/.cursor/rules/07-process-ops.mdc +0 -20
- package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
- package/dist/templates/.cursor/rules/09-docstrings.mdc +0 -89
- package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
- package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
- package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
- package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
- package/dist/templates/.cursor/rules/README.md +0 -148
- package/dist/templates/.github/copilot-instructions.md +0 -82
- package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
- package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
- package/dist/templates/.junie/guidelines.md +0 -73
- package/dist/templates/.vscode/launch.json +0 -17
- package/dist/templates/.vscode/settings.json +0 -95
- package/dist/templates/.windsurf/rules/caws-quality-standards.md +0 -54
- package/dist/templates/.windsurf/workflows/caws-guided-development.md +0 -92
- package/dist/templates/CLAUDE.md +0 -174
- package/dist/templates/COMMIT_CONVENTIONS.md +0 -86
- package/dist/templates/OIDC_SETUP.md +0 -300
- package/dist/templates/agents.md +0 -145
- package/dist/templates/codemod/README.md +0 -1
- package/dist/templates/codemod/test.js +0 -93
- package/dist/templates/docs/README.md +0 -151
- package/dist/templates/scripts/new_feature.sh +0 -80
- package/dist/templates/scripts/quality-gates/check-god-objects.js +0 -146
- package/dist/templates/scripts/quality-gates/run-quality-gates.js +0 -50
- package/dist/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
- package/dist/test-analysis.js +0 -786
- package/dist/tool-interface.js +0 -314
- package/dist/tool-loader.js +0 -303
- package/dist/tool-validator.js +0 -393
- package/dist/utils/agent-session.js +0 -202
- package/dist/utils/async-utils.js +0 -188
- package/dist/utils/command-wrapper.js +0 -200
- package/dist/utils/event-log.js +0 -584
- package/dist/utils/event-renderer.js +0 -521
- package/dist/utils/finalization.js +0 -230
- package/dist/utils/git-lock.js +0 -119
- package/dist/utils/gitignore-updater.js +0 -158
- package/dist/utils/ide-detection.js +0 -133
- package/dist/utils/lifecycle-events.js +0 -94
- package/dist/utils/project-analysis.js +0 -367
- package/dist/utils/promise-utils.js +0 -72
- package/dist/utils/quality-gates-errors.js +0 -520
- package/dist/utils/quality-gates-utils.js +0 -387
- package/dist/utils/schema-validator.js +0 -50
- package/dist/utils/spec-resolver.js +0 -711
- package/dist/utils/typescript-detector.js +0 -369
- package/dist/utils/working-state.js +0 -530
- package/dist/utils/yaml-validation.js +0 -156
- package/dist/validation/spec-validation.js +0 -921
- package/dist/waivers-manager.js +0 -732
- package/dist/worktree/worktree-manager.js +0 -1374
- package/templates/.caws/schemas/policy.schema.json +0 -112
- package/templates/.caws/schemas/scope.schema.json +0 -52
- package/templates/.caws/schemas/waivers.schema.json +0 -106
- package/templates/.caws/schemas/working-spec.schema.json +0 -340
- package/templates/.caws/schemas/worktrees.schema.json +0 -38
- package/templates/.caws/templates/working-spec.template.yml +0 -80
- package/templates/.caws/tools/README.md +0 -18
- package/templates/.caws/tools/scope-guard.js +0 -203
- package/templates/.caws/tools-allow.json +0 -331
- package/templates/.caws/waivers.yml +0 -19
- package/templates/.claude/README.md +0 -190
- package/templates/.claude/hooks/audit.sh +0 -121
- package/templates/.claude/hooks/block-dangerous.sh +0 -203
- package/templates/.claude/hooks/classify_command.py +0 -592
- package/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
- package/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
- package/templates/.claude/hooks/naming-check.sh +0 -100
- package/templates/.claude/hooks/protected-paths.sh +0 -39
- package/templates/.claude/hooks/quality-check.sh +0 -81
- package/templates/.claude/hooks/scan-secrets.sh +0 -85
- package/templates/.claude/hooks/scope-guard.sh +0 -381
- package/templates/.claude/hooks/session-caws-status.sh +0 -117
- package/templates/.claude/hooks/session-log.sh +0 -634
- package/templates/.claude/hooks/simplification-guard.sh +0 -92
- package/templates/.claude/hooks/stop-worktree-check.sh +0 -46
- package/templates/.claude/hooks/test_classify_command.py +0 -370
- package/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
- package/templates/.claude/hooks/validate-spec.sh +0 -76
- package/templates/.claude/hooks/worktree-guard.sh +0 -220
- package/templates/.claude/hooks/worktree-write-guard.sh +0 -190
- package/templates/.claude/rules/git-safety.md +0 -26
- package/templates/.claude/rules/worktree-isolation.md +0 -83
- package/templates/.claude/settings.json +0 -141
- package/templates/.cursor/README.md +0 -299
- package/templates/.cursor/hooks/audit.sh +0 -55
- package/templates/.cursor/hooks/block-dangerous.sh +0 -84
- package/templates/.cursor/hooks/caws-quality-check.sh +0 -52
- package/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
- package/templates/.cursor/hooks/format.sh +0 -38
- package/templates/.cursor/hooks/naming-check.sh +0 -64
- package/templates/.cursor/hooks/scan-secrets.sh +0 -51
- package/templates/.cursor/hooks/scope-guard.sh +0 -52
- package/templates/.cursor/hooks/session-log.sh +0 -924
- package/templates/.cursor/hooks/validate-spec.sh +0 -83
- package/templates/.cursor/hooks.json +0 -76
- package/templates/.cursor/rules/00-claims-verification.mdc +0 -144
- package/templates/.cursor/rules/01-working-style.mdc +0 -50
- package/templates/.cursor/rules/02-quality-gates.mdc +0 -368
- package/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
- package/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
- package/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
- package/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
- package/templates/.cursor/rules/07-process-ops.mdc +0 -20
- package/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
- package/templates/.cursor/rules/09-docstrings.mdc +0 -89
- package/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
- package/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
- package/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
- package/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
- package/templates/.cursor/rules/README.md +0 -148
- package/templates/.github/copilot-instructions.md +0 -82
- package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
- package/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
- package/templates/.junie/guidelines.md +0 -73
- package/templates/.vscode/launch.json +0 -17
- package/templates/.vscode/settings.json +0 -95
- package/templates/.windsurf/rules/caws-quality-standards.md +0 -54
- package/templates/.windsurf/workflows/caws-guided-development.md +0 -92
- package/templates/CLAUDE.md +0 -174
- package/templates/COMMIT_CONVENTIONS.md +0 -86
- package/templates/OIDC_SETUP.md +0 -300
- package/templates/agents.md +0 -145
- package/templates/codemod/README.md +0 -1
- package/templates/codemod/test.js +0 -93
- package/templates/docs/README.md +0 -151
- package/templates/scripts/new_feature.sh +0 -80
- package/templates/scripts/quality-gates/check-god-objects.js +0 -146
- package/templates/scripts/quality-gates/run-quality-gates.js +0 -50
- package/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CAWS Evaluate Command
|
|
3
|
-
*
|
|
4
|
-
* Evaluates work against CAWS quality standards and provides
|
|
5
|
-
* actionable feedback on meeting acceptance criteria.
|
|
6
|
-
*
|
|
7
|
-
* @author @darianrosebrook
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const path = require('path');
|
|
11
|
-
const chalk = require('chalk');
|
|
12
|
-
const { initializeGlobalSetup } = require('../config');
|
|
13
|
-
const { resolveSpec } = require('../utils/spec-resolver');
|
|
14
|
-
const { recordEvaluation } = require('../utils/working-state');
|
|
15
|
-
const { appendEvent } = require('../utils/event-log');
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Evaluate command handler
|
|
19
|
-
*
|
|
20
|
-
* @param {string} specFile - Path to working spec file
|
|
21
|
-
* @param {object} options - Command options
|
|
22
|
-
*/
|
|
23
|
-
async function evaluateCommand(specFile, options = {}) {
|
|
24
|
-
try {
|
|
25
|
-
console.log('Detecting CAWS setup...');
|
|
26
|
-
const setup = initializeGlobalSetup();
|
|
27
|
-
|
|
28
|
-
if (setup.hasWorkingSpec) {
|
|
29
|
-
console.log(`Detected ${setup.type} CAWS setup`);
|
|
30
|
-
console.log(` Capabilities: ${setup.capabilities.join(', ')}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const resolved = await resolveSpec({
|
|
34
|
-
specId: options.specId,
|
|
35
|
-
specFile: specFile || undefined,
|
|
36
|
-
warnLegacy: false,
|
|
37
|
-
interactive: false,
|
|
38
|
-
});
|
|
39
|
-
const specPath = resolved.path;
|
|
40
|
-
const spec = resolved.spec;
|
|
41
|
-
|
|
42
|
-
console.log(chalk.blue('\nEvaluating CAWS Quality Standards\n'));
|
|
43
|
-
console.log('-'.repeat(60));
|
|
44
|
-
console.log(chalk.gray(`Spec: ${path.relative(process.cwd(), specPath)}`));
|
|
45
|
-
console.log(chalk.gray(`Type: ${resolved.type}`));
|
|
46
|
-
|
|
47
|
-
// Evaluation results
|
|
48
|
-
const results = {
|
|
49
|
-
score: 0,
|
|
50
|
-
maxScore: 0,
|
|
51
|
-
checks: [],
|
|
52
|
-
recommendations: [],
|
|
53
|
-
warnings: [],
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// 1. Check working spec validity
|
|
57
|
-
results.maxScore += 10;
|
|
58
|
-
if (spec.id && spec.title && spec.risk_tier && spec.mode) {
|
|
59
|
-
results.score += 10;
|
|
60
|
-
results.checks.push({ name: 'Working Spec Structure', status: 'pass', points: 10 });
|
|
61
|
-
} else {
|
|
62
|
-
results.checks.push({ name: 'Working Spec Structure', status: 'fail', points: 0 });
|
|
63
|
-
results.warnings.push('Working spec missing required fields');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// 2. Check acceptance criteria
|
|
67
|
-
results.maxScore += 15;
|
|
68
|
-
if (spec.acceptance && spec.acceptance.length > 0) {
|
|
69
|
-
const validCriteria = spec.acceptance.filter((a) => a.id && a.given && a.when && a.then);
|
|
70
|
-
const criteriaScore = Math.floor((validCriteria.length / spec.acceptance.length) * 15);
|
|
71
|
-
results.score += criteriaScore;
|
|
72
|
-
results.checks.push({
|
|
73
|
-
name: 'Acceptance Criteria',
|
|
74
|
-
status: criteriaScore === 15 ? 'pass' : 'partial',
|
|
75
|
-
points: criteriaScore,
|
|
76
|
-
detail: `${validCriteria.length}/${spec.acceptance.length} complete`,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
if (criteriaScore < 15) {
|
|
80
|
-
results.recommendations.push(
|
|
81
|
-
'Complete all acceptance criteria with Given-When-Then format'
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
results.checks.push({ name: 'Acceptance Criteria', status: 'fail', points: 0 });
|
|
86
|
-
results.warnings.push('No acceptance criteria defined');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// 3. Check scope definition
|
|
90
|
-
results.maxScore += 10;
|
|
91
|
-
if (spec.scope && spec.scope.in && spec.scope.in.length > 0) {
|
|
92
|
-
results.score += 10;
|
|
93
|
-
results.checks.push({ name: 'Scope Definition', status: 'pass', points: 10 });
|
|
94
|
-
} else {
|
|
95
|
-
results.checks.push({ name: 'Scope Definition', status: 'fail', points: 0 });
|
|
96
|
-
results.warnings.push('Scope not clearly defined');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// 4. Check change budget
|
|
100
|
-
results.maxScore += 10;
|
|
101
|
-
if (spec.change_budget && spec.change_budget.max_files && spec.change_budget.max_loc) {
|
|
102
|
-
results.score += 10;
|
|
103
|
-
results.checks.push({ name: 'Change Budget', status: 'pass', points: 10 });
|
|
104
|
-
} else {
|
|
105
|
-
results.checks.push({ name: 'Change Budget', status: 'fail', points: 0 });
|
|
106
|
-
results.recommendations.push('Define change budget (max_files, max_loc)');
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// 5. Check invariants
|
|
110
|
-
results.maxScore += 10;
|
|
111
|
-
if (spec.invariants && spec.invariants.length > 0) {
|
|
112
|
-
results.score += 10;
|
|
113
|
-
results.checks.push({ name: 'System Invariants', status: 'pass', points: 10 });
|
|
114
|
-
} else {
|
|
115
|
-
results.checks.push({ name: 'System Invariants', status: 'partial', points: 5 });
|
|
116
|
-
results.recommendations.push('Define system invariants to maintain');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// 6. Check non-functional requirements
|
|
120
|
-
results.maxScore += 15;
|
|
121
|
-
let nfrScore = 0;
|
|
122
|
-
if (spec.non_functional) {
|
|
123
|
-
if (spec.non_functional.a11y && spec.non_functional.a11y.length > 0) nfrScore += 5;
|
|
124
|
-
if (spec.non_functional.perf && spec.non_functional.perf.api_p95_ms) nfrScore += 5;
|
|
125
|
-
if (spec.non_functional.security && spec.non_functional.security.length > 0) nfrScore += 5;
|
|
126
|
-
}
|
|
127
|
-
results.score += nfrScore;
|
|
128
|
-
results.checks.push({
|
|
129
|
-
name: 'Non-Functional Requirements',
|
|
130
|
-
status: nfrScore === 15 ? 'pass' : 'partial',
|
|
131
|
-
points: nfrScore,
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
if (nfrScore < 15) {
|
|
135
|
-
results.recommendations.push('Define a11y, performance, and security requirements');
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 7. Check rollback plan
|
|
139
|
-
results.maxScore += 10;
|
|
140
|
-
if (spec.rollback && spec.rollback.length > 0) {
|
|
141
|
-
results.score += 10;
|
|
142
|
-
results.checks.push({ name: 'Rollback Plan', status: 'pass', points: 10 });
|
|
143
|
-
} else {
|
|
144
|
-
results.checks.push({ name: 'Rollback Plan', status: 'fail', points: 0 });
|
|
145
|
-
results.recommendations.push('Document rollback procedures');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// 8. Check observability
|
|
149
|
-
results.maxScore += 10;
|
|
150
|
-
if (
|
|
151
|
-
spec.observability &&
|
|
152
|
-
(spec.observability.logs?.length > 0 ||
|
|
153
|
-
spec.observability.metrics?.length > 0 ||
|
|
154
|
-
spec.observability.traces?.length > 0)
|
|
155
|
-
) {
|
|
156
|
-
results.score += 10;
|
|
157
|
-
results.checks.push({ name: 'Observability', status: 'pass', points: 10 });
|
|
158
|
-
} else {
|
|
159
|
-
results.checks.push({ name: 'Observability', status: 'partial', points: 3 });
|
|
160
|
-
results.recommendations.push('Define logging, metrics, and tracing strategy');
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// 9. Risk tier appropriateness
|
|
164
|
-
results.maxScore += 10;
|
|
165
|
-
const hasCriticalScope = spec.blast_radius?.modules?.some(
|
|
166
|
-
(m) => m.includes('auth') || m.includes('payment') || m.includes('billing')
|
|
167
|
-
);
|
|
168
|
-
const hasDataMigration = spec.blast_radius?.data_migration === true;
|
|
169
|
-
|
|
170
|
-
if (hasCriticalScope || hasDataMigration) {
|
|
171
|
-
if (spec.risk_tier === 1) {
|
|
172
|
-
results.score += 10;
|
|
173
|
-
results.checks.push({ name: 'Risk Tier Appropriateness', status: 'pass', points: 10 });
|
|
174
|
-
} else {
|
|
175
|
-
results.checks.push({ name: 'Risk Tier Appropriateness', status: 'fail', points: 0 });
|
|
176
|
-
results.warnings.push(`Risk tier ${spec.risk_tier} may be too low for critical changes`);
|
|
177
|
-
}
|
|
178
|
-
} else {
|
|
179
|
-
results.score += 10;
|
|
180
|
-
results.checks.push({ name: 'Risk Tier Appropriateness', status: 'pass', points: 10 });
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Display results
|
|
184
|
-
console.log('\nQuality Checks:\n');
|
|
185
|
-
results.checks.forEach((check) => {
|
|
186
|
-
const icon = check.status === 'pass' ? '' : check.status === 'partial' ? '' : '';
|
|
187
|
-
const detail = check.detail ? ` (${check.detail})` : '';
|
|
188
|
-
console.log(
|
|
189
|
-
`${icon} ${check.name}: ${check.points}/${results.maxScore / results.checks.length}${detail}`
|
|
190
|
-
);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
// Calculate percentage
|
|
194
|
-
const percentage = Math.round((results.score / results.maxScore) * 100);
|
|
195
|
-
const grade =
|
|
196
|
-
percentage >= 90
|
|
197
|
-
? 'A'
|
|
198
|
-
: percentage >= 80
|
|
199
|
-
? 'B'
|
|
200
|
-
: percentage >= 70
|
|
201
|
-
? 'C'
|
|
202
|
-
: percentage >= 60
|
|
203
|
-
? 'D'
|
|
204
|
-
: 'F';
|
|
205
|
-
|
|
206
|
-
// Record to working state (Phase 1 dual-write: state layer + event log)
|
|
207
|
-
const checksPassed = results.checks.filter(c => c.status === 'pass').length;
|
|
208
|
-
const evaluationPayload = {
|
|
209
|
-
score: results.score,
|
|
210
|
-
max_score: results.maxScore,
|
|
211
|
-
percentage,
|
|
212
|
-
grade,
|
|
213
|
-
checks_passed: checksPassed,
|
|
214
|
-
checks_total: results.checks.length,
|
|
215
|
-
};
|
|
216
|
-
// CAWSFIX-02: guard recordEvaluation with `spec && spec.id` check to
|
|
217
|
-
// prevent the .caws/state/undefined.json bug class. Matches the pattern
|
|
218
|
-
// gates.js already uses and the appendEvent call below.
|
|
219
|
-
if (spec && spec.id) {
|
|
220
|
-
try {
|
|
221
|
-
recordEvaluation(spec.id, evaluationPayload);
|
|
222
|
-
} catch { /* non-fatal */ }
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// EVLOG-001: emit evaluation_completed event alongside state write.
|
|
226
|
-
if (spec && spec.id) {
|
|
227
|
-
await appendEvent(
|
|
228
|
-
{ actor: 'cli', event: 'evaluation_completed', spec_id: spec.id, data: evaluationPayload }
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
console.log('\n' + '-'.repeat(60));
|
|
233
|
-
console.log(
|
|
234
|
-
chalk.bold(
|
|
235
|
-
`\nOverall Score: ${results.score}/${results.maxScore} (${percentage}%) - Grade: ${grade}\n`
|
|
236
|
-
)
|
|
237
|
-
);
|
|
238
|
-
|
|
239
|
-
// Display warnings
|
|
240
|
-
if (results.warnings.length > 0) {
|
|
241
|
-
console.log(chalk.yellow('Warnings:\n'));
|
|
242
|
-
results.warnings.forEach((warning) => {
|
|
243
|
-
console.log(chalk.yellow(` - ${warning}`));
|
|
244
|
-
});
|
|
245
|
-
console.log();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Display recommendations
|
|
249
|
-
if (results.recommendations.length > 0) {
|
|
250
|
-
console.log(chalk.blue('Recommendations:\n'));
|
|
251
|
-
results.recommendations.forEach((rec) => {
|
|
252
|
-
console.log(chalk.blue(` - ${rec}`));
|
|
253
|
-
});
|
|
254
|
-
console.log();
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Risk tier specific guidance
|
|
258
|
-
console.log(chalk.bold(`\nRisk Tier ${spec.risk_tier} Requirements:\n`));
|
|
259
|
-
|
|
260
|
-
const tierRequirements = {
|
|
261
|
-
1: {
|
|
262
|
-
coverage: '90%+',
|
|
263
|
-
mutation: '70%+',
|
|
264
|
-
contracts: 'Required',
|
|
265
|
-
review: 'Manual code review required',
|
|
266
|
-
},
|
|
267
|
-
2: {
|
|
268
|
-
coverage: '80%+',
|
|
269
|
-
mutation: '50%+',
|
|
270
|
-
contracts: 'Required for external APIs',
|
|
271
|
-
review: 'Optional',
|
|
272
|
-
},
|
|
273
|
-
3: {
|
|
274
|
-
coverage: '70%+',
|
|
275
|
-
mutation: '30%+',
|
|
276
|
-
contracts: 'Optional',
|
|
277
|
-
review: 'Optional',
|
|
278
|
-
},
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const req = tierRequirements[spec.risk_tier] || tierRequirements[2];
|
|
282
|
-
console.log(` Branch Coverage: ${req.coverage}`);
|
|
283
|
-
console.log(` Mutation Score: ${req.mutation}`);
|
|
284
|
-
console.log(` Contract Tests: ${req.contracts}`);
|
|
285
|
-
console.log(` Code Review: ${req.review}`);
|
|
286
|
-
|
|
287
|
-
console.log(chalk.blue('\nNext Steps:\n'));
|
|
288
|
-
console.log(' 1. Address warnings and recommendations above');
|
|
289
|
-
console.log(' 2. Implement acceptance criteria with tests');
|
|
290
|
-
console.log(' 3. Run: caws validate to check spec validity');
|
|
291
|
-
console.log(' 4. Run: caws diagnose for health checks');
|
|
292
|
-
console.log(' 5. Ensure test coverage meets risk tier requirements');
|
|
293
|
-
|
|
294
|
-
// Exit with appropriate code
|
|
295
|
-
if (percentage < 70) {
|
|
296
|
-
console.log(
|
|
297
|
-
chalk.red('\nQuality score below 70% - improvements needed before proceeding\n')
|
|
298
|
-
);
|
|
299
|
-
process.exit(1);
|
|
300
|
-
} else if (percentage < 90) {
|
|
301
|
-
console.log(chalk.yellow('\nQuality score acceptable but improvements recommended\n'));
|
|
302
|
-
} else {
|
|
303
|
-
console.log(chalk.green('\nExcellent quality score - ready to proceed!\n'));
|
|
304
|
-
}
|
|
305
|
-
} catch (error) {
|
|
306
|
-
console.error(chalk.red(`\nEvaluation failed: ${error.message}`));
|
|
307
|
-
if (options.verbose) {
|
|
308
|
-
console.error(error.stack);
|
|
309
|
-
}
|
|
310
|
-
process.exit(1);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
module.exports = { evaluateCommand };
|
package/dist/commands/gates.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Unified quality gates CLI command
|
|
3
|
-
* Delegates to the v2 gate pipeline (src/gates/pipeline.js) for evaluation
|
|
4
|
-
* and formatting (src/gates/format.js) for output.
|
|
5
|
-
* @author @darianrosebrook
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { evaluateGates } = require('../gates/pipeline');
|
|
9
|
-
const { formatText, formatJson, formatEnrichedText } = require('../gates/format');
|
|
10
|
-
const { enrichGateResults } = require('../gates/feedback');
|
|
11
|
-
const { resolveSpec } = require('../utils/spec-resolver');
|
|
12
|
-
const { commandWrapper } = require('../utils/command-wrapper');
|
|
13
|
-
// EVLOG-002 Phase 2 read flip: gates still writes via recordGates (state layer)
|
|
14
|
-
// AND emits a gates_evaluated event (from Phase 1), but the feedback-enrichment
|
|
15
|
-
// READ at line ~116 now goes through the event log renderer instead of loadState.
|
|
16
|
-
// The write path is deliberately unchanged in Phase 2 — only reads flip.
|
|
17
|
-
const { recordGates } = require('../utils/working-state');
|
|
18
|
-
const { loadStateFromEvents } = require('../utils/event-renderer');
|
|
19
|
-
const { appendEvent } = require('../utils/event-log');
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Run quality gates via the v2 pipeline
|
|
23
|
-
* @param {Object} options - Command options
|
|
24
|
-
* @param {string} [options.context] - Execution context (cli, commit, edit)
|
|
25
|
-
* @param {string} [options.specId] - Target spec ID
|
|
26
|
-
* @param {string} [options.specFile] - Explicit spec file path
|
|
27
|
-
* @param {string} [options.file] - Single file to check (for edit context)
|
|
28
|
-
* @param {boolean} [options.json] - Output as JSON
|
|
29
|
-
* @param {string} [options.format] - Output format (text, json)
|
|
30
|
-
* @param {boolean} [options.quiet] - Minimal output
|
|
31
|
-
*/
|
|
32
|
-
async function gatesCommand(options = {}) {
|
|
33
|
-
return commandWrapper(
|
|
34
|
-
async () => {
|
|
35
|
-
const projectRoot = process.cwd();
|
|
36
|
-
const context = options.context || 'cli';
|
|
37
|
-
|
|
38
|
-
// Resolve spec (working-spec or feature spec)
|
|
39
|
-
let spec = null;
|
|
40
|
-
try {
|
|
41
|
-
const resolved = await resolveSpec({
|
|
42
|
-
specId: options.specId,
|
|
43
|
-
specFile: options.specFile,
|
|
44
|
-
warnLegacy: false,
|
|
45
|
-
interactive: false,
|
|
46
|
-
});
|
|
47
|
-
spec = resolved.spec;
|
|
48
|
-
} catch {
|
|
49
|
-
// No spec available — gates that need it will handle gracefully
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Get file list based on context
|
|
53
|
-
let stagedFiles = [];
|
|
54
|
-
const { execSync } = require('child_process');
|
|
55
|
-
if (context === 'commit') {
|
|
56
|
-
try {
|
|
57
|
-
stagedFiles = execSync('git diff --cached --name-only', {
|
|
58
|
-
cwd: projectRoot,
|
|
59
|
-
encoding: 'utf8',
|
|
60
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
61
|
-
})
|
|
62
|
-
.trim()
|
|
63
|
-
.split('\n')
|
|
64
|
-
.filter(Boolean);
|
|
65
|
-
} catch {
|
|
66
|
-
/* no staged files */
|
|
67
|
-
}
|
|
68
|
-
} else if (options.file) {
|
|
69
|
-
stagedFiles = [options.file];
|
|
70
|
-
} else if (context === 'cli') {
|
|
71
|
-
// For CLI context, use all tracked files so gates can provide meaningful analysis
|
|
72
|
-
try {
|
|
73
|
-
stagedFiles = execSync('git ls-files', {
|
|
74
|
-
cwd: projectRoot,
|
|
75
|
-
encoding: 'utf8',
|
|
76
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
77
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
78
|
-
})
|
|
79
|
-
.trim()
|
|
80
|
-
.split('\n')
|
|
81
|
-
.filter(Boolean);
|
|
82
|
-
} catch {
|
|
83
|
-
/* not a git repo or git unavailable */
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const report = await evaluateGates({ projectRoot, stagedFiles, spec, context });
|
|
88
|
-
|
|
89
|
-
// Record to working state (Phase 1 dual-write: state layer + event log)
|
|
90
|
-
if (spec && spec.id) {
|
|
91
|
-
try { recordGates(spec.id, report, context, projectRoot); } catch { /* non-fatal */ }
|
|
92
|
-
|
|
93
|
-
// EVLOG-001: emit gates_evaluated event alongside state write.
|
|
94
|
-
// Payload shape mirrors the `gates` field produced by recordGates.
|
|
95
|
-
await appendEvent(
|
|
96
|
-
{
|
|
97
|
-
actor: 'cli',
|
|
98
|
-
event: 'gates_evaluated',
|
|
99
|
-
spec_id: spec.id,
|
|
100
|
-
data: {
|
|
101
|
-
context,
|
|
102
|
-
passed: report.passed,
|
|
103
|
-
summary: report.summary || {},
|
|
104
|
-
gates: (report.gates || []).map((g) => ({
|
|
105
|
-
name: g.name,
|
|
106
|
-
status: g.status,
|
|
107
|
-
mode: g.mode,
|
|
108
|
-
})),
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{ projectRoot }
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (options.json || options.format === 'json') {
|
|
116
|
-
console.log(formatJson(report));
|
|
117
|
-
} else if (!options.quiet) {
|
|
118
|
-
// Enrich feedback on failure or --verbose (EVLOG-002: from event log)
|
|
119
|
-
if (!report.passed || options.verbose) {
|
|
120
|
-
try {
|
|
121
|
-
const state = spec?.id ? loadStateFromEvents(spec.id, { projectRoot }) : null;
|
|
122
|
-
const enrichments = enrichGateResults(report, { spec, state, projectRoot });
|
|
123
|
-
if (enrichments.size > 0) {
|
|
124
|
-
console.log(formatEnrichedText(report, enrichments));
|
|
125
|
-
} else {
|
|
126
|
-
console.log(formatText(report));
|
|
127
|
-
}
|
|
128
|
-
} catch {
|
|
129
|
-
console.log(formatText(report));
|
|
130
|
-
}
|
|
131
|
-
} else {
|
|
132
|
-
console.log(formatText(report));
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Exit with appropriate code
|
|
137
|
-
if (!report.passed) {
|
|
138
|
-
process.exit(1);
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
commandName: 'gates',
|
|
143
|
-
context: { options },
|
|
144
|
-
exitOnError: true,
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
module.exports = { gatesCommand };
|