@planu/cli 6.1.0 → 7.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/dist/index.d.ts +1 -2
- package/dist/index.js +1 -112
- package/dist/sdd-engine/contracts.d.ts +76 -0
- package/dist/sdd-engine/contracts.js +60 -0
- package/dist/sdd-engine/index.d.ts +5 -0
- package/dist/sdd-engine/index.js +5 -0
- package/dist/sdd-engine/patch-sandbox.d.ts +14 -0
- package/dist/sdd-engine/patch-sandbox.js +173 -0
- package/dist/sdd-engine/server.d.ts +5 -0
- package/dist/sdd-engine/server.js +30 -0
- package/dist/sdd-engine/task-window.d.ts +9 -0
- package/dist/sdd-engine/task-window.js +153 -0
- package/dist/sdd-engine/tools/execution-tools.d.ts +5 -0
- package/dist/sdd-engine/tools/execution-tools.js +138 -0
- package/dist/sdd-engine/tools/format-result.d.ts +4 -0
- package/dist/sdd-engine/tools/format-result.js +22 -0
- package/dist/sdd-engine/tools/workspace-tools.d.ts +3 -0
- package/dist/sdd-engine/tools/workspace-tools.js +193 -0
- package/dist/sdd-engine/tools.d.ts +3 -0
- package/dist/sdd-engine/tools.js +13 -0
- package/dist/types/sdd-engine.d.ts +91 -0
- package/dist/types/sdd-engine.js +2 -0
- package/package.json +43 -46
- package/dist/.planu-build.json +0 -1
- package/dist/cli/colors.d.ts +0 -14
- package/dist/cli/colors.js +0 -26
- package/dist/cli/commands/doctor.d.ts +0 -12
- package/dist/cli/commands/doctor.js +0 -91
- package/dist/cli/commands/init.d.ts +0 -3
- package/dist/cli/commands/init.js +0 -37
- package/dist/cli/commands/job.d.ts +0 -3
- package/dist/cli/commands/job.js +0 -112
- package/dist/cli/commands/list.d.ts +0 -3
- package/dist/cli/commands/list.js +0 -39
- package/dist/cli/commands/package-handoff.d.ts +0 -3
- package/dist/cli/commands/package-handoff.js +0 -75
- package/dist/cli/commands/spec.d.ts +0 -3
- package/dist/cli/commands/spec.js +0 -156
- package/dist/cli/commands/status.d.ts +0 -3
- package/dist/cli/commands/status.js +0 -113
- package/dist/cli/commands/validate.d.ts +0 -3
- package/dist/cli/commands/validate.js +0 -39
- package/dist/cli/formatter.d.ts +0 -26
- package/dist/cli/formatter.js +0 -126
- package/dist/cli/index.d.ts +0 -3
- package/dist/cli/index.js +0 -29
- package/dist/cli/project-detector.d.ts +0 -6
- package/dist/cli/project-detector.js +0 -12
- package/dist/cli/router.d.ts +0 -6
- package/dist/cli/router.js +0 -142
- package/dist/config/architecture-patterns.json +0 -324
- package/dist/config/detection-signals.json +0 -256
- package/dist/config/docs-registry.json +0 -94
- package/dist/config/dor-dod-items.json +0 -194
- package/dist/config/drift-severity.json +0 -22
- package/dist/config/event-brokers.json +0 -63
- package/dist/config/framework-registry/csharp-aspnet.json +0 -67
- package/dist/config/framework-registry/dart-flutter.json +0 -61
- package/dist/config/framework-registry/go-gin.json +0 -62
- package/dist/config/framework-registry/index.json +0 -164
- package/dist/config/framework-registry/java-springboot.json +0 -67
- package/dist/config/framework-registry/php-laravel.json +0 -67
- package/dist/config/framework-registry/python-django.json +0 -72
- package/dist/config/framework-registry/python-fastapi.json +0 -72
- package/dist/config/framework-registry/ruby-rails.json +0 -67
- package/dist/config/framework-registry/rust-actix.json +0 -61
- package/dist/config/framework-registry/swift-swiftui.json +0 -67
- package/dist/config/framework-registry/typescript-angular.json +0 -67
- package/dist/config/framework-registry/typescript-astro.json +0 -61
- package/dist/config/framework-registry/typescript-express.json +0 -67
- package/dist/config/framework-registry/typescript-nestjs.json +0 -62
- package/dist/config/framework-registry/typescript-nextjs.json +0 -82
- package/dist/config/framework-registry/typescript-nuxt.json +0 -67
- package/dist/config/framework-registry/typescript-react.json +0 -77
- package/dist/config/framework-registry/typescript-remix.json +0 -61
- package/dist/config/framework-registry/typescript-sveltekit.json +0 -67
- package/dist/config/framework-registry/typescript-vue.json +0 -72
- package/dist/config/hook-templates/planu-force-ask-user-question.sh +0 -14
- package/dist/config/hook-templates/planu-spec-sanctity.sh +0 -128
- package/dist/config/legacy-artifacts.json +0 -26
- package/dist/config/minimal-implementation-gate.json +0 -149
- package/dist/config/negative-predicate-phrases.json +0 -33
- package/dist/config/official-sdd-tools.d.ts +0 -7
- package/dist/config/official-sdd-tools.js +0 -44
- package/dist/config/out-of-scope-suggestions.json +0 -190
- package/dist/config/paradigm-registry.json +0 -380
- package/dist/config/project-knowledge-graph.json +0 -170
- package/dist/config/readiness-config.json +0 -22
- package/dist/config/registries/error-recovery.json +0 -114
- package/dist/config/registries/legacy-guidance.json +0 -118
- package/dist/config/registries/spec-folder-sanctity.json +0 -4
- package/dist/config/runtime-policy.json +0 -66
- package/dist/config/server-instructions.d.ts +0 -2
- package/dist/config/server-instructions.js +0 -18
- package/dist/config/skill-templates/planu-dogfood-bug.md +0 -43
- package/dist/config/skill-templates/planu-implement.md +0 -42
- package/dist/config/skill-templates/planu-native.md +0 -30
- package/dist/config/skill-templates/planu-new-spec.md +0 -56
- package/dist/config/skill-templates/planu-resume-work.md +0 -51
- package/dist/config/skill-templates/planu-review.md +0 -47
- package/dist/config/skill-templates/planu-validate.md +0 -59
- package/dist/config/stack-signatures.json +0 -793
- package/dist/config/subagent-templates/planu-challenger.md +0 -49
- package/dist/config/subagent-templates/planu-readiness-auditor.md +0 -51
- package/dist/config/subagent-templates/planu-spec-implementer.md +0 -50
- package/dist/config/subagent-templates/planu-validator.md +0 -56
- package/dist/config/technology-registry.json +0 -120
- package/dist/config/version.d.ts +0 -2
- package/dist/config/version.js +0 -20
- package/dist/core/shared/fs.d.ts +0 -10
- package/dist/core/shared/fs.js +0 -89
- package/dist/core/shared/object.d.ts +0 -3
- package/dist/core/shared/object.js +0 -12
- package/dist/core/shared/strings.d.ts +0 -3
- package/dist/core/shared/strings.js +0 -13
- package/dist/core/spec-validator.d.ts +0 -12
- package/dist/core/spec-validator.js +0 -250
- package/dist/engine/abortable-process-runner.d.ts +0 -26
- package/dist/engine/abortable-process-runner.js +0 -308
- package/dist/engine/ai-assurance/index.d.ts +0 -4
- package/dist/engine/ai-assurance/index.js +0 -3
- package/dist/engine/ai-assurance/new-code-gate.d.ts +0 -3
- package/dist/engine/ai-assurance/new-code-gate.js +0 -39
- package/dist/engine/ai-assurance/spec-assurance.d.ts +0 -3
- package/dist/engine/ai-assurance/spec-assurance.js +0 -138
- package/dist/engine/ai-integration/codex/agent-roles-generator.d.ts +0 -12
- package/dist/engine/ai-integration/codex/agent-roles-generator.js +0 -62
- package/dist/engine/ambiguity-scorer.d.ts +0 -13
- package/dist/engine/ambiguity-scorer.js +0 -155
- package/dist/engine/approval-workflow.d.ts +0 -21
- package/dist/engine/approval-workflow.js +0 -82
- package/dist/engine/audit-trail/hasher.d.ts +0 -18
- package/dist/engine/audit-trail/hasher.js +0 -46
- package/dist/engine/auditor-scoring.d.ts +0 -7
- package/dist/engine/auditor-scoring.js +0 -76
- package/dist/engine/build-freshness.d.ts +0 -4
- package/dist/engine/build-freshness.js +0 -170
- package/dist/engine/challenge-prioritizer.d.ts +0 -17
- package/dist/engine/challenge-prioritizer.js +0 -78
- package/dist/engine/clarification-gate/error-builder.d.ts +0 -12
- package/dist/engine/clarification-gate/error-builder.js +0 -33
- package/dist/engine/clarification-gate/gate.d.ts +0 -15
- package/dist/engine/clarification-gate/gate.js +0 -41
- package/dist/engine/clarification-gate/token-store.d.ts +0 -28
- package/dist/engine/clarification-gate/token-store.js +0 -67
- package/dist/engine/coach/i18n.d.ts +0 -11
- package/dist/engine/coach/i18n.js +0 -78
- package/dist/engine/code-scanner/gap-scorer.d.ts +0 -9
- package/dist/engine/code-scanner/gap-scorer.js +0 -89
- package/dist/engine/code-scanner/index.d.ts +0 -9
- package/dist/engine/code-scanner/index.js +0 -15
- package/dist/engine/code-scanner/keyword-extractor.d.ts +0 -11
- package/dist/engine/code-scanner/keyword-extractor.js +0 -88
- package/dist/engine/code-scanner/layer-scanner.d.ts +0 -24
- package/dist/engine/code-scanner/layer-scanner.js +0 -135
- package/dist/engine/compact/tool-list-compactor.d.ts +0 -7
- package/dist/engine/compact/tool-list-compactor.js +0 -87
- package/dist/engine/compact-obj.d.ts +0 -7
- package/dist/engine/compact-obj.js +0 -28
- package/dist/engine/complexity-budget/index.d.ts +0 -2
- package/dist/engine/complexity-budget/index.js +0 -3
- package/dist/engine/complexity-budget/trivial-detector.d.ts +0 -7
- package/dist/engine/complexity-budget/trivial-detector.js +0 -69
- package/dist/engine/config-loader.d.ts +0 -73
- package/dist/engine/config-loader.js +0 -239
- package/dist/engine/constitution/sdd-rules-registry.d.ts +0 -11
- package/dist/engine/constitution/sdd-rules-registry.js +0 -109
- package/dist/engine/context-merger.d.ts +0 -23
- package/dist/engine/context-merger.js +0 -197
- package/dist/engine/contradiction-detector.d.ts +0 -16
- package/dist/engine/contradiction-detector.js +0 -406
- package/dist/engine/convention-scanner/codebase-scanner.d.ts +0 -7
- package/dist/engine/convention-scanner/codebase-scanner.js +0 -390
- package/dist/engine/convention-scanner/convention-parser.d.ts +0 -7
- package/dist/engine/convention-scanner/convention-parser.js +0 -189
- package/dist/engine/convention-scanner/index.d.ts +0 -3
- package/dist/engine/convention-scanner/index.js +0 -5
- package/dist/engine/conventions-ttl.d.ts +0 -8
- package/dist/engine/conventions-ttl.js +0 -75
- package/dist/engine/core-bridge-duplicate-blocks.d.ts +0 -3
- package/dist/engine/core-bridge-duplicate-blocks.js +0 -56
- package/dist/engine/core-bridge-gaps.d.ts +0 -4
- package/dist/engine/core-bridge-gaps.js +0 -75
- package/dist/engine/core-bridge-project-graph.d.ts +0 -9
- package/dist/engine/core-bridge-project-graph.js +0 -499
- package/dist/engine/core-bridge.d.ts +0 -34
- package/dist/engine/core-bridge.js +0 -392
- package/dist/engine/criteria-quality-checker.d.ts +0 -8
- package/dist/engine/criteria-quality-checker.js +0 -55
- package/dist/engine/criterion-identity.d.ts +0 -7
- package/dist/engine/criterion-identity.js +0 -70
- package/dist/engine/data-projects-gc/pattern-matcher.d.ts +0 -21
- package/dist/engine/data-projects-gc/pattern-matcher.js +0 -68
- package/dist/engine/dep-guard/cycle-detector.d.ts +0 -29
- package/dist/engine/dep-guard/cycle-detector.js +0 -83
- package/dist/engine/dep-guard/index.d.ts +0 -3
- package/dist/engine/dep-guard/index.js +0 -3
- package/dist/engine/dependency-evaluator.d.ts +0 -15
- package/dist/engine/dependency-evaluator.js +0 -81
- package/dist/engine/detection-utils.d.ts +0 -13
- package/dist/engine/detection-utils.js +0 -255
- package/dist/engine/dor-dod/dod.d.ts +0 -17
- package/dist/engine/dor-dod/dod.js +0 -98
- package/dist/engine/dor-dod/dor.d.ts +0 -21
- package/dist/engine/dor-dod/dor.js +0 -149
- package/dist/engine/dor-dod/index.d.ts +0 -4
- package/dist/engine/dor-dod/index.js +0 -5
- package/dist/engine/dor-dod/items-loader.d.ts +0 -18
- package/dist/engine/dor-dod/items-loader.js +0 -55
- package/dist/engine/dor-dod/plan.d.ts +0 -8
- package/dist/engine/dor-dod/plan.js +0 -50
- package/dist/engine/dor-dod.d.ts +0 -2
- package/dist/engine/dor-dod.js +0 -4
- package/dist/engine/ears-gate.d.ts +0 -19
- package/dist/engine/ears-gate.js +0 -120
- package/dist/engine/elicitation/answer-extractor.d.ts +0 -4
- package/dist/engine/elicitation/answer-extractor.js +0 -225
- package/dist/engine/elicitation/capability.d.ts +0 -9
- package/dist/engine/elicitation/capability.js +0 -48
- package/dist/engine/elicitation/decision-gap-detector.d.ts +0 -3
- package/dist/engine/elicitation/decision-gap-detector.js +0 -142
- package/dist/engine/elicitation/elicit-helper.d.ts +0 -36
- package/dist/engine/elicitation/elicit-helper.js +0 -113
- package/dist/engine/elicitation/question-grounding-gate.d.ts +0 -3
- package/dist/engine/elicitation/question-grounding-gate.js +0 -103
- package/dist/engine/errors/error-result.d.ts +0 -4
- package/dist/engine/errors/error-result.js +0 -16
- package/dist/engine/errors/error-wrapper.d.ts +0 -4
- package/dist/engine/errors/error-wrapper.js +0 -82
- package/dist/engine/errors/recovery-registry.d.ts +0 -13
- package/dist/engine/errors/recovery-registry.js +0 -96
- package/dist/engine/errors/registry-loader.d.ts +0 -3
- package/dist/engine/errors/registry-loader.js +0 -22
- package/dist/engine/event-detector.d.ts +0 -33
- package/dist/engine/event-detector.js +0 -97
- package/dist/engine/evidence-gates/artifact-reader.d.ts +0 -133
- package/dist/engine/evidence-gates/artifact-reader.js +0 -387
- package/dist/engine/evidence-gates/evidence-autofill.d.ts +0 -15
- package/dist/engine/evidence-gates/evidence-autofill.js +0 -255
- package/dist/engine/evidence-gates/evidence-skeletons.d.ts +0 -19
- package/dist/engine/evidence-gates/evidence-skeletons.js +0 -78
- package/dist/engine/evidence-gates/lifecycle-gate.d.ts +0 -12
- package/dist/engine/evidence-gates/lifecycle-gate.js +0 -293
- package/dist/engine/evidence-gates/reconciliation-freshness.d.ts +0 -11
- package/dist/engine/evidence-gates/reconciliation-freshness.js +0 -73
- package/dist/engine/evidence-index/done-drift.d.ts +0 -7
- package/dist/engine/evidence-index/done-drift.js +0 -91
- package/dist/engine/evidence-index/index-builder.d.ts +0 -10
- package/dist/engine/evidence-index/index-builder.js +0 -202
- package/dist/engine/execution/context.d.ts +0 -19
- package/dist/engine/execution/context.js +0 -130
- package/dist/engine/execution/deadline-io.d.ts +0 -20
- package/dist/engine/execution/deadline-io.js +0 -30
- package/dist/engine/execution/durable-job-heartbeat-runtime.d.ts +0 -4
- package/dist/engine/execution/durable-job-heartbeat-runtime.js +0 -401
- package/dist/engine/execution/job-runtime.d.ts +0 -101
- package/dist/engine/execution/job-runtime.js +0 -319
- package/dist/engine/execution/operation-journal.d.ts +0 -67
- package/dist/engine/execution/operation-journal.js +0 -266
- package/dist/engine/execution/package-handoff-job-executor.d.ts +0 -22
- package/dist/engine/execution/package-handoff-job-executor.js +0 -510
- package/dist/engine/execution/public-job-sanitizer.d.ts +0 -4
- package/dist/engine/execution/public-job-sanitizer.js +0 -31
- package/dist/engine/execution/startup-recovery.d.ts +0 -3
- package/dist/engine/execution/startup-recovery.js +0 -15
- package/dist/engine/execution/validate-job-executor.d.ts +0 -37
- package/dist/engine/execution/validate-job-executor.js +0 -900
- package/dist/engine/execution/validate-job-payload.d.ts +0 -5
- package/dist/engine/execution/validate-job-payload.js +0 -145
- package/dist/engine/execution/validate-job-recovery.d.ts +0 -4
- package/dist/engine/execution/validate-job-recovery.js +0 -47
- package/dist/engine/execution/validate-worker-runtime.d.ts +0 -10
- package/dist/engine/execution/validate-worker-runtime.js +0 -188
- package/dist/engine/execution/validate-worker-thread.d.ts +0 -2
- package/dist/engine/execution/validate-worker-thread.js +0 -65
- package/dist/engine/framework-detector.d.ts +0 -35
- package/dist/engine/framework-detector.js +0 -268
- package/dist/engine/freeze/freeze-checker.d.ts +0 -14
- package/dist/engine/freeze/freeze-checker.js +0 -28
- package/dist/engine/freeze/unlock-token.d.ts +0 -17
- package/dist/engine/freeze/unlock-token.js +0 -30
- package/dist/engine/frontmatter-parser.d.ts +0 -32
- package/dist/engine/frontmatter-parser.js +0 -157
- package/dist/engine/frontmatter-sha/canonicalize.d.ts +0 -9
- package/dist/engine/frontmatter-sha/canonicalize.js +0 -20
- package/dist/engine/frontmatter-sha/compute-sha.d.ts +0 -8
- package/dist/engine/frontmatter-sha/compute-sha.js +0 -14
- package/dist/engine/frontmatter-sha/frozen-fields.d.ts +0 -6
- package/dist/engine/frontmatter-sha/frozen-fields.js +0 -14
- package/dist/engine/frontmatter-sha/index.d.ts +0 -2
- package/dist/engine/frontmatter-sha/index.js +0 -3
- package/dist/engine/git/branch-detector.d.ts +0 -7
- package/dist/engine/git/branch-detector.js +0 -45
- package/dist/engine/git/exec-git.d.ts +0 -2
- package/dist/engine/git/exec-git.js +0 -14
- package/dist/engine/git/git-command-guard.d.ts +0 -2
- package/dist/engine/git/git-command-guard.js +0 -43
- package/dist/engine/git/repository-probe.d.ts +0 -3
- package/dist/engine/git/repository-probe.js +0 -13
- package/dist/engine/handoff-artifacts/implementation-review-reader.d.ts +0 -4
- package/dist/engine/handoff-artifacts/implementation-review-reader.js +0 -86
- package/dist/engine/handoff-artifacts/io.d.ts +0 -51
- package/dist/engine/handoff-artifacts/io.js +0 -200
- package/dist/engine/handoff-artifacts/schema-skeleton.d.ts +0 -5
- package/dist/engine/handoff-artifacts/schema-skeleton.js +0 -108
- package/dist/engine/handoff-artifacts/schemas.d.ts +0 -164
- package/dist/engine/handoff-artifacts/schemas.js +0 -242
- package/dist/engine/handoff-artifacts/validation-result.d.ts +0 -18
- package/dist/engine/handoff-artifacts/validation-result.js +0 -3
- package/dist/engine/handoff-artifacts/version-policy.d.ts +0 -18
- package/dist/engine/handoff-artifacts/version-policy.js +0 -35
- package/dist/engine/handoff-format.d.ts +0 -26
- package/dist/engine/handoff-format.js +0 -253
- package/dist/engine/handoff-packager.d.ts +0 -30
- package/dist/engine/handoff-packager.js +0 -864
- package/dist/engine/host-detection/detect-host.d.ts +0 -10
- package/dist/engine/host-detection/detect-host.js +0 -34
- package/dist/engine/host-rules-templates/index.d.ts +0 -3
- package/dist/engine/host-rules-templates/index.js +0 -4
- package/dist/engine/host-rules-templates/inject-rules-block.d.ts +0 -3
- package/dist/engine/host-rules-templates/inject-rules-block.js +0 -29
- package/dist/engine/host-rules-templates/templates.d.ts +0 -12
- package/dist/engine/host-rules-templates/templates.js +0 -111
- package/dist/engine/host-tool-filter.d.ts +0 -28
- package/dist/engine/host-tool-filter.js +0 -162
- package/dist/engine/human-summary.d.ts +0 -18
- package/dist/engine/human-summary.js +0 -114
- package/dist/engine/implementation-contract/common.d.ts +0 -22
- package/dist/engine/implementation-contract/common.js +0 -47
- package/dist/engine/implementation-contract/evaluator.d.ts +0 -3
- package/dist/engine/implementation-contract/evaluator.js +0 -192
- package/dist/engine/implementation-contract/index.d.ts +0 -4
- package/dist/engine/implementation-contract/index.js +0 -4
- package/dist/engine/implementation-contract/renderer.d.ts +0 -4
- package/dist/engine/implementation-contract/renderer.js +0 -114
- package/dist/engine/keyword-matcher/boundary.d.ts +0 -18
- package/dist/engine/keyword-matcher/boundary.js +0 -30
- package/dist/engine/keyword-matcher/extractor.d.ts +0 -14
- package/dist/engine/keyword-matcher/extractor.js +0 -85
- package/dist/engine/keyword-matcher/index.d.ts +0 -5
- package/dist/engine/keyword-matcher/index.js +0 -11
- package/dist/engine/keyword-matcher/matcher.d.ts +0 -28
- package/dist/engine/keyword-matcher/matcher.js +0 -79
- package/dist/engine/keyword-matcher/stopwords.d.ts +0 -26
- package/dist/engine/keyword-matcher/stopwords.js +0 -100
- package/dist/engine/lifecycle-hints.d.ts +0 -12
- package/dist/engine/lifecycle-hints.js +0 -61
- package/dist/engine/lifecycle-reconciliation-io.d.ts +0 -11
- package/dist/engine/lifecycle-reconciliation-io.js +0 -181
- package/dist/engine/lifecycle-reconciliation.d.ts +0 -16
- package/dist/engine/lifecycle-reconciliation.js +0 -460
- package/dist/engine/living-spec-analyzer.d.ts +0 -10
- package/dist/engine/living-spec-analyzer.js +0 -397
- package/dist/engine/minimality/analyzer.d.ts +0 -3
- package/dist/engine/minimality/analyzer.js +0 -182
- package/dist/engine/minimality/formatter.d.ts +0 -3
- package/dist/engine/minimality/formatter.js +0 -25
- package/dist/engine/minimality/index.d.ts +0 -3
- package/dist/engine/minimality/index.js +0 -3
- package/dist/engine/minimality/policy-loader.d.ts +0 -3
- package/dist/engine/minimality/policy-loader.js +0 -364
- package/dist/engine/model-tier-resolver.d.ts +0 -4
- package/dist/engine/model-tier-resolver.js +0 -15
- package/dist/engine/network-policy.d.ts +0 -4
- package/dist/engine/network-policy.js +0 -96
- package/dist/engine/onboarding/new-project-resolver.d.ts +0 -6
- package/dist/engine/onboarding/new-project-resolver.js +0 -265
- package/dist/engine/opencode/config-scaffold.d.ts +0 -3
- package/dist/engine/opencode/config-scaffold.js +0 -99
- package/dist/engine/paradigm-detector.d.ts +0 -12
- package/dist/engine/paradigm-detector.js +0 -236
- package/dist/engine/paradigm-registry.d.ts +0 -20
- package/dist/engine/paradigm-registry.js +0 -44
- package/dist/engine/phase-tracker.d.ts +0 -41
- package/dist/engine/phase-tracker.js +0 -89
- package/dist/engine/planu-config-writer.d.ts +0 -33
- package/dist/engine/planu-config-writer.js +0 -68
- package/dist/engine/project-command-runtime.d.ts +0 -5
- package/dist/engine/project-command-runtime.js +0 -87
- package/dist/engine/project-graph/builder.d.ts +0 -7
- package/dist/engine/project-graph/builder.js +0 -320
- package/dist/engine/project-graph/cache.d.ts +0 -47
- package/dist/engine/project-graph/cache.js +0 -739
- package/dist/engine/project-graph/extractors/decision-store-extractor.d.ts +0 -3
- package/dist/engine/project-graph/extractors/decision-store-extractor.js +0 -58
- package/dist/engine/project-graph/extractors/git-extractor.d.ts +0 -7
- package/dist/engine/project-graph/extractors/git-extractor.js +0 -89
- package/dist/engine/project-graph/extractors/handoff-extractor.d.ts +0 -3
- package/dist/engine/project-graph/extractors/handoff-extractor.js +0 -55
- package/dist/engine/project-graph/extractors/spec-extractor.d.ts +0 -3
- package/dist/engine/project-graph/extractors/spec-extractor.js +0 -189
- package/dist/engine/project-graph/extractors/validation-extractor.d.ts +0 -3
- package/dist/engine/project-graph/extractors/validation-extractor.js +0 -36
- package/dist/engine/project-graph/freshness-projection.d.ts +0 -16
- package/dist/engine/project-graph/freshness-projection.js +0 -98
- package/dist/engine/project-graph/index.d.ts +0 -2
- package/dist/engine/project-graph/index.js +0 -2
- package/dist/engine/project-graph/native.d.ts +0 -3
- package/dist/engine/project-graph/native.js +0 -36
- package/dist/engine/project-graph/query.d.ts +0 -8
- package/dist/engine/project-graph/query.js +0 -193
- package/dist/engine/project-graph/redaction.d.ts +0 -4
- package/dist/engine/project-graph/redaction.js +0 -11
- package/dist/engine/project-scanner/convention-detector.d.ts +0 -3
- package/dist/engine/project-scanner/convention-detector.js +0 -149
- package/dist/engine/project-scanner/index.d.ts +0 -4
- package/dist/engine/project-scanner/index.js +0 -18
- package/dist/engine/project-scanner/quality-baseline.d.ts +0 -3
- package/dist/engine/project-scanner/quality-baseline.js +0 -72
- package/dist/engine/project-scanner/stack-detector.d.ts +0 -3
- package/dist/engine/project-scanner/stack-detector.js +0 -128
- package/dist/engine/readiness-checker.d.ts +0 -56
- package/dist/engine/readiness-checker.js +0 -566
- package/dist/engine/readiness-config-loader.d.ts +0 -23
- package/dist/engine/readiness-config-loader.js +0 -63
- package/dist/engine/reconcile/apply-changes.d.ts +0 -4
- package/dist/engine/reconcile/apply-changes.js +0 -117
- package/dist/engine/reconcile/propagate-mirrors.d.ts +0 -3
- package/dist/engine/reconcile/propagate-mirrors.js +0 -376
- package/dist/engine/reconcile/verify-write.d.ts +0 -10
- package/dist/engine/reconcile/verify-write.js +0 -49
- package/dist/engine/registry-extender.d.ts +0 -25
- package/dist/engine/registry-extender.js +0 -60
- package/dist/engine/reviewer-tokens/issuer.d.ts +0 -29
- package/dist/engine/reviewer-tokens/issuer.js +0 -88
- package/dist/engine/reviewer-tokens/signer.d.ts +0 -17
- package/dist/engine/reviewer-tokens/signer.js +0 -51
- package/dist/engine/reviewer-tokens/types.d.ts +0 -2
- package/dist/engine/reviewer-tokens/types.js +0 -2
- package/dist/engine/runtime-policy.d.ts +0 -9
- package/dist/engine/runtime-policy.js +0 -163
- package/dist/engine/safety/atomic-write-file.d.ts +0 -47
- package/dist/engine/safety/atomic-write-file.js +0 -232
- package/dist/engine/safety/atomic-writer.d.ts +0 -22
- package/dist/engine/safety/atomic-writer.js +0 -97
- package/dist/engine/safety/contained-project-file.d.ts +0 -3
- package/dist/engine/safety/contained-project-file.js +0 -23
- package/dist/engine/safety/cross-process-lock.d.ts +0 -13
- package/dist/engine/safety/cross-process-lock.js +0 -318
- package/dist/engine/safety/file-mutex.d.ts +0 -6
- package/dist/engine/safety/file-mutex.js +0 -182
- package/dist/engine/safety/lock-lease-store.d.ts +0 -84
- package/dist/engine/safety/lock-lease-store.js +0 -383
- package/dist/engine/safety/lock-scavenger.d.ts +0 -8
- package/dist/engine/safety/lock-scavenger.js +0 -198
- package/dist/engine/safety/lock-staleness.d.ts +0 -33
- package/dist/engine/safety/lock-staleness.js +0 -76
- package/dist/engine/safety/obsolete-lock-guard.d.ts +0 -8
- package/dist/engine/safety/obsolete-lock-guard.js +0 -31
- package/dist/engine/scope-boundaries/contradiction-checker.d.ts +0 -7
- package/dist/engine/scope-boundaries/contradiction-checker.js +0 -276
- package/dist/engine/scope-boundaries/index.d.ts +0 -4
- package/dist/engine/scope-boundaries/index.js +0 -5
- package/dist/engine/scope-boundaries/scope-validator.d.ts +0 -7
- package/dist/engine/scope-boundaries/scope-validator.js +0 -114
- package/dist/engine/scope-boundaries/suggester.d.ts +0 -8
- package/dist/engine/scope-boundaries/suggester.js +0 -27
- package/dist/engine/score-to-grade.d.ts +0 -2
- package/dist/engine/score-to-grade.js +0 -16
- package/dist/engine/sdd-model-routing.d.ts +0 -15
- package/dist/engine/sdd-model-routing.js +0 -200
- package/dist/engine/spec-dependency-graph.d.ts +0 -33
- package/dist/engine/spec-dependency-graph.js +0 -243
- package/dist/engine/spec-difficulty.d.ts +0 -3
- package/dist/engine/spec-difficulty.js +0 -17
- package/dist/engine/spec-folder-sanctity.d.ts +0 -5
- package/dist/engine/spec-folder-sanctity.js +0 -32
- package/dist/engine/spec-format/acceptance-criteria.d.ts +0 -10
- package/dist/engine/spec-format/acceptance-criteria.js +0 -157
- package/dist/engine/spec-format/bdd-parser.d.ts +0 -19
- package/dist/engine/spec-format/bdd-parser.js +0 -224
- package/dist/engine/spec-format/copula-blacklist.d.ts +0 -15
- package/dist/engine/spec-format/copula-blacklist.js +0 -31
- package/dist/engine/spec-format/criteria-drift.d.ts +0 -3
- package/dist/engine/spec-format/criteria-drift.js +0 -36
- package/dist/engine/spec-format/executable-test-path.d.ts +0 -2
- package/dist/engine/spec-format/executable-test-path.js +0 -5
- package/dist/engine/spec-format/lean-spec-generator.d.ts +0 -8
- package/dist/engine/spec-format/lean-spec-generator.js +0 -236
- package/dist/engine/spec-format/lean-technical-generator.d.ts +0 -5
- package/dist/engine/spec-format/lean-technical-generator.js +0 -45
- package/dist/engine/spec-format/markdown-sections.d.ts +0 -14
- package/dist/engine/spec-format/markdown-sections.js +0 -105
- package/dist/engine/spec-format/metadata-value-policy.d.ts +0 -156
- package/dist/engine/spec-format/metadata-value-policy.js +0 -86
- package/dist/engine/spec-format/read-technical-section.d.ts +0 -25
- package/dist/engine/spec-format/read-technical-section.js +0 -99
- package/dist/engine/spec-format/replace-section.d.ts +0 -17
- package/dist/engine/spec-format/replace-section.js +0 -79
- package/dist/engine/spec-format/retired-scaffold.d.ts +0 -3
- package/dist/engine/spec-format/retired-scaffold.js +0 -5
- package/dist/engine/spec-format/spec-id.d.ts +0 -8
- package/dist/engine/spec-format/spec-id.js +0 -25
- package/dist/engine/spec-format/technical-md-populator.d.ts +0 -17
- package/dist/engine/spec-format/technical-md-populator.js +0 -321
- package/dist/engine/spec-format/text-fences.d.ts +0 -6
- package/dist/engine/spec-format/text-fences.js +0 -28
- package/dist/engine/spec-format/unified-spec-builder.d.ts +0 -25
- package/dist/engine/spec-format/unified-spec-builder.js +0 -400
- package/dist/engine/spec-generator/fallback-generator.d.ts +0 -5
- package/dist/engine/spec-generator/fallback-generator.js +0 -41
- package/dist/engine/spec-generator/index.d.ts +0 -2
- package/dist/engine/spec-generator/index.js +0 -2
- package/dist/engine/spec-grounding/contract.d.ts +0 -24
- package/dist/engine/spec-grounding/contract.js +0 -278
- package/dist/engine/spec-grounding/grounding-entry-parser.d.ts +0 -4
- package/dist/engine/spec-grounding/grounding-entry-parser.js +0 -184
- package/dist/engine/spec-health-scorer.d.ts +0 -7
- package/dist/engine/spec-health-scorer.js +0 -134
- package/dist/engine/spec-language/english-only.d.ts +0 -30
- package/dist/engine/spec-language/english-only.js +0 -224
- package/dist/engine/spec-migrator/criteria-scanner.d.ts +0 -7
- package/dist/engine/spec-migrator/criteria-scanner.js +0 -113
- package/dist/engine/spec-migrator/drift-detector.d.ts +0 -10
- package/dist/engine/spec-migrator/drift-detector.js +0 -142
- package/dist/engine/spec-migrator/filesystem-import.d.ts +0 -10
- package/dist/engine/spec-migrator/filesystem-import.js +0 -205
- package/dist/engine/spec-migrator/flatten-specs.d.ts +0 -12
- package/dist/engine/spec-migrator/flatten-specs.js +0 -111
- package/dist/engine/spec-migrator/folder-operations.d.ts +0 -7
- package/dist/engine/spec-migrator/folder-operations.js +0 -109
- package/dist/engine/spec-migrator/frontmatter-parser.d.ts +0 -11
- package/dist/engine/spec-migrator/frontmatter-parser.js +0 -111
- package/dist/engine/spec-migrator/git-aware-fs.d.ts +0 -9
- package/dist/engine/spec-migrator/git-aware-fs.js +0 -20
- package/dist/engine/spec-migrator/index.d.ts +0 -10
- package/dist/engine/spec-migrator/index.js +0 -23
- package/dist/engine/spec-migrator/lean-migration.d.ts +0 -8
- package/dist/engine/spec-migrator/lean-migration.js +0 -405
- package/dist/engine/spec-migrator/legacy-classifier.d.ts +0 -4
- package/dist/engine/spec-migrator/legacy-classifier.js +0 -70
- package/dist/engine/spec-migrator/legacy-migration.d.ts +0 -13
- package/dist/engine/spec-migrator/legacy-migration.js +0 -88
- package/dist/engine/spec-migrator/path-utils.d.ts +0 -13
- package/dist/engine/spec-migrator/path-utils.js +0 -40
- package/dist/engine/spec-migrator/planu-canonical-policy.d.ts +0 -18
- package/dist/engine/spec-migrator/planu-canonical-policy.js +0 -105
- package/dist/engine/spec-migrator/prefix-migration.d.ts +0 -11
- package/dist/engine/spec-migrator/prefix-migration.js +0 -85
- package/dist/engine/spec-migrator/reconcile-paths.d.ts +0 -12
- package/dist/engine/spec-migrator/reconcile-paths.js +0 -77
- package/dist/engine/spec-migrator/strict-planu-cleanup.d.ts +0 -7
- package/dist/engine/spec-migrator/strict-planu-cleanup.js +0 -308
- package/dist/engine/spec-migrator/version-detection.d.ts +0 -5
- package/dist/engine/spec-migrator/version-detection.js +0 -19
- package/dist/engine/spec-migrator.d.ts +0 -2
- package/dist/engine/spec-migrator.js +0 -3
- package/dist/engine/spec-quality/generic-output-gate.d.ts +0 -9
- package/dist/engine/spec-quality/generic-output-gate.js +0 -350
- package/dist/engine/spec-quality-scorer.d.ts +0 -4
- package/dist/engine/spec-quality-scorer.js +0 -423
- package/dist/engine/spec-reader.d.ts +0 -7
- package/dist/engine/spec-reader.js +0 -23
- package/dist/engine/spec-state-machine/transition-spec.d.ts +0 -56
- package/dist/engine/spec-state-machine/transition-spec.js +0 -59
- package/dist/engine/spec-versioner.d.ts +0 -28
- package/dist/engine/spec-versioner.js +0 -92
- package/dist/engine/spec-versioning/bump-version.d.ts +0 -17
- package/dist/engine/spec-versioning/bump-version.js +0 -199
- package/dist/engine/spec-versioning/migrate-format.d.ts +0 -23
- package/dist/engine/spec-versioning/migrate-format.js +0 -96
- package/dist/engine/spec-versioning/render-history.d.ts +0 -14
- package/dist/engine/spec-versioning/render-history.js +0 -31
- package/dist/engine/technology-registry.d.ts +0 -11
- package/dist/engine/technology-registry.js +0 -142
- package/dist/engine/test-selection/policy.d.ts +0 -9
- package/dist/engine/test-selection/policy.js +0 -192
- package/dist/engine/text-signal-boundaries.d.ts +0 -8
- package/dist/engine/text-signal-boundaries.js +0 -122
- package/dist/engine/time/relative-date.d.ts +0 -3
- package/dist/engine/time/relative-date.js +0 -16
- package/dist/engine/timing/budget.d.ts +0 -29
- package/dist/engine/timing/budget.js +0 -129
- package/dist/engine/universal-rules/catalog.d.ts +0 -7
- package/dist/engine/universal-rules/catalog.js +0 -25
- package/dist/engine/universal-rules/host-writer.d.ts +0 -7
- package/dist/engine/universal-rules/host-writer.js +0 -113
- package/dist/engine/universal-rules/installer.d.ts +0 -5
- package/dist/engine/universal-rules/installer.js +0 -236
- package/dist/engine/universal-rules/rules/planu-approval-gates.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-approval-gates.js +0 -48
- package/dist/engine/universal-rules/rules/planu-bdd-criteria.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-bdd-criteria.js +0 -44
- package/dist/engine/universal-rules/rules/planu-dogfood-bugs.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-dogfood-bugs.js +0 -70
- package/dist/engine/universal-rules/rules/planu-english-specs.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-english-specs.js +0 -41
- package/dist/engine/universal-rules/rules/planu-minimal-change.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-minimal-change.js +0 -42
- package/dist/engine/universal-rules/rules/planu-modes.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-modes.js +0 -57
- package/dist/engine/universal-rules/rules/planu-sdd-model-routing.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-sdd-model-routing.js +0 -50
- package/dist/engine/universal-rules/rules/planu-workflow.d.ts +0 -3
- package/dist/engine/universal-rules/rules/planu-workflow.js +0 -92
- package/dist/engine/universal-rules/user-edit-detector.d.ts +0 -21
- package/dist/engine/universal-rules/user-edit-detector.js +0 -46
- package/dist/engine/validation/durable-validation.d.ts +0 -44
- package/dist/engine/validation/durable-validation.js +0 -344
- package/dist/engine/validation/validation-freshness.d.ts +0 -73
- package/dist/engine/validation/validation-freshness.js +0 -777
- package/dist/engine/validation/validation-receipt-codec.d.ts +0 -13
- package/dist/engine/validation/validation-receipt-codec.js +0 -184
- package/dist/engine/validation/validation-receipt.d.ts +0 -67
- package/dist/engine/validation/validation-receipt.js +0 -342
- package/dist/engine/validation/validation-source-digest.d.ts +0 -2
- package/dist/engine/validation/validation-source-digest.js +0 -86
- package/dist/engine/validation/validation-source-policy.d.ts +0 -4
- package/dist/engine/validation/validation-source-policy.js +0 -17
- package/dist/engine/validation/validation-submission.d.ts +0 -35
- package/dist/engine/validation/validation-submission.js +0 -142
- package/dist/engine/validation/validation-worktree.d.ts +0 -21
- package/dist/engine/validation/validation-worktree.js +0 -294
- package/dist/engine/validation-evidence-digest.d.ts +0 -4
- package/dist/engine/validation-evidence-digest.js +0 -83
- package/dist/engine/validation-evidence-ledger.d.ts +0 -30
- package/dist/engine/validation-evidence-ledger.js +0 -328
- package/dist/engine/validation-impact-planner.d.ts +0 -14
- package/dist/engine/validation-impact-planner.js +0 -74
- package/dist/engine/validation-loop.d.ts +0 -12
- package/dist/engine/validation-loop.js +0 -216
- package/dist/engine/validator/analyzer.d.ts +0 -23
- package/dist/engine/validator/analyzer.js +0 -495
- package/dist/engine/validator/blast-radius-gate.d.ts +0 -3
- package/dist/engine/validator/blast-radius-gate.js +0 -305
- package/dist/engine/validator/checklist.d.ts +0 -6
- package/dist/engine/validator/checklist.js +0 -147
- package/dist/engine/validator/deep-code-checker.d.ts +0 -49
- package/dist/engine/validator/deep-code-checker.js +0 -410
- package/dist/engine/validator/dor-dod.d.ts +0 -11
- package/dist/engine/validator/dor-dod.js +0 -338
- package/dist/engine/validator/executable-evidence.d.ts +0 -18
- package/dist/engine/validator/executable-evidence.js +0 -104
- package/dist/engine/validator/extractors.d.ts +0 -16
- package/dist/engine/validator/extractors.js +0 -105
- package/dist/engine/validator/gates/code-gates.d.ts +0 -14
- package/dist/engine/validator/gates/code-gates.js +0 -87
- package/dist/engine/validator/gates/convention-gates.d.ts +0 -13
- package/dist/engine/validator/gates/convention-gates.js +0 -84
- package/dist/engine/validator/gates/index.d.ts +0 -8
- package/dist/engine/validator/gates/index.js +0 -63
- package/dist/engine/validator/gates/test-gates.d.ts +0 -12
- package/dist/engine/validator/gates/test-gates.js +0 -105
- package/dist/engine/validator/holistic-report.d.ts +0 -11
- package/dist/engine/validator/holistic-report.js +0 -34
- package/dist/engine/validator/negative-predicate.d.ts +0 -17
- package/dist/engine/validator/negative-predicate.js +0 -240
- package/dist/engine/validator/package-json-evidence.d.ts +0 -3
- package/dist/engine/validator/package-json-evidence.js +0 -97
- package/dist/engine/validator/reliability-gate.d.ts +0 -4
- package/dist/engine/validator/reliability-gate.js +0 -81
- package/dist/engine/validator/scope-resolver.d.ts +0 -30
- package/dist/engine/validator/scope-resolver.js +0 -67
- package/dist/engine/validator/spec-compliance-runner.d.ts +0 -9
- package/dist/engine/validator/spec-compliance-runner.js +0 -849
- package/dist/engine/validator/test-evidence-grounding.d.ts +0 -64
- package/dist/engine/validator/test-evidence-grounding.js +0 -221
- package/dist/engine/validator/validation-report-writer.d.ts +0 -27
- package/dist/engine/validator/validation-report-writer.js +0 -208
- package/dist/engine/validator.d.ts +0 -19
- package/dist/engine/validator.js +0 -244
- package/dist/engine/verifier/bdd-entity-extractor.d.ts +0 -23
- package/dist/engine/verifier/bdd-entity-extractor.js +0 -227
- package/dist/engine/verifier/compliance-scorer.d.ts +0 -17
- package/dist/engine/verifier/compliance-scorer.js +0 -131
- package/dist/engine/verifier/criterion-matcher.d.ts +0 -22
- package/dist/engine/verifier/criterion-matcher.js +0 -309
- package/dist/engine/web-fetcher/registry-loader.d.ts +0 -7
- package/dist/engine/web-fetcher/registry-loader.js +0 -44
- package/dist/engine/whats-new.d.ts +0 -2
- package/dist/engine/whats-new.js +0 -42
- package/dist/errors/classified-degradation.d.ts +0 -3
- package/dist/errors/classified-degradation.js +0 -10
- package/dist/errors/degradation-sink.d.ts +0 -3
- package/dist/errors/degradation-sink.js +0 -5
- package/dist/errors/error-taxonomy.d.ts +0 -11
- package/dist/errors/error-taxonomy.js +0 -59
- package/dist/hosts/claude-code/coach.d.ts +0 -6
- package/dist/hosts/claude-code/coach.js +0 -10
- package/dist/hosts/claude-code/ux/subagent-publisher.d.ts +0 -20
- package/dist/hosts/claude-code/ux/subagent-publisher.js +0 -117
- package/dist/hosts/codex/config-scaffold.d.ts +0 -10
- package/dist/hosts/codex/config-scaffold.js +0 -102
- package/dist/hosts/codex/workspace-scope.d.ts +0 -43
- package/dist/hosts/codex/workspace-scope.js +0 -89
- package/dist/hosts/gemini/config-scaffold.d.ts +0 -14
- package/dist/hosts/gemini/config-scaffold.js +0 -165
- package/dist/i18n/index.d.ts +0 -61
- package/dist/i18n/index.js +0 -288
- package/dist/prompts/index.d.ts +0 -6
- package/dist/prompts/index.js +0 -121
- package/dist/resources/process.d.ts +0 -11
- package/dist/resources/process.js +0 -80
- package/dist/resources/registry.d.ts +0 -6
- package/dist/resources/registry.js +0 -16
- package/dist/resources/specs.d.ts +0 -11
- package/dist/resources/specs.js +0 -58
- package/dist/security/adapters/environment.d.ts +0 -12
- package/dist/security/adapters/environment.js +0 -25
- package/dist/security/adapters/local-file.d.ts +0 -12
- package/dist/security/adapters/local-file.js +0 -56
- package/dist/security/adapters/macos-keychain.d.ts +0 -20
- package/dist/security/adapters/macos-keychain.js +0 -151
- package/dist/security/redactor.d.ts +0 -5
- package/dist/security/redactor.js +0 -58
- package/dist/security/secret-provider.d.ts +0 -22
- package/dist/security/secret-provider.js +0 -107
- package/dist/storage/approval-operation-lock.d.ts +0 -7
- package/dist/storage/approval-operation-lock.js +0 -47
- package/dist/storage/approval-store.d.ts +0 -14
- package/dist/storage/approval-store.js +0 -117
- package/dist/storage/audit-trail-store.d.ts +0 -20
- package/dist/storage/audit-trail-store.js +0 -83
- package/dist/storage/base-store.d.ts +0 -69
- package/dist/storage/base-store.js +0 -195
- package/dist/storage/compliance-gate-config-store.d.ts +0 -4
- package/dist/storage/compliance-gate-config-store.js +0 -20
- package/dist/storage/convention-baseline.d.ts +0 -20
- package/dist/storage/convention-baseline.js +0 -62
- package/dist/storage/current-project.d.ts +0 -3
- package/dist/storage/current-project.js +0 -21
- package/dist/storage/file-mutex.d.ts +0 -14
- package/dist/storage/file-mutex.js +0 -47
- package/dist/storage/global-projects-store.d.ts +0 -53
- package/dist/storage/global-projects-store.js +0 -181
- package/dist/storage/global-store.d.ts +0 -82
- package/dist/storage/global-store.js +0 -246
- package/dist/storage/index.d.ts +0 -15
- package/dist/storage/index.js +0 -16
- package/dist/storage/knowledge-store/knowledge.d.ts +0 -25
- package/dist/storage/knowledge-store/knowledge.js +0 -112
- package/dist/storage/knowledge-store/sessions.d.ts +0 -16
- package/dist/storage/knowledge-store/sessions.js +0 -155
- package/dist/storage/knowledge-store.d.ts +0 -3
- package/dist/storage/knowledge-store.js +0 -8
- package/dist/storage/migrations/canonical-storage.d.ts +0 -15
- package/dist/storage/migrations/canonical-storage.js +0 -754
- package/dist/storage/migrations/sdd-core-v6.d.ts +0 -11
- package/dist/storage/migrations/sdd-core-v6.js +0 -873
- package/dist/storage/pattern-store.d.ts +0 -38
- package/dist/storage/pattern-store.js +0 -136
- package/dist/storage/project-identity.d.ts +0 -60
- package/dist/storage/project-identity.js +0 -454
- package/dist/storage/project-resolver.d.ts +0 -17
- package/dist/storage/project-resolver.js +0 -134
- package/dist/storage/retention.d.ts +0 -13
- package/dist/storage/retention.js +0 -383
- package/dist/storage/runtime-db.d.ts +0 -207
- package/dist/storage/runtime-db.js +0 -1313
- package/dist/storage/schema-registry.d.ts +0 -5
- package/dist/storage/schema-registry.js +0 -74
- package/dist/storage/spec-index.d.ts +0 -23
- package/dist/storage/spec-index.js +0 -117
- package/dist/storage/spec-lock-store.d.ts +0 -22
- package/dist/storage/spec-lock-store.js +0 -99
- package/dist/storage/spec-store.d.ts +0 -170
- package/dist/storage/spec-store.js +0 -968
- package/dist/storage/storage-bundle.d.ts +0 -16
- package/dist/storage/storage-bundle.js +0 -117
- package/dist/storage/storage-catalog-validation.d.ts +0 -3
- package/dist/storage/storage-catalog-validation.js +0 -20
- package/dist/storage/storage-catalog.d.ts +0 -25
- package/dist/storage/storage-catalog.js +0 -421
- package/dist/storage/storage-layout.d.ts +0 -40
- package/dist/storage/storage-layout.js +0 -117
- package/dist/storage/technology-selection-store.d.ts +0 -5
- package/dist/storage/technology-selection-store.js +0 -46
- package/dist/storage/transition-log.d.ts +0 -11
- package/dist/storage/transition-log.js +0 -234
- package/dist/tools/bump-spec-version.d.ts +0 -31
- package/dist/tools/bump-spec-version.js +0 -132
- package/dist/tools/challenge-spec/agent-challenge-scenarios.d.ts +0 -12
- package/dist/tools/challenge-spec/agent-challenge-scenarios.js +0 -129
- package/dist/tools/challenge-spec/architecture-challenge-scenarios.d.ts +0 -12
- package/dist/tools/challenge-spec/architecture-challenge-scenarios.js +0 -113
- package/dist/tools/challenge-spec/challenge-report.d.ts +0 -26
- package/dist/tools/challenge-spec/challenge-report.js +0 -221
- package/dist/tools/challenge-spec/event-challenge-scenarios.d.ts +0 -14
- package/dist/tools/challenge-spec/event-challenge-scenarios.js +0 -68
- package/dist/tools/challenge-spec/implementation-contract-challenge-scenarios.d.ts +0 -3
- package/dist/tools/challenge-spec/implementation-contract-challenge-scenarios.js +0 -51
- package/dist/tools/challenge-spec/platform-challenge-scenarios-b.d.ts +0 -7
- package/dist/tools/challenge-spec/platform-challenge-scenarios-b.js +0 -48
- package/dist/tools/challenge-spec/platform-challenge-scenarios-b1.d.ts +0 -4
- package/dist/tools/challenge-spec/platform-challenge-scenarios-b1.js +0 -109
- package/dist/tools/challenge-spec/platform-challenge-scenarios-b2.d.ts +0 -5
- package/dist/tools/challenge-spec/platform-challenge-scenarios-b2.js +0 -191
- package/dist/tools/challenge-spec/platform-challenge-scenarios.d.ts +0 -7
- package/dist/tools/challenge-spec/platform-challenge-scenarios.js +0 -224
- package/dist/tools/challenge-spec/resilience-challenge-scenarios-a.d.ts +0 -28
- package/dist/tools/challenge-spec/resilience-challenge-scenarios-a.js +0 -183
- package/dist/tools/challenge-spec/resilience-challenge-scenarios-b.d.ts +0 -14
- package/dist/tools/challenge-spec/resilience-challenge-scenarios-b.js +0 -144
- package/dist/tools/challenge-spec/resilience-challenge-scenarios.d.ts +0 -8
- package/dist/tools/challenge-spec/resilience-challenge-scenarios.js +0 -37
- package/dist/tools/challenge-spec/scenario-collector.d.ts +0 -13
- package/dist/tools/challenge-spec/scenario-collector.js +0 -84
- package/dist/tools/challenge-spec/scenarios-data.d.ts +0 -3
- package/dist/tools/challenge-spec/scenarios-data.js +0 -73
- package/dist/tools/challenge-spec/scenarios-desktop.d.ts +0 -7
- package/dist/tools/challenge-spec/scenarios-desktop.js +0 -91
- package/dist/tools/challenge-spec/scenarios-failure.d.ts +0 -3
- package/dist/tools/challenge-spec/scenarios-failure.js +0 -136
- package/dist/tools/challenge-spec/scenarios-game.d.ts +0 -6
- package/dist/tools/challenge-spec/scenarios-game.js +0 -71
- package/dist/tools/challenge-spec/scenarios-scale.d.ts +0 -3
- package/dist/tools/challenge-spec/scenarios-scale.js +0 -37
- package/dist/tools/challenge-spec/scenarios-security.d.ts +0 -3
- package/dist/tools/challenge-spec/scenarios-security.js +0 -85
- package/dist/tools/challenge-spec/scenarios-utils.d.ts +0 -42
- package/dist/tools/challenge-spec/scenarios-utils.js +0 -250
- package/dist/tools/challenge-spec-helpers.d.ts +0 -16
- package/dist/tools/challenge-spec-helpers.js +0 -152
- package/dist/tools/challenge-spec-scenarios.d.ts +0 -7
- package/dist/tools/challenge-spec-scenarios.js +0 -9
- package/dist/tools/challenge-spec.d.ts +0 -4
- package/dist/tools/challenge-spec.js +0 -448
- package/dist/tools/check-readiness.d.ts +0 -5
- package/dist/tools/check-readiness.js +0 -343
- package/dist/tools/claude-settings-file.d.ts +0 -3
- package/dist/tools/claude-settings-file.js +0 -19
- package/dist/tools/create-skill.d.ts +0 -4
- package/dist/tools/create-skill.js +0 -151
- package/dist/tools/create-spec/autopilot-analyzer.d.ts +0 -33
- package/dist/tools/create-spec/autopilot-analyzer.js +0 -171
- package/dist/tools/create-spec/constitution-validator.d.ts +0 -4
- package/dist/tools/create-spec/constitution-validator.js +0 -31
- package/dist/tools/create-spec/question-generator.d.ts +0 -4
- package/dist/tools/create-spec/question-generator.js +0 -25
- package/dist/tools/create-spec/relevance-scorer.d.ts +0 -18
- package/dist/tools/create-spec/relevance-scorer.js +0 -156
- package/dist/tools/create-spec/spec-builder.d.ts +0 -20
- package/dist/tools/create-spec/spec-builder.js +0 -274
- package/dist/tools/create-spec-helpers.d.ts +0 -4
- package/dist/tools/create-spec-helpers.js +0 -24
- package/dist/tools/create-spec-tech/constitution.d.ts +0 -7
- package/dist/tools/create-spec-tech/constitution.js +0 -79
- package/dist/tools/create-spec-tech.d.ts +0 -2
- package/dist/tools/create-spec-tech.js +0 -3
- package/dist/tools/create-spec.d.ts +0 -25
- package/dist/tools/create-spec.js +0 -1698
- package/dist/tools/git/git-helpers.d.ts +0 -20
- package/dist/tools/git/git-helpers.js +0 -33
- package/dist/tools/init-project/agents-md-writer.d.ts +0 -18
- package/dist/tools/init-project/agents-md-writer.js +0 -123
- package/dist/tools/init-project/config-builder.d.ts +0 -14
- package/dist/tools/init-project/config-builder.js +0 -19
- package/dist/tools/init-project/conventions-writer.d.ts +0 -11
- package/dist/tools/init-project/conventions-writer.js +0 -61
- package/dist/tools/init-project/handler.d.ts +0 -4
- package/dist/tools/init-project/handler.js +0 -463
- package/dist/tools/init-project/helpers.d.ts +0 -31
- package/dist/tools/init-project/helpers.js +0 -223
- package/dist/tools/init-project/host-assets-writer.d.ts +0 -28
- package/dist/tools/init-project/host-assets-writer.js +0 -240
- package/dist/tools/init-project/legacy-guidance-scanner.d.ts +0 -9
- package/dist/tools/init-project/legacy-guidance-scanner.js +0 -218
- package/dist/tools/init-project/legacy-root-migration.d.ts +0 -16
- package/dist/tools/init-project/legacy-root-migration.js +0 -213
- package/dist/tools/init-project/lifecycle-helpers.d.ts +0 -12
- package/dist/tools/init-project/lifecycle-helpers.js +0 -37
- package/dist/tools/init-project/managed-guidance-refresher.d.ts +0 -9
- package/dist/tools/init-project/managed-guidance-refresher.js +0 -65
- package/dist/tools/init-project/migration-runner.d.ts +0 -43
- package/dist/tools/init-project/migration-runner.js +0 -227
- package/dist/tools/init-project/portable-index-reconciler.d.ts +0 -32
- package/dist/tools/init-project/portable-index-reconciler.js +0 -278
- package/dist/tools/init-project/result-builder.d.ts +0 -4
- package/dist/tools/init-project/result-builder.js +0 -272
- package/dist/tools/init-project/scaffold-verifier.d.ts +0 -6
- package/dist/tools/init-project/scaffold-verifier.js +0 -97
- package/dist/tools/init-project/scaffold-writer.d.ts +0 -49
- package/dist/tools/init-project/scaffold-writer.js +0 -50
- package/dist/tools/init-project.d.ts +0 -2
- package/dist/tools/init-project.js +0 -4
- package/dist/tools/jobs/handlers.d.ts +0 -11
- package/dist/tools/jobs/handlers.js +0 -152
- package/dist/tools/list-specs.d.ts +0 -3
- package/dist/tools/list-specs.js +0 -323
- package/dist/tools/output-formatter.d.ts +0 -34
- package/dist/tools/output-formatter.js +0 -171
- package/dist/tools/output-integrity-guard.d.ts +0 -3
- package/dist/tools/output-integrity-guard.js +0 -53
- package/dist/tools/package-handoff.d.ts +0 -4
- package/dist/tools/package-handoff.js +0 -215
- package/dist/tools/reconcile-spec-sanctity-hook.d.ts +0 -3
- package/dist/tools/reconcile-spec-sanctity-hook.js +0 -55
- package/dist/tools/reconcile-spec.d.ts +0 -4
- package/dist/tools/reconcile-spec.js +0 -572
- package/dist/tools/register-sdd-tools.d.ts +0 -4
- package/dist/tools/register-sdd-tools.js +0 -13
- package/dist/tools/resolve-project-id.d.ts +0 -58
- package/dist/tools/resolve-project-id.js +0 -103
- package/dist/tools/resolve-project-path.d.ts +0 -27
- package/dist/tools/resolve-project-path.js +0 -172
- package/dist/tools/response-helpers.d.ts +0 -70
- package/dist/tools/response-helpers.js +0 -139
- package/dist/tools/safe-handler.d.ts +0 -36
- package/dist/tools/safe-handler.js +0 -283
- package/dist/tools/sanitize-path.d.ts +0 -13
- package/dist/tools/sanitize-path.js +0 -60
- package/dist/tools/schemas/agents.d.ts +0 -21
- package/dist/tools/schemas/agents.js +0 -9
- package/dist/tools/schemas/analysis.d.ts +0 -28
- package/dist/tools/schemas/analysis.js +0 -22
- package/dist/tools/schemas/index.d.ts +0 -8
- package/dist/tools/schemas/index.js +0 -9
- package/dist/tools/schemas/infra.d.ts +0 -19
- package/dist/tools/schemas/infra.js +0 -18
- package/dist/tools/schemas/lifecycle.d.ts +0 -88
- package/dist/tools/schemas/lifecycle.js +0 -85
- package/dist/tools/schemas/output-schemas.d.ts +0 -115
- package/dist/tools/schemas/output-schemas.js +0 -136
- package/dist/tools/schemas/package-handoff-output-schema.d.ts +0 -41
- package/dist/tools/schemas/package-handoff-output-schema.js +0 -70
- package/dist/tools/schemas/spec-id.d.ts +0 -2
- package/dist/tools/schemas/spec-id.js +0 -2
- package/dist/tools/schemas/spec.d.ts +0 -51
- package/dist/tools/schemas/spec.js +0 -41
- package/dist/tools/schemas/validate-output-schema.d.ts +0 -276
- package/dist/tools/schemas/validate-output-schema.js +0 -225
- package/dist/tools/status-handler.d.ts +0 -3
- package/dist/tools/status-handler.js +0 -242
- package/dist/tools/tool-entry.d.ts +0 -52
- package/dist/tools/tool-entry.js +0 -46
- package/dist/tools/tool-registry/core-tools.d.ts +0 -4
- package/dist/tools/tool-registry/core-tools.js +0 -581
- package/dist/tools/tool-registry/inventory.d.ts +0 -2
- package/dist/tools/tool-registry/inventory.js +0 -2
- package/dist/tools/tool-registry-helpers.d.ts +0 -34
- package/dist/tools/tool-registry-helpers.js +0 -45
- package/dist/tools/update-status/approval-gates.d.ts +0 -13
- package/dist/tools/update-status/approval-gates.js +0 -108
- package/dist/tools/update-status/batch.d.ts +0 -7
- package/dist/tools/update-status/batch.js +0 -176
- package/dist/tools/update-status/dod-gates.d.ts +0 -117
- package/dist/tools/update-status/dod-gates.js +0 -847
- package/dist/tools/update-status/done-receipt-verifier.d.ts +0 -38
- package/dist/tools/update-status/done-receipt-verifier.js +0 -208
- package/dist/tools/update-status/evidence-gate.d.ts +0 -16
- package/dist/tools/update-status/evidence-gate.js +0 -361
- package/dist/tools/update-status/evidence-payload.d.ts +0 -180
- package/dist/tools/update-status/evidence-payload.js +0 -79
- package/dist/tools/update-status/file-sync.d.ts +0 -37
- package/dist/tools/update-status/file-sync.js +0 -223
- package/dist/tools/update-status/gate-harness.d.ts +0 -8
- package/dist/tools/update-status/gate-harness.js +0 -8
- package/dist/tools/update-status/index.d.ts +0 -25
- package/dist/tools/update-status/index.js +0 -1487
- package/dist/tools/update-status/response-builder.d.ts +0 -17
- package/dist/tools/update-status/response-builder.js +0 -297
- package/dist/tools/update-status/side-effects.d.ts +0 -16
- package/dist/tools/update-status/side-effects.js +0 -117
- package/dist/tools/update-status/transition-guard.d.ts +0 -85
- package/dist/tools/update-status/transition-guard.js +0 -752
- package/dist/tools/update-status-actions.d.ts +0 -6
- package/dist/tools/update-status-actions.js +0 -19
- package/dist/tools/update-status-convention-gate.d.ts +0 -9
- package/dist/tools/update-status-convention-gate.js +0 -330
- package/dist/tools/update-status.d.ts +0 -2
- package/dist/tools/update-status.js +0 -3
- package/dist/tools/validate-assurance.d.ts +0 -6
- package/dist/tools/validate-assurance.js +0 -55
- package/dist/tools/validate-graph-coverage.d.ts +0 -8
- package/dist/tools/validate-graph-coverage.js +0 -54
- package/dist/tools/validate-helpers.d.ts +0 -10
- package/dist/tools/validate-helpers.js +0 -65
- package/dist/tools/validate-lint.d.ts +0 -9
- package/dist/tools/validate-lint.js +0 -170
- package/dist/tools/validate-minimality.d.ts +0 -16
- package/dist/tools/validate-minimality.js +0 -22
- package/dist/tools/validate-structured-compat.d.ts +0 -19
- package/dist/tools/validate-structured-compat.js +0 -14
- package/dist/tools/validate.d.ts +0 -8
- package/dist/tools/validate.js +0 -1039
- package/dist/transports/transport-factory.d.ts +0 -5
- package/dist/transports/transport-factory.js +0 -182
- package/dist/types/abortable-process.d.ts +0 -29
- package/dist/types/abortable-process.js +0 -2
- package/dist/types/agent-team.d.ts +0 -17
- package/dist/types/agent-team.js +0 -3
- package/dist/types/ai-assurance.d.ts +0 -32
- package/dist/types/ai-assurance.js +0 -2
- package/dist/types/ai-native.d.ts +0 -16
- package/dist/types/ai-native.js +0 -3
- package/dist/types/analysis.d.ts +0 -238
- package/dist/types/analysis.js +0 -3
- package/dist/types/approval.d.ts +0 -66
- package/dist/types/approval.js +0 -6
- package/dist/types/architecture.d.ts +0 -101
- package/dist/types/architecture.js +0 -4
- package/dist/types/audit.d.ts +0 -38
- package/dist/types/audit.js +0 -4
- package/dist/types/build-freshness.d.ts +0 -11
- package/dist/types/build-freshness.js +0 -2
- package/dist/types/clarification-token.d.ts +0 -46
- package/dist/types/clarification-token.js +0 -2
- package/dist/types/clarification.d.ts +0 -23
- package/dist/types/clarification.js +0 -5
- package/dist/types/claude-code-runtime.d.ts +0 -91
- package/dist/types/claude-code-runtime.js +0 -5
- package/dist/types/claude-code-ux.d.ts +0 -62
- package/dist/types/claude-code-ux.js +0 -5
- package/dist/types/cli.d.ts +0 -40
- package/dist/types/cli.js +0 -3
- package/dist/types/codex.d.ts +0 -108
- package/dist/types/codex.js +0 -3
- package/dist/types/common/index.d.ts +0 -4
- package/dist/types/common/index.js +0 -6
- package/dist/types/common/learning.d.ts +0 -43
- package/dist/types/common/learning.js +0 -3
- package/dist/types/common/tech-enums.d.ts +0 -8
- package/dist/types/common/tech-enums.js +0 -2
- package/dist/types/complexity-budget.d.ts +0 -17
- package/dist/types/complexity-budget.js +0 -5
- package/dist/types/compliance-gate.d.ts +0 -5
- package/dist/types/compliance-gate.js +0 -3
- package/dist/types/context.d.ts +0 -52
- package/dist/types/context.js +0 -4
- package/dist/types/conventions.d.ts +0 -135
- package/dist/types/conventions.js +0 -5
- package/dist/types/core-bridge.d.ts +0 -130
- package/dist/types/core-bridge.js +0 -3
- package/dist/types/criterion-identity.d.ts +0 -12
- package/dist/types/criterion-identity.js +0 -2
- package/dist/types/cross-repo-search.d.ts +0 -81
- package/dist/types/cross-repo-search.js +0 -9
- package/dist/types/decisions.d.ts +0 -19
- package/dist/types/decisions.js +0 -4
- package/dist/types/durable-job.d.ts +0 -119
- package/dist/types/durable-job.js +0 -10
- package/dist/types/durable-validation.d.ts +0 -158
- package/dist/types/durable-validation.js +0 -166
- package/dist/types/edge-db.d.ts +0 -21
- package/dist/types/edge-db.js +0 -9
- package/dist/types/elicitation.d.ts +0 -115
- package/dist/types/elicitation.js +0 -13
- package/dist/types/env.d.ts +0 -94
- package/dist/types/env.js +0 -3
- package/dist/types/errors/structured-error.d.ts +0 -37
- package/dist/types/errors/structured-error.js +0 -3
- package/dist/types/estimation.d.ts +0 -29
- package/dist/types/estimation.js +0 -5
- package/dist/types/events.d.ts +0 -18
- package/dist/types/events.js +0 -4
- package/dist/types/evidence-autofill.d.ts +0 -40
- package/dist/types/evidence-autofill.js +0 -3
- package/dist/types/evidence-gates.d.ts +0 -103
- package/dist/types/evidence-gates.js +0 -2
- package/dist/types/evidence-index.d.ts +0 -26
- package/dist/types/evidence-index.js +0 -2
- package/dist/types/execution.d.ts +0 -103
- package/dist/types/execution.js +0 -2
- package/dist/types/frontmatter.d.ts +0 -5
- package/dist/types/frontmatter.js +0 -2
- package/dist/types/gemini.d.ts +0 -124
- package/dist/types/gemini.js +0 -3
- package/dist/types/handoff-artifacts.d.ts +0 -182
- package/dist/types/handoff-artifacts.js +0 -3
- package/dist/types/host-rules.d.ts +0 -10
- package/dist/types/host-rules.js +0 -3
- package/dist/types/host-tool-filter.d.ts +0 -31
- package/dist/types/host-tool-filter.js +0 -3
- package/dist/types/housekeeping.d.ts +0 -8
- package/dist/types/housekeeping.js +0 -22
- package/dist/types/index.d.ts +0 -81
- package/dist/types/index.js +0 -94
- package/dist/types/interactive-question.d.ts +0 -19
- package/dist/types/interactive-question.js +0 -3
- package/dist/types/keyword-matcher.d.ts +0 -38
- package/dist/types/keyword-matcher.js +0 -3
- package/dist/types/legacy-guidance.d.ts +0 -24
- package/dist/types/legacy-guidance.js +0 -3
- package/dist/types/legal.d.ts +0 -44
- package/dist/types/legal.js +0 -5
- package/dist/types/living-spec/annotations.d.ts +0 -36
- package/dist/types/living-spec/annotations.js +0 -23
- package/dist/types/living-spec.d.ts +0 -2
- package/dist/types/living-spec.js +0 -6
- package/dist/types/llm-security.d.ts +0 -19
- package/dist/types/llm-security.js +0 -4
- package/dist/types/local-first.d.ts +0 -25
- package/dist/types/local-first.js +0 -10
- package/dist/types/mcp.d.ts +0 -34
- package/dist/types/mcp.js +0 -4
- package/dist/types/migration/canonical-storage.d.ts +0 -38
- package/dist/types/migration/canonical-storage.js +0 -2
- package/dist/types/minimal-implementation-gate.d.ts +0 -98
- package/dist/types/minimal-implementation-gate.js +0 -2
- package/dist/types/model-routing.d.ts +0 -25
- package/dist/types/model-routing.js +0 -26
- package/dist/types/multi-agent.d.ts +0 -18
- package/dist/types/multi-agent.js +0 -18
- package/dist/types/nli-context.d.ts +0 -25
- package/dist/types/nli-context.js +0 -2
- package/dist/types/opencode.d.ts +0 -4
- package/dist/types/opencode.js +0 -3
- package/dist/types/paradigm.d.ts +0 -99
- package/dist/types/paradigm.js +0 -11
- package/dist/types/privacy.d.ts +0 -81
- package/dist/types/privacy.js +0 -25
- package/dist/types/project/agent.d.ts +0 -13
- package/dist/types/project/agent.js +0 -3
- package/dist/types/project/architecture-detection.d.ts +0 -24
- package/dist/types/project/architecture-detection.js +0 -2
- package/dist/types/project/config-metrics.d.ts +0 -10
- package/dist/types/project/config-metrics.js +0 -2
- package/dist/types/project/constitution.d.ts +0 -26
- package/dist/types/project/constitution.js +0 -3
- package/dist/types/project/core.d.ts +0 -137
- package/dist/types/project/core.js +0 -7
- package/dist/types/project/health-checker.d.ts +0 -13
- package/dist/types/project/health-checker.js +0 -3
- package/dist/types/project/inputs.d.ts +0 -39
- package/dist/types/project/inputs.js +0 -5
- package/dist/types/project/legacy-artifacts.d.ts +0 -7
- package/dist/types/project/legacy-artifacts.js +0 -2
- package/dist/types/project/library-groups.d.ts +0 -112
- package/dist/types/project/library-groups.js +0 -4
- package/dist/types/project/mfe-detection.d.ts +0 -19
- package/dist/types/project/mfe-detection.js +0 -3
- package/dist/types/project/planu-config.d.ts +0 -142
- package/dist/types/project/planu-config.js +0 -2
- package/dist/types/project/platform-exotic.d.ts +0 -108
- package/dist/types/project/platform-exotic.js +0 -3
- package/dist/types/project/platform-mobile.d.ts +0 -7
- package/dist/types/project/platform-mobile.js +0 -3
- package/dist/types/project/platform-specialty.d.ts +0 -17
- package/dist/types/project/platform-specialty.js +0 -3
- package/dist/types/project/scaffold-verification.d.ts +0 -15
- package/dist/types/project/scaffold-verification.js +0 -2
- package/dist/types/project-knowledge-graph.d.ts +0 -227
- package/dist/types/project-knowledge-graph.js +0 -2
- package/dist/types/project.d.ts +0 -11
- package/dist/types/project.js +0 -13
- package/dist/types/readiness.d.ts +0 -82
- package/dist/types/readiness.js +0 -7
- package/dist/types/reconcile.d.ts +0 -41
- package/dist/types/reconcile.js +0 -9
- package/dist/types/retention.d.ts +0 -12
- package/dist/types/retention.js +0 -3
- package/dist/types/reviewer-tokens.d.ts +0 -58
- package/dist/types/reviewer-tokens.js +0 -4
- package/dist/types/runtime-database.d.ts +0 -10
- package/dist/types/runtime-database.js +0 -2
- package/dist/types/runtime-policy.d.ts +0 -62
- package/dist/types/runtime-policy.js +0 -2
- package/dist/types/safe-schemas.d.ts +0 -12
- package/dist/types/safe-schemas.js +0 -27
- package/dist/types/safety.d.ts +0 -42
- package/dist/types/safety.js +0 -3
- package/dist/types/scan-project.d.ts +0 -20
- package/dist/types/scan-project.js +0 -4
- package/dist/types/schema-registry.d.ts +0 -12
- package/dist/types/schema-registry.js +0 -2
- package/dist/types/scope-boundaries.d.ts +0 -62
- package/dist/types/scope-boundaries.js +0 -3
- package/dist/types/scope.d.ts +0 -89
- package/dist/types/scope.js +0 -3
- package/dist/types/sdd-constitution.d.ts +0 -27
- package/dist/types/sdd-constitution.js +0 -2
- package/dist/types/sdd-core-v6.d.ts +0 -62
- package/dist/types/sdd-core-v6.js +0 -2
- package/dist/types/sdd-flow.d.ts +0 -3
- package/dist/types/sdd-flow.js +0 -3
- package/dist/types/sdd-model-routing.d.ts +0 -22
- package/dist/types/sdd-model-routing.js +0 -2
- package/dist/types/security.d.ts +0 -20
- package/dist/types/security.js +0 -4
- package/dist/types/skill-bootstrap.d.ts +0 -7
- package/dist/types/skill-bootstrap.js +0 -3
- package/dist/types/spec/clarification.d.ts +0 -86
- package/dist/types/spec/clarification.js +0 -2
- package/dist/types/spec/core.d.ts +0 -414
- package/dist/types/spec/core.js +0 -3
- package/dist/types/spec/health-score.d.ts +0 -25
- package/dist/types/spec/health-score.js +0 -2
- package/dist/types/spec/index-cache.d.ts +0 -25
- package/dist/types/spec/index-cache.js +0 -3
- package/dist/types/spec/index.d.ts +0 -7
- package/dist/types/spec/index.js +0 -9
- package/dist/types/spec/inputs.d.ts +0 -250
- package/dist/types/spec/inputs.js +0 -7
- package/dist/types/spec/versioning.d.ts +0 -39
- package/dist/types/spec/versioning.js +0 -3
- package/dist/types/spec-format.d.ts +0 -211
- package/dist/types/spec-format.js +0 -3
- package/dist/types/spec-generator.d.ts +0 -32
- package/dist/types/spec-generator.js +0 -2
- package/dist/types/spec-grounding.d.ts +0 -48
- package/dist/types/spec-grounding.js +0 -2
- package/dist/types/spec-language-translation.d.ts +0 -19
- package/dist/types/spec-language-translation.js +0 -5
- package/dist/types/spec-language.d.ts +0 -8
- package/dist/types/spec-language.js +0 -2
- package/dist/types/spec-lock-v2.d.ts +0 -66
- package/dist/types/spec-lock-v2.js +0 -4
- package/dist/types/spec-lock.d.ts +0 -14
- package/dist/types/spec-lock.js +0 -8
- package/dist/types/spec-quality.d.ts +0 -82
- package/dist/types/spec-quality.js +0 -6
- package/dist/types/stack/build-tool.d.ts +0 -13
- package/dist/types/stack/build-tool.js +0 -5
- package/dist/types/stack/hypermedia.d.ts +0 -4
- package/dist/types/stack/hypermedia.js +0 -3
- package/dist/types/stack/index.d.ts +0 -4
- package/dist/types/stack/index.js +0 -4
- package/dist/types/stack/recommend.d.ts +0 -38
- package/dist/types/stack/recommend.js +0 -3
- package/dist/types/status.d.ts +0 -27
- package/dist/types/status.js +0 -6
- package/dist/types/storage-catalog.d.ts +0 -21
- package/dist/types/storage-catalog.js +0 -2
- package/dist/types/supply-chain.d.ts +0 -49
- package/dist/types/supply-chain.js +0 -25
- package/dist/types/technology-registry.d.ts +0 -36
- package/dist/types/technology-registry.js +0 -2
- package/dist/types/technology-selection.d.ts +0 -78
- package/dist/types/technology-selection.js +0 -3
- package/dist/types/technology-symbols.generated.d.ts +0 -117
- package/dist/types/technology-symbols.generated.js +0 -2
- package/dist/types/testing.d.ts +0 -17
- package/dist/types/testing.js +0 -10
- package/dist/types/timing.d.ts +0 -18
- package/dist/types/timing.js +0 -3
- package/dist/types/transition-log.d.ts +0 -78
- package/dist/types/transition-log.js +0 -4
- package/dist/types/transport.d.ts +0 -6
- package/dist/types/transport.js +0 -4
- package/dist/types/universal-rules/index.d.ts +0 -69
- package/dist/types/universal-rules/index.js +0 -4
- package/dist/types/validate-worker.d.ts +0 -50
- package/dist/types/validate-worker.js +0 -2
- package/dist/types/validation-config.d.ts +0 -36
- package/dist/types/validation-config.js +0 -2
- package/dist/types/validation-evidence.d.ts +0 -177
- package/dist/types/validation-evidence.js +0 -2
- package/dist/types/validation-loop.d.ts +0 -26
- package/dist/types/validation-loop.js +0 -3
- package/dist/types/validation-receipt.d.ts +0 -126
- package/dist/types/validation-receipt.js +0 -2
- package/dist/types/validation.d.ts +0 -67
- package/dist/types/validation.js +0 -3
- package/dist/types/verifiable-criteria.d.ts +0 -31
- package/dist/types/verifiable-criteria.js +0 -10
- package/src/i18n/messages/en.json +0 -184
- package/src/i18n/messages/es.json +0 -184
- package/src/i18n/messages/pt.json +0 -184
|
@@ -1,847 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines -- done evidence gates remain co-located for one auditable fail-closed boundary */
|
|
2
|
-
// tools/update-status/dod-gates.ts — DoD gate checks and forceStatus bypass
|
|
3
|
-
// SPEC-729: Validate gate wrapped with withEscalation for bounded retries.
|
|
4
|
-
// SPEC-780: checkApprovedFormatGate honours forceApprove, mirroring SPEC-769 readiness gate.
|
|
5
|
-
import { createHash } from 'node:crypto';
|
|
6
|
-
import { constants } from 'node:fs';
|
|
7
|
-
import { lstat, open, realpath } from 'node:fs/promises';
|
|
8
|
-
import { isAbsolute, relative, resolve as resolvePath, sep } from 'node:path';
|
|
9
|
-
import { validateSpec } from '../../engine/validator.js';
|
|
10
|
-
import { AUTOMATED_VALIDATOR_AGENT, writeImplementationReviewReport, } from '../../engine/validator/validation-report-writer.js';
|
|
11
|
-
import { formatKeyValue } from '../output-formatter.js';
|
|
12
|
-
import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
|
|
13
|
-
import { verifyCurrentDoneReceipt } from './done-receipt-verifier.js';
|
|
14
|
-
import { projectDataDir } from '../../storage/base-store.js';
|
|
15
|
-
import { transitionLogPath } from '../../storage/transition-log.js';
|
|
16
|
-
import { ImplementationReviewV1Schema, ReviewFeedbackV1Schema, ValidationReportV1Schema, } from '../../engine/handoff-artifacts/schemas.js';
|
|
17
|
-
import { renderSchemaSkeleton } from '../../engine/handoff-artifacts/schema-skeleton.js';
|
|
18
|
-
import { isLifecycleStubBody, readVerifiedImplementationReview, } from '../../engine/handoff-artifacts/implementation-review-reader.js';
|
|
19
|
-
import { verifyArtifactVisibility, } from '../../engine/handoff-artifacts/io.js';
|
|
20
|
-
export { completedJobPublishesReceipt } from './done-receipt-verifier.js';
|
|
21
|
-
const HANDOFF_ARTIFACT_TEMPLATE_TIMESTAMP = '2026-01-01T00:00:00.000Z';
|
|
22
|
-
const HANDOFF_ARTIFACT_TEMPLATE_SCHEMA_VERSION = '1.0.0';
|
|
23
|
-
function lazyTemplate(render) {
|
|
24
|
-
let cached;
|
|
25
|
-
return () => {
|
|
26
|
-
cached ??= render();
|
|
27
|
-
return cached;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function schemaBlockers(errors) {
|
|
31
|
-
return errors
|
|
32
|
-
.filter((issue) => issue.code !== 'ARTIFACT_NOT_FOUND' && issue.code !== 'INVALID_JSON')
|
|
33
|
-
.map((issue) => `${issue.path}: ${issue.message}`);
|
|
34
|
-
}
|
|
35
|
-
const reviewFeedbackTemplate = lazyTemplate(() => renderSchemaSkeleton(ReviewFeedbackV1Schema, {
|
|
36
|
-
overrides: {
|
|
37
|
-
schema_version: HANDOFF_ARTIFACT_TEMPLATE_SCHEMA_VERSION,
|
|
38
|
-
reviewedAt: HANDOFF_ARTIFACT_TEMPLATE_TIMESTAMP,
|
|
39
|
-
'reviewer.agent': 'planu-spec-reviewer',
|
|
40
|
-
},
|
|
41
|
-
}));
|
|
42
|
-
const implementationReviewTemplate = lazyTemplate(() => renderSchemaSkeleton(ImplementationReviewV1Schema, {
|
|
43
|
-
overrides: {
|
|
44
|
-
schema_version: HANDOFF_ARTIFACT_TEMPLATE_SCHEMA_VERSION,
|
|
45
|
-
reviewedAt: HANDOFF_ARTIFACT_TEMPLATE_TIMESTAMP,
|
|
46
|
-
'reviewer.agent': 'planu-implementation-reviewer',
|
|
47
|
-
'reviewer.sessionId': '<your-session-id>',
|
|
48
|
-
},
|
|
49
|
-
}));
|
|
50
|
-
const validationReportTemplate = lazyTemplate(() => renderSchemaSkeleton(ValidationReportV1Schema, {
|
|
51
|
-
overrides: {
|
|
52
|
-
schema_version: HANDOFF_ARTIFACT_TEMPLATE_SCHEMA_VERSION,
|
|
53
|
-
completedAt: HANDOFF_ARTIFACT_TEMPLATE_TIMESTAMP,
|
|
54
|
-
'reviewer.agent': AUTOMATED_VALIDATOR_AGENT,
|
|
55
|
-
'reviewer.kind': 'automation',
|
|
56
|
-
},
|
|
57
|
-
}));
|
|
58
|
-
/**
|
|
59
|
-
* SPEC-721 / SPEC-222 Trigger 1: Run validate engine before marking done.
|
|
60
|
-
*
|
|
61
|
-
* Fail-CLOSED: timeout, crash, or null score → blocked (not allowed through).
|
|
62
|
-
* The only escape hatch is `forceStatus=true` with a `forceStatusReason` ≥100 chars.
|
|
63
|
-
*
|
|
64
|
-
* The timeout lives inside this function (Promise.race) so we own the reason string.
|
|
65
|
-
* Callers must NOT wrap this with `withToolTimeout` — doing so would silently convert
|
|
66
|
-
* timeout into `blocked: false` (the exact bypass this spec closes).
|
|
67
|
-
*
|
|
68
|
-
* @param spec The spec being transitioned.
|
|
69
|
-
* @param projectPath Project root for the validate engine.
|
|
70
|
-
* @param forceStatus Whether the LLM explicitly wants to bypass the gate.
|
|
71
|
-
* @param forceStatusReason Why — required and ≥100 chars when forceStatus=true.
|
|
72
|
-
* @param budgetMs Max milliseconds to wait for validate. Default: 9000.
|
|
73
|
-
*/
|
|
74
|
-
export async function runValidateGate(spec, projectPath, forceStatus, forceStatusReason, budgetMs = 9_000, reviewContext) {
|
|
75
|
-
if (forceStatus) {
|
|
76
|
-
if (!forceStatusReason || forceStatusReason.trim().length < 100) {
|
|
77
|
-
return {
|
|
78
|
-
blocked: true,
|
|
79
|
-
score: null,
|
|
80
|
-
reason: 'validate_gate_unreachable',
|
|
81
|
-
errorMessage: 'forceStatus requires forceStatusReason (string ≥ 100 characters explaining why ' +
|
|
82
|
-
'the validate gate is being bypassed).',
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
// Best-effort score for the audit record — do not block if validate is slow.
|
|
86
|
-
let observedScore = null;
|
|
87
|
-
try {
|
|
88
|
-
const timeoutSignal = new Promise((resolve) => {
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
resolve(null);
|
|
91
|
-
}, Math.min(budgetMs, 5_000));
|
|
92
|
-
});
|
|
93
|
-
const r = await Promise.race([validateSpec(spec, projectPath), timeoutSignal]);
|
|
94
|
-
if (r !== null && typeof r === 'object' && 'score' in r) {
|
|
95
|
-
observedScore = typeof r.score === 'number' ? r.score : null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
/* reliability-optional: FORCED_BYPASS_SCORE — bypass audit remains available without score */
|
|
100
|
-
reportClassifiedDegradation('FORCED_BYPASS_SCORE', error);
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
blocked: false,
|
|
104
|
-
score: observedScore,
|
|
105
|
-
forced: true,
|
|
106
|
-
forcedReason: forceStatusReason,
|
|
107
|
-
scoreSource: 'forced-best-effort-validateSpec',
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
if (reviewContext) {
|
|
111
|
-
const report = await readApprovedValidationReportGate(reviewContext.specId, reviewContext.projectId, false);
|
|
112
|
-
if (report.ok && report.score === 100) {
|
|
113
|
-
return { blocked: false, score: 100, forced: false };
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const TIMEOUT_SENTINEL = Symbol('timeout');
|
|
117
|
-
let validateResult;
|
|
118
|
-
try {
|
|
119
|
-
validateResult = await Promise.race([
|
|
120
|
-
validateSpec(spec, projectPath),
|
|
121
|
-
new Promise((resolve) => {
|
|
122
|
-
setTimeout(() => {
|
|
123
|
-
resolve(TIMEOUT_SENTINEL);
|
|
124
|
-
}, budgetMs);
|
|
125
|
-
}),
|
|
126
|
-
]);
|
|
127
|
-
}
|
|
128
|
-
catch (err) {
|
|
129
|
-
// ---- Path C: crash -------------------------------------------------------
|
|
130
|
-
return {
|
|
131
|
-
blocked: true,
|
|
132
|
-
score: null,
|
|
133
|
-
reason: 'validate_gate_crash',
|
|
134
|
-
errorMessage: (err instanceof Error ? err.message : String(err)).slice(0, 240),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
// ---- Path D: timeout -------------------------------------------------------
|
|
138
|
-
if (validateResult === TIMEOUT_SENTINEL) {
|
|
139
|
-
return {
|
|
140
|
-
blocked: true,
|
|
141
|
-
score: null,
|
|
142
|
-
reason: 'validate_gate_timeout',
|
|
143
|
-
errorMessage: `Validate gate timed out after ${String(budgetMs)}ms — could not produce a score. Add criteria evidence and retry, or use forceStatus:true with forceStatusReason explaining why.`,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
// ---- Path B: null score (no criteria) — also guard undefined from engines that omit the field
|
|
147
|
-
const scoreValue = validateResult.score;
|
|
148
|
-
if (scoreValue === null || scoreValue === undefined) {
|
|
149
|
-
return {
|
|
150
|
-
blocked: true,
|
|
151
|
-
score: null,
|
|
152
|
-
reason: 'validate_gate_no_criteria',
|
|
153
|
-
errorMessage: 'Validate could not score this spec — no acceptance criteria found. Run check_readiness or add scenarios, then retry.',
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
// ---- Normal score check — scoreValue is guaranteed number here (null/undefined filtered above) ---
|
|
157
|
-
if (scoreValue < 100) {
|
|
158
|
-
if (reviewContext) {
|
|
159
|
-
await writeImplementationReviewReport({
|
|
160
|
-
...reviewContext,
|
|
161
|
-
spec,
|
|
162
|
-
projectPath,
|
|
163
|
-
score: scoreValue,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
return {
|
|
167
|
-
blocked: true,
|
|
168
|
-
score: scoreValue,
|
|
169
|
-
reason: 'validate_score_below_threshold',
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
if (reviewContext) {
|
|
173
|
-
await writeImplementationReviewReport({
|
|
174
|
-
...reviewContext,
|
|
175
|
-
spec,
|
|
176
|
-
projectPath,
|
|
177
|
-
score: scoreValue,
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return { blocked: false, score: scoreValue, forced: false };
|
|
181
|
-
}
|
|
182
|
-
function validationReceiptGateError(specId, reason) {
|
|
183
|
-
return {
|
|
184
|
-
content: [
|
|
185
|
-
{
|
|
186
|
-
type: 'text',
|
|
187
|
-
text: formatKeyValue({
|
|
188
|
-
error: 'validation_receipt_invalid',
|
|
189
|
-
specId,
|
|
190
|
-
reason,
|
|
191
|
-
fixHint: 'Run validate and wait for its durable job to publish a current receipt.',
|
|
192
|
-
}, 'Validation receipt gate failed'),
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
isError: true,
|
|
196
|
-
structuredContent: {
|
|
197
|
-
error: 'validation_receipt_invalid',
|
|
198
|
-
code: 422,
|
|
199
|
-
context: { specId, reason },
|
|
200
|
-
fixHint: 'Run validate and wait for the durable validation operation to complete.',
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
function doneReviewReportPath(specId, projectId) {
|
|
205
|
-
return resolvePath(projectDataDir(projectId), 'handoffs', specId, 'validation-report.json');
|
|
206
|
-
}
|
|
207
|
-
function doneReviewDigestError(specId, reportPath, code, message, digests) {
|
|
208
|
-
const fixHint = `Run validate, then recompute the sha256 digest from the exact bytes of ${reportPath}.`;
|
|
209
|
-
return {
|
|
210
|
-
content: [{ type: 'text', text: `${code}: ${message}\nFix: ${fixHint}` }],
|
|
211
|
-
isError: true,
|
|
212
|
-
structuredContent: {
|
|
213
|
-
error: code,
|
|
214
|
-
code: 422,
|
|
215
|
-
context: { specId, artifactPath: reportPath, ...digests },
|
|
216
|
-
fixHint,
|
|
217
|
-
},
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
const MAX_VALIDATION_REPORT_BYTES = 5 * 1024 * 1024;
|
|
221
|
-
function isContained(root, candidate) {
|
|
222
|
-
const pathFromRoot = relative(root, candidate);
|
|
223
|
-
return (pathFromRoot === '' ||
|
|
224
|
-
(!isAbsolute(pathFromRoot) && pathFromRoot !== '..' && !pathFromRoot.startsWith(`..${sep}`)));
|
|
225
|
-
}
|
|
226
|
-
function sameFileMetadata(left, right) {
|
|
227
|
-
return (left.dev === right.dev &&
|
|
228
|
-
left.ino === right.ino &&
|
|
229
|
-
left.size === right.size &&
|
|
230
|
-
left.mtimeNs === right.mtimeNs &&
|
|
231
|
-
left.ctimeNs === right.ctimeNs);
|
|
232
|
-
}
|
|
233
|
-
async function readStableDoneReviewReport(specId, projectId) {
|
|
234
|
-
const handoffsRoot = resolvePath(projectDataDir(projectId), 'handoffs');
|
|
235
|
-
const specRoot = resolvePath(handoffsRoot, specId);
|
|
236
|
-
const reportPath = doneReviewReportPath(specId, projectId);
|
|
237
|
-
if (!isContained(handoffsRoot, specRoot) || !isContained(specRoot, reportPath)) {
|
|
238
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The validation report path escapes its contained handoff directory.');
|
|
239
|
-
}
|
|
240
|
-
let canonicalHandoffs;
|
|
241
|
-
let canonicalSpecRoot;
|
|
242
|
-
let canonicalReport;
|
|
243
|
-
let pathStats;
|
|
244
|
-
try {
|
|
245
|
-
[canonicalHandoffs, canonicalSpecRoot, canonicalReport, pathStats] = await Promise.all([
|
|
246
|
-
realpath(handoffsRoot),
|
|
247
|
-
realpath(specRoot),
|
|
248
|
-
realpath(reportPath),
|
|
249
|
-
lstat(reportPath, { bigint: true }),
|
|
250
|
-
]);
|
|
251
|
-
}
|
|
252
|
-
catch {
|
|
253
|
-
return {
|
|
254
|
-
...doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_DIGEST_MISMATCH', 'No persisted validation report was found for this spec. Run validate first, then retry done.'),
|
|
255
|
-
isError: true,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
if (!isContained(canonicalHandoffs, canonicalSpecRoot) ||
|
|
259
|
-
!isContained(canonicalSpecRoot, canonicalReport) ||
|
|
260
|
-
pathStats.isSymbolicLink() ||
|
|
261
|
-
!pathStats.isFile() ||
|
|
262
|
-
pathStats.size > BigInt(MAX_VALIDATION_REPORT_BYTES)) {
|
|
263
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The validation report is not a contained bounded regular file.');
|
|
264
|
-
}
|
|
265
|
-
if (typeof constants.O_NOFOLLOW !== 'number') {
|
|
266
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The platform cannot safely open the validation report without following links.');
|
|
267
|
-
}
|
|
268
|
-
let handle;
|
|
269
|
-
try {
|
|
270
|
-
handle = await open(reportPath, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
271
|
-
}
|
|
272
|
-
catch {
|
|
273
|
-
return {
|
|
274
|
-
...doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The validation report could not be opened without following links.'),
|
|
275
|
-
isError: true,
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
try {
|
|
279
|
-
const openedStats = await handle.stat({ bigint: true });
|
|
280
|
-
if (!openedStats.isFile() || !sameFileMetadata(pathStats, openedStats)) {
|
|
281
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_CHANGED', 'The validation report identity changed before it was opened.');
|
|
282
|
-
}
|
|
283
|
-
const reportBytes = Buffer.alloc(Number(openedStats.size));
|
|
284
|
-
let offset = 0;
|
|
285
|
-
while (offset < reportBytes.length) {
|
|
286
|
-
const { bytesRead } = await handle.read(reportBytes, offset, reportBytes.length - offset, offset);
|
|
287
|
-
if (bytesRead === 0) {
|
|
288
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_CHANGED', 'The validation report changed while it was being read.');
|
|
289
|
-
}
|
|
290
|
-
offset += bytesRead;
|
|
291
|
-
}
|
|
292
|
-
const finalHandleStats = await handle.stat({ bigint: true });
|
|
293
|
-
if (!sameFileMetadata(openedStats, finalHandleStats)) {
|
|
294
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_CHANGED', 'The opened validation report changed while it was being read.');
|
|
295
|
-
}
|
|
296
|
-
let finalPathStats;
|
|
297
|
-
let finalCanonicalReport;
|
|
298
|
-
try {
|
|
299
|
-
[finalPathStats, finalCanonicalReport] = await Promise.all([
|
|
300
|
-
lstat(reportPath, { bigint: true }),
|
|
301
|
-
realpath(reportPath),
|
|
302
|
-
]);
|
|
303
|
-
}
|
|
304
|
-
catch {
|
|
305
|
-
return {
|
|
306
|
-
...doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_CHANGED', 'The validation report path changed while it was being read.'),
|
|
307
|
-
isError: true,
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
if (!isContained(canonicalSpecRoot, finalCanonicalReport)) {
|
|
311
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The validation report path escaped containment while it was being read.');
|
|
312
|
-
}
|
|
313
|
-
if (finalPathStats.isSymbolicLink() ||
|
|
314
|
-
!finalPathStats.isFile() ||
|
|
315
|
-
!sameFileMetadata(openedStats, finalPathStats)) {
|
|
316
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_CHANGED', 'The validation report path identity changed while it was being read.');
|
|
317
|
-
}
|
|
318
|
-
return reportBytes;
|
|
319
|
-
}
|
|
320
|
-
finally {
|
|
321
|
-
await handle.close();
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* SPEC-1356 (T-A1): auto-derive the sha256 digest of the persisted
|
|
326
|
-
* `validation-report.json` so callers no longer have to compute it by hand.
|
|
327
|
-
* Reads and hashes the exact same bytes `checkDoneReviewDigest` would validate
|
|
328
|
-
* against, using the same hardened path/identity checks. Returns the digest, or
|
|
329
|
-
* the exact blocking `ToolResult` when the report cannot be safely read (e.g.
|
|
330
|
-
* validate has not run yet). Exported for direct unit testing and for the
|
|
331
|
-
* orchestration layer (`update-status/index.ts`) that no longer requires the
|
|
332
|
-
* caller to supply `implementationReviewDigest`.
|
|
333
|
-
*/
|
|
334
|
-
export async function deriveDoneReviewDigest(specId, projectId) {
|
|
335
|
-
const reportResult = await readStableDoneReviewReport(specId, projectId);
|
|
336
|
-
if (!Buffer.isBuffer(reportResult)) {
|
|
337
|
-
return { error: reportResult };
|
|
338
|
-
}
|
|
339
|
-
return { digest: `sha256:${createHash('sha256').update(reportResult).digest('hex')}` };
|
|
340
|
-
}
|
|
341
|
-
async function checkDoneReviewDigest(specId, projectId, implementationReviewDigest) {
|
|
342
|
-
const reportPath = doneReviewReportPath(specId, projectId);
|
|
343
|
-
if (!/^sha256:[a-f0-9]{64}$/u.test(implementationReviewDigest)) {
|
|
344
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_DIGEST_INVALID', 'The implementation review digest is malformed.');
|
|
345
|
-
}
|
|
346
|
-
const reportResult = await readStableDoneReviewReport(specId, projectId);
|
|
347
|
-
if (!Buffer.isBuffer(reportResult)) {
|
|
348
|
-
return reportResult;
|
|
349
|
-
}
|
|
350
|
-
const observed = `sha256:${createHash('sha256').update(reportResult).digest('hex')}`;
|
|
351
|
-
if (observed !== implementationReviewDigest) {
|
|
352
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_DIGEST_MISMATCH', `The implementation review digest does not match the persisted validation report at ${reportPath}.`, { received: implementationReviewDigest, expected: observed });
|
|
353
|
-
}
|
|
354
|
-
let decoded;
|
|
355
|
-
try {
|
|
356
|
-
decoded = JSON.parse(reportResult.toString('utf8'));
|
|
357
|
-
}
|
|
358
|
-
catch {
|
|
359
|
-
return {
|
|
360
|
-
...doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The validation report bytes are not valid JSON.'),
|
|
361
|
-
isError: true,
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
const parsed = ValidationReportV1Schema.safeParse(decoded);
|
|
365
|
-
if (!parsed.success ||
|
|
366
|
-
parsed.data.specId !== specId ||
|
|
367
|
-
!parsed.data.passed ||
|
|
368
|
-
parsed.data.gates.some((gate) => !gate.passed) ||
|
|
369
|
-
parsed.data.minimalityReport?.blocked === true ||
|
|
370
|
-
parsed.data.reviewer.kind !== 'automation' ||
|
|
371
|
-
parsed.data.reviewer.agent !== AUTOMATED_VALIDATOR_AGENT ||
|
|
372
|
-
parsed.data.reviewer.verdict !== 'approved') {
|
|
373
|
-
return doneReviewDigestError(specId, reportPath, 'DONE_REVIEW_REPORT_UNSAFE', 'The validation report schema or automated validator evidence is invalid.');
|
|
374
|
-
}
|
|
375
|
-
return null;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* SPEC-725: Check the validation-report artifact gate before marking done.
|
|
379
|
-
* SPEC-1050: Fail closed. A done transition requires a fresh validation-report
|
|
380
|
-
* with reviewer evidence and all validation gates passing.
|
|
381
|
-
*/
|
|
382
|
-
async function readApprovedValidationReportGate(specId, projectId, force) {
|
|
383
|
-
if (force) {
|
|
384
|
-
return { ok: true, score: null };
|
|
385
|
-
}
|
|
386
|
-
try {
|
|
387
|
-
const { readArtifact } = await import('../../engine/handoff-artifacts/io.js');
|
|
388
|
-
const result = await readArtifact({ projectId, specId, kind: 'validation-report' });
|
|
389
|
-
if (!result.ok) {
|
|
390
|
-
const firstErr = result.errors[0];
|
|
391
|
-
if (firstErr?.code === 'ARTIFACT_NOT_FOUND') {
|
|
392
|
-
return {
|
|
393
|
-
ok: false,
|
|
394
|
-
error: validationReportGateError({
|
|
395
|
-
specId,
|
|
396
|
-
error: 'validation_report_missing',
|
|
397
|
-
message: 'No validation-report artifact exists for this spec. Run validate to generate implementation-review evidence before marking done.',
|
|
398
|
-
gates: [],
|
|
399
|
-
fixHint: 'Run validate for this spec, fix any failing gates, then retry update_status(done). Use force:true only with an audited reason.',
|
|
400
|
-
template: validationReportTemplate(),
|
|
401
|
-
}),
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
return {
|
|
405
|
-
ok: false,
|
|
406
|
-
error: validationReportGateError({
|
|
407
|
-
specId,
|
|
408
|
-
error: 'validation_report_invalid',
|
|
409
|
-
message: 'The validation-report artifact is malformed or uses an obsolete schema. Re-run validate so Planu can generate reviewer evidence.',
|
|
410
|
-
gates: [],
|
|
411
|
-
blockers: schemaBlockers(result.errors),
|
|
412
|
-
fixHint: 'Re-run validate for this spec. The report must include reviewer evidence and passing gates.',
|
|
413
|
-
template: validationReportTemplate(),
|
|
414
|
-
}),
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
if (!result.payload.passed) {
|
|
418
|
-
return {
|
|
419
|
-
ok: false,
|
|
420
|
-
error: validationReportGateError({
|
|
421
|
-
specId,
|
|
422
|
-
error: 'validation_report_failed',
|
|
423
|
-
message: 'Validation report has passed:false — fix all failing gates before marking done.',
|
|
424
|
-
gates: result.payload.gates,
|
|
425
|
-
fixHint: 'Fix failing gates and re-run validate before marking done.',
|
|
426
|
-
}),
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
if (result.payload.minimalityReport?.blocked) {
|
|
430
|
-
return {
|
|
431
|
-
ok: false,
|
|
432
|
-
error: validationReportGateError({
|
|
433
|
-
specId,
|
|
434
|
-
error: 'minimality_findings_block_done',
|
|
435
|
-
message: 'Validation report contains blocking minimal implementation findings. Remove avoidable complexity or provide an audited forceStatusReason.',
|
|
436
|
-
gates: result.payload.gates,
|
|
437
|
-
fixHint: 'Fix blocking minimality findings and re-run validate before marking done. Use forceStatus only with an audited reason for accepted complexity.',
|
|
438
|
-
}),
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
if (result.payload.reviewer.verdict !== 'approved' ||
|
|
442
|
-
result.payload.reviewer.agent.trim().length === 0) {
|
|
443
|
-
return {
|
|
444
|
-
ok: false,
|
|
445
|
-
error: validationReportGateError({
|
|
446
|
-
specId,
|
|
447
|
-
error: 'validation_report_reviewer_not_approved',
|
|
448
|
-
message: 'The implementation reviewer did not approve this spec. Fix the requested changes and re-run validate.',
|
|
449
|
-
gates: result.payload.gates,
|
|
450
|
-
fixHint: 'Fix reviewer findings and re-run validate before marking done.',
|
|
451
|
-
}),
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
return {
|
|
455
|
-
ok: true,
|
|
456
|
-
score: typeof result.payload.score === 'number' ? result.payload.score : null,
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
catch (err) {
|
|
460
|
-
return {
|
|
461
|
-
ok: false,
|
|
462
|
-
error: validationReportGateError({
|
|
463
|
-
specId,
|
|
464
|
-
error: 'validation_report_unreadable',
|
|
465
|
-
message: `Could not read validation-report artifact: ${err instanceof Error ? err.message : String(err)}`,
|
|
466
|
-
gates: [],
|
|
467
|
-
fixHint: 'Re-run validate for this spec, then retry update_status(done).',
|
|
468
|
-
}),
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
/** SPEC-1051: Approval requires a dedicated spec reviewer artifact. */
|
|
473
|
-
export async function checkSpecReviewGate(specId, projectId, _forceApprove, persistedBinding) {
|
|
474
|
-
try {
|
|
475
|
-
if (persistedBinding !== undefined &&
|
|
476
|
-
(persistedBinding.projectId !== projectId || persistedBinding.specId !== specId)) {
|
|
477
|
-
return evidenceVisibilityMismatch(specId, projectId, persistedBinding);
|
|
478
|
-
}
|
|
479
|
-
let result;
|
|
480
|
-
if (persistedBinding) {
|
|
481
|
-
const visible = await verifyArtifactVisibility(persistedBinding);
|
|
482
|
-
if (!visible.ok) {
|
|
483
|
-
return evidenceVisibilityMismatch(specId, projectId, persistedBinding, visible);
|
|
484
|
-
}
|
|
485
|
-
result = { ok: true, payload: visible.payload, warnings: [] };
|
|
486
|
-
}
|
|
487
|
-
else {
|
|
488
|
-
result = await (await import('../../engine/handoff-artifacts/io.js')).readArtifact({
|
|
489
|
-
projectId,
|
|
490
|
-
specId,
|
|
491
|
-
kind: 'review_feedback',
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
if (!result.ok) {
|
|
495
|
-
const firstErr = result.errors[0];
|
|
496
|
-
return specReviewGateError({
|
|
497
|
-
specId,
|
|
498
|
-
error: firstErr?.code === 'ARTIFACT_NOT_FOUND' ? 'spec_review_missing' : 'spec_review_invalid',
|
|
499
|
-
message: firstErr?.code === 'ARTIFACT_NOT_FOUND'
|
|
500
|
-
? 'No spec review feedback exists for this spec. An independent planu-spec-reviewer must review the spec and write its evidence before approval.'
|
|
501
|
-
: 'Spec review feedback is malformed or uses an obsolete schema.',
|
|
502
|
-
blockers: schemaBlockers(result.errors),
|
|
503
|
-
fixHint: firstErr?.code === 'ARTIFACT_NOT_FOUND'
|
|
504
|
-
? 'Have planu-spec-reviewer write review_feedback.md (ReviewFeedbackV1) into the handoff store, then retry update_status(approved).'
|
|
505
|
-
: 'Have planu-spec-reviewer rewrite review_feedback.md as valid ReviewFeedbackV1 evidence, then retry approval.',
|
|
506
|
-
template: reviewFeedbackTemplate(),
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
const review = result.payload;
|
|
510
|
-
if (isLifecycleStubBody(specId, review.body)) {
|
|
511
|
-
return specReviewGateError({
|
|
512
|
-
specId,
|
|
513
|
-
error: 'spec_review_stub',
|
|
514
|
-
message: 'Spec review feedback is a lifecycle-generated stub, not evidence from a real reviewer.',
|
|
515
|
-
blockers: [],
|
|
516
|
-
fixHint: `Write handoffs/${specId}/review_feedback.md as a substantive ReviewFeedbackV1 JSON: schema_version 1.0.0, verdict, reviewer.kind spec-review-agent, reviewer.agent planu-spec-reviewer, and a body covering scope reviewed, findings, and verdict rationale (not the lifecycle stub body). It must be written by an independent reviewer that is not the spec author.`,
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
if (review.verdict !== 'approved' || review.reviewer.verdict !== 'approved') {
|
|
520
|
-
return specReviewGateError({
|
|
521
|
-
specId,
|
|
522
|
-
error: 'spec_review_changes_requested',
|
|
523
|
-
message: 'Spec reviewer requested changes. Approval is blocked until the review passes.',
|
|
524
|
-
blockers: review.blockers,
|
|
525
|
-
fixHint: 'Resolve the spec review blockers and have planu-spec-reviewer write updated evidence, then retry approval.',
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
const specReviewerBlockers = [];
|
|
529
|
-
if (review.reviewer.kind !== 'spec-review-agent') {
|
|
530
|
-
specReviewerBlockers.push(`reviewer.kind was ${review.reviewer.kind}. Expected spec-review-agent.`);
|
|
531
|
-
}
|
|
532
|
-
if (review.reviewer.agent !== 'planu-spec-reviewer') {
|
|
533
|
-
specReviewerBlockers.push(`reviewer.agent was ${review.reviewer.agent}. Expected planu-spec-reviewer.`);
|
|
534
|
-
}
|
|
535
|
-
if (specReviewerBlockers.length > 0) {
|
|
536
|
-
return specReviewGateError({
|
|
537
|
-
specId,
|
|
538
|
-
error: 'spec_review_wrong_reviewer',
|
|
539
|
-
message: 'Approval requires a dedicated spec reviewer. The implementation reviewer cannot approve the spec plan.',
|
|
540
|
-
blockers: specReviewerBlockers,
|
|
541
|
-
fixHint: 'Have planu-spec-reviewer write the review artifact with reviewer.kind spec-review-agent and reviewer.agent planu-spec-reviewer, then retry approval.',
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
return null;
|
|
545
|
-
}
|
|
546
|
-
catch (err) {
|
|
547
|
-
/* reliability-optional: SPEC_REVIEW_GATE_READ — typed gate error blocks approval */
|
|
548
|
-
reportClassifiedDegradation('SPEC_REVIEW_GATE_READ', err);
|
|
549
|
-
return specReviewGateError({
|
|
550
|
-
specId,
|
|
551
|
-
error: 'spec_review_unreadable',
|
|
552
|
-
message: `Could not read spec review feedback: ${err instanceof Error ? err.message : String(err)}`,
|
|
553
|
-
blockers: [],
|
|
554
|
-
fixHint: 'Fix the artifact store issue so review_feedback.md is readable, then retry update_status(approved).',
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
function evidenceVisibilityMismatch(specId, projectId, binding, observed) {
|
|
559
|
-
return {
|
|
560
|
-
content: [
|
|
561
|
-
{
|
|
562
|
-
type: 'text',
|
|
563
|
-
text: formatKeyValue({
|
|
564
|
-
error: 'evidence_visibility_mismatch',
|
|
565
|
-
message: 'Persisted review evidence was not visible through the approval gate.',
|
|
566
|
-
expectedProjectId: projectId,
|
|
567
|
-
expectedSpecId: specId,
|
|
568
|
-
actualProjectId: binding.projectId,
|
|
569
|
-
actualSpecId: binding.specId,
|
|
570
|
-
expectedPath: binding.path,
|
|
571
|
-
actualPath: observed?.actualPath ?? binding.path,
|
|
572
|
-
expectedDigest: binding.digest,
|
|
573
|
-
actualDigest: observed?.actualDigest ?? 'unavailable',
|
|
574
|
-
reason: observed?.reason ?? 'IDENTITY_MISMATCH',
|
|
575
|
-
}),
|
|
576
|
-
},
|
|
577
|
-
],
|
|
578
|
-
isError: true,
|
|
579
|
-
structuredContent: {
|
|
580
|
-
error: 'evidence_visibility_mismatch',
|
|
581
|
-
code: 409,
|
|
582
|
-
expected: { projectId, specId, path: binding.path, digest: binding.digest },
|
|
583
|
-
actual: {
|
|
584
|
-
projectId: binding.projectId,
|
|
585
|
-
specId: binding.specId,
|
|
586
|
-
path: observed?.actualPath ?? binding.path,
|
|
587
|
-
digest: observed?.actualDigest,
|
|
588
|
-
},
|
|
589
|
-
},
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
export async function checkImplementationReviewGate(specId, projectId, _force) {
|
|
593
|
-
const verified = await readVerifiedImplementationReview(projectId, specId);
|
|
594
|
-
if (verified.ok) {
|
|
595
|
-
return null;
|
|
596
|
-
}
|
|
597
|
-
switch (verified.reason) {
|
|
598
|
-
case 'missing':
|
|
599
|
-
case 'schema_invalid':
|
|
600
|
-
return implementationReviewGateError({
|
|
601
|
-
specId,
|
|
602
|
-
error: verified.reason === 'missing'
|
|
603
|
-
? 'implementation_review_missing'
|
|
604
|
-
: 'implementation_review_invalid',
|
|
605
|
-
message: verified.reason === 'missing'
|
|
606
|
-
? 'No implementation review exists for this spec. An independent planu-implementation-reviewer must review the implementation and write its own evidence before done.'
|
|
607
|
-
: 'Implementation review evidence is malformed or uses an obsolete schema.',
|
|
608
|
-
blockers: schemaBlockers(verified.errors ?? []),
|
|
609
|
-
fixHint: verified.reason === 'missing'
|
|
610
|
-
? 'Have planu-implementation-reviewer write implementation_review.json (ImplementationReviewV1) into the handoff store, then retry update_status(done).'
|
|
611
|
-
: 'Have planu-implementation-reviewer rewrite implementation_review.json as valid ImplementationReviewV1 evidence, then retry done.',
|
|
612
|
-
template: implementationReviewTemplate(),
|
|
613
|
-
});
|
|
614
|
-
case 'wrong_spec':
|
|
615
|
-
return implementationReviewGateError({
|
|
616
|
-
specId,
|
|
617
|
-
error: 'implementation_review_wrong_spec',
|
|
618
|
-
message: 'Implementation review evidence is bound to a different spec.',
|
|
619
|
-
blockers: [`Review specId was ${verified.review?.specId}. Expected ${specId}.`],
|
|
620
|
-
fixHint: 'Have planu-implementation-reviewer write review evidence bound to this spec, then retry done.',
|
|
621
|
-
});
|
|
622
|
-
case 'stub_body':
|
|
623
|
-
return implementationReviewGateError({
|
|
624
|
-
specId,
|
|
625
|
-
error: 'implementation_review_stub',
|
|
626
|
-
message: 'Implementation review evidence is a lifecycle-generated stub, not evidence from a real reviewer.',
|
|
627
|
-
blockers: [],
|
|
628
|
-
fixHint: 'Replace the stub with genuine planu-implementation-reviewer evidence in the handoff store, then retry done.',
|
|
629
|
-
});
|
|
630
|
-
case 'not_approved':
|
|
631
|
-
return implementationReviewGateError({
|
|
632
|
-
specId,
|
|
633
|
-
error: 'implementation_review_changes_requested',
|
|
634
|
-
message: 'Implementation reviewer requested changes. Done is blocked until the review passes.',
|
|
635
|
-
blockers: verified.review?.blockers ?? [],
|
|
636
|
-
fixHint: 'Resolve the implementation review blockers and have planu-implementation-reviewer write updated evidence, then retry done.',
|
|
637
|
-
});
|
|
638
|
-
case 'wrong_agent_or_kind': {
|
|
639
|
-
const implementationReviewerBlockers = [];
|
|
640
|
-
if (verified.review?.reviewer.kind !== 'implementation-review-agent') {
|
|
641
|
-
implementationReviewerBlockers.push(`reviewer.kind was ${verified.review?.reviewer.kind}. Expected implementation-review-agent.`);
|
|
642
|
-
}
|
|
643
|
-
if (verified.review?.reviewer.agent !== 'planu-implementation-reviewer') {
|
|
644
|
-
implementationReviewerBlockers.push(`reviewer.agent was ${verified.review?.reviewer.agent}. Expected planu-implementation-reviewer.`);
|
|
645
|
-
}
|
|
646
|
-
return implementationReviewGateError({
|
|
647
|
-
specId,
|
|
648
|
-
error: 'implementation_review_wrong_reviewer',
|
|
649
|
-
message: 'Done requires the recognized independent implementation reviewer identity.',
|
|
650
|
-
blockers: implementationReviewerBlockers,
|
|
651
|
-
fixHint: 'Have planu-implementation-reviewer write the review artifact with reviewer.kind implementation-review-agent and reviewer.agent planu-implementation-reviewer, then retry done.',
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
case 'actor_unreadable':
|
|
655
|
-
return implementationReviewGateError({
|
|
656
|
-
specId,
|
|
657
|
-
error: 'implementing_actor_unreadable',
|
|
658
|
-
message: `Could not read the transition log to find the implementing actor: ${verified.readError ?? ''}`,
|
|
659
|
-
blockers: [],
|
|
660
|
-
fixHint: 'Fix the transition log so it can be read, then retry update_status(done).',
|
|
661
|
-
artifactPath: transitionLogPath(projectId),
|
|
662
|
-
});
|
|
663
|
-
case 'self_review':
|
|
664
|
-
return implementationReviewGateError({
|
|
665
|
-
specId,
|
|
666
|
-
error: 'implementation_review_self_review',
|
|
667
|
-
message: 'The implementation reviewer must be a different identity from the implementer. Self-review is blocked.',
|
|
668
|
-
blockers: [
|
|
669
|
-
`Implementer and reviewer share the session identity "${verified.implementingActor}" (verified.implementingActor).`,
|
|
670
|
-
],
|
|
671
|
-
fixHint: 'Have a different, independent agent write the implementation review evidence, then retry done.',
|
|
672
|
-
});
|
|
673
|
-
case 'identity_unverifiable':
|
|
674
|
-
return implementationReviewGateError({
|
|
675
|
-
specId,
|
|
676
|
-
error: 'implementation_review_identity_unverifiable',
|
|
677
|
-
message: 'Reviewer independence is unverifiable. reviewer.sessionId is missing, blank, or a placeholder, or the implementing actor could not be resolved from the transition log.',
|
|
678
|
-
blockers: [
|
|
679
|
-
`reviewer.sessionId was ${JSON.stringify(verified.review?.reviewer.sessionId ?? null)}. implementingActor was ${JSON.stringify(verified.implementingActor ?? null)}.`,
|
|
680
|
-
],
|
|
681
|
-
fixHint: 'Have planu-implementation-reviewer record its real session identity in reviewer.sessionId, and have the orchestrator pass a real actor on update_status(implementing), then retry done.',
|
|
682
|
-
});
|
|
683
|
-
case 'unreadable':
|
|
684
|
-
return implementationReviewGateError({
|
|
685
|
-
specId,
|
|
686
|
-
error: 'implementation_review_unreadable',
|
|
687
|
-
message: `Could not read implementation review evidence: ${verified.readError ?? ''}`,
|
|
688
|
-
blockers: [],
|
|
689
|
-
fixHint: 'Fix the artifact store issue so implementation_review.json is readable, then retry update_status(done).',
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
function implementationReviewGateError(args) {
|
|
694
|
-
const artifactPath = args.artifactPath ??
|
|
695
|
-
`external Planu project data: handoffs/${args.specId}/implementation_review.json`;
|
|
696
|
-
return {
|
|
697
|
-
content: [
|
|
698
|
-
{
|
|
699
|
-
type: 'text',
|
|
700
|
-
text: formatKeyValue({
|
|
701
|
-
error: args.error,
|
|
702
|
-
message: args.message,
|
|
703
|
-
artifactPath,
|
|
704
|
-
blockers: args.blockers.length,
|
|
705
|
-
firstBlocker: args.blockers[0],
|
|
706
|
-
fixHint: args.fixHint,
|
|
707
|
-
}, 'Implementation review gate failed'),
|
|
708
|
-
},
|
|
709
|
-
],
|
|
710
|
-
isError: true,
|
|
711
|
-
structuredContent: {
|
|
712
|
-
error: args.error,
|
|
713
|
-
code: 422,
|
|
714
|
-
context: { specId: args.specId, artifactPath, blockers: args.blockers },
|
|
715
|
-
fixHint: args.fixHint,
|
|
716
|
-
...(args.template ? { template: args.template } : {}),
|
|
717
|
-
},
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
function validationReportGateError(args) {
|
|
721
|
-
const artifactPath = `external Planu project data: handoffs/${args.specId}/validation-report.json`;
|
|
722
|
-
const blockerCount = args.blockers && args.blockers.length > 0 ? args.blockers.length : undefined;
|
|
723
|
-
return {
|
|
724
|
-
content: [
|
|
725
|
-
{
|
|
726
|
-
type: 'text',
|
|
727
|
-
text: formatKeyValue({
|
|
728
|
-
error: args.error,
|
|
729
|
-
message: args.message,
|
|
730
|
-
artifactPath,
|
|
731
|
-
failedGates: args.gates.filter((gate) => !gate.passed).length,
|
|
732
|
-
totalGates: args.gates.length,
|
|
733
|
-
blockers: blockerCount,
|
|
734
|
-
firstBlocker: args.blockers?.[0],
|
|
735
|
-
fixHint: args.fixHint,
|
|
736
|
-
}, 'Validation report gate failed'),
|
|
737
|
-
},
|
|
738
|
-
],
|
|
739
|
-
isError: true,
|
|
740
|
-
structuredContent: {
|
|
741
|
-
error: args.error,
|
|
742
|
-
code: 422,
|
|
743
|
-
context: {
|
|
744
|
-
specId: args.specId,
|
|
745
|
-
artifactPath,
|
|
746
|
-
gates: args.gates,
|
|
747
|
-
...(args.blockers ? { blockers: args.blockers } : {}),
|
|
748
|
-
},
|
|
749
|
-
fixHint: args.fixHint,
|
|
750
|
-
...(args.template ? { template: args.template } : {}),
|
|
751
|
-
},
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
function specReviewGateError(args) {
|
|
755
|
-
const artifactPath = `external Planu project data: handoffs/${args.specId}/review_feedback.md`;
|
|
756
|
-
return {
|
|
757
|
-
content: [
|
|
758
|
-
{
|
|
759
|
-
type: 'text',
|
|
760
|
-
text: formatKeyValue({
|
|
761
|
-
error: args.error,
|
|
762
|
-
message: args.message,
|
|
763
|
-
artifactPath,
|
|
764
|
-
blockers: args.blockers.length,
|
|
765
|
-
firstBlocker: args.blockers[0],
|
|
766
|
-
fixHint: args.fixHint,
|
|
767
|
-
}, 'Spec review gate failed'),
|
|
768
|
-
},
|
|
769
|
-
],
|
|
770
|
-
isError: true,
|
|
771
|
-
structuredContent: {
|
|
772
|
-
error: args.error,
|
|
773
|
-
code: 422,
|
|
774
|
-
context: { specId: args.specId, artifactPath, blockers: args.blockers },
|
|
775
|
-
fixHint: args.fixHint,
|
|
776
|
-
...(args.template ? { template: args.template } : {}),
|
|
777
|
-
},
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* SPEC-335: Combined done-gates runner — DoD + security.
|
|
782
|
-
* When force=true, gates are not blocking but failing items are recorded in
|
|
783
|
-
* the project's force-bypass-log.json for traceability (guard: done ≠ implemented).
|
|
784
|
-
*/
|
|
785
|
-
export async function checkDoneGates(spec, specId, projectId, projectPath, _force, _forceReason = 'No force reason provided', verifyReceipt = verifyCurrentDoneReceipt, implementationReviewDigest) {
|
|
786
|
-
try {
|
|
787
|
-
const reviewGateError = await checkImplementationReviewGate(specId, projectId, _force);
|
|
788
|
-
if (reviewGateError) {
|
|
789
|
-
return {
|
|
790
|
-
blocked: reviewGateError,
|
|
791
|
-
forcedBypassWarning: null,
|
|
792
|
-
freshnessLease: null,
|
|
793
|
-
};
|
|
794
|
-
}
|
|
795
|
-
if (implementationReviewDigest !== undefined) {
|
|
796
|
-
const digestError = await checkDoneReviewDigest(specId, projectId, implementationReviewDigest);
|
|
797
|
-
if (digestError) {
|
|
798
|
-
return {
|
|
799
|
-
blocked: digestError,
|
|
800
|
-
forcedBypassWarning: null,
|
|
801
|
-
freshnessLease: null,
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
const result = await verifyReceipt({ projectId, specId, projectPath, specPath: spec.specPath });
|
|
806
|
-
return result.valid
|
|
807
|
-
? {
|
|
808
|
-
blocked: null,
|
|
809
|
-
forcedBypassWarning: null,
|
|
810
|
-
freshnessLease: result.freshnessLease ?? null,
|
|
811
|
-
}
|
|
812
|
-
: {
|
|
813
|
-
blocked: validationReceiptGateError(specId, result.reason ?? 'invalid-receipt'),
|
|
814
|
-
forcedBypassWarning: null,
|
|
815
|
-
freshnessLease: null,
|
|
816
|
-
};
|
|
817
|
-
}
|
|
818
|
-
catch (error) {
|
|
819
|
-
/* reliability-optional: VALIDATION_RECEIPT_GATE — typed blocked result fails closed */
|
|
820
|
-
reportClassifiedDegradation('VALIDATION_RECEIPT_GATE', error);
|
|
821
|
-
return {
|
|
822
|
-
blocked: validationReceiptGateError(specId, error instanceof Error ? error.message : 'receipt-verification-failed'),
|
|
823
|
-
forcedBypassWarning: null,
|
|
824
|
-
freshnessLease: null,
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
export { checkApprovedFormatGate, checkComplianceGate, } from './approval-gates.js';
|
|
829
|
-
// ---------------------------------------------------------------------------
|
|
830
|
-
// SPEC-729: Validate gate wrapped with withEscalation
|
|
831
|
-
// ---------------------------------------------------------------------------
|
|
832
|
-
/**
|
|
833
|
-
* Run the validate gate wrapped in withEscalation for bounded retries.
|
|
834
|
-
*
|
|
835
|
-
* On budget exhaustion, returns an escalation sentinel with decision='retry'|'abort'.
|
|
836
|
-
* The caller is responsible for surfacing the decision as interactiveQuestions.
|
|
837
|
-
*
|
|
838
|
-
* @param spec - The spec being transitioned.
|
|
839
|
-
* @param projectPath - Project root for the validate engine.
|
|
840
|
-
* @param projectId - Project ID for retry counter persistence.
|
|
841
|
-
* @param specId - Spec ID for retry counter keying.
|
|
842
|
-
* @param frontmatterSha - Frontmatter SHA for retry counter keying.
|
|
843
|
-
* @param forceStatus - Whether to bypass the gate.
|
|
844
|
-
* @param forceStatusReason - Required when forceStatus=true.
|
|
845
|
-
* @param budgetMs - Max milliseconds for validate.
|
|
846
|
-
*/
|
|
847
|
-
//# sourceMappingURL=dod-gates.js.map
|