@planu/cli 4.14.1 → 5.1.1
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/CHANGELOG.md +82 -0
- package/LICENSE +55 -12
- package/README.md +10 -2
- package/dist/cli/commands/install.d.ts +1 -12
- package/dist/cli/commands/install.js +9 -65
- package/dist/cli/commands/job.js +4 -3
- package/dist/cli/commands/spec.js +12 -3
- package/dist/cli/commands/validate.js +2 -2
- package/dist/cli/router.js +1 -3
- package/dist/config/environment-schema.json +1 -3
- package/dist/config/official-sdd-tools.d.ts +4 -0
- package/dist/config/official-sdd-tools.js +35 -0
- package/dist/config/product-public.d.ts +139 -3
- package/dist/config/product-public.js +8 -1
- package/dist/config/product-public.json +7 -36
- package/dist/config/registries/hosts/codex.json +20 -363
- package/dist/config/release-policy.json +84 -2
- package/dist/config/runtime-policy.json +12 -1
- package/dist/config/skill-templates/planu-resume-work.md +2 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/core/spec-validator.d.ts +4 -4
- package/dist/core/spec-validator.js +33 -19
- package/dist/engine/abortable-process-runner.d.ts +20 -2
- package/dist/engine/abortable-process-runner.js +243 -74
- package/dist/engine/ambiguity-scorer.js +4 -26
- package/dist/engine/auth/scope-mapper.js +1 -7
- package/dist/engine/autopilot/state-updater.js +4 -4
- package/dist/engine/cascade-hooks/hooks/review-enricher.hook.js +9 -6
- package/dist/engine/cascade-hooks/state-drift-detector.d.ts +3 -3
- package/dist/engine/cascade-hooks/state-drift-detector.js +1 -1
- package/dist/engine/ci-generator/planu-config.js +1 -7
- package/dist/engine/clarification-gate/gate.d.ts +3 -3
- package/dist/engine/code-scanner/layer-scanner.js +6 -22
- package/dist/engine/core-bridge.d.ts +3 -3
- package/dist/engine/cost-guardrails.d.ts +1 -1
- package/dist/engine/cost-guardrails.js +1 -1
- package/dist/engine/criterion-identity.d.ts +1 -0
- package/dist/engine/criterion-identity.js +7 -0
- package/dist/engine/dashboard/data-loader.js +2 -7
- package/dist/engine/dashboard/templates-layout.js +0 -3
- package/dist/engine/dashboard/templates-project.js +1 -13
- package/dist/engine/docs-site-generator/data-collector.d.ts +1 -1
- package/dist/engine/docs-site-generator/data-collector.js +7 -28
- package/dist/engine/docs-site-generator/tools-renderer.js +3 -10
- package/dist/engine/evidence-gates/artifact-reader.d.ts +12 -1
- package/dist/engine/evidence-gates/artifact-reader.js +174 -4
- package/dist/engine/evidence-gates/evidence-autofill.d.ts +10 -0
- package/dist/engine/evidence-gates/evidence-autofill.js +148 -0
- package/dist/engine/evidence-gates/evidence-skeletons.d.ts +19 -0
- package/dist/engine/evidence-gates/evidence-skeletons.js +69 -0
- package/dist/engine/evidence-gates/lifecycle-gate.js +4 -3
- package/dist/engine/evidence-gates/reconciliation-freshness.d.ts +11 -0
- package/dist/engine/evidence-gates/reconciliation-freshness.js +72 -0
- package/dist/engine/evidence-index/done-drift.d.ts +1 -1
- package/dist/engine/evidence-index/done-drift.js +40 -18
- package/dist/engine/execution/context.js +3 -0
- package/dist/engine/execution/durable-job-heartbeat-runtime.d.ts +4 -0
- package/dist/engine/execution/durable-job-heartbeat-runtime.js +400 -0
- package/dist/engine/execution/job-runtime.d.ts +30 -0
- package/dist/engine/execution/job-runtime.js +114 -6
- package/dist/engine/execution/operation-journal.js +10 -4
- package/dist/engine/execution/public-job-sanitizer.d.ts +4 -0
- package/dist/engine/execution/public-job-sanitizer.js +31 -0
- package/dist/engine/execution/validate-job-executor.d.ts +12 -1
- package/dist/engine/execution/validate-job-executor.js +549 -86
- package/dist/engine/execution/validate-job-payload.js +107 -50
- package/dist/engine/execution/validate-job-recovery.js +1 -1
- package/dist/engine/execution/validate-worker-runtime.d.ts +5 -0
- package/dist/engine/execution/validate-worker-runtime.js +90 -2
- package/dist/engine/execution/validate-worker-thread.js +17 -24
- package/dist/engine/handoff-artifacts/schemas.d.ts +2 -1
- package/dist/engine/handoff-artifacts/schemas.js +33 -0
- package/dist/engine/handoff-packager.d.ts +19 -0
- package/dist/engine/handoff-packager.js +415 -13
- package/dist/engine/hooks/effort-configurator.js +1 -1
- package/dist/engine/impact-detector/test-break-predictor.js +3 -3
- package/dist/engine/impact-detector/tool-registration.js +1 -1
- package/dist/engine/implementation-contract/renderer.js +23 -8
- package/dist/engine/lifecycle-reconciliation-io.d.ts +11 -0
- package/dist/engine/lifecycle-reconciliation-io.js +180 -0
- package/dist/engine/lifecycle-reconciliation.d.ts +16 -0
- package/dist/engine/lifecycle-reconciliation.js +406 -0
- package/dist/engine/local-first/tool-classification.js +2 -0
- package/dist/engine/macos-keychain-native-port.d.ts +5 -0
- package/dist/engine/macos-keychain-native-port.js +19 -7
- package/dist/engine/migrations/remove-commercial-state.d.ts +3 -0
- package/dist/engine/migrations/remove-commercial-state.js +343 -0
- package/dist/engine/minimality/policy-loader.js +247 -6
- package/dist/engine/network-policy.js +1 -0
- package/dist/engine/planu-core.darwin-arm64.node.manifest.json +7 -7
- package/dist/engine/planu-core.darwin-arm64.node.sbom.json +20 -20
- package/dist/engine/planu-core.darwin-x64.node.manifest.json +7 -7
- package/dist/engine/planu-core.darwin-x64.node.sbom.json +20 -20
- package/dist/engine/planu-core.linux-arm64-gnu.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-arm64-gnu.node.sbom.json +20 -20
- package/dist/engine/planu-core.linux-arm64-musl.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-arm64-musl.node.sbom.json +20 -20
- package/dist/engine/planu-core.linux-x64-gnu.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-x64-gnu.node.sbom.json +20 -20
- package/dist/engine/planu-core.linux-x64-musl.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-x64-musl.node.sbom.json +20 -20
- package/dist/engine/planu-core.win32-arm64-msvc.node.manifest.json +7 -7
- package/dist/engine/planu-core.win32-arm64-msvc.node.sbom.json +20 -20
- package/dist/engine/planu-core.win32-x64-msvc.node.manifest.json +7 -7
- package/dist/engine/planu-core.win32-x64-msvc.node.sbom.json +20 -20
- package/dist/engine/readiness-checker.d.ts +1 -16
- package/dist/engine/readiness-checker.js +27 -88
- package/dist/engine/reverse-engineer/api-detector.js +2 -13
- package/dist/engine/reverse-engineer/complexity-analyzer.js +2 -13
- package/dist/engine/reverse-engineer/config-analyzer.js +2 -13
- package/dist/engine/reverse-engineer/dependency-graph.js +2 -13
- package/dist/engine/reverse-engineer/test-analyzer.js +2 -13
- package/dist/engine/reverse-engineer/walk-ignore.d.ts +3 -0
- package/dist/engine/reverse-engineer/walk-ignore.js +26 -0
- package/dist/engine/runtime-policy.d.ts +2 -0
- package/dist/engine/runtime-policy.js +42 -5
- package/dist/engine/runtime-security/rate-limiter.js +0 -1
- package/dist/engine/safety/contained-project-file.d.ts +3 -0
- package/dist/engine/safety/contained-project-file.js +23 -0
- package/dist/engine/scope-boundaries/contradiction-checker.js +63 -1
- package/dist/engine/scope-boundaries/scope-validator.js +45 -7
- package/dist/engine/session/checkpoint-writer.js +0 -9
- package/dist/engine/spec-format/acceptance-criteria.d.ts +6 -2
- package/dist/engine/spec-format/acceptance-criteria.js +82 -22
- package/dist/engine/spec-format/markdown-sections.d.ts +14 -0
- package/dist/engine/spec-format/markdown-sections.js +105 -0
- package/dist/engine/spec-format/read-technical-section.js +33 -5
- package/dist/engine/spec-format/technical-md-populator.js +3 -2
- package/dist/engine/spec-format/text-fences.js +20 -2
- package/dist/engine/spec-format/unified-spec-builder.d.ts +7 -0
- package/dist/engine/spec-format/unified-spec-builder.js +202 -0
- package/dist/engine/spec-migrator/canonical-deduplicator.d.ts +18 -0
- package/dist/engine/spec-migrator/canonical-deduplicator.js +479 -0
- package/dist/engine/spec-migrator/filesystem-import.d.ts +4 -8
- package/dist/engine/spec-migrator/filesystem-import.js +121 -14
- package/dist/engine/spec-migrator/frontmatter-parser.js +32 -15
- package/dist/engine/spec-migrator/index.d.ts +1 -0
- package/dist/engine/spec-migrator/index.js +1 -0
- package/dist/engine/spec-state-machine/transition-spec.d.ts +6 -1
- package/dist/engine/spec-state-machine/transition-spec.js +10 -1
- package/dist/engine/spec-state-syncer.js +1 -1
- package/dist/engine/technical-enricher/index.js +16 -8
- package/dist/engine/technical-enricher/render-enriched.d.ts +1 -0
- package/dist/engine/technical-enricher/render-enriched.js +42 -14
- package/dist/engine/telemetry/health-checker.js +53 -17
- package/dist/engine/telemetry/telemetry-client.js +26 -8
- package/dist/engine/text-signal-boundaries.d.ts +2 -0
- package/dist/engine/text-signal-boundaries.js +25 -2
- package/dist/engine/time/relative-date.d.ts +3 -0
- package/dist/engine/time/relative-date.js +16 -0
- package/dist/engine/timing/budget.d.ts +11 -0
- package/dist/engine/timing/budget.js +31 -9
- package/dist/engine/token-optimizer/analytics.d.ts +1 -1
- package/dist/engine/token-optimizer/analytics.js +5 -6
- package/dist/engine/usage-tracker/core.d.ts +2 -2
- package/dist/engine/usage-tracker/core.js +1 -2
- package/dist/engine/usage-tracker/index.d.ts +0 -3
- package/dist/engine/usage-tracker/index.js +0 -3
- package/dist/engine/usage-tracker/stats.d.ts +2 -2
- package/dist/engine/usage-tracker/stats.js +1 -28
- package/dist/engine/validation/durable-validation.d.ts +1 -1
- package/dist/engine/validation/durable-validation.js +3 -82
- package/dist/engine/validation/validation-freshness.d.ts +11 -1
- package/dist/engine/validation/validation-freshness.js +231 -91
- package/dist/engine/validation/validation-receipt.d.ts +9 -6
- package/dist/engine/validation/validation-receipt.js +84 -24
- package/dist/engine/validation/validation-source-digest.d.ts +2 -0
- package/dist/engine/validation/validation-source-digest.js +86 -0
- package/dist/engine/validation/validation-submission.d.ts +5 -4
- package/dist/engine/validation/validation-submission.js +25 -11
- package/dist/engine/validation/validation-worktree.d.ts +21 -0
- package/dist/engine/validation/validation-worktree.js +260 -0
- package/dist/engine/validation-impact-planner.d.ts +14 -2
- package/dist/engine/validation-impact-planner.js +0 -3
- package/dist/engine/validator/dor-dod.d.ts +1 -0
- package/dist/engine/validator/dor-dod.js +5 -3
- package/dist/engine/validator/extractors.d.ts +1 -5
- package/dist/engine/validator/extractors.js +24 -69
- package/dist/engine/validator/spec-compliance-runner.d.ts +12 -24
- package/dist/engine/validator/spec-compliance-runner.js +429 -211
- package/dist/engine/validator.js +35 -22
- package/dist/index.js +4 -16
- package/dist/resources/usage-stats-resource.js +2 -18
- package/dist/security/adapters/linux-secret-service.js +7 -3
- package/dist/security/adapters/windows-credential-manager.js +6 -4
- package/dist/server/routes/specs.js +13 -1
- package/dist/storage/base-store.d.ts +1 -1
- package/dist/storage/base-store.js +1 -1
- package/dist/storage/feedback-remote.d.ts +2 -3
- package/dist/storage/feedback-remote.js +45 -31
- package/dist/storage/global-store.d.ts +1 -17
- package/dist/storage/global-store.js +1 -42
- package/dist/storage/index.d.ts +0 -2
- package/dist/storage/index.js +0 -2
- package/dist/storage/migrations/canonical-storage.js +124 -11
- package/dist/storage/runtime-db.d.ts +9 -0
- package/dist/storage/runtime-db.js +64 -8
- package/dist/storage/spec-store.d.ts +14 -2
- package/dist/storage/spec-store.js +104 -14
- package/dist/storage/status-store/atomic-status-write.d.ts +5 -0
- package/dist/storage/status-store/atomic-status-write.js +57 -0
- package/dist/storage/status-store/file-lock.js +30 -11
- package/dist/storage/status-store/self-healing.js +3 -3
- package/dist/storage/status-store/version-sync.d.ts +2 -1
- package/dist/storage/status-store/version-sync.js +35 -40
- package/dist/storage/usage-store.d.ts +1 -5
- package/dist/storage/usage-store.js +0 -35
- package/dist/tools/auto-update-handler.d.ts +3 -3
- package/dist/tools/auto-update-handler.js +3 -3
- package/dist/tools/challenge-spec/resilience-challenge-scenarios.d.ts +2 -1
- package/dist/tools/challenge-spec/resilience-challenge-scenarios.js +10 -7
- package/dist/tools/challenge-spec/scenario-collector.js +1 -1
- package/dist/tools/challenge-spec/scenarios-data.js +1 -1
- package/dist/tools/challenge-spec/scenarios-utils.d.ts +1 -1
- package/dist/tools/challenge-spec/scenarios-utils.js +35 -11
- package/dist/tools/challenge-spec-helpers.d.ts +10 -1
- package/dist/tools/challenge-spec-helpers.js +63 -22
- package/dist/tools/challenge-spec.js +23 -8
- package/dist/tools/check-readiness.js +38 -14
- package/dist/tools/configure-telemetry.js +30 -2
- package/dist/tools/create-spec/spec-builder.d.ts +7 -0
- package/dist/tools/create-spec/spec-builder.js +19 -15
- package/dist/tools/create-spec.d.ts +1 -0
- package/dist/tools/create-spec.js +584 -309
- package/dist/tools/git/branch-ops.d.ts +1 -1
- package/dist/tools/git/branch-ops.js +3 -2
- package/dist/tools/init-project/handler.js +10 -12
- package/dist/tools/init-project/host-assets-writer.js +26 -1
- package/dist/tools/init-project/lint-scaffolder.d.ts +3 -3
- package/dist/tools/init-project/migration-runner.d.ts +2 -4
- package/dist/tools/init-project/migration-runner.js +3 -2
- package/dist/tools/init-project/portable-index-reconciler.d.ts +4 -0
- package/dist/tools/init-project/portable-index-reconciler.js +14 -0
- package/dist/tools/init-project/result-builder.js +1 -3
- package/dist/tools/jobs/handlers.js +38 -6
- package/dist/tools/list-specs.js +5 -26
- package/dist/tools/merge-risk-handler.js +2 -2
- package/dist/tools/package-handoff.js +2 -0
- package/dist/tools/reconcile-spec.js +0 -27
- package/dist/tools/register-agent-squad-tools.js +2 -2
- package/dist/tools/register-platform-tools/design-stack-tools.js +11 -11
- package/dist/tools/register-platform-tools/lifecycle-infra-tools.js +7 -7
- package/dist/tools/register-sdd-tools.d.ts +1 -1
- package/dist/tools/register-sdd-tools.js +2 -29
- package/dist/tools/register-spec-tools/analysis-tools.js +8 -8
- package/dist/tools/register-spec-tools/core-spec-tools.js +29 -19
- package/dist/tools/safe-handler.d.ts +5 -13
- package/dist/tools/safe-handler.js +7 -23
- package/dist/tools/schemas/index.d.ts +1 -1
- package/dist/tools/schemas/index.js +1 -1
- package/dist/tools/schemas/output-schemas.d.ts +0 -23
- package/dist/tools/schemas/output-schemas.js +0 -28
- package/dist/tools/schemas/spec.d.ts +4 -0
- package/dist/tools/schemas/spec.js +3 -0
- package/dist/tools/schemas/validate-output-schema.d.ts +11 -0
- package/dist/tools/schemas/validate-output-schema.js +7 -0
- package/dist/tools/spec-prompt-handler.js +3 -3
- package/dist/tools/sync-spec-state-handler.d.ts +1 -1
- package/dist/tools/sync-spec-state-handler.js +50 -2
- package/dist/tools/tool-entry.d.ts +4 -4
- package/dist/tools/tool-entry.js +3 -3
- package/dist/tools/tool-registry/core-tools.js +31 -15
- package/dist/tools/tool-registry/group-infra.js +27 -110
- package/dist/tools/tool-registry/group-quality-compliance.js +26 -26
- package/dist/tools/tool-registry/inventory.d.ts +2 -0
- package/dist/tools/tool-registry/inventory.js +2 -0
- package/dist/tools/tool-registry-helpers.d.ts +3 -3
- package/dist/tools/tool-registry-helpers.js +3 -3
- package/dist/tools/tool-usage-report/registered-tools.d.ts +1 -1
- package/dist/tools/tool-usage-report/registered-tools.js +3 -15
- package/dist/tools/update-status/approval-gates.js +3 -0
- package/dist/tools/update-status/batch.d.ts +6 -2
- package/dist/tools/update-status/batch.js +58 -1
- package/dist/tools/update-status/dod-gates.d.ts +16 -1
- package/dist/tools/update-status/dod-gates.js +191 -1
- package/dist/tools/update-status/done-receipt-verifier.d.ts +8 -0
- package/dist/tools/update-status/done-receipt-verifier.js +75 -27
- package/dist/tools/update-status/evidence-gate.d.ts +4 -0
- package/dist/tools/update-status/evidence-gate.js +103 -3
- package/dist/tools/update-status/file-sync.d.ts +4 -3
- package/dist/tools/update-status/file-sync.js +57 -6
- package/dist/tools/update-status/index.d.ts +25 -1
- package/dist/tools/update-status/index.js +292 -78
- package/dist/tools/update-status/response-builder.js +3 -3
- package/dist/tools/update-status/side-effects.d.ts +2 -0
- package/dist/tools/update-status/side-effects.js +2 -2
- package/dist/tools/update-status/transition-guard.js +45 -16
- package/dist/tools/update-status-actions.d.ts +4 -2
- package/dist/tools/update-status-actions.js +16 -14
- package/dist/tools/usage-report.js +1 -16
- package/dist/tools/usage-stats.js +1 -18
- package/dist/tools/usage-tracking.d.ts +4 -0
- package/dist/tools/usage-tracking.js +20 -0
- package/dist/tools/validate-lint.d.ts +1 -0
- package/dist/tools/validate-lint.js +1 -1
- package/dist/tools/validate.d.ts +2 -1
- package/dist/tools/validate.js +114 -34
- package/dist/tools/workspace-dashboard-handler.js +38 -0
- package/dist/transports/http-transport.js +6 -8
- package/dist/transports/mcp-types.d.ts +0 -2
- package/dist/transports/session-context.js +1 -1
- package/dist/types/cascade-hooks.d.ts +1 -1
- package/dist/types/ci.d.ts +0 -4
- package/dist/types/clarification-token.d.ts +1 -1
- package/dist/types/claude-code-runtime.d.ts +0 -27
- package/dist/types/commercial-migration.d.ts +17 -0
- package/dist/types/commercial-migration.js +2 -0
- package/dist/types/common/primitives.d.ts +0 -2
- package/dist/types/core-bridge.d.ts +4 -10
- package/dist/types/dashboard.d.ts +3 -7
- package/dist/types/docs.d.ts +0 -1
- package/dist/types/durable-job.d.ts +4 -4
- package/dist/types/durable-validation.d.ts +100 -2
- package/dist/types/durable-validation.js +165 -1
- package/dist/types/errors/structured-error.d.ts +3 -3
- package/dist/types/estimation.d.ts +2 -0
- package/dist/types/evidence-autofill.d.ts +34 -0
- package/dist/types/evidence-autofill.js +2 -0
- package/dist/types/evidence-gates.d.ts +9 -1
- package/dist/types/execution.d.ts +2 -0
- package/dist/types/gemini-integration.d.ts +0 -11
- package/dist/types/handoff-artifacts.d.ts +41 -0
- package/dist/types/hooks-advanced.d.ts +0 -13
- package/dist/types/impact-detection.d.ts +2 -2
- package/dist/types/index.d.ts +3 -6
- package/dist/types/index.js +2 -5
- package/dist/types/kiro-integration.d.ts +0 -6
- package/dist/types/network-policy.d.ts +1 -1
- package/dist/types/project/lint-scaffolder.d.ts +1 -1
- package/dist/types/runtime-policy.d.ts +11 -0
- package/dist/types/session-safeguard.d.ts +0 -31
- package/dist/types/spec/canonical-repair.d.ts +81 -0
- package/dist/types/spec/canonical-repair.js +2 -0
- package/dist/types/spec/core.d.ts +20 -0
- package/dist/types/spec/index.d.ts +1 -0
- package/dist/types/spec/index.js +1 -0
- package/dist/types/spec/inputs.d.ts +35 -1
- package/dist/types/spec-format.d.ts +25 -1
- package/dist/types/telemetry.d.ts +4 -1
- package/dist/types/transition-log.d.ts +1 -1
- package/dist/types/transport.d.ts +0 -2
- package/dist/types/usage.d.ts +1 -36
- package/dist/types/usage.js +1 -1
- package/dist/types/validate-worker.d.ts +6 -0
- package/dist/types/validation-receipt.d.ts +1 -1
- package/dist/types/validation.d.ts +10 -4
- package/package.json +17 -12
- package/planu-native.json +1 -1
- package/planu-plugin.json +23 -40
- package/scripts/lib/pending-release-file.mjs +93 -0
- package/src/i18n/messages/en.json +0 -41
- package/src/i18n/messages/es.json +0 -41
- package/src/i18n/messages/pt.json +0 -41
- package/dist/cli/commands/activate.d.ts +0 -14
- package/dist/cli/commands/activate.js +0 -174
- package/dist/config/license-plans.json +0 -251
- package/dist/config/product-public.ts +0 -148
- package/dist/config/server-instructions.ts +0 -121
- package/dist/config/version-defaults.ts +0 -76
- package/dist/config/version.ts +0 -21
- package/dist/engine/ai-integration/gemini/settings-generator.d.ts +0 -4
- package/dist/engine/ai-integration/gemini/settings-generator.js +0 -195
- package/dist/engine/ai-integration/kiro/hooks-generator.d.ts +0 -6
- package/dist/engine/ai-integration/kiro/hooks-generator.js +0 -75
- package/dist/engine/hooks/full-spectrum-generator.d.ts +0 -32
- package/dist/engine/hooks/full-spectrum-generator.js +0 -117
- package/dist/engine/license-validator/config-loader.d.ts +0 -5
- package/dist/engine/license-validator/config-loader.js +0 -16
- package/dist/engine/license-validator/core.d.ts +0 -15
- package/dist/engine/license-validator/core.js +0 -151
- package/dist/engine/license-validator/fingerprint.d.ts +0 -3
- package/dist/engine/license-validator/fingerprint.js +0 -17
- package/dist/engine/license-validator/lemon-squeezy.d.ts +0 -5
- package/dist/engine/license-validator/lemon-squeezy.js +0 -55
- package/dist/engine/license-validator.d.ts +0 -5
- package/dist/engine/license-validator.js +0 -6
- package/dist/engine/product-intelligence/index.d.ts +0 -7
- package/dist/engine/product-intelligence/index.js +0 -211
- package/dist/engine/session/auto-save.d.ts +0 -18
- package/dist/engine/session/auto-save.js +0 -98
- package/dist/engine/session/context-snapshot.d.ts +0 -8
- package/dist/engine/session/context-snapshot.js +0 -49
- package/dist/engine/session/memory-sync.d.ts +0 -12
- package/dist/engine/session/memory-sync.js +0 -34
- package/dist/engine/session/session-diff.d.ts +0 -11
- package/dist/engine/session/session-diff.js +0 -42
- package/dist/engine/session/session-merge.d.ts +0 -12
- package/dist/engine/session/session-merge.js +0 -55
- package/dist/engine/session-safeguard/checkpoint-runner.d.ts +0 -4
- package/dist/engine/session-safeguard/checkpoint-runner.js +0 -70
- package/dist/engine/session-safeguard/learnings-buffer.d.ts +0 -15
- package/dist/engine/session-safeguard/learnings-buffer.js +0 -91
- package/dist/engine/session-safeguard/precompaction-drain.d.ts +0 -10
- package/dist/engine/session-safeguard/precompaction-drain.js +0 -82
- package/dist/engine/session-safeguard/unpushed-detector.d.ts +0 -7
- package/dist/engine/session-safeguard/unpushed-detector.js +0 -59
- package/dist/engine/spec-changelog/core.d.ts +0 -16
- package/dist/engine/spec-changelog/core.js +0 -176
- package/dist/engine/spec-changelog/diff.d.ts +0 -18
- package/dist/engine/spec-changelog/diff.js +0 -121
- package/dist/engine/spec-changelog/index.d.ts +0 -3
- package/dist/engine/spec-changelog/index.js +0 -4
- package/dist/engine/trial-engine.d.ts +0 -5
- package/dist/engine/trial-engine.js +0 -14
- package/dist/engine/usage-tracker/rate-check.d.ts +0 -7
- package/dist/engine/usage-tracker/rate-check.js +0 -18
- package/dist/engine/usage-tracker/rate-limiter.d.ts +0 -14
- package/dist/engine/usage-tracker/rate-limiter.js +0 -73
- package/dist/engine/usage-tracker/trial.d.ts +0 -27
- package/dist/engine/usage-tracker/trial.js +0 -49
- package/dist/engine/webhook/event-handlers.d.ts +0 -25
- package/dist/engine/webhook/event-handlers.js +0 -89
- package/dist/engine/webhook/index.d.ts +0 -4
- package/dist/engine/webhook/index.js +0 -5
- package/dist/engine/webhook/server.d.ts +0 -12
- package/dist/engine/webhook/server.js +0 -249
- package/dist/engine/webhook/signature.d.ts +0 -16
- package/dist/engine/webhook/signature.js +0 -49
- package/dist/storage/license-store.d.ts +0 -6
- package/dist/storage/license-store.js +0 -63
- package/dist/storage/session-store.d.ts +0 -20
- package/dist/storage/session-store.js +0 -136
- package/dist/tools/activate-license.d.ts +0 -6
- package/dist/tools/activate-license.js +0 -132
- package/dist/tools/checkpoint-handler.d.ts +0 -3
- package/dist/tools/checkpoint-handler.js +0 -130
- package/dist/tools/export-session.d.ts +0 -3
- package/dist/tools/export-session.js +0 -90
- package/dist/tools/license-gate.d.ts +0 -18
- package/dist/tools/license-gate.js +0 -222
- package/dist/tools/license-status.d.ts +0 -3
- package/dist/tools/license-status.js +0 -93
- package/dist/tools/list-sessions.d.ts +0 -3
- package/dist/tools/list-sessions.js +0 -46
- package/dist/tools/planu-session-checkpoint.d.ts +0 -6
- package/dist/tools/planu-session-checkpoint.js +0 -42
- package/dist/tools/restore-session.d.ts +0 -3
- package/dist/tools/restore-session.js +0 -71
- package/dist/tools/spec-history.d.ts +0 -3
- package/dist/tools/spec-history.js +0 -59
- package/dist/tools/webhook.d.ts +0 -6
- package/dist/tools/webhook.js +0 -150
- package/dist/types/changelog.d.ts +0 -49
- package/dist/types/changelog.js +0 -3
- package/dist/types/licensing.d.ts +0 -109
- package/dist/types/licensing.js +0 -4
- package/dist/types/product-intelligence.d.ts +0 -60
- package/dist/types/product-intelligence.js +0 -3
- package/dist/types/session.d.ts +0 -84
- package/dist/types/session.js +0 -3
- package/dist/types/webhook.d.ts +0 -62
- package/dist/types/webhook.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolResult } from './index.js';
|
|
2
2
|
import type { ValidateWorkerCall } from './validate-worker.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ValidationReceiptIssueInput } from './validation-receipt.js';
|
|
4
4
|
export interface DurableValidationBindings {
|
|
5
5
|
readonly projectId: string;
|
|
6
6
|
readonly specId: string;
|
|
@@ -9,6 +9,14 @@ export interface DurableValidationBindings {
|
|
|
9
9
|
readonly policyHash: string;
|
|
10
10
|
readonly toolchainHash: string;
|
|
11
11
|
}
|
|
12
|
+
export type ValidationWorktreeErrorCode = 'VALIDATION_PAYLOAD_VERSION_UNSUPPORTED' | 'VALIDATION_ROOT_ID_MALFORMED' | 'VALIDATION_ROOT_ID_MISMATCH' | 'VALIDATION_ROOT_BUSY' | 'VALIDATION_ROOT_NOT_GIT_WORKTREE' | 'VALIDATION_COMMON_DIR_MISMATCH' | 'VALIDATION_SPEC_PATH_TRAVERSAL' | 'VALIDATION_SPEC_PATH_SYMLINK' | 'VALIDATION_SPEC_NOT_FOUND' | 'VALIDATION_SPEC_ID_MISMATCH';
|
|
13
|
+
export interface ResolvedValidationWorktree {
|
|
14
|
+
readonly projectPath: string;
|
|
15
|
+
readonly gitCommonDir: string;
|
|
16
|
+
readonly specPath: string;
|
|
17
|
+
readonly relativeSpecPath: string;
|
|
18
|
+
readonly validationRootId: string;
|
|
19
|
+
}
|
|
12
20
|
export interface ValidationPhaseProgress {
|
|
13
21
|
readonly phase: string;
|
|
14
22
|
readonly command: string;
|
|
@@ -43,6 +51,76 @@ export interface ValidationPhaseGraphResult {
|
|
|
43
51
|
}
|
|
44
52
|
export interface ValidateJobExecutorOptions {
|
|
45
53
|
readonly runWorker?: (call: ValidateWorkerCall) => Promise<ToolResult>;
|
|
54
|
+
readonly workerTimingPolicy?: {
|
|
55
|
+
readonly workerLeaseMs: number;
|
|
56
|
+
readonly workerHeartbeatMs: number;
|
|
57
|
+
};
|
|
58
|
+
readonly receiptCheckpointPolicy?: {
|
|
59
|
+
readonly logMaxBytes: number;
|
|
60
|
+
readonly resultMaxBytes: number;
|
|
61
|
+
};
|
|
62
|
+
readonly heartbeatFactory?: DurableJobHeartbeatFactory;
|
|
63
|
+
}
|
|
64
|
+
export interface DurableJobHeartbeatIdentity {
|
|
65
|
+
readonly projectId: string;
|
|
66
|
+
readonly workspaceId: string;
|
|
67
|
+
readonly operationId: string;
|
|
68
|
+
readonly workerId: string;
|
|
69
|
+
readonly fencingToken: number;
|
|
70
|
+
}
|
|
71
|
+
export interface DurableJobHeartbeatWorkerData extends DurableJobHeartbeatIdentity {
|
|
72
|
+
readonly kind: 'planu-durable-job-heartbeat';
|
|
73
|
+
readonly schemaVersion: 1;
|
|
74
|
+
readonly databasePath: string;
|
|
75
|
+
readonly leaseMs: number;
|
|
76
|
+
readonly heartbeatMs: number;
|
|
77
|
+
readonly databaseBusyTimeoutMs: number;
|
|
78
|
+
}
|
|
79
|
+
export type DurableJobHeartbeatMessage = (DurableJobHeartbeatIdentity & {
|
|
80
|
+
readonly schemaVersion: 1;
|
|
81
|
+
readonly type: 'ready';
|
|
82
|
+
}) | (DurableJobHeartbeatIdentity & {
|
|
83
|
+
readonly schemaVersion: 1;
|
|
84
|
+
readonly type: 'renewed';
|
|
85
|
+
readonly sequence: number;
|
|
86
|
+
}) | (DurableJobHeartbeatIdentity & {
|
|
87
|
+
readonly schemaVersion: 1;
|
|
88
|
+
readonly type: 'authorityLost';
|
|
89
|
+
readonly sequence: number;
|
|
90
|
+
readonly reason: 'cancelled-or-stale' | 'database-failure' | 'worker-failure';
|
|
91
|
+
}) | (DurableJobHeartbeatIdentity & {
|
|
92
|
+
readonly schemaVersion: 1;
|
|
93
|
+
readonly type: 'stopped';
|
|
94
|
+
});
|
|
95
|
+
export interface DurableJobHeartbeatController {
|
|
96
|
+
stop(): Promise<void>;
|
|
97
|
+
}
|
|
98
|
+
export interface DurableJobHeartbeatStartInput extends DurableJobHeartbeatIdentity {
|
|
99
|
+
readonly databasePath: string;
|
|
100
|
+
readonly leaseMs: number;
|
|
101
|
+
readonly heartbeatMs: number;
|
|
102
|
+
readonly databaseBusyTimeoutMs: number;
|
|
103
|
+
readonly startupTimeoutMs: number;
|
|
104
|
+
readonly shutdownTimeoutMs: number;
|
|
105
|
+
readonly onAuthorityLost: (reason: Error) => void;
|
|
106
|
+
}
|
|
107
|
+
export type DurableJobHeartbeatFactory = (input: DurableJobHeartbeatStartInput) => Promise<DurableJobHeartbeatController>;
|
|
108
|
+
export interface DurableJobHeartbeatWorkerHandle {
|
|
109
|
+
on(event: 'message', listener: (value: unknown) => void): this;
|
|
110
|
+
once(event: 'error', listener: (error: Error) => void): this;
|
|
111
|
+
once(event: 'exit', listener: (code: number) => void): this;
|
|
112
|
+
postMessage(value: unknown): void;
|
|
113
|
+
terminate(): Promise<number>;
|
|
114
|
+
unref(): void;
|
|
115
|
+
removeAllListeners(): this;
|
|
116
|
+
}
|
|
117
|
+
export interface DurableJobHeartbeatRuntimeOptions {
|
|
118
|
+
readonly workerFactory?: (url: URL, data: DurableJobHeartbeatWorkerData) => DurableJobHeartbeatWorkerHandle;
|
|
119
|
+
}
|
|
120
|
+
interface ValidationRecoveryJob {
|
|
121
|
+
readonly payload: unknown;
|
|
122
|
+
readonly state: string;
|
|
123
|
+
readonly leaseExpiresAt?: string;
|
|
46
124
|
}
|
|
47
125
|
export interface ValidateJobRecoveryOptions {
|
|
48
126
|
readonly runtimeFactory?: () => {
|
|
@@ -50,11 +128,31 @@ export interface ValidateJobRecoveryOptions {
|
|
|
50
128
|
projectId: string;
|
|
51
129
|
workspaceId: string;
|
|
52
130
|
}[];
|
|
53
|
-
list(projectId: string, workspaceId: string): readonly
|
|
131
|
+
list(projectId: string, workspaceId: string): readonly ValidationRecoveryJob[];
|
|
54
132
|
close(): void;
|
|
55
133
|
};
|
|
56
134
|
readonly schedule?: (projectId: string, workspaceId: string) => void;
|
|
57
135
|
readonly scheduleLater?: (callback: () => void, delayMs: number) => void;
|
|
58
136
|
readonly now?: () => number;
|
|
59
137
|
}
|
|
138
|
+
export interface ValidationReceiptPendingCheckpoint {
|
|
139
|
+
readonly kind: 'validation-receipt-pending';
|
|
140
|
+
readonly schemaVersion: 1;
|
|
141
|
+
readonly errorCode: 'VALIDATION_RECEIPT_PENDING';
|
|
142
|
+
readonly recoveryAction: 'restart_job';
|
|
143
|
+
readonly result: ToolResult;
|
|
144
|
+
readonly receiptInput: ValidationReceiptIssueInput & {
|
|
145
|
+
readonly log: string;
|
|
146
|
+
readonly issuedAt: string;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export interface ValidationReceiptCheckpointLimits {
|
|
150
|
+
readonly logMaxBytes: number;
|
|
151
|
+
readonly resultMaxBytes: number;
|
|
152
|
+
}
|
|
153
|
+
/** Parse the sole durable authority allowed to resume receipt publication. */
|
|
154
|
+
export declare function parseValidationReceiptPendingCheckpoint(value: unknown, limits: ValidationReceiptCheckpointLimits): ValidationReceiptPendingCheckpoint | undefined;
|
|
155
|
+
/** Detect an attempted receipt authority even when its strict schema is malformed. */
|
|
156
|
+
export declare function isValidationReceiptPendingIntent(value: unknown): boolean;
|
|
157
|
+
export {};
|
|
60
158
|
//# sourceMappingURL=durable-validation.d.ts.map
|
|
@@ -1,2 +1,166 @@
|
|
|
1
|
-
|
|
1
|
+
import { redactSensitiveValue } from '../security/redactor.js';
|
|
2
|
+
const DIGEST = /^sha256:[a-f0-9]{64}$/u;
|
|
3
|
+
const PROJECT_ID = /^[a-f0-9]{32}$/u;
|
|
4
|
+
const SPEC_ID = /^SPEC-[1-9]\d*$/u;
|
|
5
|
+
function exactKeys(value, keys) {
|
|
6
|
+
const actual = Object.keys(value).sort();
|
|
7
|
+
return (actual.length === keys.length && actual.every((key, index) => key === [...keys].sort()[index]));
|
|
8
|
+
}
|
|
9
|
+
function record(value) {
|
|
10
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
11
|
+
? value
|
|
12
|
+
: undefined;
|
|
13
|
+
}
|
|
14
|
+
function isJsonValue(value) {
|
|
15
|
+
if (value === null || typeof value === 'string' || typeof value === 'boolean') {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (typeof value === 'number') {
|
|
19
|
+
return Number.isFinite(value);
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(value)) {
|
|
22
|
+
return value.every(isJsonValue);
|
|
23
|
+
}
|
|
24
|
+
const candidate = record(value);
|
|
25
|
+
return candidate !== undefined && Object.values(candidate).every(isJsonValue);
|
|
26
|
+
}
|
|
27
|
+
function validToolResult(value) {
|
|
28
|
+
const candidate = record(value);
|
|
29
|
+
if (!candidate || !isJsonValue(candidate)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (!Array.isArray(candidate.content) ||
|
|
33
|
+
!candidate.content.every((item) => {
|
|
34
|
+
const entry = record(item);
|
|
35
|
+
return Boolean(entry &&
|
|
36
|
+
exactKeys(entry, ['text', 'type']) &&
|
|
37
|
+
entry.type === 'text' &&
|
|
38
|
+
typeof entry.text === 'string');
|
|
39
|
+
})) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (candidate.isError !== undefined && typeof candidate.isError !== 'boolean') {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return (candidate.structuredContent === undefined ||
|
|
46
|
+
Boolean(record(candidate.structuredContent) && isJsonValue(candidate.structuredContent)));
|
|
47
|
+
}
|
|
48
|
+
function validBindings(value) {
|
|
49
|
+
const candidate = record(value);
|
|
50
|
+
const artifactDigests = record(candidate?.artifactDigests);
|
|
51
|
+
return Boolean(candidate &&
|
|
52
|
+
exactKeys(candidate, [
|
|
53
|
+
'artifactDigests',
|
|
54
|
+
'policyDigest',
|
|
55
|
+
'projectId',
|
|
56
|
+
'sourceDigest',
|
|
57
|
+
'specDigest',
|
|
58
|
+
'specId',
|
|
59
|
+
'toolchainDigest',
|
|
60
|
+
]) &&
|
|
61
|
+
typeof candidate.projectId === 'string' &&
|
|
62
|
+
PROJECT_ID.test(candidate.projectId) &&
|
|
63
|
+
typeof candidate.specId === 'string' &&
|
|
64
|
+
SPEC_ID.test(candidate.specId) &&
|
|
65
|
+
['sourceDigest', 'specDigest', 'policyDigest', 'toolchainDigest'].every((key) => typeof candidate[key] === 'string' && DIGEST.test(candidate[key])) &&
|
|
66
|
+
artifactDigests &&
|
|
67
|
+
exactKeys(artifactDigests, [
|
|
68
|
+
'approvedSpec',
|
|
69
|
+
'contractValidation',
|
|
70
|
+
'discovery',
|
|
71
|
+
'taskPlan',
|
|
72
|
+
'traceability',
|
|
73
|
+
]) &&
|
|
74
|
+
Object.values(artifactDigests).every((digest) => typeof digest === 'string' && DIGEST.test(digest)));
|
|
75
|
+
}
|
|
76
|
+
// eslint-disable-next-line complexity -- the closed persisted authority validates every field without coercion
|
|
77
|
+
function validReceiptInput(value) {
|
|
78
|
+
const candidate = record(value);
|
|
79
|
+
if (!candidate ||
|
|
80
|
+
!exactKeys(candidate, [
|
|
81
|
+
'bindings',
|
|
82
|
+
'command',
|
|
83
|
+
'durationMs',
|
|
84
|
+
'exitCode',
|
|
85
|
+
'gates',
|
|
86
|
+
'issuedAt',
|
|
87
|
+
'log',
|
|
88
|
+
'versions',
|
|
89
|
+
])) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const command = record(candidate.command);
|
|
93
|
+
const versions = record(candidate.versions);
|
|
94
|
+
const canonicalIssuedAt = typeof candidate.issuedAt === 'string' &&
|
|
95
|
+
Number.isFinite(Date.parse(candidate.issuedAt)) &&
|
|
96
|
+
new Date(candidate.issuedAt).toISOString() === candidate.issuedAt;
|
|
97
|
+
return Boolean(validBindings(candidate.bindings) &&
|
|
98
|
+
command &&
|
|
99
|
+
exactKeys(command, ['args', 'cwd', 'executable']) &&
|
|
100
|
+
command.executable === 'planu' &&
|
|
101
|
+
command.cwd === '<project>' &&
|
|
102
|
+
Array.isArray(command.args) &&
|
|
103
|
+
command.args.length === 2 &&
|
|
104
|
+
command.args[0] === 'validate' &&
|
|
105
|
+
typeof command.args[1] === 'string' &&
|
|
106
|
+
SPEC_ID.test(command.args[1]) &&
|
|
107
|
+
record(candidate.bindings)?.specId === command.args[1] &&
|
|
108
|
+
versions &&
|
|
109
|
+
exactKeys(versions, ['node', 'receiptSchema']) &&
|
|
110
|
+
typeof versions.node === 'string' &&
|
|
111
|
+
versions.receiptSchema === '1' &&
|
|
112
|
+
candidate.exitCode === 0 &&
|
|
113
|
+
Number.isSafeInteger(candidate.durationMs) &&
|
|
114
|
+
candidate.durationMs >= 0 &&
|
|
115
|
+
typeof candidate.log === 'string' &&
|
|
116
|
+
Array.isArray(candidate.gates) &&
|
|
117
|
+
candidate.gates.length === 1 &&
|
|
118
|
+
(() => {
|
|
119
|
+
const gate = record(candidate.gates[0]);
|
|
120
|
+
return Boolean(gate &&
|
|
121
|
+
exactKeys(gate, ['durationMs', 'gate', 'status']) &&
|
|
122
|
+
gate.gate === 'validation' &&
|
|
123
|
+
gate.status === 'passed' &&
|
|
124
|
+
Number.isSafeInteger(gate.durationMs) &&
|
|
125
|
+
gate.durationMs >= 0);
|
|
126
|
+
})() &&
|
|
127
|
+
canonicalIssuedAt);
|
|
128
|
+
}
|
|
129
|
+
/** Parse the sole durable authority allowed to resume receipt publication. */
|
|
130
|
+
// eslint-disable-next-line complexity -- persisted authority checks shape, privacy, and both policy byte bounds without coercion
|
|
131
|
+
export function parseValidationReceiptPendingCheckpoint(value, limits) {
|
|
132
|
+
const candidate = record(value);
|
|
133
|
+
const redacted = redactSensitiveValue(value);
|
|
134
|
+
if (!Number.isSafeInteger(limits.logMaxBytes) ||
|
|
135
|
+
limits.logMaxBytes <= 0 ||
|
|
136
|
+
!Number.isSafeInteger(limits.resultMaxBytes) ||
|
|
137
|
+
limits.resultMaxBytes <= 0 ||
|
|
138
|
+
limits.logMaxBytes > limits.resultMaxBytes ||
|
|
139
|
+
!candidate ||
|
|
140
|
+
!exactKeys(candidate, [
|
|
141
|
+
'errorCode',
|
|
142
|
+
'kind',
|
|
143
|
+
'receiptInput',
|
|
144
|
+
'recoveryAction',
|
|
145
|
+
'result',
|
|
146
|
+
'schemaVersion',
|
|
147
|
+
]) ||
|
|
148
|
+
candidate.kind !== 'validation-receipt-pending' ||
|
|
149
|
+
candidate.schemaVersion !== 1 ||
|
|
150
|
+
candidate.errorCode !== 'VALIDATION_RECEIPT_PENDING' ||
|
|
151
|
+
candidate.recoveryAction !== 'restart_job' ||
|
|
152
|
+
!validToolResult(candidate.result) ||
|
|
153
|
+
!validReceiptInput(candidate.receiptInput) ||
|
|
154
|
+
Buffer.byteLength(JSON.stringify(candidate.result), 'utf8') > limits.resultMaxBytes ||
|
|
155
|
+
Buffer.byteLength(candidate.receiptInput.log, 'utf8') >
|
|
156
|
+
limits.logMaxBytes ||
|
|
157
|
+
JSON.stringify(redacted) !== JSON.stringify(candidate)) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
return candidate;
|
|
161
|
+
}
|
|
162
|
+
/** Detect an attempted receipt authority even when its strict schema is malformed. */
|
|
163
|
+
export function isValidationReceiptPendingIntent(value) {
|
|
164
|
+
return record(value)?.kind === 'validation-receipt-pending';
|
|
165
|
+
}
|
|
2
166
|
//# sourceMappingURL=durable-validation.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolResult } from '../index.js';
|
|
2
2
|
export type ToolHandler = (args: Record<string, unknown>, extra?: unknown) => Promise<ToolResult>;
|
|
3
|
-
export interface
|
|
3
|
+
export interface StructuredErrorNextAction {
|
|
4
4
|
tool: string;
|
|
5
5
|
args: Record<string, unknown>;
|
|
6
6
|
rationale?: string;
|
|
@@ -9,7 +9,7 @@ export interface StructuredError {
|
|
|
9
9
|
ok: false;
|
|
10
10
|
what: string;
|
|
11
11
|
why: string;
|
|
12
|
-
nextAction:
|
|
12
|
+
nextAction: StructuredErrorNextAction;
|
|
13
13
|
errorCode?: string;
|
|
14
14
|
citations?: string[];
|
|
15
15
|
}
|
|
@@ -21,7 +21,7 @@ export interface ErrorRecoveryRule {
|
|
|
21
21
|
};
|
|
22
22
|
what: string;
|
|
23
23
|
why?: string;
|
|
24
|
-
nextAction:
|
|
24
|
+
nextAction: StructuredErrorNextAction;
|
|
25
25
|
}
|
|
26
26
|
export interface WrapCtx {
|
|
27
27
|
toolName: string;
|
|
@@ -58,6 +58,8 @@ export interface ValidateInput {
|
|
|
58
58
|
specId: string;
|
|
59
59
|
projectId?: string;
|
|
60
60
|
projectPath?: string;
|
|
61
|
+
/** Internal executor-owned portable spec path after worktree verification. */
|
|
62
|
+
specPath?: string;
|
|
61
63
|
/** Durable submission is the only public MCP execution mode. */
|
|
62
64
|
mode?: 'submit';
|
|
63
65
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Actuals } from './estimation.js';
|
|
2
|
+
/**
|
|
3
|
+
* Caller-supplied actuals on a `done` transition. Every field is optional:
|
|
4
|
+
* missing numeric fields are treated as "not measured" and defaulted to 0 by
|
|
5
|
+
* the done gate; `completedAt`/`notes` default when the whole object is
|
|
6
|
+
* absent. Any field the caller does supply is always stored verbatim.
|
|
7
|
+
*/
|
|
8
|
+
export type ActualsInput = Partial<Actuals>;
|
|
9
|
+
/** Injectable process runner so tests never shell out to real git. */
|
|
10
|
+
export type EvidenceAutofillExec = (command: string, args: string[], options: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
}) => Promise<string>;
|
|
13
|
+
export interface AutofillTraceabilityMatrixArgs {
|
|
14
|
+
projectId: string;
|
|
15
|
+
specId: string;
|
|
16
|
+
/** Absolute path to the project working copy; used for `git diff` and file existence checks. */
|
|
17
|
+
projectPath?: string;
|
|
18
|
+
/** Raw spec.md content (frontmatter + body) used to derive criteria, scenarios, and `## Files`. */
|
|
19
|
+
specBody: string;
|
|
20
|
+
/** Overrides the default `execFile`-based git runner. */
|
|
21
|
+
exec?: EvidenceAutofillExec;
|
|
22
|
+
/** Branch to diff against for changed-files detection. Defaults to `main`. */
|
|
23
|
+
baseBranch?: string;
|
|
24
|
+
}
|
|
25
|
+
export type AutofillTraceabilityMatrixResult = {
|
|
26
|
+
written: true;
|
|
27
|
+
path: string;
|
|
28
|
+
rowCount: number;
|
|
29
|
+
} | {
|
|
30
|
+
written: false;
|
|
31
|
+
reason: 'already-exists' | 'no-criteria' | 'write-failed';
|
|
32
|
+
error?: string;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=evidence-autofill.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ValidationArtifactProvenance, ValidationReceipt } from './validation-receipt.js';
|
|
2
|
+
import type { ValidationGateCapability } from './validation-evidence.js';
|
|
2
3
|
export type EvidenceGateTransition = 'approved' | 'implementing' | 'done';
|
|
3
4
|
export interface DiscoveryEvidence {
|
|
4
5
|
version: 1;
|
|
@@ -41,6 +42,13 @@ export interface TraceabilityMatrixEvidence {
|
|
|
41
42
|
changedFiles: string[];
|
|
42
43
|
validationEvidence?: string;
|
|
43
44
|
reviewerEvidence?: string;
|
|
45
|
+
commandEvidence?: {
|
|
46
|
+
capability: ValidationGateCapability;
|
|
47
|
+
command: string;
|
|
48
|
+
scope: string[];
|
|
49
|
+
relevantPaths?: string[];
|
|
50
|
+
evidenceKey: string;
|
|
51
|
+
};
|
|
44
52
|
}[];
|
|
45
53
|
}
|
|
46
54
|
export interface ContractValidationEvidence {
|
|
@@ -62,7 +70,7 @@ export interface EvidenceReceiptContext {
|
|
|
62
70
|
receipt: ValidationReceipt;
|
|
63
71
|
}
|
|
64
72
|
export interface EvidenceGateIssue {
|
|
65
|
-
code: 'discovery_missing' | 'discovery_unresolved_questions' | 'task_plan_missing' | 'task_plan_uncovered_criteria' | 'traceability_missing' | 'traceability_uncovered_criteria' | 'traceability_incomplete_rows' | 'contract_validation_missing' | 'contract_validation_failed' | 'evidence_provenance_invalid' | 'done_drift_uncovered_criteria' | 'done_drift_stale_evidence' | 'done_drift_unapproved_scope' | 'evidence_artifact_invalid';
|
|
73
|
+
code: 'discovery_missing' | 'discovery_unresolved_questions' | 'task_plan_missing' | 'task_plan_uncovered_criteria' | 'traceability_missing' | 'traceability_uncovered_criteria' | 'traceability_incomplete_rows' | 'contract_validation_missing' | 'contract_validation_failed' | 'evidence_provenance_invalid' | 'done_drift_uncovered_criteria' | 'done_drift_stale_evidence' | 'done_drift_unapproved_scope' | 'evidence_artifact_invalid' | 'SUPERSEDED_RECONCILIATION_EVIDENCE';
|
|
66
74
|
message: string;
|
|
67
75
|
}
|
|
68
76
|
export interface EvidenceGateResult {
|
|
@@ -128,6 +128,7 @@ export interface CreateExecutionScopeOptions {
|
|
|
128
128
|
export interface CancellationScope {
|
|
129
129
|
readonly signal: AbortSignal;
|
|
130
130
|
readonly timeoutMs: number;
|
|
131
|
+
didDeadlineElapse: () => boolean;
|
|
131
132
|
dispose: () => void;
|
|
132
133
|
}
|
|
133
134
|
export interface BudgetExecution<T> {
|
|
@@ -137,6 +138,7 @@ export interface BudgetExecution<T> {
|
|
|
137
138
|
} | {
|
|
138
139
|
ok: false;
|
|
139
140
|
error: Error;
|
|
141
|
+
source: 'operation' | 'deadline';
|
|
140
142
|
}>;
|
|
141
143
|
timeoutMs: number;
|
|
142
144
|
dispose: () => void;
|
|
@@ -4,17 +4,6 @@ export interface GeminiDetectionResult {
|
|
|
4
4
|
configPath?: string;
|
|
5
5
|
hasGeminiMd: boolean;
|
|
6
6
|
}
|
|
7
|
-
export type GeminiHookEvent = 'SessionStart' | 'SessionEnd' | 'BeforeAgent' | 'AfterAgent' | 'BeforeModel' | 'AfterModel' | 'BeforeToolSelection' | 'BeforeTool' | 'AfterTool' | 'PreCompress' | 'Notification';
|
|
8
|
-
export interface GeminiHook {
|
|
9
|
-
event: GeminiHookEvent;
|
|
10
|
-
command: string;
|
|
11
|
-
timeout?: number;
|
|
12
|
-
matcher?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface GeminiSettings {
|
|
15
|
-
hooks: GeminiHook[];
|
|
16
|
-
theme?: string;
|
|
17
|
-
}
|
|
18
7
|
export interface GeminiPolicy {
|
|
19
8
|
name: string;
|
|
20
9
|
description: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Spec } from './spec/core.js';
|
|
1
2
|
/** Artifact kinds produced/consumed by each role transition */
|
|
2
3
|
export type ArtifactKind = 'intake' | 'spec.lock' | 'review_feedback' | 'implementation-report' | 'validation-report';
|
|
3
4
|
/** Triagier → Elicitor: describes the intent to be elaborated */
|
|
@@ -78,6 +79,46 @@ export interface ValidationReportV1 {
|
|
|
78
79
|
receiptId?: string;
|
|
79
80
|
receiptKey?: string;
|
|
80
81
|
}
|
|
82
|
+
export type ReconciliationReceiptState = 'prepared' | 'committed' | 'aborted';
|
|
83
|
+
/** Mutable, atomically replaced recovery record for a reconciliation transaction. */
|
|
84
|
+
export interface ReconciliationReceiptV1 {
|
|
85
|
+
schema_version: '1.0.0';
|
|
86
|
+
projectId: string;
|
|
87
|
+
specId: string;
|
|
88
|
+
requestId: string;
|
|
89
|
+
sourceImplementingTransitionId: string;
|
|
90
|
+
sourceUpdatedAt: string;
|
|
91
|
+
bindingDigest: string;
|
|
92
|
+
reasonDigest: string;
|
|
93
|
+
implementationReviewDigest: string;
|
|
94
|
+
supersededArtifacts: {
|
|
95
|
+
artifactId: string;
|
|
96
|
+
sha256?: string;
|
|
97
|
+
}[];
|
|
98
|
+
state: ReconciliationReceiptState;
|
|
99
|
+
stateHistory: {
|
|
100
|
+
state: ReconciliationReceiptState;
|
|
101
|
+
at: string;
|
|
102
|
+
reason?: string;
|
|
103
|
+
}[];
|
|
104
|
+
preparedAt: string;
|
|
105
|
+
committedAt?: string;
|
|
106
|
+
abortedAt?: string;
|
|
107
|
+
committedTransitionId?: string;
|
|
108
|
+
transitionId?: string;
|
|
109
|
+
phase?: 'prepared' | 'status-committed' | 'spec-synced' | 'audit-appended';
|
|
110
|
+
auditPending?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/** Injectable receipt persistence boundary used only for reconciliation crash tests. */
|
|
113
|
+
export interface ReconciliationIo {
|
|
114
|
+
writeReceipt?: (path: string, receipt: ReconciliationReceiptV1) => Promise<void>;
|
|
115
|
+
}
|
|
116
|
+
/** Portable spec synchronization injected by the tool boundary into lifecycle reconciliation. */
|
|
117
|
+
export type ReconciliationSpecSync = (spec: Spec, currentStatus: 'implementing' | 'review', newStatus: 'implementing' | 'review', projectPath?: string) => Promise<{
|
|
118
|
+
warning?: {
|
|
119
|
+
reason: string;
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
81
122
|
export interface ArtifactPayloadMap {
|
|
82
123
|
intake: IntakeV1;
|
|
83
124
|
'spec.lock': SpecLockV1;
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export type ClaudeCodeEventType = 'Stop' | 'PreCompact' | 'UserPromptSubmit' | 'Notification' | 'WorktreeCreate' | 'WorktreeRemove';
|
|
2
|
-
export interface HookScript {
|
|
3
|
-
eventType: ClaudeCodeEventType;
|
|
4
|
-
scriptContent: string;
|
|
5
|
-
description: string;
|
|
6
|
-
}
|
|
7
|
-
export interface FullSpectrumHookConfig {
|
|
8
|
-
stopHook: boolean;
|
|
9
|
-
preCompactHook: boolean;
|
|
10
|
-
userPromptSubmitHook: boolean;
|
|
11
|
-
notificationHook: boolean;
|
|
12
|
-
worktreeHooks: boolean;
|
|
13
|
-
}
|
|
14
1
|
export interface CustomCommand {
|
|
15
2
|
name: string;
|
|
16
3
|
description: string;
|
|
@@ -10,10 +10,10 @@ export interface ImpactDetectionResult {
|
|
|
10
10
|
}
|
|
11
11
|
export interface TestBreakHit {
|
|
12
12
|
testPath: string;
|
|
13
|
-
matchedPattern: 'tool-count' | 'snapshot' | '
|
|
13
|
+
matchedPattern: 'tool-count' | 'snapshot' | 'tool-registry-sync' | 'streams-anchor';
|
|
14
14
|
linePreview: string;
|
|
15
15
|
}
|
|
16
|
-
export type AnticipatedBreakPattern = 'tool-count' | 'snapshot' | '
|
|
16
|
+
export type AnticipatedBreakPattern = 'tool-count' | 'snapshot' | 'tool-registry-sync' | 'streams-anchor' | 'other';
|
|
17
17
|
export interface AnticipatedBreak {
|
|
18
18
|
testPath: string;
|
|
19
19
|
pattern: AnticipatedBreakPattern;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from './privacy.js';
|
|
|
30
30
|
export * from './events.js';
|
|
31
31
|
export * from './evidence-gates.js';
|
|
32
32
|
export * from './evidence-index.js';
|
|
33
|
+
export * from './evidence-autofill.js';
|
|
33
34
|
export * from './analytics.js';
|
|
34
35
|
export * from './sdd-flow.js';
|
|
35
36
|
export * from './sdd-model-routing.js';
|
|
@@ -57,14 +58,12 @@ export * from './actionable-spec-metrics.js';
|
|
|
57
58
|
export * from './actuals.js';
|
|
58
59
|
export * from './risk.js';
|
|
59
60
|
export * from './context-budget.js';
|
|
60
|
-
export * from './licensing.js';
|
|
61
61
|
export * from './usage.js';
|
|
62
|
-
export * from './
|
|
62
|
+
export * from './commercial-migration.js';
|
|
63
63
|
export * from './coverage.js';
|
|
64
64
|
export * from './ai-cost.js';
|
|
65
65
|
export * from './hooks.js';
|
|
66
66
|
export * from './hook-status-update.js';
|
|
67
|
-
export * from './webhook.js';
|
|
68
67
|
export * from './ci.js';
|
|
69
68
|
export * from './spec-templates.js';
|
|
70
69
|
export * from './spec-generator.js';
|
|
@@ -76,7 +75,6 @@ export * from './code-transforms.js';
|
|
|
76
75
|
export * from './ecosystem.js';
|
|
77
76
|
export * from './model-routing.js';
|
|
78
77
|
export * from './vector-store.js';
|
|
79
|
-
export * from './session.js';
|
|
80
78
|
export * from './ide.js';
|
|
81
79
|
export * from './delete.js';
|
|
82
80
|
export * from './runtime-security.js';
|
|
@@ -121,7 +119,7 @@ export * from './error-telemetry.js';
|
|
|
121
119
|
export * from './audit-trail.js';
|
|
122
120
|
export * from './elicitation.js';
|
|
123
121
|
export * from './well-known.js';
|
|
124
|
-
export type { ValidationSource, ValidationError, ValidationWarning,
|
|
122
|
+
export type { ValidationSource, ValidationError, ValidationWarning, SpecValidationResult, ValidateSpecFormatOptions, } from './validation.js';
|
|
125
123
|
export * from './observability.js';
|
|
126
124
|
export * from './resources.js';
|
|
127
125
|
export * from './discovery.js';
|
|
@@ -179,7 +177,6 @@ export * from './property-testing.js';
|
|
|
179
177
|
export * from './agent-ready.js';
|
|
180
178
|
export * from './compliance.js';
|
|
181
179
|
export * from './version-resolution.js';
|
|
182
|
-
export * from './product-intelligence.js';
|
|
183
180
|
export * from './agent-orchestration.js';
|
|
184
181
|
export * from './living-specs.js';
|
|
185
182
|
export * from './filesystem-hooks.js';
|
package/dist/types/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export * from './privacy.js';
|
|
|
31
31
|
export * from './events.js';
|
|
32
32
|
export * from './evidence-gates.js';
|
|
33
33
|
export * from './evidence-index.js';
|
|
34
|
+
export * from './evidence-autofill.js';
|
|
34
35
|
export * from './analytics.js';
|
|
35
36
|
export * from './sdd-flow.js';
|
|
36
37
|
export * from './sdd-model-routing.js';
|
|
@@ -58,14 +59,12 @@ export * from './actionable-spec-metrics.js';
|
|
|
58
59
|
export * from './actuals.js';
|
|
59
60
|
export * from './risk.js';
|
|
60
61
|
export * from './context-budget.js';
|
|
61
|
-
export * from './licensing.js';
|
|
62
62
|
export * from './usage.js';
|
|
63
|
-
export * from './
|
|
63
|
+
export * from './commercial-migration.js';
|
|
64
64
|
export * from './coverage.js';
|
|
65
65
|
export * from './ai-cost.js';
|
|
66
66
|
export * from './hooks.js';
|
|
67
67
|
export * from './hook-status-update.js';
|
|
68
|
-
export * from './webhook.js';
|
|
69
68
|
export * from './ci.js';
|
|
70
69
|
export * from './spec-templates.js';
|
|
71
70
|
export * from './spec-generator.js';
|
|
@@ -77,7 +76,6 @@ export * from './code-transforms.js';
|
|
|
77
76
|
export * from './ecosystem.js';
|
|
78
77
|
export * from './model-routing.js';
|
|
79
78
|
export * from './vector-store.js';
|
|
80
|
-
export * from './session.js';
|
|
81
79
|
export * from './ide.js';
|
|
82
80
|
export * from './delete.js';
|
|
83
81
|
export * from './runtime-security.js';
|
|
@@ -176,7 +174,6 @@ export * from './property-testing.js';
|
|
|
176
174
|
export * from './agent-ready.js';
|
|
177
175
|
export * from './compliance.js';
|
|
178
176
|
export * from './version-resolution.js';
|
|
179
|
-
export * from './product-intelligence.js';
|
|
180
177
|
export * from './agent-orchestration.js';
|
|
181
178
|
export * from './living-specs.js';
|
|
182
179
|
export * from './filesystem-hooks.js';
|
|
@@ -9,12 +9,6 @@ export interface KiroSteeringOptions {
|
|
|
9
9
|
}[];
|
|
10
10
|
architectureStyle?: string;
|
|
11
11
|
}
|
|
12
|
-
export interface KiroHookDefinition {
|
|
13
|
-
id: string;
|
|
14
|
-
event: 'agentSpawn' | 'userPromptSubmit' | 'preToolUse' | 'postToolUse' | 'stop';
|
|
15
|
-
description: string;
|
|
16
|
-
script: string;
|
|
17
|
-
}
|
|
18
12
|
export interface KiroSpecFormat {
|
|
19
13
|
id: string;
|
|
20
14
|
title: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type NetworkPurpose = 'dependency-audit' | 'integration' | 'oauth' | 'registry' | 'telemetry' | 'updates';
|
|
1
|
+
export type NetworkPurpose = 'dependency-audit' | 'feedback' | 'integration' | 'oauth' | 'registry' | 'telemetry' | 'updates';
|
|
2
2
|
export type NetworkRequestPurpose = NetworkPurpose | 'unclassified';
|
|
3
3
|
export interface NetworkConsentReceipt {
|
|
4
4
|
readonly purpose: NetworkPurpose;
|
|
@@ -23,11 +23,22 @@ export interface RuntimePolicy {
|
|
|
23
23
|
};
|
|
24
24
|
validation: {
|
|
25
25
|
defaultDeadlineMs: number;
|
|
26
|
+
durableLintTimeoutMs: number;
|
|
27
|
+
complianceCommandTimeoutMs: number;
|
|
28
|
+
noProgressTimeoutMs: number;
|
|
26
29
|
submissionLockWaitMs: number;
|
|
27
30
|
submissionLockPollMs: number;
|
|
28
31
|
workerLeaseMs: number;
|
|
29
32
|
workerHeartbeatMs: number;
|
|
30
33
|
workerConcurrency: number;
|
|
34
|
+
heartbeatStartupTimeoutMs: number;
|
|
35
|
+
heartbeatShutdownTimeoutMs: number;
|
|
36
|
+
heartbeatDatabaseBusyTimeoutMs: number;
|
|
37
|
+
freshnessLeaseTtlMs: number;
|
|
38
|
+
freshnessInvalidationCoalesceMs: number;
|
|
39
|
+
receiptPublicationDeadlineMs: number;
|
|
40
|
+
receiptCheckpointLogMaxBytes: number;
|
|
41
|
+
receiptCheckpointResultMaxBytes: number;
|
|
31
42
|
};
|
|
32
43
|
postCommit: {
|
|
33
44
|
defaultTaskTimeoutMs: number;
|