@planu/cli 6.0.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -112
- package/dist/sdd-engine/contracts.d.ts +76 -0
- package/dist/sdd-engine/contracts.js +60 -0
- package/dist/sdd-engine/index.d.ts +5 -0
- package/dist/sdd-engine/index.js +5 -0
- package/dist/sdd-engine/patch-sandbox.d.ts +14 -0
- package/dist/sdd-engine/patch-sandbox.js +173 -0
- package/dist/sdd-engine/server.d.ts +5 -0
- package/dist/sdd-engine/server.js +30 -0
- package/dist/sdd-engine/task-window.d.ts +9 -0
- package/dist/sdd-engine/task-window.js +153 -0
- package/dist/sdd-engine/tools/execution-tools.d.ts +5 -0
- package/dist/sdd-engine/tools/execution-tools.js +138 -0
- package/dist/sdd-engine/tools/format-result.d.ts +4 -0
- package/dist/sdd-engine/tools/format-result.js +22 -0
- package/dist/sdd-engine/tools/workspace-tools.d.ts +3 -0
- package/dist/sdd-engine/tools/workspace-tools.js +193 -0
- package/dist/sdd-engine/tools.d.ts +3 -0
- package/dist/sdd-engine/tools.js +13 -0
- package/dist/types/sdd-engine.d.ts +91 -0
- package/dist/types/sdd-engine.js +2 -0
- package/package.json +60 -48
- 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 -106
- package/dist/engine/reconcile/propagate-mirrors.d.ts +0 -3
- package/dist/engine/reconcile/propagate-mirrors.js +0 -311
- 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 -39
- package/dist/engine/safety/atomic-write-file.js +0 -195
- 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 -490
- 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/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 -825
- 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 -271
- 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 -502
- 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 -1038
- 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,864 +0,0 @@
|
|
|
1
|
-
// engine/handoff-packager.ts — Assembles handoff context package for AI agents (SPEC-039)
|
|
2
|
-
/* eslint-disable max-lines -- package assembly and the SPEC-1240 atomic-publish/version-fence path stay co-located for auditability */
|
|
3
|
-
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
-
import { access, mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
5
|
-
import { isAbsolute, join, resolve as resolvePath } from 'node:path';
|
|
6
|
-
import { stripFrontmatter } from './frontmatter-parser.js';
|
|
7
|
-
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
8
|
-
import { hashProjectPath, projectDataDir } from '../storage/base-store.js';
|
|
9
|
-
import { extractAcceptanceCriteriaTexts } from './spec-format/acceptance-criteria.js';
|
|
10
|
-
import { extractListItems, findMarkdownSectionRange } from './spec-format/markdown-sections.js';
|
|
11
|
-
// ── Parsing helpers ──────────────────────────────────────────────────────────
|
|
12
|
-
function extractObjective(huContent, spec) {
|
|
13
|
-
if (!huContent) {
|
|
14
|
-
return spec.title;
|
|
15
|
-
}
|
|
16
|
-
// Look for "quiero" pattern (Spanish HU format)
|
|
17
|
-
const quieroMatch = /quiero[^,.\n]+/i.exec(huContent);
|
|
18
|
-
if (quieroMatch?.[0]) {
|
|
19
|
-
return quieroMatch[0].trim().replace(/^quiero\s+/i, '');
|
|
20
|
-
}
|
|
21
|
-
// Fallback: first non-empty line after "Historia de Usuario" heading
|
|
22
|
-
const lines = huContent.split('\n');
|
|
23
|
-
const huIdx = lines.findIndex((l) => /historia de usuario/i.test(l));
|
|
24
|
-
if (huIdx !== -1) {
|
|
25
|
-
for (let i = huIdx + 1; i < lines.length && i < huIdx + 10; i++) {
|
|
26
|
-
/* v8 ignore next 1 */
|
|
27
|
-
const line = lines[i]?.trim() ?? '';
|
|
28
|
-
if (line.length > 20 && !line.startsWith('#') && !line.startsWith('|')) {
|
|
29
|
-
return line.replace(/\*\*/g, '').slice(0, 200);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return spec.title;
|
|
34
|
-
}
|
|
35
|
-
function extractFilesFromFicha(fichaContent) {
|
|
36
|
-
if (!fichaContent) {
|
|
37
|
-
return { toModify: [], toCreate: [] };
|
|
38
|
-
}
|
|
39
|
-
const toModify = [];
|
|
40
|
-
const toCreate = [];
|
|
41
|
-
const lines = fichaContent.split('\n');
|
|
42
|
-
let inFilesSection = false;
|
|
43
|
-
for (const line of lines) {
|
|
44
|
-
const trimmed = line.trim();
|
|
45
|
-
if (/archivos?\s*(clave|key|impactados?|modificar|crear)/i.test(trimmed)) {
|
|
46
|
-
inFilesSection = true;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (inFilesSection && trimmed.startsWith('##')) {
|
|
50
|
-
inFilesSection = false;
|
|
51
|
-
}
|
|
52
|
-
if (!inFilesSection) {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
// Parse table rows: | path/to/file.ts | role |
|
|
56
|
-
const tableMatch = /\|\s*(`?)([./\w-]+\.[a-z]+)\1\s*\|(.+)\|/.exec(trimmed);
|
|
57
|
-
if (!tableMatch) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
/* v8 ignore next 2 */
|
|
61
|
-
const filePath = tableMatch[2] ?? '';
|
|
62
|
-
const role = (tableMatch[3] ?? '').toLowerCase();
|
|
63
|
-
/* v8 ignore start */
|
|
64
|
-
if (!filePath) {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
/* v8 ignore stop */
|
|
68
|
-
if (role.includes('nuevo') || role.includes('new') || role.includes('crear')) {
|
|
69
|
-
toCreate.push(filePath);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
toModify.push(filePath);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return { toModify, toCreate };
|
|
76
|
-
}
|
|
77
|
-
function sectionContentAtLevel(content, heading, level) {
|
|
78
|
-
let offset = 0;
|
|
79
|
-
while (offset < content.length) {
|
|
80
|
-
const range = findMarkdownSectionRange(content.slice(offset), heading);
|
|
81
|
-
if (range === null) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
if (range.level === level) {
|
|
85
|
-
return content.slice(offset + range.contentStart, offset + range.end);
|
|
86
|
-
}
|
|
87
|
-
const nextOffset = offset + range.end;
|
|
88
|
-
if (nextOffset <= offset) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
offset = nextOffset;
|
|
92
|
-
}
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
function ownershipItems(content) {
|
|
96
|
-
const visibleLines = [];
|
|
97
|
-
const fenced = [];
|
|
98
|
-
let fence = null;
|
|
99
|
-
for (const line of content.split('\n')) {
|
|
100
|
-
const marker = /^[ \t]{0,3}(`{3,}|~{3,})/.exec(line)?.[1];
|
|
101
|
-
if (marker) {
|
|
102
|
-
const type = marker[0];
|
|
103
|
-
if (fence === null) {
|
|
104
|
-
fence = { marker: type, length: marker.length };
|
|
105
|
-
}
|
|
106
|
-
else if (fence.marker === type && marker.length >= fence.length) {
|
|
107
|
-
fence = null;
|
|
108
|
-
}
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
if (fence !== null) {
|
|
112
|
-
const trimmed = line.trim();
|
|
113
|
-
if (trimmed.length > 0) {
|
|
114
|
-
fenced.push(extractListItems(line)[0] ?? trimmed);
|
|
115
|
-
}
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
visibleLines.push(line);
|
|
119
|
-
}
|
|
120
|
-
return { items: extractListItems(visibleLines.join('\n')), fenced };
|
|
121
|
-
}
|
|
122
|
-
const OWNERSHIP_DESCRIPTION_SEPARATOR = /\s+(?:—|–|-)\s+/u;
|
|
123
|
-
/** Normalize one repository-relative ownership path without retaining unsafe input in diagnostics. */
|
|
124
|
-
function normalizeOwnedPath(value) {
|
|
125
|
-
const trimmed = value.trim();
|
|
126
|
-
if (/^none\.?$/i.test(trimmed)) {
|
|
127
|
-
return { status: 'none' };
|
|
128
|
-
}
|
|
129
|
-
const backticked = /^`([^`]+)`/.exec(trimmed)?.[1];
|
|
130
|
-
const candidate = (backticked ??
|
|
131
|
-
trimmed.split(new RegExp(`${OWNERSHIP_DESCRIPTION_SEPARATOR.source}|\\s+\\(`, 'u'), 1)[0] ??
|
|
132
|
-
'').trim();
|
|
133
|
-
if (candidate.length === 0) {
|
|
134
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_EMPTY' };
|
|
135
|
-
}
|
|
136
|
-
if (candidate.startsWith('```') || candidate.startsWith('~~~')) {
|
|
137
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_FENCED' };
|
|
138
|
-
}
|
|
139
|
-
if (candidate.includes('\0')) {
|
|
140
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_NUL' };
|
|
141
|
-
}
|
|
142
|
-
if (/^[\\/]{2}/.test(candidate)) {
|
|
143
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_UNC' };
|
|
144
|
-
}
|
|
145
|
-
const normalizedSeparators = candidate.replaceAll('\\', '/');
|
|
146
|
-
if (normalizedSeparators.startsWith('/')) {
|
|
147
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_ABSOLUTE' };
|
|
148
|
-
}
|
|
149
|
-
if (normalizedSeparators.startsWith('~/')) {
|
|
150
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_HOME_RELATIVE' };
|
|
151
|
-
}
|
|
152
|
-
if (/^[A-Za-z]:\//.test(normalizedSeparators)) {
|
|
153
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_DRIVE_ABSOLUTE' };
|
|
154
|
-
}
|
|
155
|
-
if (/^[A-Za-z][A-Za-z\d+.-]*:/.test(normalizedSeparators)) {
|
|
156
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_URI' };
|
|
157
|
-
}
|
|
158
|
-
if (normalizedSeparators.split('/').includes('..')) {
|
|
159
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_TRAVERSAL' };
|
|
160
|
-
}
|
|
161
|
-
const path = normalizedSeparators.replace(/\/+/g, '/').replace(/^(?:\.\/)+/, '');
|
|
162
|
-
return path.length > 0
|
|
163
|
-
? { status: 'valid', path }
|
|
164
|
-
: { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_EMPTY' };
|
|
165
|
-
}
|
|
166
|
-
/** Normalize a raw traceability changed-file value without interpreting Markdown or prose. */
|
|
167
|
-
export function normalizeChangedFilePath(value) {
|
|
168
|
-
const trimmed = value.trim();
|
|
169
|
-
if (trimmed.includes('`') ||
|
|
170
|
-
/^(?:#{1,6}|[-*+]|\d+[.)]|>)\s/u.test(trimmed) ||
|
|
171
|
-
/^\[[ xX]\]\s/u.test(trimmed)) {
|
|
172
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_MARKDOWN' };
|
|
173
|
-
}
|
|
174
|
-
if (/\s/u.test(trimmed)) {
|
|
175
|
-
return { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_DESCRIPTION' };
|
|
176
|
-
}
|
|
177
|
-
return normalizeOwnedPath(trimmed);
|
|
178
|
-
}
|
|
179
|
-
export function extractCanonicalFileOwnership(content) {
|
|
180
|
-
const filesSection = sectionContentAtLevel(content, 'Files', 2);
|
|
181
|
-
if (filesSection === null) {
|
|
182
|
-
return {
|
|
183
|
-
present: false,
|
|
184
|
-
toModify: [],
|
|
185
|
-
toCreate: [],
|
|
186
|
-
toTest: [],
|
|
187
|
-
toTestDeclared: [],
|
|
188
|
-
blockers: [],
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
const blockers = [];
|
|
192
|
-
const addBlocker = (blocker) => {
|
|
193
|
-
if (!blockers.includes(blocker)) {
|
|
194
|
-
blockers.push(blocker);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
const parseSection = (heading) => {
|
|
198
|
-
const subsection = sectionContentAtLevel(filesSection, heading, 3);
|
|
199
|
-
if (subsection === null) {
|
|
200
|
-
return [];
|
|
201
|
-
}
|
|
202
|
-
const { items, fenced } = ownershipItems(subsection);
|
|
203
|
-
for (const _value of fenced) {
|
|
204
|
-
addBlocker('INVALID_FILE_OWNERSHIP_FENCED');
|
|
205
|
-
}
|
|
206
|
-
const paths = [];
|
|
207
|
-
for (const value of items) {
|
|
208
|
-
const normalized = normalizeOwnedPath(value);
|
|
209
|
-
if (normalized.status === 'invalid') {
|
|
210
|
-
addBlocker(normalized.code);
|
|
211
|
-
}
|
|
212
|
-
else if (normalized.status === 'valid' && !paths.includes(normalized.path)) {
|
|
213
|
-
paths.push(normalized.path);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return paths;
|
|
217
|
-
};
|
|
218
|
-
const toCreate = parseSection('Create');
|
|
219
|
-
const toModify = parseSection('Modify');
|
|
220
|
-
const toTest = parseSection('Test');
|
|
221
|
-
const conflicts = toCreate.filter((path) => toModify.includes(path));
|
|
222
|
-
for (const path of conflicts) {
|
|
223
|
-
addBlocker(`CONFLICTING_FILE_OWNERSHIP: ${path}`);
|
|
224
|
-
}
|
|
225
|
-
return {
|
|
226
|
-
present: true,
|
|
227
|
-
toCreate: toCreate.filter((path) => !conflicts.includes(path)),
|
|
228
|
-
toModify: toModify.filter((path) => !conflicts.includes(path)),
|
|
229
|
-
toTest: toTest.filter((path) => !conflicts.includes(path)),
|
|
230
|
-
toTestDeclared: toTest,
|
|
231
|
-
blockers,
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
const SAFE_OWNERSHIP_ANNOTATION = /^[\p{L}\p{N} .,_:-]+$/u;
|
|
235
|
-
function isSafeOwnershipResidual(value) {
|
|
236
|
-
let remaining = value.trim();
|
|
237
|
-
while (remaining.length > 0) {
|
|
238
|
-
remaining = remaining.trimStart();
|
|
239
|
-
if (remaining.length === 0) {
|
|
240
|
-
return true;
|
|
241
|
-
}
|
|
242
|
-
const connector = /^(?:and|or)\b/iu.exec(remaining)?.[0];
|
|
243
|
-
if (connector) {
|
|
244
|
-
remaining = remaining.slice(connector.length);
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
if (',;&.'.includes(remaining[0] ?? '')) {
|
|
248
|
-
remaining = remaining.slice(1);
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
if (remaining.startsWith('(')) {
|
|
252
|
-
const end = remaining.indexOf(')');
|
|
253
|
-
if (end < 2 || !SAFE_OWNERSHIP_ANNOTATION.test(remaining.slice(1, end))) {
|
|
254
|
-
return false;
|
|
255
|
-
}
|
|
256
|
-
remaining = remaining.slice(end + 1);
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
if (remaining.startsWith('—') || remaining.startsWith('-')) {
|
|
260
|
-
const description = remaining.slice(1).trim();
|
|
261
|
-
return description.length > 0 && SAFE_OWNERSHIP_ANNOTATION.test(description);
|
|
262
|
-
}
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
return true;
|
|
266
|
-
}
|
|
267
|
-
const OWNERSHIP_LINE_SHAPE_HINT = 'Use exactly one backticked full path: - Create|Modify: `exact/canonical/path` (pending) — plain description. No path in prose, no extra backticked tokens.';
|
|
268
|
-
const OWNERSHIP_DUPLICATE_HINT = 'Path is declared twice under the same section; list it once.';
|
|
269
|
-
const OWNERSHIP_CONFLICT_HINT = 'Path is declared under both ### Create and ### Modify; keep it in only one.';
|
|
270
|
-
function ownershipMissingSectionHint(classification) {
|
|
271
|
-
return `Add a ### ${classification} subsection under ## Files with a - \`path\` bullet, or - None. if there are none.`;
|
|
272
|
-
}
|
|
273
|
-
function ownershipMalformedSectionHint(classification) {
|
|
274
|
-
return `The ### ${classification} subsection has no list items; add a - \`path\` bullet or - None.`;
|
|
275
|
-
}
|
|
276
|
-
function ownershipNoneConflictHint(classification) {
|
|
277
|
-
return `The ### ${classification} subsection mixes - None. with real paths; use one or the other.`;
|
|
278
|
-
}
|
|
279
|
-
function ownershipAgreementHint(canonicalClass, workPlanClass, path) {
|
|
280
|
-
if (canonicalClass === 'Absent') {
|
|
281
|
-
return `Declared as ${workPlanClass} in ### File-Level Work Plan with no matching entry in ## Files; add "- ${workPlanClass}: \`${path}\`" under ### ${workPlanClass} in ## Files, or remove the work-plan line.`;
|
|
282
|
-
}
|
|
283
|
-
if (workPlanClass === 'Absent') {
|
|
284
|
-
return `Declared under ### ${canonicalClass} in ## Files; add the line "- ${canonicalClass}: \`${path}\` (pending) — <description>" to ### File-Level Work Plan.`;
|
|
285
|
-
}
|
|
286
|
-
return `Declared under ### ${canonicalClass} in ## Files but as ${workPlanClass} in ### File-Level Work Plan; align the verb in one of the two sections.`;
|
|
287
|
-
}
|
|
288
|
-
function ownershipBlocker(path, classifications, hint) {
|
|
289
|
-
const base = `handoff_ownership_invalid path=${path} classifications=${classifications.join(',')}`;
|
|
290
|
-
return hint ? `${base} hint=${JSON.stringify(hint)}` : base;
|
|
291
|
-
}
|
|
292
|
-
function stripInertOwnershipMarkup(content) {
|
|
293
|
-
let fence = null;
|
|
294
|
-
let script = false;
|
|
295
|
-
return content
|
|
296
|
-
.split('\n')
|
|
297
|
-
.map((line) => {
|
|
298
|
-
const trimmed = line.trim();
|
|
299
|
-
const marker = /^[ \t]{0,3}(`{3,}|~{3,})/u.exec(line)?.[1];
|
|
300
|
-
if (marker) {
|
|
301
|
-
const type = marker[0];
|
|
302
|
-
if (fence === null) {
|
|
303
|
-
fence = { marker: type, length: marker.length };
|
|
304
|
-
}
|
|
305
|
-
else if (fence.marker === type && marker.length >= fence.length) {
|
|
306
|
-
fence = null;
|
|
307
|
-
}
|
|
308
|
-
return '';
|
|
309
|
-
}
|
|
310
|
-
if (fence !== null) {
|
|
311
|
-
return '';
|
|
312
|
-
}
|
|
313
|
-
if (/<script\b/iu.test(trimmed)) {
|
|
314
|
-
script = !/<\/script>/iu.test(trimmed);
|
|
315
|
-
return '';
|
|
316
|
-
}
|
|
317
|
-
if (script) {
|
|
318
|
-
if (/<\/script>/iu.test(trimmed)) {
|
|
319
|
-
script = false;
|
|
320
|
-
}
|
|
321
|
-
return '';
|
|
322
|
-
}
|
|
323
|
-
return /<\/?[A-Za-z][^>]*>/u.test(trimmed) ? '' : line;
|
|
324
|
-
})
|
|
325
|
-
.join('\n');
|
|
326
|
-
}
|
|
327
|
-
function normalizeStrictOwnedPath(rawValue) {
|
|
328
|
-
const normalized = normalizeOwnedPath(rawValue);
|
|
329
|
-
if (normalized.status !== 'valid') {
|
|
330
|
-
return normalized;
|
|
331
|
-
}
|
|
332
|
-
return /^[A-Za-z0-9._/()[\]@-]+$/u.test(normalized.path)
|
|
333
|
-
? normalized
|
|
334
|
-
: { status: 'invalid', code: 'INVALID_FILE_OWNERSHIP_CHARSET' };
|
|
335
|
-
}
|
|
336
|
-
function ownershipHeadEnd(rawPath) {
|
|
337
|
-
const masked = rawPath.replaceAll(/`[^`\n]+`/gu, (match) => 'x'.repeat(match.length));
|
|
338
|
-
return OWNERSHIP_DESCRIPTION_SEPARATOR.exec(masked)?.index ?? rawPath.length;
|
|
339
|
-
}
|
|
340
|
-
const ownershipReasonCode = (result) => result.status === 'invalid' ? result.code : 'INVALID_FILE_OWNERSHIP_EMPTY';
|
|
341
|
-
function ownershipInvalidTokenBlocker(token, classification, reasonCode) {
|
|
342
|
-
const printed = JSON.stringify(token.length > 120 ? token.slice(0, 120) : token);
|
|
343
|
-
const hint = `${OWNERSHIP_LINE_SHAPE_HINT} reason=${reasonCode}`;
|
|
344
|
-
return ownershipBlocker(printed, [classification, 'InvalidPath'], hint);
|
|
345
|
-
}
|
|
346
|
-
function collectStrictOwnershipEntry(rawValue, classification, state) {
|
|
347
|
-
const rawPath = rawValue.trim();
|
|
348
|
-
const head = rawPath.slice(0, ownershipHeadEnd(rawPath));
|
|
349
|
-
const backtickMatches = [...head.matchAll(/`([^`\n]+)`/gu)].map((match) => match[1] ?? '');
|
|
350
|
-
const pathCandidates = backtickMatches.filter((token) => /[./]/u.test(token));
|
|
351
|
-
const pushInvalid = (token, code) => {
|
|
352
|
-
state.blockers.push(ownershipInvalidTokenBlocker(token, classification, code));
|
|
353
|
-
};
|
|
354
|
-
if (!/`[^`\n]+`/u.test(rawPath)) {
|
|
355
|
-
const direct = normalizeStrictOwnedPath(head);
|
|
356
|
-
if (direct.status !== 'valid') {
|
|
357
|
-
pushInvalid(head, ownershipReasonCode(direct));
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
collectStrictOwnershipPath(direct.path, classification, state);
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
if (backtickMatches.length === 0) {
|
|
364
|
-
pushInvalid(head, 'INVALID_FILE_OWNERSHIP_HEAD_RESIDUAL');
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
const residual = head.replaceAll(/`[^`\n]+`/gu, '').trim();
|
|
368
|
-
if (!isSafeOwnershipResidual(residual)) {
|
|
369
|
-
pushInvalid(residual, 'INVALID_FILE_OWNERSHIP_HEAD_RESIDUAL');
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
const normalizedCandidates = pathCandidates.map((token) => ({
|
|
373
|
-
token,
|
|
374
|
-
result: normalizeStrictOwnedPath(token),
|
|
375
|
-
}));
|
|
376
|
-
const failed = normalizedCandidates.filter(({ result }) => result.status !== 'valid');
|
|
377
|
-
if (failed.length > 0) {
|
|
378
|
-
for (const { token, result } of failed) {
|
|
379
|
-
pushInvalid(token, ownershipReasonCode(result));
|
|
380
|
-
}
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
for (const { result } of normalizedCandidates) {
|
|
384
|
-
if (result.status === 'valid') {
|
|
385
|
-
collectStrictOwnershipPath(result.path, classification, state);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
function collectStrictOwnershipPath(path, classification, state) {
|
|
390
|
-
const own = classification === 'Create' ? state.create : state.modify;
|
|
391
|
-
const other = classification === 'Create' ? state.modify : state.create;
|
|
392
|
-
if (own.has(path)) {
|
|
393
|
-
state.blockers.push(ownershipBlocker(path, [classification, classification], OWNERSHIP_DUPLICATE_HINT));
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
if (other.has(path)) {
|
|
397
|
-
state.blockers.push(ownershipBlocker(path, ['Create', 'Modify'], OWNERSHIP_CONFLICT_HINT));
|
|
398
|
-
own.delete(path);
|
|
399
|
-
other.delete(path);
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
own.add(path);
|
|
403
|
-
}
|
|
404
|
-
function extractStrictCanonicalOwnership(content) {
|
|
405
|
-
const filesSection = sectionContentAtLevel(content, 'Files', 2);
|
|
406
|
-
if (filesSection === null) {
|
|
407
|
-
return { present: false, toModify: [], toCreate: [], blockers: [] };
|
|
408
|
-
}
|
|
409
|
-
const state = { create: new Set(), modify: new Set(), blockers: [] };
|
|
410
|
-
const parseSection = (classification) => {
|
|
411
|
-
const subsection = sectionContentAtLevel(filesSection, classification, 3);
|
|
412
|
-
if (subsection === null) {
|
|
413
|
-
state.blockers.push(ownershipBlocker('<missing>', [classification, 'MissingSection'], ownershipMissingSectionHint(classification)));
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
const items = subsection
|
|
417
|
-
.split('\n')
|
|
418
|
-
.map((line) => /^\s*[-*]\s+(.+)$/u.exec(line)?.[1]?.trim())
|
|
419
|
-
.filter((item) => Boolean(item));
|
|
420
|
-
if (items.length === 0) {
|
|
421
|
-
state.blockers.push(ownershipBlocker('<empty>', [classification, 'Malformed'], ownershipMalformedSectionHint(classification)));
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
let explicitNone = false;
|
|
425
|
-
for (const item of items) {
|
|
426
|
-
if (/^none\.?$/iu.test(item.trim())) {
|
|
427
|
-
if (explicitNone) {
|
|
428
|
-
state.blockers.push(ownershipBlocker('<none>', [classification, classification], ownershipNoneConflictHint(classification)));
|
|
429
|
-
}
|
|
430
|
-
explicitNone = true;
|
|
431
|
-
continue;
|
|
432
|
-
}
|
|
433
|
-
collectStrictOwnershipEntry(item, classification, state);
|
|
434
|
-
}
|
|
435
|
-
const own = classification === 'Create' ? state.create : state.modify;
|
|
436
|
-
if (explicitNone && own.size > 0) {
|
|
437
|
-
state.blockers.push(ownershipBlocker('<none>', [classification, classification], ownershipNoneConflictHint(classification)));
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
parseSection('Create');
|
|
441
|
-
parseSection('Modify');
|
|
442
|
-
return {
|
|
443
|
-
present: true,
|
|
444
|
-
toCreate: [...state.create].sort(),
|
|
445
|
-
toModify: [...state.modify].sort(),
|
|
446
|
-
blockers: [...new Set(state.blockers)].sort(),
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
function extractFileLevelWorkPlanOwnership(content) {
|
|
450
|
-
const state = { create: new Set(), modify: new Set(), blockers: [] };
|
|
451
|
-
const section = sectionContentAtLevel(content, 'File-Level Work Plan', 3);
|
|
452
|
-
if (section === null) {
|
|
453
|
-
return { present: false, toModify: [], toCreate: [], blockers: [] };
|
|
454
|
-
}
|
|
455
|
-
for (const item of extractListItems(section)) {
|
|
456
|
-
const match = /^(Create|Modify)\s*:\s*(.+?)(?:\s+\([^)]*\))?\s*$/iu.exec(item);
|
|
457
|
-
if (!match?.[1] || !match[2]) {
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
const classification = match[1].toLowerCase() === 'create' ? 'Create' : 'Modify';
|
|
461
|
-
collectStrictOwnershipEntry(match[2], classification, state);
|
|
462
|
-
}
|
|
463
|
-
return {
|
|
464
|
-
present: state.create.size + state.modify.size + state.blockers.length > 0,
|
|
465
|
-
toCreate: [...state.create].sort(),
|
|
466
|
-
toModify: [...state.modify].sort(),
|
|
467
|
-
blockers: [...new Set(state.blockers)].sort(),
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
function validateOwnershipAgreement(canonical, workPlan, testDeclaredPaths) {
|
|
471
|
-
if (!canonical.present) {
|
|
472
|
-
return [];
|
|
473
|
-
}
|
|
474
|
-
const testDeclared = new Set(testDeclaredPaths);
|
|
475
|
-
const classification = (ownership, path) => ownership.toCreate.includes(path)
|
|
476
|
-
? 'Create'
|
|
477
|
-
: ownership.toModify.includes(path)
|
|
478
|
-
? 'Modify'
|
|
479
|
-
: 'Absent';
|
|
480
|
-
if (!workPlan.present) {
|
|
481
|
-
const canonicalPaths = [...canonical.toCreate, ...canonical.toModify].filter((path) => !testDeclared.has(path));
|
|
482
|
-
return [...new Set(canonicalPaths)].sort().map((path) => {
|
|
483
|
-
const canonicalClass = classification(canonical, path);
|
|
484
|
-
return ownershipBlocker(path, [`Canonical:${canonicalClass}`, 'WorkPlan:Absent'], ownershipAgreementHint(canonicalClass, 'Absent', path));
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
const paths = new Set([
|
|
488
|
-
...canonical.toCreate,
|
|
489
|
-
...canonical.toModify,
|
|
490
|
-
...workPlan.toCreate,
|
|
491
|
-
...workPlan.toModify,
|
|
492
|
-
].filter((path) => !testDeclared.has(path)));
|
|
493
|
-
return [...paths].sort().flatMap((path) => {
|
|
494
|
-
const canonicalClass = classification(canonical, path);
|
|
495
|
-
const workPlanClass = classification(workPlan, path);
|
|
496
|
-
return canonicalClass === workPlanClass
|
|
497
|
-
? []
|
|
498
|
-
: [
|
|
499
|
-
ownershipBlocker(path, [`Canonical:${canonicalClass}`, `WorkPlan:${workPlanClass}`], ownershipAgreementHint(canonicalClass, workPlanClass, path)),
|
|
500
|
-
];
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
function ownershipValidationBlockers(canonicalFiles, canonicalOwnership, workPlanOwnership) {
|
|
504
|
-
return [
|
|
505
|
-
...canonicalFiles.blockers,
|
|
506
|
-
...canonicalOwnership.blockers,
|
|
507
|
-
...workPlanOwnership.blockers,
|
|
508
|
-
...validateOwnershipAgreement(canonicalOwnership, workPlanOwnership, canonicalFiles.toTestDeclared),
|
|
509
|
-
];
|
|
510
|
-
}
|
|
511
|
-
/** Return the exact ownership blockers enforced by package_handoff for one spec document. */
|
|
512
|
-
export function validateHandoffOwnership(content) {
|
|
513
|
-
const ownershipContent = stripInertOwnershipMarkup(content);
|
|
514
|
-
return ownershipValidationBlockers(extractCanonicalFileOwnership(content), extractStrictCanonicalOwnership(ownershipContent), extractFileLevelWorkPlanOwnership(ownershipContent));
|
|
515
|
-
}
|
|
516
|
-
function extractBacktickedFiles(content) {
|
|
517
|
-
const files = new Set();
|
|
518
|
-
for (const match of content.matchAll(/`([^`\n]+)`/gu)) {
|
|
519
|
-
const normalized = match[1] ? normalizeStrictOwnedPath(match[1]) : null;
|
|
520
|
-
if (normalized?.status === 'valid') {
|
|
521
|
-
files.add(normalized.path);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
return [...files].sort();
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* SPEC-1406 (DEFECT 6): markdown heading lines (e.g. "### Edge Cases And Failure Modes")
|
|
528
|
-
* match keyword regexes like /\bedge\b/ just as readily as real bullet content, so headings
|
|
529
|
-
* used to leak into testPlan/risks/ownership as if they were grounded items. Skip headings
|
|
530
|
-
* and dedupe before truncating, so a criterion repeated under multiple sections — or the same
|
|
531
|
-
* heading matching two keyword sets — is not counted as distinct evidence twice.
|
|
532
|
-
*/
|
|
533
|
-
function extractLinesByKeywords(content, keywords) {
|
|
534
|
-
const lines = content
|
|
535
|
-
.split('\n')
|
|
536
|
-
.map((line) => line.trim().replace(/^[-*]\s*/, ''))
|
|
537
|
-
.filter((line) => line.length > 0 && !/^#{1,6}\s/.test(line) && keywords.test(line));
|
|
538
|
-
return [...new Set(lines)].slice(0, 12);
|
|
539
|
-
}
|
|
540
|
-
const LIST_ITEM_PATTERN = /^(?:[-*]|\d+\.)\s+(?:\[[ x]\]\s+)?(.+)$/;
|
|
541
|
-
function sectionBullets(content, headingRegex) {
|
|
542
|
-
const lines = content.split('\n');
|
|
543
|
-
const bullets = [];
|
|
544
|
-
let inSection = false;
|
|
545
|
-
for (const line of lines) {
|
|
546
|
-
const trimmed = line.trim();
|
|
547
|
-
if (headingRegex.test(trimmed)) {
|
|
548
|
-
inSection = true;
|
|
549
|
-
continue;
|
|
550
|
-
}
|
|
551
|
-
if (/^#{1,6}\s/.test(trimmed)) {
|
|
552
|
-
inSection = false;
|
|
553
|
-
continue;
|
|
554
|
-
}
|
|
555
|
-
if (!inSection) {
|
|
556
|
-
continue;
|
|
557
|
-
}
|
|
558
|
-
const match = LIST_ITEM_PATTERN.exec(trimmed);
|
|
559
|
-
if (match?.[1]) {
|
|
560
|
-
bullets.push(match[1].trim());
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
return bullets;
|
|
564
|
-
}
|
|
565
|
-
function dedupeMerge(primary, fallback) {
|
|
566
|
-
const seen = new Set();
|
|
567
|
-
const merged = [];
|
|
568
|
-
for (const item of [...primary, ...fallback]) {
|
|
569
|
-
if (!seen.has(item)) {
|
|
570
|
-
seen.add(item);
|
|
571
|
-
merged.push(item);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
return merged.slice(0, 12);
|
|
575
|
-
}
|
|
576
|
-
function extractOperationalSections(content, spec) {
|
|
577
|
-
return {
|
|
578
|
-
testPlan: dedupeMerge(sectionBullets(content, /^#{2,6}\s*test plan\b/i), extractLinesByKeywords(content, /\b(test|typecheck|lint|vitest|playwright|verification|validate|pnpm|npm)\b/i)),
|
|
579
|
-
risks: dedupeMerge(sectionBullets(content, /^#{2,6}\s*risks?\b/i), extractLinesByKeywords(content, /\b(risk|edge|failure|security|drift|migration|breaking|compatibility|rollback)\b/i)),
|
|
580
|
-
ownership: extractLinesByKeywords(content, /\b(owner|ownership|wave|agent|reviewer|arbiter|files?|responsible)\b/i),
|
|
581
|
-
currentState: `Spec ${spec.id} is ${spec.status}; implementation must follow the approved spec artifact, not chat history.`,
|
|
582
|
-
nextAction: lifecycleNextAction(spec.status),
|
|
583
|
-
};
|
|
584
|
-
}
|
|
585
|
-
function lifecycleNextAction(status) {
|
|
586
|
-
switch (status) {
|
|
587
|
-
case 'draft':
|
|
588
|
-
return 'Complete the specification, discovery, challenge, and readiness evidence before review.';
|
|
589
|
-
case 'review':
|
|
590
|
-
return 'Resolve reviewer feedback and obtain independent spec approval before implementation.';
|
|
591
|
-
case 'approved':
|
|
592
|
-
return 'Move to implementing with this handoff, then implement only the listed scope.';
|
|
593
|
-
case 'implementing':
|
|
594
|
-
return 'Finish the remaining criteria, persist traceability, obtain independent implementation review, and run validation.';
|
|
595
|
-
case 'done':
|
|
596
|
-
return 'No implementation remains; preserve the validated done contract.';
|
|
597
|
-
case 'discarded':
|
|
598
|
-
return 'Do not implement this discarded specification.';
|
|
599
|
-
default:
|
|
600
|
-
return `Unsupported lifecycle status "${status}"; repair the canonical status before implementation.`;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
function extractOutOfScope(huContent, spec) {
|
|
604
|
-
if (!huContent) {
|
|
605
|
-
return [
|
|
606
|
-
`Anything beyond the ${spec.target} layer`,
|
|
607
|
-
'Performance optimizations not specified in criteria',
|
|
608
|
-
];
|
|
609
|
-
}
|
|
610
|
-
const lines = huContent.split('\n');
|
|
611
|
-
const outOfScopeItems = [];
|
|
612
|
-
let inOosSection = false;
|
|
613
|
-
for (const line of lines) {
|
|
614
|
-
const trimmed = line.trim();
|
|
615
|
-
if (/out of scope|fuera del scope|no incluye/i.test(trimmed)) {
|
|
616
|
-
inOosSection = true;
|
|
617
|
-
continue;
|
|
618
|
-
}
|
|
619
|
-
if (inOosSection && trimmed.startsWith('##')) {
|
|
620
|
-
inOosSection = false;
|
|
621
|
-
}
|
|
622
|
-
if (inOosSection && /^[-*]/.test(trimmed)) {
|
|
623
|
-
const item = trimmed.replace(/^[-*]\s*/, '').trim();
|
|
624
|
-
if (item.length > 0) {
|
|
625
|
-
outOfScopeItems.push(item);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
if (outOfScopeItems.length === 0) {
|
|
630
|
-
return [
|
|
631
|
-
`Changes beyond the ${spec.target} target layer`,
|
|
632
|
-
'Refactors not explicitly requested in acceptance criteria',
|
|
633
|
-
'New dependencies not listed in spec.md ## Technical',
|
|
634
|
-
];
|
|
635
|
-
}
|
|
636
|
-
return outOfScopeItems;
|
|
637
|
-
}
|
|
638
|
-
function buildConstraints(knowledge) {
|
|
639
|
-
const constraints = [];
|
|
640
|
-
const conventions = knowledge.conventions;
|
|
641
|
-
const conventionEntries = Object.entries(conventions);
|
|
642
|
-
for (const [key, value] of conventionEntries.slice(0, 5)) {
|
|
643
|
-
constraints.push({
|
|
644
|
-
type: 'interface',
|
|
645
|
-
description: `Convention — ${key}: ${value}`,
|
|
646
|
-
affectedItems: [],
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
|
-
// Architecture constraints
|
|
650
|
-
constraints.push({
|
|
651
|
-
type: 'interface',
|
|
652
|
-
description: `Architecture pattern: ${knowledge.architecture.primary} — do not break layer boundaries`,
|
|
653
|
-
affectedItems: knowledge.layers,
|
|
654
|
-
});
|
|
655
|
-
return constraints;
|
|
656
|
-
}
|
|
657
|
-
async function readSpecFile(specPath, projectPath) {
|
|
658
|
-
if (isAbsolute(specPath)) {
|
|
659
|
-
return readFile(specPath, 'utf-8');
|
|
660
|
-
}
|
|
661
|
-
if (!projectPath) {
|
|
662
|
-
return '';
|
|
663
|
-
}
|
|
664
|
-
return readFile(resolvePath(projectPath, specPath), 'utf-8');
|
|
665
|
-
}
|
|
666
|
-
// ── Public API ───────────────────────────────────────────────────────────────
|
|
667
|
-
export async function packageHandoff(spec, knowledge, versionFence) {
|
|
668
|
-
const warnings = [];
|
|
669
|
-
let rawSpecContent = '';
|
|
670
|
-
try {
|
|
671
|
-
rawSpecContent = spec.specPath ? await readSpecFile(spec.specPath, knowledge.projectPath) : '';
|
|
672
|
-
}
|
|
673
|
-
catch (error) {
|
|
674
|
-
if (versionFence?.strictSpecRead === true) {
|
|
675
|
-
throw error;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
const huContent = rawSpecContent ? stripFrontmatter(rawSpecContent) : '';
|
|
679
|
-
const fichaContent = huContent;
|
|
680
|
-
if (!huContent) {
|
|
681
|
-
warnings.push('spec.md not found — using minimal package. Run create_spec to generate it.');
|
|
682
|
-
}
|
|
683
|
-
const objective = extractObjective(huContent, spec);
|
|
684
|
-
const criteria = extractAcceptanceCriteriaTexts(rawSpecContent);
|
|
685
|
-
const ownershipContent = stripInertOwnershipMarkup(rawSpecContent);
|
|
686
|
-
const canonicalFiles = extractCanonicalFileOwnership(rawSpecContent);
|
|
687
|
-
const canonicalOwnership = extractStrictCanonicalOwnership(ownershipContent);
|
|
688
|
-
const workPlanOwnership = extractFileLevelWorkPlanOwnership(ownershipContent);
|
|
689
|
-
const testOwnedPaths = new Set(canonicalFiles.toTestDeclared);
|
|
690
|
-
const explicitOwnership = canonicalOwnership.present
|
|
691
|
-
? {
|
|
692
|
-
...canonicalOwnership,
|
|
693
|
-
toCreate: canonicalOwnership.toCreate.filter((path) => !testOwnedPaths.has(path)),
|
|
694
|
-
toModify: canonicalOwnership.toModify.filter((path) => !testOwnedPaths.has(path)),
|
|
695
|
-
}
|
|
696
|
-
: workPlanOwnership.present
|
|
697
|
-
? workPlanOwnership
|
|
698
|
-
: null;
|
|
699
|
-
const legacyFiles = extractFilesFromFicha(ownershipContent);
|
|
700
|
-
const hasLegacyOwnership = legacyFiles.toModify.length + legacyFiles.toCreate.length > 0;
|
|
701
|
-
const toModify = explicitOwnership
|
|
702
|
-
? explicitOwnership.toModify
|
|
703
|
-
: hasLegacyOwnership
|
|
704
|
-
? legacyFiles.toModify
|
|
705
|
-
: extractBacktickedFiles(ownershipContent);
|
|
706
|
-
const toCreate = explicitOwnership
|
|
707
|
-
? explicitOwnership.toCreate
|
|
708
|
-
: hasLegacyOwnership
|
|
709
|
-
? legacyFiles.toCreate
|
|
710
|
-
: [];
|
|
711
|
-
if (!explicitOwnership && toModify.length + toCreate.length > 0) {
|
|
712
|
-
warnings.push('LEGACY_FILE_OWNERSHIP_FALLBACK');
|
|
713
|
-
}
|
|
714
|
-
const outOfScope = extractOutOfScope(huContent, spec);
|
|
715
|
-
const constraints = buildConstraints(knowledge);
|
|
716
|
-
const operational = extractOperationalSections(`${huContent}\n${fichaContent}`, spec);
|
|
717
|
-
if (criteria.length === 0) {
|
|
718
|
-
warnings.push('No acceptance criteria found with complete BDD structure — implementation handoff is blocked');
|
|
719
|
-
}
|
|
720
|
-
const blockers = [
|
|
721
|
-
...(criteria.length === 0 ? ['Missing BDD acceptance criteria'] : []),
|
|
722
|
-
...(toModify.length + toCreate.length + canonicalFiles.toTest.length === 0
|
|
723
|
-
? ['Missing file ownership / target files']
|
|
724
|
-
: []),
|
|
725
|
-
...(operational.testPlan.length === 0 ? ['Missing test plan'] : []),
|
|
726
|
-
...(operational.risks.length === 0 ? ['Missing risk analysis'] : []),
|
|
727
|
-
...(operational.ownership.length === 0 ? ['Missing ownership'] : []),
|
|
728
|
-
...ownershipValidationBlockers(canonicalFiles, canonicalOwnership, workPlanOwnership),
|
|
729
|
-
...(!['draft', 'review', 'approved', 'implementing', 'done', 'discarded'].includes(spec.status)
|
|
730
|
-
? [`UNSUPPORTED_LIFECYCLE_STATUS: ${spec.status}`]
|
|
731
|
-
: []),
|
|
732
|
-
];
|
|
733
|
-
const pkg = {
|
|
734
|
-
specId: spec.id,
|
|
735
|
-
generatedAt: new Date().toISOString(),
|
|
736
|
-
readinessScore: 0, // caller can populate with checkSpecReadiness result
|
|
737
|
-
objective,
|
|
738
|
-
criteria,
|
|
739
|
-
filesToModify: toModify,
|
|
740
|
-
filesToCreate: toCreate,
|
|
741
|
-
filesToTest: canonicalFiles.toTest,
|
|
742
|
-
ownership: operational.ownership,
|
|
743
|
-
testPlan: operational.testPlan,
|
|
744
|
-
risks: operational.risks,
|
|
745
|
-
outOfScope,
|
|
746
|
-
currentState: operational.currentState,
|
|
747
|
-
nextAction: operational.nextAction,
|
|
748
|
-
constraints,
|
|
749
|
-
warnings,
|
|
750
|
-
blocked: blockers.length > 0,
|
|
751
|
-
blockers,
|
|
752
|
-
};
|
|
753
|
-
return persistHandoffIfPossible(pkg, knowledge, versionFence);
|
|
754
|
-
}
|
|
755
|
-
function renderPersistedHandoff(pkg) {
|
|
756
|
-
return [
|
|
757
|
-
`# Implementation Handoff Package — ${pkg.specId}`,
|
|
758
|
-
'',
|
|
759
|
-
`Generated: ${pkg.generatedAt}`,
|
|
760
|
-
`Blocked: ${pkg.blocked ? 'yes' : 'no'}`,
|
|
761
|
-
'',
|
|
762
|
-
'## Objective',
|
|
763
|
-
pkg.objective,
|
|
764
|
-
'',
|
|
765
|
-
'## Acceptance Criteria (BDD)',
|
|
766
|
-
...pkg.criteria.map((criterion) => `- ${criterion}`),
|
|
767
|
-
'',
|
|
768
|
-
'## Files To Modify',
|
|
769
|
-
...pkg.filesToModify.map((filePath) => `- ${filePath}`),
|
|
770
|
-
'',
|
|
771
|
-
'## Files To Create',
|
|
772
|
-
...pkg.filesToCreate.map((filePath) => `- ${filePath}`),
|
|
773
|
-
'',
|
|
774
|
-
'## Test Files',
|
|
775
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- compat guard: callers may construct a HandoffPackage object predating this field
|
|
776
|
-
...(pkg.filesToTest ?? []).map((filePath) => `- ${filePath}`),
|
|
777
|
-
'',
|
|
778
|
-
'## Ownership',
|
|
779
|
-
...pkg.ownership.map((item) => `- ${item}`),
|
|
780
|
-
'',
|
|
781
|
-
'## Test Plan',
|
|
782
|
-
...pkg.testPlan.map((item) => `- ${item}`),
|
|
783
|
-
'',
|
|
784
|
-
'## Risks',
|
|
785
|
-
...pkg.risks.map((item) => `- ${item}`),
|
|
786
|
-
'',
|
|
787
|
-
'## Out Of Scope',
|
|
788
|
-
...pkg.outOfScope.map((item) => `- ${item}`),
|
|
789
|
-
'',
|
|
790
|
-
'## Current State',
|
|
791
|
-
pkg.currentState,
|
|
792
|
-
'',
|
|
793
|
-
'## Next Action',
|
|
794
|
-
pkg.nextAction,
|
|
795
|
-
'',
|
|
796
|
-
'## Blockers',
|
|
797
|
-
...(pkg.blockers.length > 0 ? pkg.blockers.map((item) => `- ${item}`) : ['- None']),
|
|
798
|
-
'',
|
|
799
|
-
].join('\n');
|
|
800
|
-
}
|
|
801
|
-
async function persistHandoffIfPossible(pkg, knowledge, versionFence) {
|
|
802
|
-
if (!knowledge.projectPath) {
|
|
803
|
-
return pkg;
|
|
804
|
-
}
|
|
805
|
-
const handoffDir = join(projectDataDir(hashProjectPath(knowledge.projectPath)), 'handoffs');
|
|
806
|
-
const handoffPath = join(handoffDir, `${pkg.specId}.md`);
|
|
807
|
-
const tempPath = join(handoffDir, `.${pkg.specId}.md.tmp-${randomUUID()}`);
|
|
808
|
-
const sessionContextPath = join(knowledge.projectPath, 'planu', 'session-context.md');
|
|
809
|
-
const markdown = renderPersistedHandoff(pkg);
|
|
810
|
-
const existingContext = await readFile(sessionContextPath, 'utf-8').catch(() => '');
|
|
811
|
-
const contextContent = existingContext.trim().length >= 80
|
|
812
|
-
? existingContext
|
|
813
|
-
: ['# Planu Session Context', '', markdown].join('\n');
|
|
814
|
-
const contextTempPath = join(knowledge.projectPath, 'planu', `.session-context.md.tmp-${randomUUID()}`);
|
|
815
|
-
try {
|
|
816
|
-
await mkdir(handoffDir, { recursive: true });
|
|
817
|
-
await mkdir(join(knowledge.projectPath, 'planu'), { recursive: true });
|
|
818
|
-
await writeFile(tempPath, markdown, 'utf-8');
|
|
819
|
-
if (contextContent !== existingContext) {
|
|
820
|
-
await writeFile(contextTempPath, contextContent, 'utf-8');
|
|
821
|
-
}
|
|
822
|
-
if (versionFence) {
|
|
823
|
-
const abandoned = versionFence.signal?.aborted === true;
|
|
824
|
-
const currentSpecVersion = abandoned ? undefined : await versionFence.getCurrentSpecVersion();
|
|
825
|
-
if (abandoned ||
|
|
826
|
-
(currentSpecVersion !== undefined &&
|
|
827
|
-
currentSpecVersion !== versionFence.specVersion &&
|
|
828
|
-
(await access(handoffPath).then(() => true, () => false)))) {
|
|
829
|
-
await rm(tempPath, { force: true });
|
|
830
|
-
await rm(contextTempPath, { force: true });
|
|
831
|
-
return { ...pkg, staleVersionSkipped: true };
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
await rename(tempPath, handoffPath);
|
|
835
|
-
if (contextContent !== existingContext) {
|
|
836
|
-
await rename(contextTempPath, sessionContextPath);
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
catch (error) {
|
|
840
|
-
await rm(tempPath, { force: true }).catch(() => {
|
|
841
|
-
/* best-effort temp cleanup — the publish already failed */
|
|
842
|
-
});
|
|
843
|
-
await rm(contextTempPath, { force: true }).catch(() => {
|
|
844
|
-
/* best-effort temp cleanup — the publish already failed */
|
|
845
|
-
});
|
|
846
|
-
if (versionFence) {
|
|
847
|
-
throw error;
|
|
848
|
-
}
|
|
849
|
-
return {
|
|
850
|
-
...pkg,
|
|
851
|
-
warnings: [
|
|
852
|
-
...pkg.warnings,
|
|
853
|
-
'Could not persist handoff artifact — context gate will block implementing.',
|
|
854
|
-
],
|
|
855
|
-
blocked: true,
|
|
856
|
-
blockers: [...pkg.blockers, 'Handoff artifact could not be persisted'],
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
const contextHash = createHash('sha256')
|
|
860
|
-
.update(`${contextContent}\n---HANDOFF---\n${markdown}`, 'utf8')
|
|
861
|
-
.digest('hex');
|
|
862
|
-
return { ...pkg, handoffPath, contextHash };
|
|
863
|
-
}
|
|
864
|
-
//# sourceMappingURL=handoff-packager.js.map
|