@planu/cli 5.3.67 → 5.3.69
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 +92 -0
- package/dist/.planu-build.json +1 -1
- package/dist/cli/commands/install.d.ts +2 -15
- package/dist/config/release-policy.json +2 -2
- package/dist/core/shared/fs.d.ts +11 -0
- package/dist/core/shared/fs.js +90 -0
- package/dist/core/shared/strings.d.ts +3 -0
- package/dist/core/shared/strings.js +13 -0
- package/dist/engine/actuals/git-analyzer.js +1 -1
- package/dist/engine/actuals/progress-parser.js +1 -3
- package/dist/engine/agent-handoff-store.js +1 -0
- package/dist/engine/agent-squad/dispatcher.js +1 -0
- package/dist/engine/agent-telemetry.js +1 -0
- package/dist/engine/auth/config.js +1 -0
- package/dist/engine/auto-updater/atomic-upgrade.js +1 -0
- package/dist/engine/auto-updater/index.js +1 -0
- package/dist/engine/autopilot/action-registry.js +20 -0
- package/dist/engine/autopilot/audit-logger.js +1 -0
- package/dist/engine/autopilot/bootstrap.js +9 -2
- package/dist/engine/autopilot/complete-loop.js +4 -0
- package/dist/engine/autopilot/crash-shield-rate-limiter.js +1 -0
- package/dist/engine/autopilot/event-bus.js +1 -0
- package/dist/engine/autopilot/state-updater.js +6 -0
- package/dist/engine/browser-validator.js +1 -3
- package/dist/engine/build-tool-detector.js +1 -8
- package/dist/engine/bundle-installer.js +2 -10
- package/dist/engine/cascade-hooks/core/append-releases.js +1 -0
- package/dist/engine/cascade-hooks/core/write-session-json.js +2 -2
- package/dist/engine/cascade-hooks/hooks/dispatch-hook-event.hook.d.ts +3 -1
- package/dist/engine/cascade-hooks/hooks/dispatch-hook-event.hook.js +12 -3
- package/dist/engine/cascade-hooks/hooks/estimate-calibration.hook.js +1 -0
- package/dist/engine/cascade-hooks/hooks/housekeeping-on-done.hook.js +2 -0
- package/dist/engine/cascade-hooks/hooks/implementing-kickoff.hook.js +5 -1
- package/dist/engine/cascade-hooks/hooks/lesson-drift.hook.js +1 -0
- package/dist/engine/cascade-hooks/hooks/orchestration-plan.hook.js +1 -0
- package/dist/engine/cascade-hooks/hooks/session-context.hook.js +4 -2
- package/dist/engine/cascade-hooks/hooks/slack-notify.hook.js +1 -0
- package/dist/engine/cascade-hooks/hooks/status-json.hook.js +2 -0
- package/dist/engine/cascade-hooks/hooks/velocity-profile.hook.js +2 -0
- package/dist/engine/cascade-hooks/runner.js +2 -0
- package/dist/engine/cascade-hooks/state-drift-detector.js +2 -0
- package/dist/engine/checkpoint/checkpoint-manager.js +2 -0
- package/dist/engine/checkpoint/policy-engine.js +1 -0
- package/dist/engine/ci-generator/stack-detector.js +2 -10
- package/dist/engine/clarification-gate/token-store.js +1 -0
- package/dist/engine/claude-config-auditor/claudemd-auditor.js +2 -10
- package/dist/engine/claude-config-auditor/settings-auditor.js +2 -10
- package/dist/engine/client-detection.js +2 -10
- package/dist/engine/compliance/auto-remediator.js +1 -0
- package/dist/engine/compliance/evidence-builder.d.ts +2 -2
- package/dist/engine/compliance/framework-catalog.d.ts +6 -6
- package/dist/engine/compliance/gap-analyzer.d.ts +2 -2
- package/dist/engine/config-health/build-tool-checker.js +1 -9
- package/dist/engine/config-health/ci-commands-collector.d.ts +2 -1
- package/dist/engine/config-health/ci-commands-collector.js +2 -9
- package/dist/engine/config-health/go-checker.js +1 -9
- package/dist/engine/config-health/mcp-config-checker.js +2 -10
- package/dist/engine/config-health/python-checker.js +1 -9
- package/dist/engine/config-health/rust-checker.js +1 -9
- package/dist/engine/config-health/ts-checker-scripts.js +1 -9
- package/dist/engine/config-health/ts-checker.js +1 -9
- package/dist/engine/context-artifacts/store.js +1 -0
- package/dist/engine/context-md-generator.js +1 -0
- package/dist/engine/context-orchestrator/index.js +2 -0
- package/dist/engine/convention-scanner/convention-parser.js +2 -9
- package/dist/engine/cost-guardrails.js +1 -0
- package/dist/engine/cost-tracking/ledger.js +1 -0
- package/dist/engine/criterion-identity.js +1 -1
- package/dist/engine/dashboard/data-loader.js +1 -0
- package/dist/engine/dashboard/drift-score.js +2 -0
- package/dist/engine/dashboard/spec-updater.d.ts +3 -1
- package/dist/engine/dashboard/spec-updater.js +9 -2
- package/dist/engine/dashboard/templates-layout.d.ts +2 -2
- package/dist/engine/dashboard/templates-layout.js +2 -9
- package/dist/engine/data-projects-gc/gc-runner.js +2 -4
- package/dist/engine/deleter/audit-logger.js +1 -0
- package/dist/engine/deleter/core.js +6 -0
- package/dist/engine/deleter/trash-manager.js +1 -0
- package/dist/engine/desktop-detector.js +1 -9
- package/dist/engine/detection-utils.d.ts +2 -1
- package/dist/engine/detection-utils.js +3 -10
- package/dist/engine/detectors/advanced-framework-detector/helpers.d.ts +3 -2
- package/dist/engine/detectors/advanced-framework-detector/helpers.js +3 -17
- package/dist/engine/detectors/cicd-detector.js +2 -10
- package/dist/engine/detectors/css-framework-detector.js +2 -10
- package/dist/engine/detectors/deployment-detector.js +3 -12
- package/dist/engine/detectors/frontend-perf-detector.js +2 -10
- package/dist/engine/detectors/gitops-detector.js +3 -11
- package/dist/engine/detectors/idp-detector.js +1 -3
- package/dist/engine/detectors/k3s-detector.js +3 -11
- package/dist/engine/detectors/llm-detector/file-readers.d.ts +2 -1
- package/dist/engine/detectors/llm-detector/file-readers.js +2 -9
- package/dist/engine/detectors/mfe-detector.js +5 -13
- package/dist/engine/detectors/monitoring-detector.js +2 -11
- package/dist/engine/detectors/monorepo-detector.d.ts +1 -0
- package/dist/engine/detectors/monorepo-detector.js +1 -10
- package/dist/engine/detectors/nomad-detector.js +3 -11
- package/dist/engine/detectors/otel-ecosystem-detectors.d.ts +2 -1
- package/dist/engine/detectors/otel-ecosystem-detectors.js +2 -10
- package/dist/engine/doc-generator/executive-summary/html-template.js +1 -7
- package/dist/engine/doc-generator/executive-summary/section-builders.js +1 -7
- package/dist/engine/doc-generator/per-spec-report/mermaid-renderer.js +1 -7
- package/dist/engine/doc-generator/per-spec-report/spec-section-builders.js +1 -7
- package/dist/engine/doc-generator/per-spec-report/technical-report.js +1 -7
- package/dist/engine/doc-generator/portal/analytics-page.js +1 -7
- package/dist/engine/doc-generator/portal/architecture-page.js +1 -7
- package/dist/engine/doc-generator/portal/changelog-page.js +1 -7
- package/dist/engine/doc-generator/portal/decision-page.js +1 -7
- package/dist/engine/doc-generator/portal/decision-timeline-builder.js +1 -7
- package/dist/engine/doc-generator/portal/kanban-view-builder.js +1 -7
- package/dist/engine/doc-generator/portal/portal-breadcrumbs.js +1 -7
- package/dist/engine/doc-generator/portal/portal-landing-cards.js +1 -7
- package/dist/engine/doc-generator/portal/portal-navbar.js +1 -7
- package/dist/engine/doc-generator/portal/portal-page-detector.d.ts +3 -0
- package/dist/engine/doc-generator/portal/portal-page-detector.js +1 -10
- package/dist/engine/doc-generator/portal/portal-regenerator.js +2 -0
- package/dist/engine/doc-generator/portal/risk-matrix-svg.js +1 -7
- package/dist/engine/doc-generator/portal/risk-page.js +1 -7
- package/dist/engine/doc-generator/portal/roadmap-page.js +1 -7
- package/dist/engine/doc-generator/proposal/proposal-gantt-builder.js +1 -7
- package/dist/engine/doc-generator/proposal/proposal-kpi-builder.js +1 -7
- package/dist/engine/doc-generator/proposal/proposal-section-builders-advanced.js +2 -8
- package/dist/engine/doc-generator/proposal/proposal-section-builders.js +1 -7
- package/dist/engine/docs-site-generator/html-templates.js +1 -7
- package/dist/engine/docs-site-generator/markdown-renderer.js +1 -7
- package/dist/engine/drift/violation-resolver.js +2 -0
- package/dist/engine/dynamic-knowledge/knowledge-cache.js +1 -0
- package/dist/engine/ecosystem-absorber/knowledge-cache.js +1 -0
- package/dist/engine/edge-db-detector.js +1 -10
- package/dist/engine/escalator/retry-counter.js +1 -0
- package/dist/engine/evidence-gates/artifact-reader.js +1 -0
- package/dist/engine/evidence-gates/evidence-autofill.js +1 -0
- package/dist/engine/evidence-gates/evidence-skeletons.js +1 -0
- package/dist/engine/evidence-gates/reconciliation-freshness.js +1 -0
- package/dist/engine/execution/durable-job-heartbeat-runtime.js +1 -0
- package/dist/engine/execution/job-runtime.js +2 -0
- package/dist/engine/execution/validate-job-executor.d.ts +1 -1
- package/dist/engine/execution/validate-job-executor.js +3 -0
- package/dist/engine/execution/validate-job-payload.js +1 -0
- package/dist/engine/execution/validate-worker-thread.js +1 -0
- package/dist/engine/facilitate/context-loader.js +1 -0
- package/dist/engine/figma/change-detector.d.ts +1 -8
- package/dist/engine/figma/code-connect-fetcher.d.ts +1 -7
- package/dist/engine/figma/design-enricher.d.ts +1 -17
- package/dist/engine/figma/design-enricher.js +0 -1
- package/dist/engine/figma/e2e-generator.d.ts +1 -23
- package/dist/engine/figma/flow-analyzer.d.ts +1 -11
- package/dist/engine/figma/frame-extractor.d.ts +1 -11
- package/dist/engine/figma/frame-extractor.js +3 -0
- package/dist/engine/figma/multi-file-manager.d.ts +1 -6
- package/dist/engine/figma/spec-generator.js +2 -0
- package/dist/engine/figma/thumbnail-fetcher.d.ts +1 -1
- package/dist/engine/figma/token-extractor.d.ts +1 -6
- package/dist/engine/figma/token-extractor.js +0 -1
- package/dist/engine/figma/version-tracker.d.ts +1 -7
- package/dist/engine/figma/version-tracker.js +0 -1
- package/dist/engine/figma/visual-qa.d.ts +5 -19
- package/dist/engine/figma/visual-qa.js +1 -2
- package/dist/engine/figma/webhook-manager.d.ts +1 -7
- package/dist/engine/frontmatter-sha/reseal.js +1 -0
- package/dist/engine/frontmatter-sha/verify-terminal.js +1 -0
- package/dist/engine/git-hook-injector.js +2 -10
- package/dist/engine/github/quality-dimensions.js +1 -3
- package/dist/engine/global-rules-manager.js +2 -3
- package/dist/engine/handoff-artifacts/implementation-review-reader.js +1 -0
- package/dist/engine/handoff-artifacts/io.js +2 -0
- package/dist/engine/handoff-packager.js +2 -1
- package/dist/engine/health/auto-fixer.js +1 -0
- package/dist/engine/hooks/context-injector.js +1 -0
- package/dist/engine/hooks-reconciler.js +1 -8
- package/dist/engine/impact-detector/index.js +2 -9
- package/dist/engine/implementation-contract/common.js +1 -3
- package/dist/engine/implementation-contract/evaluator.js +1 -3
- package/dist/engine/keyword-matcher/boundary.d.ts +2 -7
- package/dist/engine/keyword-matcher/boundary.js +2 -14
- package/dist/engine/lifecycle-reconciliation-io.js +1 -0
- package/dist/engine/lifecycle-reconciliation.js +3 -0
- package/dist/engine/local-first/detector.js +1 -9
- package/dist/engine/marketplace-fetcher/cache.js +2 -0
- package/dist/engine/marketplace-fetcher/index.js +1 -0
- package/dist/engine/mcp-config/mcp-config-writer.js +2 -10
- package/dist/engine/migrations/remove-commercial-state.js +2 -0
- package/dist/engine/mobile-detector-shared.d.ts +1 -1
- package/dist/engine/mobile-detector-shared.js +2 -9
- package/dist/engine/multi-channel-notifier.js +1 -0
- package/dist/engine/multi-teammate-review/disagreement-counter.js +1 -0
- package/dist/engine/multi-teammate-review/panel-orchestrator.js +1 -0
- package/dist/engine/onboarding-engine.js +1 -9
- package/dist/engine/permissions-merger/stack-detectors.js +2 -10
- package/dist/engine/pii-detector/core.js +1 -3
- package/dist/engine/platform-engineering/dx-analyzer.js +1 -10
- package/dist/engine/platform-engineering/idp-detector.js +2 -10
- package/dist/engine/project-dna/ai-tool-detector.js +2 -10
- package/dist/engine/project-dna/stack-detector.js +2 -10
- package/dist/engine/project-graph/builder.js +11 -2
- package/dist/engine/project-graph/cache.d.ts +5 -2
- package/dist/engine/project-graph/cache.js +174 -34
- package/dist/engine/project-graph/extractors/decision-store-extractor.js +1 -0
- package/dist/engine/project-graph/freshness-projection.js +3 -0
- package/dist/engine/project-graph/query.js +14 -11
- package/dist/engine/project-health-checker.js +2 -6
- package/dist/engine/provider-adapters/shared/spec-loader.js +1 -0
- package/dist/engine/quality-gates/gate-evaluator.js +1 -3
- package/dist/engine/react-detector.js +6 -14
- package/dist/engine/reconcile/apply-changes.js +1 -3
- package/dist/engine/registry/core.js +1 -0
- package/dist/engine/registry/loader.js +2 -0
- package/dist/engine/release/postmortem-generator.js +1 -0
- package/dist/engine/release/rollback-runner.d.ts +2 -2
- package/dist/engine/release/stuck-spec-detector.js +7 -0
- package/dist/engine/release-pipeline/release-spec-closer.js +3 -0
- package/dist/engine/rules-reconciler.d.ts +1 -1
- package/dist/engine/rules-reconciler.js +2 -9
- package/dist/engine/safety/atomic-writer.js +1 -0
- package/dist/engine/safety/cross-process-lock.js +2 -0
- package/dist/engine/safety/file-mutex.js +1 -0
- package/dist/engine/safety/lock-lease-store.js +1 -0
- package/dist/engine/safety/lock-scavenger.js +2 -0
- package/dist/engine/saga/transition-cascade.js +3 -0
- package/dist/engine/scan-project/index.js +1 -0
- package/dist/engine/scan-project/module-discoverer.js +1 -9
- package/dist/engine/schema-parity-auditor/handler-checker.js +1 -3
- package/dist/engine/schema-parity-auditor/index.js +1 -3
- package/dist/engine/schema-parity-auditor/type-checker.js +1 -3
- package/dist/engine/self-healing/strategies/coverage-fix.js +2 -10
- package/dist/engine/session-context-generator.d.ts +8 -0
- package/dist/engine/session-context-generator.js +33 -23
- package/dist/engine/session-state/session-artifact-refresher.d.ts +7 -0
- package/dist/engine/session-state/session-artifact-refresher.js +140 -0
- package/dist/engine/session-state/writer.d.ts +3 -0
- package/dist/engine/session-state/writer.js +35 -17
- package/dist/engine/shared-agent-memory.js +1 -0
- package/dist/engine/skill-adapter/index.js +3 -0
- package/dist/engine/skill-bootstrap/registry-fetcher.js +1 -0
- package/dist/engine/skill-bootstrap/skill-writer.js +2 -9
- package/dist/engine/skill-bootstrap/stack-matcher.js +1 -9
- package/dist/engine/skill-discovery/multi-agent-writer.d.ts +1 -0
- package/dist/engine/skill-discovery/multi-agent-writer.js +1 -9
- package/dist/engine/skill-generator/workflow-skill-generator.js +1 -0
- package/dist/engine/skill-registry/ttl-refresh.js +2 -0
- package/dist/engine/spec-audit/index.js +2 -0
- package/dist/engine/spec-audit/report-writer.js +1 -0
- package/dist/engine/spec-coverage/core.js +1 -0
- package/dist/engine/spec-decomposer/analyzer.js +1 -11
- package/dist/engine/spec-dependency-graph/dot-exporter.d.ts +1 -1
- package/dist/engine/spec-dependency-graph/graph-builder.d.ts +1 -20
- package/dist/engine/spec-dependency-graph/superseded-set.d.ts +1 -1
- package/dist/engine/spec-diff-engine.js +1 -7
- package/dist/engine/spec-format/read-technical-section.js +1 -3
- package/dist/engine/spec-format/replace-section.js +1 -3
- package/dist/engine/spec-format/spec-id.d.ts +9 -1
- package/dist/engine/spec-format/spec-id.js +24 -3
- package/dist/engine/spec-format/unified-spec-builder.js +1 -3
- package/dist/engine/spec-migrator/canonical-deduplicator.js +2 -0
- package/dist/engine/spec-observability/tracker.js +1 -0
- package/dist/engine/spec-registry/adapter.js +2 -10
- package/dist/engine/spec-registry/validator.d.ts +1 -0
- package/dist/engine/spec-registry/validator.js +1 -9
- package/dist/engine/spec-state-machine/transition-spec.js +1 -0
- package/dist/engine/spec-templates/custom-loader.js +1 -0
- package/dist/engine/stack-auditor/build-tool-auditor.js +1 -9
- package/dist/engine/staleness/stale-implementing.js +5 -14
- package/dist/engine/status-reconciler/index.js +4 -1
- package/dist/engine/structural-memory/helpers.js +1 -0
- package/dist/engine/supply-chain/slsa-checker.js +1 -9
- package/dist/engine/tdd-enforcer/stub-artifact-path.js +1 -0
- package/dist/engine/telemetry/health-checker.js +1 -0
- package/dist/engine/telemetry/telemetry-store.js +1 -0
- package/dist/engine/token-optimizer/response-cache.js +1 -3
- package/dist/engine/tool-groups/group-manager.js +2 -0
- package/dist/engine/update-notifier.js +1 -0
- package/dist/engine/validation/approved-spec-portability.js +1 -0
- package/dist/engine/validation/durable-validation.js +1 -0
- package/dist/engine/validation/validation-freshness.js +2 -0
- package/dist/engine/validation/validation-receipt.js +1 -0
- package/dist/engine/validation/validation-submission.d.ts +1 -1
- package/dist/engine/validation-evidence-ledger.js +1 -0
- package/dist/engine/validator/deep-code-checker.js +1 -3
- package/dist/engine/validator/executable-evidence.d.ts +1 -14
- package/dist/engine/validator/scope-resolver.d.ts +2 -2
- package/dist/engine/validator/spec-compliance-runner.d.ts +1 -31
- package/dist/engine/validator/validation-report-writer.js +1 -1
- package/dist/engine/validator.d.ts +1 -1
- package/dist/engine/validator.js +1 -0
- package/dist/engine/velocity/measure-velocity.js +2 -0
- package/dist/engine/version-resolver.js +1 -0
- package/dist/engine/workers/handlers/auto-drift.js +3 -0
- package/dist/engine/workspace-manager.js +4 -0
- package/dist/hosts/gemini/config-scaffold.js +2 -10
- package/dist/storage/approval-operation-lock.js +1 -0
- package/dist/storage/auto-promoter-config-store.js +1 -0
- package/dist/storage/autopilot-log-store.js +1 -0
- package/dist/storage/base-store.js +1 -0
- package/dist/storage/checkpoint-store.js +1 -0
- package/dist/storage/feedback-remote.js +1 -0
- package/dist/storage/gaps-log.js +1 -0
- package/dist/storage/global-projects-store.d.ts +17 -0
- package/dist/storage/global-projects-store.js +47 -0
- package/dist/storage/global-store.js +1 -0
- package/dist/storage/knowledge-store/sessions.js +2 -0
- package/dist/storage/migrations/canonical-storage.js +42 -18
- package/dist/storage/project-drift-store.js +1 -0
- package/dist/storage/project-identity.d.ts +27 -0
- package/dist/storage/project-identity.js +132 -2
- package/dist/storage/project-resolver.js +1 -17
- package/dist/storage/runtime-db.d.ts +2 -20
- package/dist/storage/runtime-db.js +2 -9
- package/dist/storage/semantic-index-store.js +1 -0
- package/dist/storage/sentry-store.js +1 -0
- package/dist/storage/session-state-store.js +1 -0
- package/dist/storage/spec-store.d.ts +31 -3
- package/dist/storage/spec-store.js +146 -5
- package/dist/storage/status-store/atomic-status-write.js +1 -0
- package/dist/storage/status-store/file-lock.js +1 -0
- package/dist/storage/status-store/self-healing.js +1 -0
- package/dist/storage/storage-bundle.d.ts +12 -2
- package/dist/storage/supabase-store.js +1 -0
- package/dist/storage/technology-selection-store.js +1 -0
- package/dist/storage/trash-store.d.ts +2 -4
- package/dist/storage/trash-store.js +2 -15
- package/dist/storage/vector-store/json-fallback.js +1 -0
- package/dist/storage/vector-store/migrator.js +1 -0
- package/dist/storage/vector-store/sqlite-adapter.js +1 -0
- package/dist/tools/audit-claude-config.js +1 -10
- package/dist/tools/challenge-spec-helpers.d.ts +1 -1
- package/dist/tools/challenge-spec-helpers.js +7 -2
- package/dist/tools/challenge-spec.js +11 -6
- package/dist/tools/check-readiness.js +121 -24
- package/dist/tools/clarify-requirements/multiple-choice.d.ts +3 -3
- package/dist/tools/configure-oauth-handler.js +1 -0
- package/dist/tools/create-spec-helpers.d.ts +1 -3
- package/dist/tools/create-spec-helpers.js +1 -8
- package/dist/tools/create-spec.js +1 -13
- package/dist/tools/dashboard.js +5 -0
- package/dist/tools/generate-execution-plan.js +10 -6
- package/dist/tools/github-pr-handler.js +1 -0
- package/dist/tools/github-release-handler.d.ts +1 -0
- package/dist/tools/github-release-handler.js +4 -3
- package/dist/tools/graph-specs.d.ts +1 -1
- package/dist/tools/heal-spec-docs.js +1 -3
- package/dist/tools/init-project/git-setup.d.ts +2 -2
- package/dist/tools/init-project/host-assets-writer.js +2 -10
- package/dist/tools/init-project/lifecycle-helpers.d.ts +2 -2
- package/dist/tools/init-project/lint-scaffolder.js +2 -10
- package/dist/tools/init-project/stack-detector.d.ts +2 -2
- package/dist/tools/reconcile-interactive-question-hooks.d.ts +2 -2
- package/dist/tools/register-sdd-tools.js +1 -0
- package/dist/tools/safe-handler.js +1 -0
- package/dist/tools/schemas/spec-id.d.ts +1 -6
- package/dist/tools/schemas/spec-id.js +1 -16
- package/dist/tools/tool-entry.d.ts +2 -2
- package/dist/tools/tool-entry.js +1 -1
- package/dist/tools/tool-registry/core-tools.d.ts +2 -2
- package/dist/tools/tool-registry/deprecated-stubs.d.ts +3 -3
- package/dist/tools/tool-registry/deprecated-stubs.js +1 -1
- package/dist/tools/triage-request.d.ts +2 -2
- package/dist/tools/update-status/approval-gates.d.ts +2 -2
- package/dist/tools/update-status/approval-gates.js +1 -0
- package/dist/tools/update-status/dod-gates.d.ts +1 -1
- package/dist/tools/update-status/done-receipt-verifier.d.ts +1 -1
- package/dist/tools/update-status/evidence-gate.js +5 -5
- package/dist/tools/update-status/file-sync.js +11 -39
- package/dist/tools/update-status/index.js +1 -1
- package/dist/tools/update-status/side-effects.js +5 -0
- package/dist/tools/update-status/transition-guard.d.ts +1 -1
- package/dist/tools/update-status/transition-guard.js +40 -8
- package/dist/tools/update-status-actions.js +28 -40
- package/dist/tools/validate-graph-coverage.js +14 -2
- package/dist/tools/validate.js +2 -0
- package/dist/transports/middleware/types.d.ts +3 -3
- package/dist/types/atomic-upgrade.d.ts +1 -1
- package/dist/types/cascade-hooks.d.ts +3 -0
- package/dist/types/cross-repo-search.d.ts +2 -0
- package/dist/types/dashboard.d.ts +4 -1
- package/dist/types/durable-job.d.ts +20 -0
- package/dist/types/durable-job.js +9 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/installation.d.ts +16 -0
- package/dist/types/installation.js +2 -0
- package/dist/types/project-knowledge-graph.d.ts +11 -0
- package/dist/types/session-checkpoint.d.ts +16 -0
- package/dist/types/spec-dependency-graph.d.ts +21 -0
- package/dist/types/spec-dependency-graph.js +2 -0
- package/dist/types/validation-evidence.d.ts +45 -0
- package/package.json +2 -2
- package/planu-plugin.json +1 -1
- package/dist/types/storage-bundle.d.ts +0 -13
- package/dist/types/storage-bundle.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// engine/spec-decomposer/analyzer.ts — Analyze spec content into work units (SPEC-157)
|
|
2
2
|
// Reads spec.md acceptance criteria and technical.md file lists, then groups
|
|
3
3
|
// criteria into independent work units suitable for parallel agent execution.
|
|
4
|
-
import { readFile } from 'node:fs/promises';
|
|
5
4
|
import { extractAcceptanceCriteria } from '../shared/ac-extractor.js';
|
|
5
|
+
import { readFileSafe as safeReadFile } from '../../core/shared/fs.js';
|
|
6
6
|
// ---------------------------------------------------------------------------
|
|
7
7
|
// Criterion classification
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
@@ -122,16 +122,6 @@ function categorize(criterion) {
|
|
|
122
122
|
// ---------------------------------------------------------------------------
|
|
123
123
|
// Public API
|
|
124
124
|
// ---------------------------------------------------------------------------
|
|
125
|
-
/** Read spec.md file and return its content, or empty string on error. */
|
|
126
|
-
async function safeReadFile(filePath) {
|
|
127
|
-
try {
|
|
128
|
-
return await readFile(filePath, 'utf-8');
|
|
129
|
-
/* v8 ignore next 3 */
|
|
130
|
-
}
|
|
131
|
-
catch {
|
|
132
|
-
return '';
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
125
|
/**
|
|
136
126
|
* Analyze spec content from disk and produce raw work units.
|
|
137
127
|
* Groups acceptance criteria by category heuristics.
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import type { Spec } from '../../types/index.js';
|
|
2
|
-
|
|
3
|
-
export interface GraphNode {
|
|
4
|
-
id: string;
|
|
5
|
-
status: string;
|
|
6
|
-
supersededBy?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface GraphEdge {
|
|
9
|
-
from: string;
|
|
10
|
-
to: string;
|
|
11
|
-
kind: EdgeKind;
|
|
12
|
-
}
|
|
13
|
-
export interface SupersedesCycleDiagnostic {
|
|
14
|
-
code: 'SUPERSEDES_CYCLE';
|
|
15
|
-
cycle: string[];
|
|
16
|
-
}
|
|
17
|
-
export interface SpecGraph {
|
|
18
|
-
nodes: GraphNode[];
|
|
19
|
-
edges: GraphEdge[];
|
|
20
|
-
diagnostics: SupersedesCycleDiagnostic[];
|
|
21
|
-
}
|
|
2
|
+
import type { SpecGraph } from '../../types/spec-dependency-graph.js';
|
|
22
3
|
/**
|
|
23
4
|
* Build a full SpecGraph from an array of specs.
|
|
24
5
|
* Ingests `supersedes`, `depends_on`, and legacy `dependencies` fields.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SpecGraph } from '
|
|
1
|
+
import type { SpecGraph } from '../../types/spec-dependency-graph.js';
|
|
2
2
|
/**
|
|
3
3
|
* Returns the set of spec IDs that appear as the target of a `supersedes` edge.
|
|
4
4
|
* These are specs that have been intentionally replaced and should be excluded
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// engine/spec-diff-engine.ts — SPEC-362: Visual Spec Diff & 3-way Merge
|
|
2
|
+
import { escapeHtml } from '../core/shared/strings.js';
|
|
2
3
|
// ---------------------------------------------------------------------------
|
|
3
4
|
// LCS-based line diff
|
|
4
5
|
// ---------------------------------------------------------------------------
|
|
@@ -151,13 +152,6 @@ export function computeVisualDiff(textA, textB, labelA = 'A', labelB = 'B') {
|
|
|
151
152
|
htmlOutput,
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
function escapeHtml(text) {
|
|
155
|
-
return text
|
|
156
|
-
.replace(/&/g, '&')
|
|
157
|
-
.replace(/</g, '<')
|
|
158
|
-
.replace(/>/g, '>')
|
|
159
|
-
.replace(/"/g, '"');
|
|
160
|
-
}
|
|
161
155
|
function buildHtmlDiff(diffLines, labelA, labelB) {
|
|
162
156
|
const rows = diffLines
|
|
163
157
|
.map((line) => {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// single source of truth for "give me the technical body for this spec":
|
|
6
6
|
// it extracts only the canonical inline `## Technical` section.
|
|
7
7
|
import { readFile } from 'node:fs/promises';
|
|
8
|
+
import { escapeRegex } from '../../core/shared/strings.js';
|
|
8
9
|
/**
|
|
9
10
|
* Read the `## Technical` section body from a spec's unified `spec.md`.
|
|
10
11
|
* Returns "" when the spec file is unreadable or the section is missing.
|
|
@@ -95,7 +96,4 @@ function maskFencedBlocks(body) {
|
|
|
95
96
|
}
|
|
96
97
|
return masked.join('');
|
|
97
98
|
}
|
|
98
|
-
function escapeRegex(input) {
|
|
99
|
-
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
100
|
-
}
|
|
101
99
|
//# sourceMappingURL=read-technical-section.js.map
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// positive heading matches inside fenced code blocks.
|
|
9
9
|
import { readFile } from 'node:fs/promises';
|
|
10
10
|
import { atomicWriteFile } from '../safety/atomic-write-file.js';
|
|
11
|
+
import { escapeRegex } from '../../core/shared/strings.js';
|
|
11
12
|
/**
|
|
12
13
|
* Replace the body of a top-level `## ${sectionName}` section in the given
|
|
13
14
|
* spec.md file with `newBody`. If the section does not yet exist it is
|
|
@@ -75,7 +76,4 @@ export async function replaceSectionInSpec(specPath, sectionName, newBody) {
|
|
|
75
76
|
function maskFencedBlocks(body) {
|
|
76
77
|
return body.replace(/(```|~~~)[\s\S]*?\1/g, (block) => block.replace(/[^\n]/g, ' '));
|
|
77
78
|
}
|
|
78
|
-
function escapeRegex(input) {
|
|
79
|
-
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
80
|
-
}
|
|
81
79
|
//# sourceMappingURL=replace-section.js.map
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SPEC_ID_PATTERN: RegExp;
|
|
3
|
+
export declare const SPEC_DIR_NAME_PATTERN: RegExp;
|
|
4
|
+
export declare const SpecIdSchema: z.ZodString;
|
|
5
|
+
export declare const SpecDirNameSchema: z.ZodString;
|
|
6
|
+
export declare function isCanonicalSpecId(value: string): boolean;
|
|
7
|
+
export declare function generateSpecId(existingSpecs: {
|
|
8
|
+
id: string;
|
|
9
|
+
}[]): string;
|
|
2
10
|
//# sourceMappingURL=spec-id.d.ts.map
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SPEC_ID_PATTERN = /^SPEC-\d+$/;
|
|
3
|
+
export const SPEC_DIR_NAME_PATTERN = /^SPEC-\d+(?:-[a-z0-9]+(?:-[a-z0-9]+)*)?$/;
|
|
4
|
+
export const SpecIdSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.min(1)
|
|
7
|
+
.max(50)
|
|
8
|
+
.regex(SPEC_ID_PATTERN, 'Spec ID must use canonical numeric format like SPEC-042.');
|
|
9
|
+
export const SpecDirNameSchema = z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(200)
|
|
13
|
+
.regex(SPEC_DIR_NAME_PATTERN, 'Spec directory must start with a canonical numeric ID like SPEC-042 or SPEC-042-my-feature.');
|
|
14
|
+
export function isCanonicalSpecId(value) {
|
|
15
|
+
return SPEC_ID_PATTERN.test(value);
|
|
16
|
+
}
|
|
17
|
+
export function generateSpecId(existingSpecs) {
|
|
18
|
+
const maxNum = existingSpecs.reduce((max, spec) => {
|
|
19
|
+
const match = /^SPEC-(\d+)$/.exec(spec.id);
|
|
20
|
+
const num = match?.[1] ? parseInt(match[1], 10) : 0;
|
|
21
|
+
return Math.max(max, num);
|
|
22
|
+
}, 0);
|
|
23
|
+
return `SPEC-${String(maxNum + 1).padStart(3, '0')}`;
|
|
24
|
+
}
|
|
4
25
|
//# sourceMappingURL=spec-id.js.map
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// two-file spec.md + technical.md pair only to be merged on the next list_specs run.
|
|
4
4
|
import { stripFrontmatter } from '../frontmatter-parser.js';
|
|
5
5
|
import { extractAcceptanceCriteriaTexts } from './acceptance-criteria.js';
|
|
6
|
+
import { escapeRegex } from '../../core/shared/strings.js';
|
|
6
7
|
const REQUIRED_SECTIONS = [
|
|
7
8
|
'Problem',
|
|
8
9
|
'Goal',
|
|
@@ -122,9 +123,6 @@ function demoteTopLevelHeadings(section) {
|
|
|
122
123
|
function stripFencedCodeBlocks(body) {
|
|
123
124
|
return body.replace(/```[\s\S]*?```/g, '').replace(/~~~[\s\S]*?~~~/g, '');
|
|
124
125
|
}
|
|
125
|
-
function escapeRegex(input) {
|
|
126
|
-
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
127
|
-
}
|
|
128
126
|
/**
|
|
129
127
|
* Extract a top-level (`## `) section from a body, returning the heading line
|
|
130
128
|
* plus its content up to the next top-level heading (or EOF). Returns null
|
|
@@ -3,7 +3,9 @@ import { createHash } from 'node:crypto';
|
|
|
3
3
|
import { mkdir as mkdirFs, readFile as readFileFs } from 'node:fs/promises';
|
|
4
4
|
import { join, relative, resolve } from 'node:path';
|
|
5
5
|
import { atomicWriteFile } from '../safety/atomic-write-file.js';
|
|
6
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
6
7
|
import { projectDataDir } from '../../storage/base-store.js';
|
|
8
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
7
9
|
import { invalidateSpecsCache, validateCanonicalSpecRows, withCanonicalSpecRepairLock, } from '../../storage/spec-store.js';
|
|
8
10
|
function digest(value) {
|
|
9
11
|
return createHash('sha256').update(value).digest('hex');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// engine/spec-observability/tracker.ts — SpecUsageTracker (SPEC-158)
|
|
2
2
|
// Records spec access events fire-and-forget — zero latency impact on callers.
|
|
3
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
3
4
|
import { recordSpecAccess } from '../../storage/spec-observability-store.js';
|
|
4
5
|
// ---------------------------------------------------------------------------
|
|
5
6
|
// Spec ID extraction helpers
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { technologyValue } from '../technology-registry.js';
|
|
2
|
+
import { fileExists } from '../../core/shared/fs.js';
|
|
2
3
|
/**
|
|
3
4
|
* Stack detection and spec adaptation for registry specs.
|
|
4
5
|
* Detects project technology stack from config files and applies
|
|
5
6
|
* framework-specific substitutions to spec content.
|
|
6
7
|
*/
|
|
7
|
-
import { readFile,
|
|
8
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
8
9
|
import { join } from 'node:path';
|
|
9
10
|
// ---------------------------------------------------------------------------
|
|
10
11
|
// Helpers
|
|
11
12
|
// ---------------------------------------------------------------------------
|
|
12
|
-
async function fileExists(filePath) {
|
|
13
|
-
try {
|
|
14
|
-
await access(filePath);
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
13
|
/* v8 ignore start -- safe file readers, catch branches are defensive */
|
|
22
14
|
async function readJsonSafe(filePath) {
|
|
23
15
|
try {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Validates a spec directory before publishing to the registry.
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
|
+
import { fileExists } from '../../core/shared/fs.js';
|
|
5
6
|
/** Maximum total size of all spec files combined (500 KB). */
|
|
6
7
|
const MAX_TOTAL_SIZE = 500 * 1024;
|
|
7
8
|
/** Semver regex (simplified: major.minor.patch with optional pre-release). */
|
|
@@ -132,13 +133,4 @@ async function validateTotalSize(specDir, errors) {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
/** Check if a file exists at the given path. */
|
|
135
|
-
async function fileExists(filePath) {
|
|
136
|
-
try {
|
|
137
|
-
await fs.access(filePath);
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
136
|
//# sourceMappingURL=validator.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// engine/spec-state-machine/transition-spec.ts — SPEC-720
|
|
2
2
|
// Single, authoritative store-side entry point for all status writes.
|
|
3
3
|
// MUST only be called from src/tools/update-status/index.ts (enforced by ESLint).
|
|
4
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
4
5
|
import { specStore } from '../../storage/index.js';
|
|
5
6
|
// ---------------------------------------------------------------------------
|
|
6
7
|
// Core transition
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { readdir, readFile } from 'node:fs/promises';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
7
8
|
import { resolvedStorageArtifactPath } from '../../storage/storage-catalog.js';
|
|
8
9
|
/** Zod schema for validating custom template JSON files. */
|
|
9
10
|
const templateVariableSchema = z.object({
|
|
@@ -2,20 +2,12 @@
|
|
|
2
2
|
// Detects build-tool anti-patterns in audit_stack.
|
|
3
3
|
// C14: Webpack 4 EOL → high severity finding
|
|
4
4
|
// C15: require() CJS in ESM-first project → high severity finding
|
|
5
|
-
import { readFile } from 'node:fs/promises';
|
|
6
5
|
import { join } from 'node:path';
|
|
7
6
|
import { glob } from 'glob';
|
|
7
|
+
import { readFileSafe } from '../../core/shared/fs.js';
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
9
9
|
// Helpers
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
|
-
async function readFileSafe(filePath) {
|
|
12
|
-
try {
|
|
13
|
-
return await readFile(filePath, 'utf-8');
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return '';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
11
|
function parseVersionMajor(version) {
|
|
20
12
|
if (!version) {
|
|
21
13
|
return null;
|
|
@@ -2,23 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Finds specs in 'implementing' status that have been there for >N days and have
|
|
4
4
|
// no progress.md file. These are candidates for "done but untransitioned".
|
|
5
|
-
import {
|
|
5
|
+
import { readdir } from 'node:fs/promises';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
|
-
|
|
7
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
8
8
|
import { hashProjectPath } from '../../storage/base-store.js';
|
|
9
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
9
10
|
import { readTransitionLog } from '../../storage/transition-log.js';
|
|
10
|
-
|
|
11
|
-
// Helpers
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
async function fileExists(p) {
|
|
14
|
-
try {
|
|
15
|
-
await access(p, constants.F_OK);
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
11
|
+
import { fileExists } from '../../core/shared/fs.js';
|
|
22
12
|
async function getLastTransitionForSpec(projectId, specId) {
|
|
23
13
|
const entries = await readTransitionLog(projectId, specId);
|
|
24
14
|
let lastAt = null;
|
|
@@ -54,6 +44,7 @@ async function getDaysInImplementing(projectId, specId) {
|
|
|
54
44
|
export async function findStaleImplementing(params) {
|
|
55
45
|
const { projectPath, daysThreshold = 7 } = params;
|
|
56
46
|
const projectId = hashProjectPath(projectPath);
|
|
47
|
+
// eslint-disable-next-line no-restricted-syntax -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
57
48
|
const { specStore } = await import('../../storage/index.js').catch(() => ({ specStore: null }));
|
|
58
49
|
if (!specStore) {
|
|
59
50
|
return [];
|
|
@@ -133,8 +133,11 @@ export async function reconcileStatusFromDisk(projectPath, projectId) {
|
|
|
133
133
|
}
|
|
134
134
|
// Log to autopilot for observability (best-effort)
|
|
135
135
|
try {
|
|
136
|
+
// eslint-disable-next-line no-restricted-syntax -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
136
137
|
const { appendAutopilotLogEntry } = await import('../../storage/autopilot-log-store.js');
|
|
137
|
-
const resolvedProjectId =
|
|
138
|
+
const resolvedProjectId =
|
|
139
|
+
// eslint-disable-next-line no-restricted-syntax -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
140
|
+
projectId ?? (await import('../../storage/base-store.js')).hashProjectPath(projectPath);
|
|
138
141
|
await appendAutopilotLogEntry(resolvedProjectId, {
|
|
139
142
|
specId: 'system',
|
|
140
143
|
hookName: 'status_json_reconcile',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isAbsolute, normalize, relative, resolve } from 'node:path';
|
|
2
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
2
3
|
import { hashProjectPath } from '../../storage/base-store.js';
|
|
3
4
|
import { getProjectGraphFreshness, loadProjectGraphPolicy, readProjectGraph, } from '../project-graph/cache.js';
|
|
4
5
|
export function resolveProjectId(input) {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { readFile } from 'node:fs/promises';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { glob } from 'glob';
|
|
8
|
+
import { readFileSafe } from '../../core/shared/fs.js';
|
|
8
9
|
// SLSA GitHub Generator workflow action
|
|
9
10
|
const SLSA_GENERATOR_ACTION = 'slsa-framework/slsa-github-generator';
|
|
10
11
|
// Actions/tools that provide SLSA L2 provenance
|
|
@@ -23,15 +24,6 @@ const SLSA_REFS = [
|
|
|
23
24
|
// Both formats are valid; v1 is preferred for new setups.
|
|
24
25
|
const SLSA_PROVENANCE_V1_FORMAT = 'slsa.dev/provenance/v1';
|
|
25
26
|
const SLSA_PROVENANCE_V02_FORMAT = 'slsa.dev/provenance/v0.2';
|
|
26
|
-
/** Read a file and return its content, or empty string on error. */
|
|
27
|
-
async function readFileSafe(filePath) {
|
|
28
|
-
try {
|
|
29
|
-
return await readFile(filePath, 'utf-8');
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return '';
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
27
|
/** Find all GitHub Actions workflow files. */
|
|
36
28
|
async function findWorkflowFiles(projectPath) {
|
|
37
29
|
try {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
2
3
|
import { hashProjectPath, projectDataDir } from '../../storage/base-store.js';
|
|
3
4
|
export function resolveTddStubArtifactPath(specId, projectPath) {
|
|
4
5
|
const projectId = hashProjectPath(projectPath);
|
|
@@ -4,6 +4,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { isTelemetryEnabled } from './telemetry-store.js';
|
|
6
6
|
import { sendTelemetryEvent } from './telemetry-client.js';
|
|
7
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
7
8
|
import { hashProjectPath, projectDataDir } from '../../storage/base-store.js';
|
|
8
9
|
import { networkFetch, withNetworkConsent } from '../network-policy.js';
|
|
9
10
|
const NETWORK_TIMEOUT_MS = 5_000;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Stores opt-in preference and installation ID outside the project directory.
|
|
4
4
|
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
6
7
|
import { resolveStorageLayout } from '../../storage/storage-layout.js';
|
|
7
8
|
const PLANU_DIR = resolveStorageLayout().config;
|
|
8
9
|
const TELEMETRY_FILE = join(PLANU_DIR, 'telemetry.json');
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
// engine/token-optimizer/response-cache.ts — LRU cache with content-hash keys (SPEC-082 AC-02, AC-10)
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { countTokens } from './counter.js';
|
|
4
|
+
import { escapeRegex } from '../../core/shared/strings.js';
|
|
4
5
|
const DEFAULT_CACHE_CONFIG = {
|
|
5
6
|
defaultTtlMs: 5 * 60 * 1000, // 5 minutes
|
|
6
7
|
maxEntries: 100,
|
|
7
8
|
maxPersistentSizeMb: 5,
|
|
8
9
|
persistMinTtlMs: 60 * 60 * 1000, // 1 hour
|
|
9
10
|
};
|
|
10
|
-
function escapeRegex(input) {
|
|
11
|
-
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
12
|
-
}
|
|
13
11
|
/**
|
|
14
12
|
* In-memory LRU response cache with content-hash keys and TTL support.
|
|
15
13
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
1
2
|
import { readJson, writeJson } from '../../storage/base-store.js';
|
|
2
3
|
import toolGroupsConfigJson from '../../config/tool-groups.json' with { type: 'json' };
|
|
4
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
3
5
|
import { resolvedStorageArtifactPath } from '../../storage/storage-catalog.js';
|
|
4
6
|
const toolGroupsConfig = toolGroupsConfigJson;
|
|
5
7
|
export class GroupManager {
|
|
@@ -5,6 +5,7 @@ import { get } from 'node:https';
|
|
|
5
5
|
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { PLANU_VERSION } from '../config/version.js';
|
|
8
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
8
9
|
import { resolveStorageLayout } from '../storage/storage-layout.js';
|
|
9
10
|
import { assertNetworkAllowed } from './network-policy.js';
|
|
10
11
|
const NPM_REGISTRY_URL = 'https://registry.npmjs.org/@planu%2Fcli/latest';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { access, readFile } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { atomicWriteFile } from '../safety/atomic-write-file.js';
|
|
4
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
4
5
|
import { projectDataDir } from '../../storage/base-store.js';
|
|
5
6
|
import { PROJECT_ID as CANONICAL_PROJECT_ID } from './validation-receipt-codec.js';
|
|
6
7
|
import { parseGroundedTechnicalPaths } from '../spec-grounding/contract.js';
|
|
@@ -3,6 +3,7 @@ import { createHash } from 'node:crypto';
|
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
4
|
import { basename, join } from 'node:path';
|
|
5
5
|
import { runAbortableProcess } from '../abortable-process-runner.js';
|
|
6
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
6
7
|
import { projectDataDir } from '../../storage/base-store.js';
|
|
7
8
|
import { atomicWriteFile } from '../safety/atomic-write-file.js';
|
|
8
9
|
import { evidenceArtifactCollectionDigest, evidenceArtifactDigest, } from '../evidence-gates/artifact-reader.js';
|
|
@@ -55,7 +55,9 @@ import { createHash, randomUUID } from 'node:crypto';
|
|
|
55
55
|
import { constants, watch } from 'node:fs';
|
|
56
56
|
import { lstat, mkdir, open, readdir } from 'node:fs/promises';
|
|
57
57
|
import { basename, join } from 'node:path';
|
|
58
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
58
59
|
import { RuntimeDatabase } from '../../storage/runtime-db.js';
|
|
60
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
59
61
|
import { resolveStorageLayout } from '../../storage/storage-layout.js';
|
|
60
62
|
import { ValidationReceiptStore } from './validation-receipt.js';
|
|
61
63
|
import { isValidationSourcePath } from './validation-source-policy.js';
|
|
@@ -3,6 +3,7 @@ import { chmod, mkdir, open, readFile, rename, unlink } from 'node:fs/promises';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { TextDecoder } from 'node:util';
|
|
5
5
|
import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
|
|
6
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
6
7
|
import { resolvedStorageArtifactPath, } from '../../storage/storage-catalog.js';
|
|
7
8
|
import { formatSecretReference, getSecretProvider, parseSecretReference, SecretProviderError, } from '../../security/secret-provider.js';
|
|
8
9
|
import { redactText } from '../../security/redactor.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DurableJobRuntime } from '../execution/job-runtime.js';
|
|
2
|
-
import type { DurableJobRecord } from '../../
|
|
2
|
+
import type { DurableJobRecord } from '../../types/durable-job.js';
|
|
3
3
|
import type { DurableValidationBindings } from '../../types/durable-validation.js';
|
|
4
4
|
import type { ValidationArtifactDigests, ValidationFreshnessLease } from '../../types/validation-receipt.js';
|
|
5
5
|
/** Stable identity for exactly one immutable validation input tuple. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
2
|
import { existsSync, lstatSync, mkdirSync, linkSync, appendFileSync, readFileSync, unlinkSync, writeFileSync, } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
4
5
|
import { projectDataDir } from '../storage/base-store.js';
|
|
5
6
|
import { VALIDATION_EVIDENCE_SCHEMA_VERSION, } from '../types/validation-evidence.js';
|
|
6
7
|
import { digestValidationPaths, resolveValidationToolchain } from './validation-evidence-digest.js';
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
import { readFile, stat } from 'node:fs/promises';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { glob } from 'glob';
|
|
6
|
+
import { escapeRegex } from '../../core/shared/strings.js';
|
|
6
7
|
const DEFAULT_IGNORE = ['node_modules/**', 'dist/**', 'build/**', '.git/**', 'coverage/**'];
|
|
7
|
-
function escapeRegex(input) {
|
|
8
|
-
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
9
|
-
}
|
|
10
8
|
// ─── Numeric literal normalization (SPEC-1367) ───────────────────────────────
|
|
11
9
|
// Grounds criteria whose THEN names an explicit numeric timeout (e.g. "45_000")
|
|
12
10
|
// against test files that may spell the same literal without underscores (or
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
path: string;
|
|
3
|
-
}
|
|
4
|
-
export interface EvidenceScenario {
|
|
5
|
-
title: string;
|
|
6
|
-
tests: EvidenceTestLink[];
|
|
7
|
-
}
|
|
8
|
-
export type ExecutableEvidenceSource = 'frontmatter' | 'criteria' | 'none';
|
|
9
|
-
export interface ExecutableEvidence {
|
|
10
|
-
source: ExecutableEvidenceSource;
|
|
11
|
-
scenarios: EvidenceScenario[];
|
|
12
|
-
unmappedCriteria: string[];
|
|
13
|
-
ignoredCriteriaTitles: string[];
|
|
14
|
-
}
|
|
1
|
+
import type { ExecutableEvidence } from '../../types/validation-evidence.js';
|
|
15
2
|
/**
|
|
16
3
|
* Single evidence normalizer shared by spec-compliance-runner.ts and
|
|
17
4
|
* readiness-checker.ts (SPEC-1214). Frontmatter `scenarios` stay canonical when
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Spec } from '../../types/spec/core.js';
|
|
2
2
|
export type Dimension = 'tests' | 'lint' | 'typecheck' | 'security-scan' | 'spec-compliance';
|
|
3
|
-
export type
|
|
3
|
+
export type ScopeSkipReason = 'doc-only-scope' | 'meta-target' | 'no-source-files' | 'spec-config';
|
|
4
4
|
export interface SkippedDimension {
|
|
5
5
|
dimension: Dimension;
|
|
6
|
-
reason:
|
|
6
|
+
reason: ScopeSkipReason;
|
|
7
7
|
}
|
|
8
8
|
export interface ResolvedDimensions {
|
|
9
9
|
applicable: Dimension[];
|
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
import type { Spec } from '../../types/index.js';
|
|
2
|
-
|
|
3
|
-
export interface ScenarioTestLink {
|
|
4
|
-
path: string;
|
|
5
|
-
line?: number;
|
|
6
|
-
runner?: string;
|
|
7
|
-
config?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ScenarioStep {
|
|
11
|
-
keyword: string;
|
|
12
|
-
text: string;
|
|
13
|
-
}
|
|
14
|
-
export interface FrontmatterScenario {
|
|
15
|
-
title: string;
|
|
16
|
-
done: boolean;
|
|
17
|
-
tests?: ScenarioTestLink[];
|
|
18
|
-
steps?: ScenarioStep[];
|
|
19
|
-
}
|
|
20
|
-
export interface PerScenarioResult {
|
|
21
|
-
title: string;
|
|
22
|
-
verdict: ScenarioVerdict;
|
|
23
|
-
evidence: string[];
|
|
24
|
-
unverifiable?: true;
|
|
25
|
-
}
|
|
26
|
-
export interface SpecComplianceResult {
|
|
27
|
-
dimensionScore: number;
|
|
28
|
-
perScenario: PerScenarioResult[];
|
|
29
|
-
command: string;
|
|
30
|
-
evidenceSource?: 'frontmatter' | 'criteria' | 'none';
|
|
31
|
-
ignoredCriteriaTitles?: string[];
|
|
32
|
-
}
|
|
2
|
+
import type { FrontmatterScenario, SpecComplianceResult } from '../../types/validation-evidence.js';
|
|
33
3
|
/** A sanitized terminal adapter failure that cannot be mistaken for a failed test verdict. */
|
|
34
4
|
export declare class ComplianceCommandTerminalError extends Error {
|
|
35
5
|
readonly code: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendArtifact, readArtifact } from '../handoff-artifacts/io.js';
|
|
2
|
-
import { runSpecCompliance
|
|
2
|
+
import { runSpecCompliance } from './spec-compliance-runner.js';
|
|
3
3
|
export const AUTOMATED_VALIDATOR_AGENT = 'planu-automated-validator';
|
|
4
4
|
export async function writeImplementationReviewReport(input) {
|
|
5
5
|
const specCompliance = await runSpecCompliance(input.spec, input.projectPath, input.signal, input.projectId);
|
|
@@ -2,7 +2,7 @@ import type { Spec, ValidateResult, DriftReport } from '../types/index.js';
|
|
|
2
2
|
export { generateDoR, generateDoD } from './validator/dor-dod.js';
|
|
3
3
|
export { generateChecklist } from './validator/checklist.js';
|
|
4
4
|
export { resolveApplicableDimensions, normaliseScore } from './validator/scope-resolver.js';
|
|
5
|
-
export type { Dimension,
|
|
5
|
+
export type { Dimension, ScopeSkipReason, SkippedDimension, ResolvedDimensions, } from './validator/scope-resolver.js';
|
|
6
6
|
export { buildHolisticReportFromFlatScore } from './validator/holistic-report.js';
|
|
7
7
|
export type { HolisticValidateReport } from '../types/analysis.js';
|
|
8
8
|
/**
|
package/dist/engine/validator.js
CHANGED
|
@@ -9,6 +9,7 @@ import { resolveApplicableDimensions } from './validator/scope-resolver.js';
|
|
|
9
9
|
import { buildHolisticReportFromFlatScore } from './validator/holistic-report.js';
|
|
10
10
|
import { readEvidenceArtifacts, traceabilityRowHasCurrentCommandEvidence, traceabilityRowHasCurrentTestEvidence, } from './evidence-gates/artifact-reader.js';
|
|
11
11
|
import { createCriterionIdentity, hasExplicitCriterionId, normalizeCriterionText, } from './criterion-identity.js';
|
|
12
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
12
13
|
import { hashProjectPath } from '../storage/base-store.js';
|
|
13
14
|
// Re-export the full public API so external callers never need to know
|
|
14
15
|
// about the sub-module layout.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// engine/velocity/measure-velocity.ts — Compute VelocityProfile from real project actuals (SPEC-555)
|
|
2
2
|
// Pure async function: reads specs from storage, computes calibrated day estimates.
|
|
3
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
3
4
|
import { hashProjectPath } from '../../storage/index.js';
|
|
5
|
+
// eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
|
|
4
6
|
import { listSpecs } from '../../storage/spec-store.js';
|
|
5
7
|
// ---------------------------------------------------------------------------
|
|
6
8
|
// Default profile used when insufficient data is available
|