@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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Agents registry loader.
|
|
3
|
+
//
|
|
4
|
+
// Reads `.caws/agents.json`. Same shape rules as worktrees-store: missing
|
|
5
|
+
// → empty, malformed → Err. Agents.json is freshness/display only and
|
|
6
|
+
// never authority per CAWSFIX-31/32 doctrine; the store treats it like
|
|
7
|
+
// any other data payload.
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.loadAgents = loadAgents;
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const caws_kernel_1 = require("@paths.design/caws-kernel");
|
|
45
|
+
const json_store_1 = require("./json-store");
|
|
46
|
+
const repo_root_1 = require("./repo-root");
|
|
47
|
+
const rules_1 = require("./rules");
|
|
48
|
+
function loadAgents(cawsDir) {
|
|
49
|
+
const filePath = path.join(cawsDir, 'agents.json');
|
|
50
|
+
const r = (0, json_store_1.readJsonFile)(filePath);
|
|
51
|
+
if (!(0, caws_kernel_1.isOk)(r)) {
|
|
52
|
+
if (r.errors.some((e) => e.rule === rules_1.STORE_RULES.READ_MISSING_FILE)) {
|
|
53
|
+
return (0, caws_kernel_1.ok)({});
|
|
54
|
+
}
|
|
55
|
+
return (0, caws_kernel_1.err)(r.errors);
|
|
56
|
+
}
|
|
57
|
+
const value = r.value;
|
|
58
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
59
|
+
return (0, caws_kernel_1.err)((0, repo_root_1.storeDiagnostic)(rules_1.STORE_RULES.REGISTRY_NOT_OBJECT, `agents.json is not a JSON object.`, { subject: filePath }));
|
|
60
|
+
}
|
|
61
|
+
return (0, caws_kernel_1.ok)(value);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=agents-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-store.js","sourceRoot":"","sources":["../../src/store/agents-store.ts"],"names":[],"mappings":";AAAA,0BAA0B;AAC1B,EAAE;AACF,0EAA0E;AAC1E,sEAAsE;AACtE,uEAAuE;AACvE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc1B,gCAoBC;AAhCD,2CAA6B;AAC7B,2DAMmC;AACnC,6CAA4C;AAC5C,2CAA8C;AAC9C,mCAAsC;AAEtC,SAAgB,UAAU,CAAC,OAAe;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,IAAA,yBAAY,EAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,CAAC,IAAA,kBAAI,EAAC,CAAC,CAAC,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,mBAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACnE,OAAO,IAAA,gBAAE,EAAC,EAAE,CAAC,CAAC;QAChB,CAAC;QACD,OAAO,IAAA,iBAAG,EAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,OAAO,IAAA,iBAAG,EACR,IAAA,2BAAe,EACb,mBAAW,CAAC,mBAAmB,EAC/B,mCAAmC,EACnC,EAAE,OAAO,EAAE,QAAQ,EAAE,CACtB,CACF,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,gBAAE,EAAC,KAAsB,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RegistryPatch } from '@paths.design/caws-kernel';
|
|
2
|
+
import { type Result } from '@paths.design/caws-kernel';
|
|
3
|
+
/**
|
|
4
|
+
* Apply a single RegistryPatch to the on-disk registries.
|
|
5
|
+
*
|
|
6
|
+
* Returns Ok(true) on successful write. The patch envelope itself is the
|
|
7
|
+
* proof-of-intent — this function never invents fields. It only translates
|
|
8
|
+
* the patch into the corresponding registry mutation and persists it.
|
|
9
|
+
*
|
|
10
|
+
* Reads the existing registry from disk, applies the patch, and writes
|
|
11
|
+
* back atomically. If the read fails (e.g., malformed JSON on disk), the
|
|
12
|
+
* function returns Err and refuses to overwrite the file — silent recovery
|
|
13
|
+
* would erase potentially-recoverable user state.
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyRegistryPatch(cawsDir: string, patch: RegistryPatch): Result<true>;
|
|
16
|
+
//# sourceMappingURL=apply-patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-patch.d.ts","sourceRoot":"","sources":["../../src/store/apply-patch.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAC;AA0DlF;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAWtF"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Apply kernel-emitted RegistryPatch envelopes to on-disk registries.
|
|
3
|
+
//
|
|
4
|
+
// The kernel never reads or writes files — it returns typed patches
|
|
5
|
+
// describing exactly what the shell should do. This module is the SINGLE
|
|
6
|
+
// place those patches turn into atomic writes:
|
|
7
|
+
//
|
|
8
|
+
// bind_worktree → worktrees.json[name] = { specId, owner, ... }
|
|
9
|
+
// rebind_worktree → worktrees.json[name].specId = newSpecId
|
|
10
|
+
// takeover_claim → worktrees.json[name].owner = newOwner;
|
|
11
|
+
// worktrees.json[name].prior_owners.push(audit)
|
|
12
|
+
// refresh_agent → agents.json[session_id] = { last_active, ... }
|
|
13
|
+
//
|
|
14
|
+
// All writes use the existing atomic-write helper (temp + fsync + rename).
|
|
15
|
+
// We do NOT touch agents.json from worktree-patch paths and vice versa.
|
|
16
|
+
//
|
|
17
|
+
// Authority discipline preserved:
|
|
18
|
+
// - worktrees.json[name].owner is the SOLE authority for ownership.
|
|
19
|
+
// - agents.json updates are display/freshness only.
|
|
20
|
+
// - prior_owners is append-only; takeover_claim never truncates.
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
25
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(o, k2, desc);
|
|
28
|
+
}) : (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
o[k2] = m[k];
|
|
31
|
+
}));
|
|
32
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
+
}) : function(o, v) {
|
|
35
|
+
o["default"] = v;
|
|
36
|
+
});
|
|
37
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
38
|
+
var ownKeys = function(o) {
|
|
39
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
+
var ar = [];
|
|
41
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
return ownKeys(o);
|
|
45
|
+
};
|
|
46
|
+
return function (mod) {
|
|
47
|
+
if (mod && mod.__esModule) return mod;
|
|
48
|
+
var result = {};
|
|
49
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
+
__setModuleDefault(result, mod);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.applyRegistryPatch = applyRegistryPatch;
|
|
56
|
+
const path = __importStar(require("node:path"));
|
|
57
|
+
const fs = __importStar(require("node:fs"));
|
|
58
|
+
const caws_kernel_1 = require("@paths.design/caws-kernel");
|
|
59
|
+
const atomic_write_1 = require("./atomic-write");
|
|
60
|
+
const rules_1 = require("./rules");
|
|
61
|
+
const WORKTREES_FILENAME = 'worktrees.json';
|
|
62
|
+
const AGENTS_FILENAME = 'agents.json';
|
|
63
|
+
function storeErr(rule, message, data) {
|
|
64
|
+
const base = {
|
|
65
|
+
rule,
|
|
66
|
+
authority: 'kernel/diagnostics',
|
|
67
|
+
severity: 'error',
|
|
68
|
+
message,
|
|
69
|
+
};
|
|
70
|
+
return data !== undefined ? { ...base, data } : base;
|
|
71
|
+
}
|
|
72
|
+
function readRegistryJson(filePath, defaultValue) {
|
|
73
|
+
if (!fs.existsSync(filePath)) {
|
|
74
|
+
return (0, caws_kernel_1.ok)(defaultValue);
|
|
75
|
+
}
|
|
76
|
+
let raw;
|
|
77
|
+
try {
|
|
78
|
+
raw = fs.readFileSync(filePath, 'utf8');
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
return (0, caws_kernel_1.err)(storeErr(rules_1.STORE_RULES.READ_IO_FAILED, `Failed to read ${path.basename(filePath)}: ${e.message}`, { filePath }));
|
|
82
|
+
}
|
|
83
|
+
if (raw.trim().length === 0)
|
|
84
|
+
return (0, caws_kernel_1.ok)(defaultValue);
|
|
85
|
+
try {
|
|
86
|
+
const parsed = JSON.parse(raw);
|
|
87
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
88
|
+
return (0, caws_kernel_1.err)(storeErr(rules_1.STORE_RULES.REGISTRY_NOT_OBJECT, `${path.basename(filePath)} is not a JSON object.`));
|
|
89
|
+
}
|
|
90
|
+
return (0, caws_kernel_1.ok)(parsed);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
return (0, caws_kernel_1.err)(storeErr(rules_1.STORE_RULES.READ_JSON_INVALID, `Invalid JSON in ${path.basename(filePath)}: ${e.message}`, { filePath }));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function writeRegistryJson(filePath, value) {
|
|
97
|
+
return (0, atomic_write_1.writeFileAtomic)(filePath, JSON.stringify(value, null, 2) + '\n');
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Apply a single RegistryPatch to the on-disk registries.
|
|
101
|
+
*
|
|
102
|
+
* Returns Ok(true) on successful write. The patch envelope itself is the
|
|
103
|
+
* proof-of-intent — this function never invents fields. It only translates
|
|
104
|
+
* the patch into the corresponding registry mutation and persists it.
|
|
105
|
+
*
|
|
106
|
+
* Reads the existing registry from disk, applies the patch, and writes
|
|
107
|
+
* back atomically. If the read fails (e.g., malformed JSON on disk), the
|
|
108
|
+
* function returns Err and refuses to overwrite the file — silent recovery
|
|
109
|
+
* would erase potentially-recoverable user state.
|
|
110
|
+
*/
|
|
111
|
+
function applyRegistryPatch(cawsDir, patch) {
|
|
112
|
+
switch (patch.kind) {
|
|
113
|
+
case 'bind_worktree':
|
|
114
|
+
return applyBindWorktree(cawsDir, patch);
|
|
115
|
+
case 'rebind_worktree':
|
|
116
|
+
return applyRebindWorktree(cawsDir, patch);
|
|
117
|
+
case 'takeover_claim':
|
|
118
|
+
return applyTakeoverClaim(cawsDir, patch);
|
|
119
|
+
case 'refresh_agent':
|
|
120
|
+
return applyRefreshAgent(cawsDir, patch);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function applyBindWorktree(cawsDir, patch) {
|
|
124
|
+
const filePath = path.join(cawsDir, WORKTREES_FILENAME);
|
|
125
|
+
const readResult = readRegistryJson(filePath, {});
|
|
126
|
+
if (!readResult.ok)
|
|
127
|
+
return readResult;
|
|
128
|
+
const registry = { ...readResult.value };
|
|
129
|
+
const prev = registry[patch.worktree_name] ?? {};
|
|
130
|
+
registry[patch.worktree_name] = {
|
|
131
|
+
...prev,
|
|
132
|
+
specId: patch.spec_id,
|
|
133
|
+
owner: patch.owner,
|
|
134
|
+
last_heartbeat: patch.when,
|
|
135
|
+
};
|
|
136
|
+
return writeRegistryJson(filePath, registry);
|
|
137
|
+
}
|
|
138
|
+
function applyRebindWorktree(cawsDir, patch) {
|
|
139
|
+
const filePath = path.join(cawsDir, WORKTREES_FILENAME);
|
|
140
|
+
const readResult = readRegistryJson(filePath, {});
|
|
141
|
+
if (!readResult.ok)
|
|
142
|
+
return readResult;
|
|
143
|
+
const registry = { ...readResult.value };
|
|
144
|
+
const prev = registry[patch.worktree_name];
|
|
145
|
+
if (prev === undefined) {
|
|
146
|
+
return (0, caws_kernel_1.err)(storeErr(rules_1.STORE_RULES.WRITE_PATCH_TARGET_MISSING, `Cannot rebind worktree "${patch.worktree_name}" — no existing entry.`, { worktree_name: patch.worktree_name }));
|
|
147
|
+
}
|
|
148
|
+
registry[patch.worktree_name] = {
|
|
149
|
+
...prev,
|
|
150
|
+
specId: patch.to_spec_id,
|
|
151
|
+
};
|
|
152
|
+
return writeRegistryJson(filePath, registry);
|
|
153
|
+
}
|
|
154
|
+
function applyTakeoverClaim(cawsDir, patch) {
|
|
155
|
+
const filePath = path.join(cawsDir, WORKTREES_FILENAME);
|
|
156
|
+
const readResult = readRegistryJson(filePath, {});
|
|
157
|
+
if (!readResult.ok)
|
|
158
|
+
return readResult;
|
|
159
|
+
const registry = { ...readResult.value };
|
|
160
|
+
const prev = registry[patch.worktree_name];
|
|
161
|
+
if (prev === undefined) {
|
|
162
|
+
return (0, caws_kernel_1.err)(storeErr(rules_1.STORE_RULES.WRITE_PATCH_TARGET_MISSING, `Cannot take over "${patch.worktree_name}" — no existing entry.`, { worktree_name: patch.worktree_name }));
|
|
163
|
+
}
|
|
164
|
+
// prior_owners is append-only. Kernel never truncates; we don't either.
|
|
165
|
+
const priorOwners = [...(prev.prior_owners ?? []), patch.prior_owner];
|
|
166
|
+
registry[patch.worktree_name] = {
|
|
167
|
+
...prev,
|
|
168
|
+
owner: patch.owner,
|
|
169
|
+
last_heartbeat: patch.when,
|
|
170
|
+
prior_owners: priorOwners,
|
|
171
|
+
};
|
|
172
|
+
return writeRegistryJson(filePath, registry);
|
|
173
|
+
}
|
|
174
|
+
function applyRefreshAgent(cawsDir, patch) {
|
|
175
|
+
const filePath = path.join(cawsDir, AGENTS_FILENAME);
|
|
176
|
+
const readResult = readRegistryJson(filePath, {});
|
|
177
|
+
if (!readResult.ok)
|
|
178
|
+
return readResult;
|
|
179
|
+
const registry = { ...readResult.value };
|
|
180
|
+
const prev = registry[patch.session.session_id] ?? { session_id: patch.session.session_id, last_active: patch.last_active };
|
|
181
|
+
registry[patch.session.session_id] = {
|
|
182
|
+
...prev,
|
|
183
|
+
session_id: patch.session.session_id,
|
|
184
|
+
...(patch.session.platform !== undefined ? { platform: patch.session.platform } : {}),
|
|
185
|
+
last_active: patch.last_active,
|
|
186
|
+
...(patch.bound_worktree !== undefined ? { bound_worktree: patch.bound_worktree } : {}),
|
|
187
|
+
...(patch.bound_spec_id !== undefined ? { bound_spec_id: patch.bound_spec_id } : {}),
|
|
188
|
+
};
|
|
189
|
+
return writeRegistryJson(filePath, registry);
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=apply-patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-patch.js","sourceRoot":"","sources":["../../src/store/apply-patch.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,+CAA+C;AAC/C,EAAE;AACF,sEAAsE;AACtE,gEAAgE;AAChE,+DAA+D;AAC/D,sEAAsE;AACtE,uEAAuE;AACvE,EAAE;AACF,2EAA2E;AAC3E,wEAAwE;AACxE,EAAE;AACF,kCAAkC;AAClC,sEAAsE;AACtE,sDAAsD;AACtD,mEAAmE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFnE,gDAWC;AAzFD,gDAAkC;AAClC,4CAA8B;AAO9B,2DAAkF;AAElF,iDAAiD;AACjD,mCAAsC;AAEtC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAC5C,MAAM,eAAe,GAAG,aAAa,CAAC;AAEtC,SAAS,QAAQ,CAAC,IAAY,EAAE,OAAe,EAAE,IAA8B;IAC7E,MAAM,IAAI,GAAe;QACvB,IAAI;QACJ,SAAS,EAAE,oBAAoB;QAC/B,QAAQ,EAAE,OAAO;QACjB,OAAO;KACR,CAAC;IACF,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC;AAED,SAAS,gBAAgB,CAAI,QAAgB,EAAE,YAAe;IAC5D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAA,gBAAE,EAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAA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9B,GAAG,CAAC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvF,GAAG,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrF,CAAC;IACF,OAAO,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Result } from '@paths.design/caws-kernel';
|
|
2
|
+
/**
|
|
3
|
+
* Write `contents` to `targetPath` atomically.
|
|
4
|
+
*
|
|
5
|
+
* On Err, the temp file is cleaned up. On Ok, the target file holds the
|
|
6
|
+
* new bytes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function writeFileAtomic(targetPath: string, contents: string | Buffer): Result<true>;
|
|
9
|
+
/**
|
|
10
|
+
* Best-effort parent-directory fsync. Returns true on success, false on
|
|
11
|
+
* failure (some filesystems / platforms don't support it). Callers that
|
|
12
|
+
* care about durability past crash should call this after a sequence of
|
|
13
|
+
* atomic writes. Never throws.
|
|
14
|
+
*/
|
|
15
|
+
export declare function fsyncDir(dirPath: string): boolean;
|
|
16
|
+
//# sourceMappingURL=atomic-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../../src/store/atomic-write.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAajE;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAgC3F;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAiBjD"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Atomic file write.
|
|
3
|
+
//
|
|
4
|
+
// Contract: file CONTENT atomicity. After writeFileAtomic returns Ok, the
|
|
5
|
+
// file at `targetPath` either contains the new bytes in full or the old
|
|
6
|
+
// bytes in full. There is no partial-write window for readers.
|
|
7
|
+
//
|
|
8
|
+
// Mechanism: write to a sibling temp path (`<target>.tmp.<pid>.<counter>`),
|
|
9
|
+
// fsync the data + descriptor, then rename onto the target. rename(2) is
|
|
10
|
+
// atomic on the same filesystem; the sibling location guarantees that.
|
|
11
|
+
//
|
|
12
|
+
// We do NOT guarantee crash-proof directory durability. A power loss
|
|
13
|
+
// between rename and a parent-directory fsync may leave the directory
|
|
14
|
+
// entry on disk while the new file contents are still in the page cache.
|
|
15
|
+
// Callers that need durability past power loss should fsync the parent
|
|
16
|
+
// directory themselves; events-store does this for events.jsonl.
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
+
var ownKeys = function(o) {
|
|
35
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
+
var ar = [];
|
|
37
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
return ownKeys(o);
|
|
41
|
+
};
|
|
42
|
+
return function (mod) {
|
|
43
|
+
if (mod && mod.__esModule) return mod;
|
|
44
|
+
var result = {};
|
|
45
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
+
__setModuleDefault(result, mod);
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.writeFileAtomic = writeFileAtomic;
|
|
52
|
+
exports.fsyncDir = fsyncDir;
|
|
53
|
+
const fs = __importStar(require("fs"));
|
|
54
|
+
const path = __importStar(require("path"));
|
|
55
|
+
const caws_kernel_1 = require("@paths.design/caws-kernel");
|
|
56
|
+
const repo_root_1 = require("./repo-root");
|
|
57
|
+
const rules_1 = require("./rules");
|
|
58
|
+
let tmpCounter = 0;
|
|
59
|
+
function nextTempName(targetPath) {
|
|
60
|
+
const dir = path.dirname(targetPath);
|
|
61
|
+
const base = path.basename(targetPath);
|
|
62
|
+
const counter = tmpCounter++;
|
|
63
|
+
return path.join(dir, `${base}.tmp.${process.pid}.${counter}`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Write `contents` to `targetPath` atomically.
|
|
67
|
+
*
|
|
68
|
+
* On Err, the temp file is cleaned up. On Ok, the target file holds the
|
|
69
|
+
* new bytes.
|
|
70
|
+
*/
|
|
71
|
+
function writeFileAtomic(targetPath, contents) {
|
|
72
|
+
const tmpPath = nextTempName(targetPath);
|
|
73
|
+
let fd;
|
|
74
|
+
try {
|
|
75
|
+
fd = fs.openSync(tmpPath, 'w');
|
|
76
|
+
fs.writeFileSync(fd, contents);
|
|
77
|
+
fs.fsyncSync(fd);
|
|
78
|
+
fs.closeSync(fd);
|
|
79
|
+
fd = undefined;
|
|
80
|
+
fs.renameSync(tmpPath, targetPath);
|
|
81
|
+
return (0, caws_kernel_1.ok)(true);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
if (fd !== undefined) {
|
|
85
|
+
try {
|
|
86
|
+
fs.closeSync(fd);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
/* swallow; we're already in an error path */
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
fs.unlinkSync(tmpPath);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
/* temp file may not have been created */
|
|
97
|
+
}
|
|
98
|
+
const cause = e;
|
|
99
|
+
return (0, caws_kernel_1.err)((0, repo_root_1.storeDiagnostic)(rules_1.STORE_RULES.WRITE_IO_FAILED, `Failed to write ${targetPath}: ${cause.message ?? 'unknown error'}.`, {
|
|
100
|
+
subject: targetPath,
|
|
101
|
+
data: { code: cause.code },
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Best-effort parent-directory fsync. Returns true on success, false on
|
|
107
|
+
* failure (some filesystems / platforms don't support it). Callers that
|
|
108
|
+
* care about durability past crash should call this after a sequence of
|
|
109
|
+
* atomic writes. Never throws.
|
|
110
|
+
*/
|
|
111
|
+
function fsyncDir(dirPath) {
|
|
112
|
+
let fd;
|
|
113
|
+
try {
|
|
114
|
+
fd = fs.openSync(dirPath, 'r');
|
|
115
|
+
fs.fsyncSync(fd);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
finally {
|
|
122
|
+
if (fd !== undefined) {
|
|
123
|
+
try {
|
|
124
|
+
fs.closeSync(fd);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
/* ignore */
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=atomic-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-write.js","sourceRoot":"","sources":["../../src/store/atomic-write.ts"],"names":[],"mappings":";AAAA,qBAAqB;AACrB,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,+DAA+D;AAC/D,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,uEAAuE;AACvE,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,yEAAyE;AACzE,uEAAuE;AACvE,iEAAiE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBjE,0CAgCC;AAQD,4BAiBC;AA9ED,uCAAyB;AACzB,2CAA6B;AAC7B,2DAAiE;AACjE,2CAA8C;AAC9C,mCAAsC;AAEtC,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,SAAS,YAAY,CAAC,UAAkB;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,QAAQ,OAAO,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,UAAkB,EAAE,QAAyB;IAC3E,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,EAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC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CAAC;YACrB,IAAI,CAAC;gBACH,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY;YACd,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type DoctorInput, type TemplateCheck } from '@paths.design/caws-kernel';
|
|
2
|
+
import type { StoreSnapshot } from './types';
|
|
3
|
+
export interface ComposeOptions {
|
|
4
|
+
readonly repoRoot: string;
|
|
5
|
+
readonly cawsDir: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function composeStoreSnapshot(options: ComposeOptions): StoreSnapshot;
|
|
8
|
+
export interface ComposeDoctorOptions extends ComposeOptions {
|
|
9
|
+
readonly now: Date;
|
|
10
|
+
readonly templates?: readonly TemplateCheck[];
|
|
11
|
+
readonly staleAgentTtlMs?: number;
|
|
12
|
+
readonly unboundActiveThresholdMs?: number;
|
|
13
|
+
readonly priorOwnersGrowthThreshold?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ComposeDoctorResult {
|
|
16
|
+
readonly snapshot: StoreSnapshot;
|
|
17
|
+
readonly doctorInput: DoctorInput;
|
|
18
|
+
}
|
|
19
|
+
export declare function composeDoctorSnapshot(options: ComposeDoctorOptions): ComposeDoctorResult;
|
|
20
|
+
//# sourceMappingURL=doctor-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-snapshot.d.ts","sourceRoot":"","sources":["../../src/store/doctor-snapshot.ts"],"names":[],"mappings":"AAuBA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CAqC3E;AA8DD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;IACnB,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA6BxF"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Doctor snapshot composition.
|
|
3
|
+
//
|
|
4
|
+
// Pulls state from each store adapter and assembles two artifacts:
|
|
5
|
+
// 1. StoreSnapshot — the full I/O-derived state, including load
|
|
6
|
+
// diagnostics. The shell uses this for separate display of
|
|
7
|
+
// load failures.
|
|
8
|
+
// 2. DoctorInput — the projection of valid state the kernel's
|
|
9
|
+
// `inspectProjectState` accepts.
|
|
10
|
+
//
|
|
11
|
+
// Discipline:
|
|
12
|
+
// - The composer does NOT invent validation. It loads, calls the
|
|
13
|
+
// existing kernel functions, and forwards.
|
|
14
|
+
// - The composer accepts `now` as input. It never reads Date.now().
|
|
15
|
+
// - Template-check discovery is OUT OF SCOPE in Slice 5b. If the
|
|
16
|
+
// caller wants template diagnostics, they pass `TemplateCheck[]`
|
|
17
|
+
// themselves.
|
|
18
|
+
// - Session capsules (.caws/sessions/<id>.json) are OUT OF SCOPE in
|
|
19
|
+
// Slice 5b — they're tied to identity resolution which is a Slice
|
|
20
|
+
// 5c concern.
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
25
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(o, k2, desc);
|
|
28
|
+
}) : (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
o[k2] = m[k];
|
|
31
|
+
}));
|
|
32
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
+
}) : function(o, v) {
|
|
35
|
+
o["default"] = v;
|
|
36
|
+
});
|
|
37
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
38
|
+
var ownKeys = function(o) {
|
|
39
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
+
var ar = [];
|
|
41
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
return ownKeys(o);
|
|
45
|
+
};
|
|
46
|
+
return function (mod) {
|
|
47
|
+
if (mod && mod.__esModule) return mod;
|
|
48
|
+
var result = {};
|
|
49
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
+
__setModuleDefault(result, mod);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.composeStoreSnapshot = composeStoreSnapshot;
|
|
56
|
+
exports.composeDoctorSnapshot = composeDoctorSnapshot;
|
|
57
|
+
const fs = __importStar(require("fs"));
|
|
58
|
+
const path = __importStar(require("path"));
|
|
59
|
+
const caws_kernel_1 = require("@paths.design/caws-kernel");
|
|
60
|
+
const agents_store_1 = require("./agents-store");
|
|
61
|
+
const events_store_1 = require("./events-store");
|
|
62
|
+
const policy_store_1 = require("./policy-store");
|
|
63
|
+
const specs_store_1 = require("./specs-store");
|
|
64
|
+
const waivers_store_1 = require("./waivers-store");
|
|
65
|
+
const worktrees_store_1 = require("./worktrees-store");
|
|
66
|
+
function composeStoreSnapshot(options) {
|
|
67
|
+
const { repoRoot, cawsDir } = options;
|
|
68
|
+
const specsResult = (0, specs_store_1.loadSpecs)(cawsDir);
|
|
69
|
+
const policyResult = (0, policy_store_1.loadPolicy)(cawsDir);
|
|
70
|
+
const worktreesResult = (0, worktrees_store_1.loadWorktrees)(cawsDir);
|
|
71
|
+
const agentsResult = (0, agents_store_1.loadAgents)(cawsDir);
|
|
72
|
+
const eventsResult = (0, events_store_1.loadEvents)(cawsDir);
|
|
73
|
+
const waiversResult = (0, waivers_store_1.loadWaivers)(cawsDir);
|
|
74
|
+
// Slice 7c.1 — observe vNext-shape facts the kernel cannot derive.
|
|
75
|
+
// The store is the only place that may stat the filesystem; doctor
|
|
76
|
+
// consumes the booleans below without any I/O of its own.
|
|
77
|
+
const initResidue = observeInitResidue(cawsDir);
|
|
78
|
+
const filesystem = observeFilesystem(cawsDir);
|
|
79
|
+
const registryDiagnostics = collectRegistryDiagnostics(worktreesResult, agentsResult);
|
|
80
|
+
return {
|
|
81
|
+
repoRoot,
|
|
82
|
+
cawsDir,
|
|
83
|
+
specs: specsResult.specs,
|
|
84
|
+
specDiagnostics: specsResult.diagnostics,
|
|
85
|
+
...(policyResult.policy !== undefined ? { policy: policyResult.policy } : {}),
|
|
86
|
+
policyWarnings: policyResult.warnings,
|
|
87
|
+
policyErrors: policyResult.errors,
|
|
88
|
+
worktrees: (0, caws_kernel_1.isOk)(worktreesResult) ? worktreesResult.value : {},
|
|
89
|
+
agents: (0, caws_kernel_1.isOk)(agentsResult) ? agentsResult.value : {},
|
|
90
|
+
events: (0, caws_kernel_1.isOk)(eventsResult) ? eventsResult.value.events : [],
|
|
91
|
+
eventWarnings: (0, caws_kernel_1.isOk)(eventsResult) ? eventsResult.value.warnings : eventsResult.errors,
|
|
92
|
+
waivers: waiversResult.waivers,
|
|
93
|
+
waiverDiagnostics: waiversResult.diagnostics,
|
|
94
|
+
initResidue,
|
|
95
|
+
filesystem,
|
|
96
|
+
registryDiagnostics,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// ----------------------------------------------------------------------------
|
|
100
|
+
// 7c.1 helpers — file-existence observation
|
|
101
|
+
//
|
|
102
|
+
// These intentionally do NOT distinguish "not a file vs not a directory" —
|
|
103
|
+
// doctor's rules in 7c.2 only need "is this canonical surface present?".
|
|
104
|
+
// Distinguishing kind would expand the input shape with information no
|
|
105
|
+
// rule yet consumes.
|
|
106
|
+
// ----------------------------------------------------------------------------
|
|
107
|
+
function isFile(p) {
|
|
108
|
+
try {
|
|
109
|
+
return fs.statSync(p).isFile();
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function isDir(p) {
|
|
116
|
+
try {
|
|
117
|
+
return fs.statSync(p).isDirectory();
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function observeInitResidue(cawsDir) {
|
|
124
|
+
return {
|
|
125
|
+
workingSpecYaml: isFile(path.join(cawsDir, 'working-spec.yaml')),
|
|
126
|
+
workingSpecSchemaJson: isFile(path.join(cawsDir, 'working-spec.schema.json')),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function observeFilesystem(cawsDir) {
|
|
130
|
+
return {
|
|
131
|
+
cawsDirExists: isDir(cawsDir),
|
|
132
|
+
specsDirExists: isDir(path.join(cawsDir, 'specs')),
|
|
133
|
+
waiversDirExists: isDir(path.join(cawsDir, 'waivers')),
|
|
134
|
+
policyYamlExists: isFile(path.join(cawsDir, 'policy.yaml')),
|
|
135
|
+
worktreesJsonExists: isFile(path.join(cawsDir, 'worktrees.json')),
|
|
136
|
+
agentsJsonExists: isFile(path.join(cawsDir, 'agents.json')),
|
|
137
|
+
eventsJsonlExists: isFile(path.join(cawsDir, 'events.jsonl')),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function collectRegistryDiagnostics(worktreesResult, agentsResult) {
|
|
141
|
+
const out = [];
|
|
142
|
+
if (!(0, caws_kernel_1.isOk)(worktreesResult))
|
|
143
|
+
out.push(...worktreesResult.errors);
|
|
144
|
+
if (!(0, caws_kernel_1.isOk)(agentsResult))
|
|
145
|
+
out.push(...agentsResult.errors);
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
function composeDoctorSnapshot(options) {
|
|
149
|
+
const snapshot = composeStoreSnapshot(options);
|
|
150
|
+
const doctorInput = {
|
|
151
|
+
specs: snapshot.specs,
|
|
152
|
+
...(snapshot.policy !== undefined ? { policy: snapshot.policy } : {}),
|
|
153
|
+
policyWarnings: snapshot.policyWarnings,
|
|
154
|
+
worktrees: snapshot.worktrees,
|
|
155
|
+
agents: snapshot.agents,
|
|
156
|
+
events: snapshot.events,
|
|
157
|
+
...(options.templates !== undefined ? { templates: options.templates } : {}),
|
|
158
|
+
waivers: snapshot.waivers,
|
|
159
|
+
waiverDiagnostics: snapshot.waiverDiagnostics,
|
|
160
|
+
initResidue: snapshot.initResidue,
|
|
161
|
+
filesystem: snapshot.filesystem,
|
|
162
|
+
registryDiagnostics: snapshot.registryDiagnostics,
|
|
163
|
+
now: options.now,
|
|
164
|
+
...(options.staleAgentTtlMs !== undefined
|
|
165
|
+
? { staleAgentTtlMs: options.staleAgentTtlMs }
|
|
166
|
+
: {}),
|
|
167
|
+
...(options.unboundActiveThresholdMs !== undefined
|
|
168
|
+
? { unboundActiveThresholdMs: options.unboundActiveThresholdMs }
|
|
169
|
+
: {}),
|
|
170
|
+
...(options.priorOwnersGrowthThreshold !== undefined
|
|
171
|
+
? { priorOwnersGrowthThreshold: options.priorOwnersGrowthThreshold }
|
|
172
|
+
: {}),
|
|
173
|
+
};
|
|
174
|
+
return { snapshot, doctorInput };
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=doctor-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-snapshot.js","sourceRoot":"","sources":["../../src/store/doctor-snapshot.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,EAAE;AACF,mEAAmE;AACnE,kEAAkE;AAClE,gEAAgE;AAChE,sBAAsB;AACtB,gEAAgE;AAChE,sCAAsC;AACtC,EAAE;AACF,cAAc;AACd,mEAAmE;AACnE,+CAA+C;AAC/C,sEAAsE;AACtE,mEAAmE;AACnE,qEAAqE;AACrE,kBAAkB;AAClB,sEAAsE;AACtE,sEAAsE;AACtE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BlB,oDAqCC;AA2ED,sDA6BC;AAvKD,uCAAyB;AACzB,2CAA6B;AAE7B,2DAKmC;AACnC,iDAA4C;AAC5C,iDAA4C;AAC5C,iDAA4C;AAC5C,+CAA0C;AAE1C,mDAA8C;AAC9C,uDAAkD;AAWlD,SAAgB,oBAAoB,CAAC,OAAuB;IAC1D,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACtC,MAAM,WAAW,GAAG,IAAA,uBAAS,EAAC,OAAO,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,IAAA,yBAAU,EAAC,OAAO,CAAC,CAAC;IACzC,MAAM,eAAe,GAAG,IAAA,+BAAa,EAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,YAAY,GAAG,IAAA,yBAAU,EAAC,OAAO,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,IAAA,yBAAU,EAAC,OAAO,CAAC,CAAC;IACzC,MAAM,a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