@planu/cli 6.1.0 → 7.1.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 +2 -2
- 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,900 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines -- durable validation, resumable receipt publication, and fencing stay co-located for auditability */
|
|
2
|
-
import { randomUUID } from 'node:crypto';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { DurableJobRuntime } from './job-runtime.js';
|
|
5
|
-
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
6
|
-
import { RuntimeDatabase } from '../../storage/runtime-db.js';
|
|
7
|
-
import { createExecutionScope } from './context.js';
|
|
8
|
-
import { runValidateWorker } from './validate-worker-runtime.js';
|
|
9
|
-
import { redactValidationProgress, computeDurableValidationBindings, toValidationReceiptBindings, writeValidationArtifactProvenance, } from '../validation/durable-validation.js';
|
|
10
|
-
import { parseValidationReceiptPendingCheckpoint, isValidationReceiptPendingIntent, } from '../../types/durable-validation.js';
|
|
11
|
-
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
12
|
-
import { resolveStorageLayout } from '../../storage/storage-layout.js';
|
|
13
|
-
import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
|
|
14
|
-
import { createValidationReceiptAuthority, ensureValidationIssuerKey, issueValidationReceipt, LOCAL_VALIDATION_RECEIPT_ISSUER, preflightValidationReceiptSigner, } from '../validation/validation-receipt.js';
|
|
15
|
-
import { appendArtifact, readArtifact } from '../handoff-artifacts/io.js';
|
|
16
|
-
import { beginValidationFreshnessBarrier, beginValidationFreshnessPublicationWindow, bindValidationFreshnessLease, closeValidationFreshnessLease, evaluateValidationFreshnessBarrier, rebaselineValidationFreshnessLeaseAfterRecompute, } from '../validation/validation-freshness.js';
|
|
17
|
-
import { recoverValidateJobs } from './validate-job-recovery.js';
|
|
18
|
-
import { getRuntimePolicy } from '../runtime-policy.js';
|
|
19
|
-
import { isValidateJob, parseValidatePayload, rehydrateValidationPayload, } from './validate-job-payload.js';
|
|
20
|
-
import { revalidateValidationWorktree } from '../validation/validation-worktree.js';
|
|
21
|
-
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
22
|
-
import { projectDataDir } from '../../storage/base-store.js';
|
|
23
|
-
import { redactSensitiveValue, redactText } from '../../security/redactor.js';
|
|
24
|
-
import { MacOSKeychainOperationError } from '../../security/adapters/macos-keychain.js';
|
|
25
|
-
import { createDurableJobHeartbeat } from './durable-job-heartbeat-runtime.js';
|
|
26
|
-
const WORKSPACE_ID = 'global';
|
|
27
|
-
const MIN_LEASE_WAIT_MS = 50;
|
|
28
|
-
const activeScopes = new Map();
|
|
29
|
-
const RECEIPT_PUBLICATION_FAILURE_MESSAGES = {
|
|
30
|
-
keychain_timeout: '[Planu] VALIDATION_RECEIPT_PENDING action=restart_job cause=keychain_timeout: the signing key could not be read from the keychain before the read timed out',
|
|
31
|
-
publication_deadline_elapsed: '[Planu] VALIDATION_RECEIPT_PENDING action=restart_job cause=publication_deadline_elapsed: the receipt publication deadline elapsed before the receipt was signed',
|
|
32
|
-
publication_interrupted: '[Planu] VALIDATION_RECEIPT_PENDING action=restart_job cause=publication_interrupted: receipt publication was interrupted after the receipt was signed and persisted; check the provenance files under handoffs/<spec>/*.provenance.json for an already-persisted receiptId before restarting',
|
|
33
|
-
};
|
|
34
|
-
class ReceiptPublicationTimeoutError extends Error {
|
|
35
|
-
constructor() {
|
|
36
|
-
super('[Planu] Receipt publication deadline elapsed');
|
|
37
|
-
this.name = 'ReceiptPublicationTimeoutError';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
class ReceiptPublicationInterruptedError extends Error {
|
|
41
|
-
constructor(options) {
|
|
42
|
-
super('[Planu] Receipt publication was interrupted after persistence', options);
|
|
43
|
-
this.name = 'ReceiptPublicationInterruptedError';
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
class ValidationAuthorityLostError extends Error {
|
|
47
|
-
reason;
|
|
48
|
-
constructor(reason, options) {
|
|
49
|
-
super(`[Planu] Durable validate job authority was lost (${reason})`, options);
|
|
50
|
-
this.reason = reason;
|
|
51
|
-
this.name = 'ValidationAuthorityLostError';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function classifyReceiptPublicationFailure(error) {
|
|
55
|
-
if (error instanceof ReceiptPublicationTimeoutError) {
|
|
56
|
-
return 'publication_deadline_elapsed';
|
|
57
|
-
}
|
|
58
|
-
if (error instanceof ReceiptPublicationInterruptedError) {
|
|
59
|
-
return 'publication_interrupted';
|
|
60
|
-
}
|
|
61
|
-
if (error instanceof MacOSKeychainOperationError && error.code === 'KEYCHAIN_TIMEOUT') {
|
|
62
|
-
return 'keychain_timeout';
|
|
63
|
-
}
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
function decodeUtf8Prefix(encoded, prefixLength) {
|
|
67
|
-
try {
|
|
68
|
-
return {
|
|
69
|
-
valid: true,
|
|
70
|
-
value: new TextDecoder('utf-8', { fatal: true }).decode(encoded.subarray(0, prefixLength)),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return { valid: false };
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function truncateUtf8ByBytes(value, maximumBytes) {
|
|
78
|
-
const encoded = Buffer.from(value, 'utf8');
|
|
79
|
-
if (encoded.length <= maximumBytes) {
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
for (let length = maximumBytes; length >= 0; length -= 1) {
|
|
83
|
-
const decoded = decodeUtf8Prefix(encoded, length);
|
|
84
|
-
if (decoded.valid) {
|
|
85
|
-
return decoded.value;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return '';
|
|
89
|
-
}
|
|
90
|
-
function canonicalJson(value) {
|
|
91
|
-
return JSON.stringify(value);
|
|
92
|
-
}
|
|
93
|
-
function delay(ms) {
|
|
94
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
95
|
-
}
|
|
96
|
-
function hasReceipt(result) {
|
|
97
|
-
const structured = result.structuredContent;
|
|
98
|
-
return typeof structured?.receiptId === 'string' && typeof structured.receiptKey === 'string';
|
|
99
|
-
}
|
|
100
|
-
function validationPassed(result) {
|
|
101
|
-
const structured = result.structuredContent;
|
|
102
|
-
const report = structured?.validationReport;
|
|
103
|
-
return structured?.ready === true && report?.passed === true;
|
|
104
|
-
}
|
|
105
|
-
function withEnrichedValidationReportSha(structuredContent, sha) {
|
|
106
|
-
const validationReport = structuredContent.validationReport;
|
|
107
|
-
const artifactRefs = structuredContent.artifactRefs;
|
|
108
|
-
return {
|
|
109
|
-
...structuredContent,
|
|
110
|
-
...(validationReport ? { validationReport: { ...validationReport, sha } } : {}),
|
|
111
|
-
...(artifactRefs ? { artifactRefs: { ...artifactRefs, validationReportSha: sha } } : {}),
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function buildReceiptResult(checkpointResult, receiptId, receiptKey, enrichedReportSha) {
|
|
115
|
-
const baseStructuredContent = checkpointResult.structuredContent ?? {};
|
|
116
|
-
const structuredContent = enrichedReportSha
|
|
117
|
-
? withEnrichedValidationReportSha(baseStructuredContent, enrichedReportSha)
|
|
118
|
-
: baseStructuredContent;
|
|
119
|
-
return {
|
|
120
|
-
...checkpointResult,
|
|
121
|
-
structuredContent: { ...structuredContent, receiptId, receiptKey },
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
async function closeFreshnessLeaseSafely(lease) {
|
|
125
|
-
if (!lease) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
try {
|
|
129
|
-
await closeValidationFreshnessLease(lease);
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
reportClassifiedDegradation('VALIDATION_FRESHNESS_CHECK_FAILED', error);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
async function stopHeartbeatSafely(heartbeat) {
|
|
136
|
-
if (!heartbeat) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
await heartbeat.stop();
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
reportClassifiedDegradation('VALIDATE_JOB_HEARTBEAT_FAILURE', error);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function toolResultError(result) {
|
|
147
|
-
return result.content
|
|
148
|
-
.map((item) => item.text)
|
|
149
|
-
.join('\n')
|
|
150
|
-
.slice(0, 4_096);
|
|
151
|
-
}
|
|
152
|
-
function executionAborted(signal) {
|
|
153
|
-
return signal.aborted;
|
|
154
|
-
}
|
|
155
|
-
function actionableFreshnessMessage(prefix, reason, changedInput) {
|
|
156
|
-
const changedSuffix = changedInput ? ` (changed: ${changedInput})` : '';
|
|
157
|
-
return `${prefix}: ${reason}${changedSuffix} Re-run validate to issue a fresh receipt, then retry the original call.`;
|
|
158
|
-
}
|
|
159
|
-
function freshnessBarrierErrorMessage(phase, result) {
|
|
160
|
-
return actionableFreshnessMessage(`[Planu] Validation inputs changed ${phase} receipt publication`, result.reason, result.changedInput);
|
|
161
|
-
}
|
|
162
|
-
function rebaselineRejectionErrorMessage(rejection) {
|
|
163
|
-
return actionableFreshnessMessage('[Planu] Validation inputs changed before receipt publication', rejection.reason, rejection.changedInput);
|
|
164
|
-
}
|
|
165
|
-
function hasReceiptInputs(payload) {
|
|
166
|
-
return Boolean(payload.bindings && payload.artifactDigests && payload.freshnessLease);
|
|
167
|
-
}
|
|
168
|
-
/** Executes accepted validate jobs directly against the validation core, never through MCP. */
|
|
169
|
-
export class ValidateJobExecutor {
|
|
170
|
-
runtime;
|
|
171
|
-
workerId;
|
|
172
|
-
options;
|
|
173
|
-
constructor(runtime, workerId = `validate-${randomUUID()}`, options = {}) {
|
|
174
|
-
this.runtime = runtime;
|
|
175
|
-
this.workerId = workerId;
|
|
176
|
-
this.options = options;
|
|
177
|
-
}
|
|
178
|
-
async runOnce(projectId, workspaceId = WORKSPACE_ID) {
|
|
179
|
-
const candidates = this.runtime
|
|
180
|
-
.list(projectId, workspaceId)
|
|
181
|
-
.filter((job) => (job.state === 'accepted' || job.state === 'checkpointed') && isValidateJob(job.payload))
|
|
182
|
-
.slice(0, getRuntimePolicy().validation.workerConcurrency);
|
|
183
|
-
return Promise.all(candidates.map((job) => this.execute(job)));
|
|
184
|
-
}
|
|
185
|
-
async runUntilIdle(projectId, workspaceId = WORKSPACE_ID) {
|
|
186
|
-
const capacity = getRuntimePolicy().validation.workerConcurrency;
|
|
187
|
-
const workerLeaseMs = getRuntimePolicy().validation.workerLeaseMs;
|
|
188
|
-
const active = new Set();
|
|
189
|
-
for (;;) {
|
|
190
|
-
this.runtime.recoverExpired(projectId, workspaceId);
|
|
191
|
-
const available = capacity - active.size;
|
|
192
|
-
const candidates = this.runtime
|
|
193
|
-
.list(projectId, workspaceId)
|
|
194
|
-
.filter((job) => (job.state === 'accepted' || job.state === 'checkpointed') &&
|
|
195
|
-
isValidateJob(job.payload))
|
|
196
|
-
.slice(0, available);
|
|
197
|
-
for (const candidate of candidates) {
|
|
198
|
-
const execution = this.execute(candidate)
|
|
199
|
-
.then(() => undefined)
|
|
200
|
-
.catch((error) => {
|
|
201
|
-
reportClassifiedDegradation('VALIDATE_JOB_EXECUTION_FAILURE', error);
|
|
202
|
-
})
|
|
203
|
-
.finally(() => {
|
|
204
|
-
active.delete(execution);
|
|
205
|
-
});
|
|
206
|
-
active.add(execution);
|
|
207
|
-
}
|
|
208
|
-
if (active.size === 0) {
|
|
209
|
-
const ownLostLease = this.runtime
|
|
210
|
-
.list(projectId, workspaceId)
|
|
211
|
-
.find((job) => job.state === 'running' &&
|
|
212
|
-
job.leaseOwner === this.workerId &&
|
|
213
|
-
isValidateJob(job.payload));
|
|
214
|
-
if (ownLostLease) {
|
|
215
|
-
await delay(this.ownLeaseWaitMs(ownLostLease.leaseExpiresAt, workerLeaseMs));
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
if (active.size >= capacity || candidates.length === 0) {
|
|
221
|
-
await Promise.race(active);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
ownLeaseWaitMs(leaseExpiresAt, workerLeaseMs) {
|
|
226
|
-
const expiresAtMs = leaseExpiresAt ? Date.parse(leaseExpiresAt) : Number.NaN;
|
|
227
|
-
if (!Number.isFinite(expiresAtMs)) {
|
|
228
|
-
return workerLeaseMs;
|
|
229
|
-
}
|
|
230
|
-
return Math.min(Math.max(expiresAtMs - Date.now(), MIN_LEASE_WAIT_MS), workerLeaseMs);
|
|
231
|
-
}
|
|
232
|
-
async execute(job) {
|
|
233
|
-
const identity = {
|
|
234
|
-
operationId: job.id,
|
|
235
|
-
projectId: job.projectId,
|
|
236
|
-
workspaceId: job.workspaceId,
|
|
237
|
-
};
|
|
238
|
-
const claimed = this.runtime.claim({
|
|
239
|
-
...identity,
|
|
240
|
-
workerId: this.workerId,
|
|
241
|
-
leaseMs: this.workerTimingPolicy().workerLeaseMs,
|
|
242
|
-
});
|
|
243
|
-
if (!claimed) {
|
|
244
|
-
return this.runtime.get(identity);
|
|
245
|
-
}
|
|
246
|
-
let parsedPayload;
|
|
247
|
-
try {
|
|
248
|
-
parsedPayload = parseValidatePayload(claimed.payload);
|
|
249
|
-
}
|
|
250
|
-
catch (error) {
|
|
251
|
-
reportClassifiedDegradation('VALIDATE_JOB_PAYLOAD_PARSE_FAILURE', error);
|
|
252
|
-
return this.runtime.fail({
|
|
253
|
-
...identity,
|
|
254
|
-
workerId: this.workerId,
|
|
255
|
-
fencingToken: claimed.fencingToken,
|
|
256
|
-
error: error instanceof Error ? error.message : '[Planu] Invalid validate job payload',
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
if (!parsedPayload) {
|
|
260
|
-
return this.runtime.fail({
|
|
261
|
-
...identity,
|
|
262
|
-
workerId: this.workerId,
|
|
263
|
-
fencingToken: claimed.fencingToken,
|
|
264
|
-
error: '[Planu] Invalid validate job payload',
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
const pendingCheckpoint = parseValidationReceiptPendingCheckpoint(claimed.checkpoint, this.receiptCheckpointLimits());
|
|
268
|
-
if (pendingCheckpoint) {
|
|
269
|
-
return this.resumeReceiptPublication(identity, parsedPayload, pendingCheckpoint, claimed.fencingToken);
|
|
270
|
-
}
|
|
271
|
-
if (isValidationReceiptPendingIntent(claimed.checkpoint)) {
|
|
272
|
-
return this.runtime.fail({
|
|
273
|
-
...identity,
|
|
274
|
-
workerId: this.workerId,
|
|
275
|
-
fencingToken: claimed.fencingToken,
|
|
276
|
-
error: '[Planu] Invalid validation receipt checkpoint',
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
const deadlineAt = parsedPayload.deadlineAt ?? Date.now() + getRuntimePolicy().validation.defaultDeadlineMs;
|
|
280
|
-
if (deadlineAt <= Date.now()) {
|
|
281
|
-
return this.runtime.fail({
|
|
282
|
-
...identity,
|
|
283
|
-
workerId: this.workerId,
|
|
284
|
-
fencingToken: claimed.fencingToken,
|
|
285
|
-
error: '[Planu] Durable validate job deadline elapsed',
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
return this.runClaimedValidation(identity, parsedPayload, deadlineAt, claimed.fencingToken);
|
|
289
|
-
}
|
|
290
|
-
// eslint-disable-next-line max-lines-per-function -- worker and receipt failure cleanup share one lease boundary
|
|
291
|
-
async runClaimedValidation(identity, submittedPayload, deadlineAt, fencingToken) {
|
|
292
|
-
let scope;
|
|
293
|
-
let heartbeat;
|
|
294
|
-
let payload;
|
|
295
|
-
try {
|
|
296
|
-
const executionScope = createExecutionScope({ requestId: identity.operationId, deadlineAt });
|
|
297
|
-
scope = executionScope;
|
|
298
|
-
heartbeat = await this.startHeartbeat(identity, fencingToken, (reason) => {
|
|
299
|
-
executionScope.cancel(reason);
|
|
300
|
-
});
|
|
301
|
-
let hydratedPayload;
|
|
302
|
-
try {
|
|
303
|
-
hydratedPayload = await rehydrateValidationPayload(submittedPayload);
|
|
304
|
-
}
|
|
305
|
-
catch (error) {
|
|
306
|
-
reportClassifiedDegradation('VALIDATE_JOB_SUBMISSION_FAILURE', error);
|
|
307
|
-
throw error;
|
|
308
|
-
}
|
|
309
|
-
payload = hydratedPayload;
|
|
310
|
-
await executionScope.run(() => preflightValidationReceiptSigner({
|
|
311
|
-
projectId: identity.projectId,
|
|
312
|
-
issuerId: LOCAL_VALIDATION_RECEIPT_ISSUER,
|
|
313
|
-
}));
|
|
314
|
-
const afterPreflight = this.observeForSettlement(identity);
|
|
315
|
-
if (afterPreflight.state === 'cancelled' || afterPreflight.cancelRequested) {
|
|
316
|
-
return afterPreflight;
|
|
317
|
-
}
|
|
318
|
-
this.requireCurrentFence(afterPreflight, fencingToken);
|
|
319
|
-
const startedAt = Date.now();
|
|
320
|
-
const result = await executionScope.run(() => (this.options.runWorker ?? runValidateWorker)({
|
|
321
|
-
requestId: identity.operationId,
|
|
322
|
-
input: { ...hydratedPayload.input, specPath: hydratedPayload.specPath },
|
|
323
|
-
deadlineAt,
|
|
324
|
-
signal: executionScope.context.signal,
|
|
325
|
-
onProgress: (progress) => {
|
|
326
|
-
this.persistProgress(identity, fencingToken, progress);
|
|
327
|
-
},
|
|
328
|
-
}));
|
|
329
|
-
const current = this.observeForSettlement(identity);
|
|
330
|
-
if (current.state === 'cancelled' || current.cancelRequested) {
|
|
331
|
-
return current;
|
|
332
|
-
}
|
|
333
|
-
this.requireCurrentFence(current, fencingToken);
|
|
334
|
-
if (result.isError === true) {
|
|
335
|
-
return this.runtime.fail({
|
|
336
|
-
...identity,
|
|
337
|
-
workerId: this.workerId,
|
|
338
|
-
fencingToken,
|
|
339
|
-
error: toolResultError(result),
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
if (hasReceipt(result)) {
|
|
343
|
-
throw new Error('[Planu] Validate workers cannot self-issue authoritative receipts');
|
|
344
|
-
}
|
|
345
|
-
const durableResult = validationPassed(result)
|
|
346
|
-
? await this.publishInitialReceipt(identity, payload, result, Date.now() - startedAt, fencingToken, executionScope.context.signal)
|
|
347
|
-
: result;
|
|
348
|
-
this.currentFence(identity, fencingToken);
|
|
349
|
-
return this.runtime.complete({
|
|
350
|
-
...identity,
|
|
351
|
-
workerId: this.workerId,
|
|
352
|
-
fencingToken,
|
|
353
|
-
result: durableResult,
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
catch (error) {
|
|
357
|
-
/* reliability-optional: VALIDATE_JOB_EXECUTION_FAILURE — runtime records typed failure */
|
|
358
|
-
reportClassifiedDegradation('VALIDATE_JOB_EXECUTION_FAILURE', error);
|
|
359
|
-
const disposition = this.failureDisposition(identity, fencingToken, error);
|
|
360
|
-
if (disposition.settleLocally) {
|
|
361
|
-
if (disposition.current) {
|
|
362
|
-
return disposition.current;
|
|
363
|
-
}
|
|
364
|
-
throw error;
|
|
365
|
-
}
|
|
366
|
-
const current = disposition.current;
|
|
367
|
-
if (current.state === 'cancelled') {
|
|
368
|
-
return current;
|
|
369
|
-
}
|
|
370
|
-
const receiptFailureCause = classifyReceiptPublicationFailure(error);
|
|
371
|
-
if (receiptFailureCause &&
|
|
372
|
-
parseValidationReceiptPendingCheckpoint(current.checkpoint, this.receiptCheckpointLimits())) {
|
|
373
|
-
return this.runtime.fail({
|
|
374
|
-
...identity,
|
|
375
|
-
workerId: this.workerId,
|
|
376
|
-
fencingToken,
|
|
377
|
-
error: RECEIPT_PUBLICATION_FAILURE_MESSAGES[receiptFailureCause],
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
if (parseValidationReceiptPendingCheckpoint(current.checkpoint, this.receiptCheckpointLimits())) {
|
|
381
|
-
this.recordFencedProgress(identity, fencingToken, {
|
|
382
|
-
phase: 'receipt-publication',
|
|
383
|
-
command: '[Planu] Receipt publication failed closed',
|
|
384
|
-
durationMs: 0,
|
|
385
|
-
status: 'failed',
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
return this.runtime.fail({
|
|
389
|
-
...identity,
|
|
390
|
-
workerId: this.workerId,
|
|
391
|
-
fencingToken,
|
|
392
|
-
error: redactValidationProgress({
|
|
393
|
-
phase: 'worker',
|
|
394
|
-
command: error instanceof Error ? error.message : String(error),
|
|
395
|
-
durationMs: 0,
|
|
396
|
-
status: 'failed',
|
|
397
|
-
}).command.slice(0, 4_096),
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
finally {
|
|
401
|
-
await stopHeartbeatSafely(heartbeat);
|
|
402
|
-
scope?.dispose();
|
|
403
|
-
await closeFreshnessLeaseSafely(payload?.freshnessLease);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
// eslint-disable-next-line max-lines-per-function -- receipt resume must keep its fresh lease and fail-closed cleanup together
|
|
407
|
-
async resumeReceiptPublication(identity, payload, checkpoint, fencingToken) {
|
|
408
|
-
const publicationDeadlineMs = getRuntimePolicy().validation.receiptPublicationDeadlineMs;
|
|
409
|
-
const deadlineAt = Date.now() + publicationDeadlineMs;
|
|
410
|
-
const scope = createExecutionScope({ requestId: identity.operationId, deadlineAt });
|
|
411
|
-
const deadlineTimer = setTimeout(() => {
|
|
412
|
-
scope.cancel(new ReceiptPublicationTimeoutError());
|
|
413
|
-
}, publicationDeadlineMs);
|
|
414
|
-
deadlineTimer.unref();
|
|
415
|
-
let heartbeat;
|
|
416
|
-
let ownedLease;
|
|
417
|
-
try {
|
|
418
|
-
heartbeat = await this.startHeartbeat(identity, fencingToken, (reason) => {
|
|
419
|
-
scope.cancel(reason);
|
|
420
|
-
});
|
|
421
|
-
const receiptBindings = checkpoint.receiptInput.bindings;
|
|
422
|
-
const resolved = await revalidateValidationWorktree({
|
|
423
|
-
projectPath: payload.input.projectPath ?? '',
|
|
424
|
-
specPath: payload.specPath,
|
|
425
|
-
specId: payload.input.specId,
|
|
426
|
-
validationRootId: payload.validationRootId,
|
|
427
|
-
});
|
|
428
|
-
const lease = await beginValidationFreshnessBarrier({
|
|
429
|
-
projectId: identity.projectId,
|
|
430
|
-
specId: payload.input.specId,
|
|
431
|
-
projectPath: resolved.projectPath,
|
|
432
|
-
handoffPath: join(projectDataDir(identity.projectId), 'handoffs', payload.input.specId),
|
|
433
|
-
invalidateCurrentBindings: false,
|
|
434
|
-
});
|
|
435
|
-
ownedLease = lease;
|
|
436
|
-
const observed = await computeDurableValidationBindings({
|
|
437
|
-
canonicalProjectId: identity.projectId,
|
|
438
|
-
specId: payload.input.specId,
|
|
439
|
-
projectPath: resolved.projectPath,
|
|
440
|
-
specPath: resolved.specPath,
|
|
441
|
-
});
|
|
442
|
-
const observedBindings = toValidationReceiptBindings(observed.bindings, observed.artifactDigests);
|
|
443
|
-
if (canonicalJson(observedBindings) !== canonicalJson(receiptBindings) ||
|
|
444
|
-
!(await bindValidationFreshnessLease(lease, observedBindings))) {
|
|
445
|
-
throw new Error('[Planu] Durable validation bindings became stale; submit a new validation');
|
|
446
|
-
}
|
|
447
|
-
const hydratedPayload = {
|
|
448
|
-
...payload,
|
|
449
|
-
input: { ...payload.input, projectPath: resolved.projectPath },
|
|
450
|
-
specPath: resolved.specPath,
|
|
451
|
-
bindings: observed.bindings,
|
|
452
|
-
artifactDigests: observed.artifactDigests,
|
|
453
|
-
freshnessLease: lease,
|
|
454
|
-
};
|
|
455
|
-
const result = await scope.run(() => {
|
|
456
|
-
this.currentFence(identity, fencingToken);
|
|
457
|
-
return this.issueReceipt(identity, hydratedPayload, checkpoint, lease, fencingToken, scope.context.signal);
|
|
458
|
-
});
|
|
459
|
-
this.currentFence(identity, fencingToken);
|
|
460
|
-
return this.runtime.complete({
|
|
461
|
-
...identity,
|
|
462
|
-
workerId: this.workerId,
|
|
463
|
-
fencingToken,
|
|
464
|
-
result,
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
catch (error) {
|
|
468
|
-
reportClassifiedDegradation('VALIDATE_JOB_EXECUTION_FAILURE', error);
|
|
469
|
-
const disposition = this.failureDisposition(identity, fencingToken, error);
|
|
470
|
-
if (disposition.settleLocally) {
|
|
471
|
-
if (disposition.current) {
|
|
472
|
-
return disposition.current;
|
|
473
|
-
}
|
|
474
|
-
throw error;
|
|
475
|
-
}
|
|
476
|
-
const current = disposition.current;
|
|
477
|
-
if (current.state === 'cancelled') {
|
|
478
|
-
return current;
|
|
479
|
-
}
|
|
480
|
-
const receiptFailureCause = classifyReceiptPublicationFailure(error);
|
|
481
|
-
if (receiptFailureCause) {
|
|
482
|
-
return this.runtime.fail({
|
|
483
|
-
...identity,
|
|
484
|
-
workerId: this.workerId,
|
|
485
|
-
fencingToken,
|
|
486
|
-
error: RECEIPT_PUBLICATION_FAILURE_MESSAGES[receiptFailureCause],
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
this.recordFencedProgress(identity, fencingToken, {
|
|
490
|
-
phase: 'receipt-publication',
|
|
491
|
-
command: '[Planu] Receipt publication failed closed',
|
|
492
|
-
durationMs: 0,
|
|
493
|
-
status: 'failed',
|
|
494
|
-
});
|
|
495
|
-
return this.runtime.fail({
|
|
496
|
-
...identity,
|
|
497
|
-
workerId: this.workerId,
|
|
498
|
-
fencingToken,
|
|
499
|
-
error: '[Planu] Receipt publication failed closed',
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
finally {
|
|
503
|
-
clearTimeout(deadlineTimer);
|
|
504
|
-
await stopHeartbeatSafely(heartbeat);
|
|
505
|
-
scope.dispose();
|
|
506
|
-
await closeFreshnessLeaseSafely(ownedLease);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
startHeartbeat(identity, fencingToken, cancel) {
|
|
510
|
-
const timing = this.workerTimingPolicy();
|
|
511
|
-
const policy = getRuntimePolicy().validation;
|
|
512
|
-
const factory = this.options.heartbeatFactory ?? createDurableJobHeartbeat;
|
|
513
|
-
return factory({
|
|
514
|
-
...identity,
|
|
515
|
-
workerId: this.workerId,
|
|
516
|
-
fencingToken,
|
|
517
|
-
databasePath: this.runtime.runtimeDatabasePath(),
|
|
518
|
-
leaseMs: timing.workerLeaseMs,
|
|
519
|
-
heartbeatMs: timing.workerHeartbeatMs,
|
|
520
|
-
databaseBusyTimeoutMs: policy.heartbeatDatabaseBusyTimeoutMs,
|
|
521
|
-
startupTimeoutMs: policy.heartbeatStartupTimeoutMs,
|
|
522
|
-
shutdownTimeoutMs: policy.heartbeatShutdownTimeoutMs,
|
|
523
|
-
onAuthorityLost: (reason) => {
|
|
524
|
-
reportClassifiedDegradation('VALIDATE_JOB_HEARTBEAT_FAILURE', reason);
|
|
525
|
-
cancel(new ValidationAuthorityLostError('infrastructure', { cause: reason }));
|
|
526
|
-
},
|
|
527
|
-
}).catch((error) => {
|
|
528
|
-
const authorityError = new ValidationAuthorityLostError('infrastructure', { cause: error });
|
|
529
|
-
reportClassifiedDegradation('VALIDATE_JOB_HEARTBEAT_FAILURE', error);
|
|
530
|
-
cancel(authorityError);
|
|
531
|
-
throw authorityError;
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
persistProgress(identity, fencingToken, progress) {
|
|
535
|
-
const current = this.observeForSettlement(identity);
|
|
536
|
-
if (current.state !== 'running') {
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
const previous = current.checkpoint;
|
|
540
|
-
if (previous &&
|
|
541
|
-
(progress.completedGates < (previous.completedGates ?? 0) ||
|
|
542
|
-
(typeof previous.lastProgressAt === 'string' &&
|
|
543
|
-
progress.lastProgressAt < previous.lastProgressAt) ||
|
|
544
|
-
(progress.completedGates === previous.completedGates &&
|
|
545
|
-
progress.phase === previous.phase &&
|
|
546
|
-
progress.status === previous.status))) {
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
this.recordFencedProgress(identity, fencingToken, redactValidationProgress(progress));
|
|
550
|
-
}
|
|
551
|
-
async publishInitialReceipt(identity, payload, result, durationMs, fencingToken, signal) {
|
|
552
|
-
this.currentFence(identity, fencingToken);
|
|
553
|
-
if (!hasReceiptInputs(payload)) {
|
|
554
|
-
throw new Error('[Planu] Passing durable validation is missing receipt bindings');
|
|
555
|
-
}
|
|
556
|
-
const receiptBindings = toValidationReceiptBindings(payload.bindings, payload.artifactDigests);
|
|
557
|
-
const checkpoint = this.buildReceiptPendingCheckpoint(payload, receiptBindings, result, durationMs);
|
|
558
|
-
this.recordFencedProgress(identity, fencingToken, checkpoint);
|
|
559
|
-
const publicationDeadlineMs = getRuntimePolicy().validation.receiptPublicationDeadlineMs;
|
|
560
|
-
const publicationScope = createExecutionScope({
|
|
561
|
-
requestId: identity.operationId,
|
|
562
|
-
deadlineAt: Date.now() + publicationDeadlineMs,
|
|
563
|
-
upstreamSignal: signal,
|
|
564
|
-
});
|
|
565
|
-
const deadlineTimer = setTimeout(() => {
|
|
566
|
-
publicationScope.cancel(new ReceiptPublicationTimeoutError());
|
|
567
|
-
}, publicationDeadlineMs);
|
|
568
|
-
deadlineTimer.unref();
|
|
569
|
-
try {
|
|
570
|
-
return await publicationScope.run(async () => {
|
|
571
|
-
const publicationLease = await this.preparePublicationLease(payload, receiptBindings);
|
|
572
|
-
this.currentFence(identity, fencingToken);
|
|
573
|
-
return this.issueReceipt(identity, payload, checkpoint, publicationLease, fencingToken, publicationScope.context.signal);
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
finally {
|
|
577
|
-
clearTimeout(deadlineTimer);
|
|
578
|
-
publicationScope.dispose();
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
workerTimingPolicy() {
|
|
582
|
-
const production = getRuntimePolicy().validation;
|
|
583
|
-
const injected = this.options.workerTimingPolicy;
|
|
584
|
-
if (!injected) {
|
|
585
|
-
return production;
|
|
586
|
-
}
|
|
587
|
-
const { workerLeaseMs, workerHeartbeatMs } = injected;
|
|
588
|
-
if (!Number.isSafeInteger(workerLeaseMs) ||
|
|
589
|
-
workerLeaseMs <= 0 ||
|
|
590
|
-
!Number.isSafeInteger(workerHeartbeatMs) ||
|
|
591
|
-
workerHeartbeatMs <= 0 ||
|
|
592
|
-
workerHeartbeatMs >= workerLeaseMs ||
|
|
593
|
-
BigInt(workerHeartbeatMs) * BigInt(production.workerLeaseMs) !==
|
|
594
|
-
BigInt(workerLeaseMs) * BigInt(production.workerHeartbeatMs) ||
|
|
595
|
-
production.heartbeatDatabaseBusyTimeoutMs >= workerLeaseMs - workerHeartbeatMs) {
|
|
596
|
-
throw new Error('[Planu] Invalid validation worker timing policy');
|
|
597
|
-
}
|
|
598
|
-
return injected;
|
|
599
|
-
}
|
|
600
|
-
requireCurrentFence(current, fencingToken) {
|
|
601
|
-
if (!this.hasCurrentFence(current, fencingToken)) {
|
|
602
|
-
throw new ValidationAuthorityLostError('reclaimed');
|
|
603
|
-
}
|
|
604
|
-
if (!current.leaseExpiresAt || Date.parse(current.leaseExpiresAt) <= Date.now()) {
|
|
605
|
-
throw new ValidationAuthorityLostError('expired');
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
hasCurrentFence(current, fencingToken) {
|
|
609
|
-
return (current.state === 'running' &&
|
|
610
|
-
current.leaseOwner === this.workerId &&
|
|
611
|
-
current.fencingToken === fencingToken &&
|
|
612
|
-
!current.cancelRequested);
|
|
613
|
-
}
|
|
614
|
-
currentFence(identity, fencingToken) {
|
|
615
|
-
const current = this.observeForSettlement(identity);
|
|
616
|
-
this.requireCurrentFence(current, fencingToken);
|
|
617
|
-
return current;
|
|
618
|
-
}
|
|
619
|
-
observeForSettlement(identity) {
|
|
620
|
-
try {
|
|
621
|
-
return this.runtime.get(identity);
|
|
622
|
-
}
|
|
623
|
-
catch (error) {
|
|
624
|
-
reportClassifiedDegradation('VALIDATE_JOB_STATE_READ_FAILURE', error);
|
|
625
|
-
throw new ValidationAuthorityLostError('infrastructure', { cause: error });
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
recordFencedProgress(identity, fencingToken, checkpoint) {
|
|
629
|
-
try {
|
|
630
|
-
this.runtime.recordProgress({
|
|
631
|
-
...identity,
|
|
632
|
-
workerId: this.workerId,
|
|
633
|
-
fencingToken,
|
|
634
|
-
leaseMs: this.workerTimingPolicy().workerLeaseMs,
|
|
635
|
-
checkpoint,
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
catch (error) {
|
|
639
|
-
reportClassifiedDegradation('VALIDATE_JOB_PROGRESS_FAILURE', error);
|
|
640
|
-
throw new ValidationAuthorityLostError('infrastructure', { cause: error });
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
failureDisposition(identity, fencingToken, error) {
|
|
644
|
-
let current;
|
|
645
|
-
try {
|
|
646
|
-
current = this.runtime.get(identity);
|
|
647
|
-
}
|
|
648
|
-
catch (readError) {
|
|
649
|
-
reportClassifiedDegradation('VALIDATE_JOB_STATE_READ_FAILURE', readError);
|
|
650
|
-
return { settleLocally: true };
|
|
651
|
-
}
|
|
652
|
-
if (current.state === 'cancelled' || current.cancelRequested) {
|
|
653
|
-
return { settleLocally: true, current };
|
|
654
|
-
}
|
|
655
|
-
if (!this.hasCurrentFence(current, fencingToken) ||
|
|
656
|
-
!current.leaseExpiresAt ||
|
|
657
|
-
Date.parse(current.leaseExpiresAt) <= Date.now()) {
|
|
658
|
-
return { settleLocally: true, current };
|
|
659
|
-
}
|
|
660
|
-
return error instanceof ValidationAuthorityLostError
|
|
661
|
-
? { settleLocally: true, current }
|
|
662
|
-
: { settleLocally: false, current };
|
|
663
|
-
}
|
|
664
|
-
buildReceiptPendingCheckpoint(payload, receiptBindings, result, durationMs) {
|
|
665
|
-
const { logMaxBytes, resultMaxBytes } = this.receiptCheckpointLimits();
|
|
666
|
-
if (!Number.isSafeInteger(logMaxBytes) ||
|
|
667
|
-
logMaxBytes <= 0 ||
|
|
668
|
-
!Number.isSafeInteger(resultMaxBytes) ||
|
|
669
|
-
resultMaxBytes <= 0 ||
|
|
670
|
-
logMaxBytes > resultMaxBytes) {
|
|
671
|
-
throw new Error('[Planu] Invalid receipt checkpoint policy');
|
|
672
|
-
}
|
|
673
|
-
const redactedResult = redactSensitiveValue(result);
|
|
674
|
-
if (!redactedResult ||
|
|
675
|
-
typeof redactedResult !== 'object' ||
|
|
676
|
-
Buffer.byteLength(canonicalJson(redactedResult), 'utf8') > resultMaxBytes) {
|
|
677
|
-
throw new Error('[Planu] VALIDATION_CHECKPOINT_TOO_LARGE');
|
|
678
|
-
}
|
|
679
|
-
const receiptInput = {
|
|
680
|
-
bindings: receiptBindings,
|
|
681
|
-
command: {
|
|
682
|
-
executable: 'planu',
|
|
683
|
-
args: ['validate', payload.bindings.specId],
|
|
684
|
-
cwd: '<project>',
|
|
685
|
-
},
|
|
686
|
-
versions: { node: process.version, receiptSchema: '1' },
|
|
687
|
-
exitCode: 0,
|
|
688
|
-
durationMs,
|
|
689
|
-
log: truncateUtf8ByBytes(redactText(result.content.map((item) => item.text).join('\n')), logMaxBytes),
|
|
690
|
-
gates: [{ gate: 'validation', status: 'passed', durationMs }],
|
|
691
|
-
issuedAt: new Date().toISOString(),
|
|
692
|
-
};
|
|
693
|
-
const checkpoint = {
|
|
694
|
-
kind: 'validation-receipt-pending',
|
|
695
|
-
schemaVersion: 1,
|
|
696
|
-
errorCode: 'VALIDATION_RECEIPT_PENDING',
|
|
697
|
-
recoveryAction: 'restart_job',
|
|
698
|
-
result: redactedResult,
|
|
699
|
-
receiptInput,
|
|
700
|
-
};
|
|
701
|
-
const parsed = parseValidationReceiptPendingCheckpoint(checkpoint, this.receiptCheckpointLimits());
|
|
702
|
-
if (!parsed) {
|
|
703
|
-
throw new Error('[Planu] Validation receipt checkpoint is not persistable');
|
|
704
|
-
}
|
|
705
|
-
return parsed;
|
|
706
|
-
}
|
|
707
|
-
receiptCheckpointLimits() {
|
|
708
|
-
const policy = getRuntimePolicy().validation;
|
|
709
|
-
return {
|
|
710
|
-
logMaxBytes: this.options.receiptCheckpointPolicy?.logMaxBytes ?? policy.receiptCheckpointLogMaxBytes,
|
|
711
|
-
resultMaxBytes: this.options.receiptCheckpointPolicy?.resultMaxBytes ??
|
|
712
|
-
policy.receiptCheckpointResultMaxBytes,
|
|
713
|
-
};
|
|
714
|
-
}
|
|
715
|
-
// eslint-disable-next-line max-lines-per-function -- publication window and the double freshness assert share one auditable receipt-issuance boundary
|
|
716
|
-
async issueReceipt(identity, payload, checkpoint, publicationLease, fencingToken, signal) {
|
|
717
|
-
const receiptBindings = checkpoint.receiptInput.bindings;
|
|
718
|
-
const endPublicationWindow = beginValidationFreshnessPublicationWindow(publicationLease);
|
|
719
|
-
try {
|
|
720
|
-
if (executionAborted(signal)) {
|
|
721
|
-
signal.throwIfAborted();
|
|
722
|
-
}
|
|
723
|
-
const barrierBeforePublication = await evaluateValidationFreshnessBarrier(publicationLease, receiptBindings);
|
|
724
|
-
if (!barrierBeforePublication.fresh) {
|
|
725
|
-
throw new Error(freshnessBarrierErrorMessage('before', barrierBeforePublication));
|
|
726
|
-
}
|
|
727
|
-
const database = new RuntimeDatabase({ path: resolveStorageLayout().runtimeDatabase });
|
|
728
|
-
try {
|
|
729
|
-
const signingKeyReference = await ensureValidationIssuerKey({
|
|
730
|
-
projectId: identity.projectId,
|
|
731
|
-
issuerId: LOCAL_VALIDATION_RECEIPT_ISSUER,
|
|
732
|
-
});
|
|
733
|
-
signal.throwIfAborted();
|
|
734
|
-
const { store } = createValidationReceiptAuthority({
|
|
735
|
-
database,
|
|
736
|
-
workspaceId: identity.workspaceId,
|
|
737
|
-
projectId: identity.projectId,
|
|
738
|
-
issuerId: LOCAL_VALIDATION_RECEIPT_ISSUER,
|
|
739
|
-
authorizePersistence: (persistenceDatabase) => {
|
|
740
|
-
persistenceDatabase.assertActiveJobLease({
|
|
741
|
-
id: identity.operationId,
|
|
742
|
-
projectId: identity.projectId,
|
|
743
|
-
workspaceId: identity.workspaceId,
|
|
744
|
-
workerId: this.workerId,
|
|
745
|
-
fencingToken,
|
|
746
|
-
leaseMs: this.workerTimingPolicy().workerLeaseMs,
|
|
747
|
-
now: new Date().toISOString(),
|
|
748
|
-
});
|
|
749
|
-
},
|
|
750
|
-
});
|
|
751
|
-
const receipt = await issueValidationReceipt(checkpoint.receiptInput, {
|
|
752
|
-
issuerId: LOCAL_VALIDATION_RECEIPT_ISSUER,
|
|
753
|
-
signingKeyReference,
|
|
754
|
-
store,
|
|
755
|
-
});
|
|
756
|
-
if (executionAborted(signal)) {
|
|
757
|
-
signal.throwIfAborted();
|
|
758
|
-
}
|
|
759
|
-
const barrierDuringPublication = await evaluateValidationFreshnessBarrier(publicationLease, receiptBindings);
|
|
760
|
-
if (!barrierDuringPublication.fresh) {
|
|
761
|
-
await store.invalidateCurrentBindings(identity.projectId, payload.bindings.specId);
|
|
762
|
-
throw new Error(freshnessBarrierErrorMessage('during', barrierDuringPublication));
|
|
763
|
-
}
|
|
764
|
-
const receiptKey = `validation-receipt:${receipt.receiptId.slice('sha256:'.length)}`;
|
|
765
|
-
let enrichedReportSha;
|
|
766
|
-
try {
|
|
767
|
-
enrichedReportSha = await this.persistReceiptArtifacts(identity, payload, receipt.receiptId, receiptKey);
|
|
768
|
-
}
|
|
769
|
-
catch (error) {
|
|
770
|
-
throw new ReceiptPublicationInterruptedError({ cause: error });
|
|
771
|
-
}
|
|
772
|
-
return buildReceiptResult(checkpoint.result, receipt.receiptId, receiptKey, enrichedReportSha);
|
|
773
|
-
}
|
|
774
|
-
finally {
|
|
775
|
-
database.close();
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
finally {
|
|
779
|
-
endPublicationWindow();
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
async preparePublicationLease(payload, expectedBindings) {
|
|
783
|
-
let lease = payload.freshnessLease;
|
|
784
|
-
if (!lease) {
|
|
785
|
-
throw new Error('[Planu] Passing durable validation is missing freshness lease');
|
|
786
|
-
}
|
|
787
|
-
if (!payload.bindings || !payload.input.projectPath || !payload.specPath) {
|
|
788
|
-
return lease;
|
|
789
|
-
}
|
|
790
|
-
const bindings = payload.bindings;
|
|
791
|
-
const resolved = await revalidateValidationWorktree({
|
|
792
|
-
projectPath: payload.input.projectPath,
|
|
793
|
-
specPath: payload.specPath,
|
|
794
|
-
specId: payload.input.specId,
|
|
795
|
-
validationRootId: payload.validationRootId,
|
|
796
|
-
});
|
|
797
|
-
const projectPath = resolved.projectPath;
|
|
798
|
-
const specPath = resolved.specPath;
|
|
799
|
-
const rebaselined = await rebaselineValidationFreshnessLeaseAfterRecompute({
|
|
800
|
-
lease,
|
|
801
|
-
expectedBindings,
|
|
802
|
-
recompute: async () => {
|
|
803
|
-
const observed = await computeDurableValidationBindings({
|
|
804
|
-
canonicalProjectId: bindings.projectId,
|
|
805
|
-
specId: bindings.specId,
|
|
806
|
-
projectPath,
|
|
807
|
-
specPath,
|
|
808
|
-
});
|
|
809
|
-
return toValidationReceiptBindings(observed.bindings, observed.artifactDigests);
|
|
810
|
-
},
|
|
811
|
-
});
|
|
812
|
-
if ('rejection' in rebaselined) {
|
|
813
|
-
throw new Error(rebaselineRejectionErrorMessage(rebaselined.rejection));
|
|
814
|
-
}
|
|
815
|
-
lease = rebaselined.lease;
|
|
816
|
-
return lease;
|
|
817
|
-
}
|
|
818
|
-
async persistReceiptArtifacts(identity, payload, receiptId, receiptKey) {
|
|
819
|
-
await writeValidationArtifactProvenance({
|
|
820
|
-
canonicalProjectId: identity.projectId,
|
|
821
|
-
specId: payload.bindings.specId,
|
|
822
|
-
receiptId,
|
|
823
|
-
issuerId: LOCAL_VALIDATION_RECEIPT_ISSUER,
|
|
824
|
-
artifactDigests: payload.artifactDigests,
|
|
825
|
-
});
|
|
826
|
-
const existingReport = await readArtifact({
|
|
827
|
-
projectId: identity.projectId,
|
|
828
|
-
specId: payload.bindings.specId,
|
|
829
|
-
kind: 'validation-report',
|
|
830
|
-
});
|
|
831
|
-
if (existingReport.ok) {
|
|
832
|
-
const rewritten = await appendArtifact({
|
|
833
|
-
projectId: identity.projectId,
|
|
834
|
-
specId: payload.bindings.specId,
|
|
835
|
-
kind: 'validation-report',
|
|
836
|
-
payload: { ...existingReport.payload, receiptId, receiptKey },
|
|
837
|
-
});
|
|
838
|
-
return `sha256:${rewritten.sha}`;
|
|
839
|
-
}
|
|
840
|
-
return undefined;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
export function isValidateScopeActive(projectId, workspaceId = WORKSPACE_ID) {
|
|
844
|
-
return activeScopes.has(`${projectId}:${workspaceId}`);
|
|
845
|
-
}
|
|
846
|
-
/** Schedules background execution after the submit response can be flushed. */
|
|
847
|
-
export function scheduleValidateJobExecution(projectId, workspaceId = WORKSPACE_ID) {
|
|
848
|
-
const scope = `${projectId}:${workspaceId}`;
|
|
849
|
-
const active = activeScopes.get(scope);
|
|
850
|
-
if (active) {
|
|
851
|
-
active.rescheduleRequested = true;
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
|
-
const state = { rescheduleRequested: false };
|
|
855
|
-
activeScopes.set(scope, state);
|
|
856
|
-
setImmediate(() => {
|
|
857
|
-
const runtime = new DurableJobRuntime();
|
|
858
|
-
const executor = new ValidateJobExecutor(runtime);
|
|
859
|
-
void (async () => {
|
|
860
|
-
try {
|
|
861
|
-
do {
|
|
862
|
-
state.rescheduleRequested = false;
|
|
863
|
-
await executor.runUntilIdle(projectId, workspaceId);
|
|
864
|
-
} while (rescheduleRequested(state));
|
|
865
|
-
}
|
|
866
|
-
finally {
|
|
867
|
-
runtime.close();
|
|
868
|
-
activeScopes.delete(scope);
|
|
869
|
-
}
|
|
870
|
-
})().catch((error) => {
|
|
871
|
-
reportClassifiedDegradation('VALIDATE_JOB_SCHEDULER_FAILURE', error);
|
|
872
|
-
});
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
function rescheduleRequested(state) {
|
|
876
|
-
return state.rescheduleRequested;
|
|
877
|
-
}
|
|
878
|
-
async function runValidateScopeUntilIdle(projectId, workspaceId) {
|
|
879
|
-
const runtime = new DurableJobRuntime();
|
|
880
|
-
try {
|
|
881
|
-
await new ValidateJobExecutor(runtime).runUntilIdle(projectId, workspaceId);
|
|
882
|
-
}
|
|
883
|
-
finally {
|
|
884
|
-
runtime.close();
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
/** Re-enqueues accepted/checkpointed validate work discovered after a process restart. */
|
|
888
|
-
export async function recoverValidateJobsAtStartup(options = {}) {
|
|
889
|
-
const pending = [];
|
|
890
|
-
const runRecoveredScope = (projectId, workspaceId) => {
|
|
891
|
-
if (options.schedule) {
|
|
892
|
-
options.schedule(projectId, workspaceId);
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
pending.push(runValidateScopeUntilIdle(projectId, workspaceId));
|
|
896
|
-
};
|
|
897
|
-
recoverValidateJobs(runRecoveredScope, options);
|
|
898
|
-
await Promise.all(pending);
|
|
899
|
-
}
|
|
900
|
-
//# sourceMappingURL=validate-job-executor.js.map
|