@devtrack-solution/codesdd 1.2.2 → 1.2.3
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/.sdd/skills/curated/api-clean-flask-langgraph/SKILL.md +17 -17
- package/.sdd/skills/curated/devtrack-api/SKILL.md +160 -28
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +1 -1
- package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +8 -7
- package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +93 -0
- package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +317 -0
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +95 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +295 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +4 -4
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +4 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +2 -2
- package/LICENSE +1 -1
- package/README.md +243 -51
- package/bin/codesdd.js +3 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +11 -558
- package/dist/cli/program.d.ts +14 -0
- package/dist/cli/program.js +645 -0
- package/dist/commands/change.js +5 -5
- package/dist/commands/completion.d.ts +1 -1
- package/dist/commands/completion.js +9 -2
- package/dist/commands/config.js +159 -20
- package/dist/commands/feedback.js +1 -1
- package/dist/commands/schema.d.ts +63 -0
- package/dist/commands/schema.js +12 -12
- package/dist/commands/sdd/backlog.d.ts +3 -0
- package/dist/commands/sdd/backlog.js +54 -0
- package/dist/commands/sdd/execution.js +147 -16
- package/dist/commands/sdd/plugin.d.ts +3 -0
- package/dist/commands/sdd/plugin.js +153 -0
- package/dist/commands/sdd/shared.js +2 -23
- package/dist/commands/sdd/skills.js +7 -0
- package/dist/commands/sdd.js +69 -12
- package/dist/commands/spec.js +9 -9
- package/dist/commands/validate.js +6 -6
- package/dist/commands/workflow/instructions.js +6 -6
- package/dist/commands/workflow/new-change.js +3 -3
- package/dist/commands/workflow/shared.d.ts +1 -1
- package/dist/commands/workflow/shared.js +4 -4
- package/dist/core/archive.js +15 -5
- package/dist/core/artifact-graph/instruction-loader.d.ts +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +3 -3
- package/dist/core/artifact-graph/resolver.d.ts +4 -4
- package/dist/core/artifact-graph/resolver.js +6 -6
- package/dist/core/branding.js +3 -3
- package/dist/core/cli/command-matrix.js +10 -1
- package/dist/core/cli-command-quality.d.ts +27 -0
- package/dist/core/cli-command-quality.js +171 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +1 -1
- package/dist/core/command-generation/adapters/costrict.js +2 -2
- package/dist/core/command-generation/types.d.ts +1 -1
- package/dist/core/completions/command-registry.d.ts +1 -1
- package/dist/core/completions/command-registry.js +155 -12
- package/dist/core/completions/completion-provider.d.ts +14 -1
- package/dist/core/completions/completion-provider.js +29 -1
- package/dist/core/completions/generators/bash-generator.d.ts +1 -1
- package/dist/core/completions/generators/bash-generator.js +20 -12
- package/dist/core/completions/generators/fish-generator.d.ts +9 -1
- package/dist/core/completions/generators/fish-generator.js +39 -25
- package/dist/core/completions/generators/powershell-generator.d.ts +1 -1
- package/dist/core/completions/generators/powershell-generator.js +21 -11
- package/dist/core/completions/generators/zsh-generator.d.ts +3 -6
- package/dist/core/completions/generators/zsh-generator.js +21 -42
- package/dist/core/completions/installers/bash-installer.js +6 -6
- package/dist/core/completions/installers/fish-installer.js +1 -1
- package/dist/core/completions/installers/powershell-installer.js +14 -14
- package/dist/core/completions/installers/zsh-installer.d.ts +7 -1
- package/dist/core/completions/installers/zsh-installer.js +36 -8
- package/dist/core/completions/templates/bash-templates.d.ts +1 -1
- package/dist/core/completions/templates/bash-templates.js +12 -6
- package/dist/core/completions/templates/fish-templates.d.ts +2 -2
- package/dist/core/completions/templates/fish-templates.js +20 -9
- package/dist/core/completions/templates/powershell-templates.d.ts +1 -1
- package/dist/core/completions/templates/powershell-templates.js +13 -4
- package/dist/core/completions/templates/zsh-templates.d.ts +1 -1
- package/dist/core/completions/templates/zsh-templates.js +18 -9
- package/dist/core/config-schema.d.ts +3 -1
- package/dist/core/config-schema.js +26 -1
- package/dist/core/config.d.ts +3 -3
- package/dist/core/config.js +4 -4
- package/dist/core/global-config.d.ts +41 -12
- package/dist/core/global-config.js +344 -27
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/init.d.ts +6 -1
- package/dist/core/init.js +99 -77
- package/dist/core/legacy-cleanup.d.ts +17 -17
- package/dist/core/legacy-cleanup.js +96 -79
- package/dist/core/list.js +18 -4
- package/dist/core/migration.d.ts +3 -1
- package/dist/core/migration.js +7 -8
- package/dist/core/parsers/change-parser.js +1 -1
- package/dist/core/parsers/markdown-parser.js +2 -2
- package/dist/core/profile-sync-drift.d.ts +1 -1
- package/dist/core/profile-sync-drift.js +13 -13
- package/dist/core/project-config.d.ts +4 -4
- package/dist/core/project-config.js +11 -11
- package/dist/core/schemas/change.schema.d.ts +1 -1
- package/dist/core/schemas/change.schema.js +1 -1
- package/dist/core/schemas/spec.schema.d.ts +1 -1
- package/dist/core/schemas/spec.schema.js +1 -1
- package/dist/core/sdd/adr.js +23 -1
- package/dist/core/sdd/agent-binding.d.ts +346 -0
- package/dist/core/sdd/agent-binding.js +343 -0
- package/dist/core/sdd/backlog-cli.d.ts +16 -0
- package/dist/core/sdd/backlog-cli.js +146 -0
- package/dist/core/sdd/backlog-conflict-policy.d.ts +58 -0
- package/dist/core/sdd/backlog-conflict-policy.js +230 -0
- package/dist/core/sdd/backlog-projection.d.ts +8 -0
- package/dist/core/sdd/backlog-projection.js +89 -0
- package/dist/core/sdd/backlog-provider-contract.d.ts +252 -0
- package/dist/core/sdd/backlog-provider-contract.js +158 -0
- package/dist/core/sdd/bootstrap.js +2 -2
- package/dist/core/sdd/check.d.ts +42 -0
- package/dist/core/sdd/check.js +22 -22
- package/dist/core/sdd/contract.d.ts +13 -0
- package/dist/core/sdd/contract.js +36 -0
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +38 -0
- package/dist/core/sdd/coordination/coordination-adapters.js +139 -1
- package/dist/core/sdd/deepagent-contracts.d.ts +276 -0
- package/dist/core/sdd/deepagent-contracts.js +173 -0
- package/dist/core/sdd/deepagents/adr-governor.d.ts +2 -0
- package/dist/core/sdd/deepagents/adr-governor.js +30 -0
- package/dist/core/sdd/deepagents/backend.d.ts +63 -0
- package/dist/core/sdd/deepagents/backend.js +174 -0
- package/dist/core/sdd/deepagents/codesdd-tools.d.ts +39 -0
- package/dist/core/sdd/deepagents/codesdd-tools.js +83 -0
- package/dist/core/sdd/deepagents/evidence-mapper.d.ts +86 -0
- package/dist/core/sdd/deepagents/evidence-mapper.js +178 -0
- package/dist/core/sdd/deepagents/model-provider.d.ts +53 -0
- package/dist/core/sdd/deepagents/model-provider.js +379 -0
- package/dist/core/sdd/deepagents/policy-enforcement.d.ts +30 -0
- package/dist/core/sdd/deepagents/policy-enforcement.js +90 -0
- package/dist/core/sdd/deepagents/policy.d.ts +75 -0
- package/dist/core/sdd/deepagents/policy.js +358 -0
- package/dist/core/sdd/deepagents/quality-witness.d.ts +3 -0
- package/dist/core/sdd/deepagents/quality-witness.js +77 -0
- package/dist/core/sdd/deepagents/reversa-subagents.d.ts +75 -0
- package/dist/core/sdd/deepagents/reversa-subagents.js +182 -0
- package/dist/core/sdd/deepagents/runtime-factory.d.ts +90 -0
- package/dist/core/sdd/deepagents/runtime-factory.js +231 -0
- package/dist/core/sdd/deepagents/runtime-loader.d.ts +16 -0
- package/dist/core/sdd/deepagents/runtime-loader.js +65 -0
- package/dist/core/sdd/default-bootstrap-files.d.ts +2 -2
- package/dist/core/sdd/default-bootstrap-files.js +36 -2
- package/dist/core/sdd/default-skills.d.ts +30 -0
- package/dist/core/sdd/default-skills.js +181 -5
- package/dist/core/sdd/devtrack-api-appliance.d.ts +84 -0
- package/dist/core/sdd/devtrack-api-appliance.js +257 -0
- package/dist/core/sdd/devtrack-api-architecture.d.ts +31 -0
- package/dist/core/sdd/devtrack-api-architecture.js +608 -0
- package/dist/core/sdd/devtrack-api-import-boundary.d.ts +19 -0
- package/dist/core/sdd/devtrack-api-import-boundary.js +32 -0
- package/dist/core/sdd/diagnose.d.ts +59 -0
- package/dist/core/sdd/diagnose.js +37 -37
- package/dist/core/sdd/docs-sync.js +33 -5
- package/dist/core/sdd/domain/post-active-validation.d.ts +7 -0
- package/dist/core/sdd/domain/post-active-validation.js +61 -0
- package/dist/core/sdd/domain/transition-engine.js +1 -0
- package/dist/core/sdd/entity-reference.d.ts +5 -0
- package/dist/core/sdd/entity-reference.js +22 -0
- package/dist/core/sdd/governance-backfill.d.ts +31 -0
- package/dist/core/sdd/governance-backfill.js +359 -0
- package/dist/core/sdd/governance-parser.d.ts +21 -0
- package/dist/core/sdd/governance-parser.js +91 -0
- package/dist/core/sdd/governance-schemas.d.ts +245 -0
- package/dist/core/sdd/governance-schemas.js +143 -0
- package/dist/core/sdd/{import-openspec.d.ts → import-legacy-spec.d.ts} +7 -7
- package/dist/core/sdd/{import-openspec.js → import-legacy-spec.js} +21 -29
- package/dist/core/sdd/init.d.ts +3 -0
- package/dist/core/sdd/init.js +6 -3
- package/dist/core/sdd/json-schema.js +100 -6
- package/dist/core/sdd/knowledge-graph.d.ts +45 -0
- package/dist/core/sdd/knowledge-graph.js +288 -0
- package/dist/core/sdd/legacy-operations.js +431 -43
- package/dist/core/sdd/lenses.d.ts +1 -0
- package/dist/core/sdd/lenses.js +29 -1
- package/dist/core/sdd/migrate-workspace.js +56 -2
- package/dist/core/sdd/migrate.d.ts +1 -1
- package/dist/core/sdd/migrate.js +36 -2
- package/dist/core/sdd/package-structure-gate.d.ts +83 -0
- package/dist/core/sdd/package-structure-gate.js +362 -0
- package/dist/core/sdd/parallel-feat-automation.d.ts +152 -0
- package/dist/core/sdd/parallel-feat-automation.js +212 -0
- package/dist/core/sdd/plugin-broker.d.ts +558 -0
- package/dist/core/sdd/plugin-broker.js +482 -0
- package/dist/core/sdd/plugin-certification.d.ts +79 -0
- package/dist/core/sdd/plugin-certification.js +453 -0
- package/dist/core/sdd/plugin-cli.d.ts +109 -0
- package/dist/core/sdd/plugin-cli.js +198 -0
- package/dist/core/sdd/plugin-evidence.d.ts +275 -0
- package/dist/core/sdd/plugin-evidence.js +307 -0
- package/dist/core/sdd/plugin-manifest.d.ts +164 -0
- package/dist/core/sdd/plugin-manifest.js +215 -0
- package/dist/core/sdd/plugin-policy-pack.d.ts +88 -0
- package/dist/core/sdd/plugin-policy-pack.js +236 -0
- package/dist/core/sdd/plugin-policy.d.ts +68 -0
- package/dist/core/sdd/plugin-policy.js +212 -0
- package/dist/core/sdd/plugin-registry.d.ts +311 -0
- package/dist/core/sdd/plugin-registry.js +138 -0
- package/dist/core/sdd/plugin-skill-binding.d.ts +151 -0
- package/dist/core/sdd/plugin-skill-binding.js +339 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.d.ts +28 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.js +167 -0
- package/dist/core/sdd/quality-evidence-renderer.d.ts +65 -0
- package/dist/core/sdd/quality-evidence-renderer.js +218 -0
- package/dist/core/sdd/quality-scenario-runner.d.ts +42 -0
- package/dist/core/sdd/quality-scenario-runner.js +613 -0
- package/dist/core/sdd/quality-validation.d.ts +547 -0
- package/dist/core/sdd/quality-validation.js +239 -0
- package/dist/core/sdd/resolve-project-root.d.ts +2 -2
- package/dist/core/sdd/resolve-project-root.js +11 -5
- package/dist/core/sdd/sanitize.d.ts +30 -1
- package/dist/core/sdd/sanitize.js +23 -23
- package/dist/core/sdd/services/agent-run.service.d.ts +65 -0
- package/dist/core/sdd/services/agent-run.service.js +189 -0
- package/dist/core/sdd/services/breakdown.service.js +2 -1
- package/dist/core/sdd/services/context.service.js +18 -16
- package/dist/core/sdd/services/debate.service.js +15 -2
- package/dist/core/sdd/services/feature-lint.service.d.ts +22 -0
- package/dist/core/sdd/services/feature-lint.service.js +105 -5
- package/dist/core/sdd/services/finalize.service.d.ts +80 -0
- package/dist/core/sdd/services/finalize.service.js +323 -24
- package/dist/core/sdd/services/frontend-gap.service.js +22 -7
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.d.ts +17 -0
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.js +38 -0
- package/dist/core/sdd/services/governance-control-plane.service.d.ts +66 -0
- package/dist/core/sdd/services/governance-control-plane.service.js +134 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
- package/dist/core/sdd/services/legacy-capability.service.d.ts +10 -7
- package/dist/core/sdd/services/legacy-capability.service.js +38 -21
- package/dist/core/sdd/services/mcp-runtime.service.d.ts +123 -8
- package/dist/core/sdd/services/mcp-runtime.service.js +1085 -33
- package/dist/core/sdd/services/onboard.service.js +2 -1
- package/dist/core/sdd/services/rebuild.service.js +6 -1
- package/dist/core/sdd/services/skills-sync.service.d.ts +17 -5
- package/dist/core/sdd/services/skills-sync.service.js +55 -2
- package/dist/core/sdd/services/start.service.js +6 -4
- package/dist/core/sdd/skill-bundles-curation-schema.d.ts +66 -0
- package/dist/core/sdd/skill-bundles-curation-schema.js +52 -0
- package/dist/core/sdd/skill-evidence.d.ts +19 -0
- package/dist/core/sdd/skill-evidence.js +38 -0
- package/dist/core/sdd/skill-policy-pool.d.ts +46 -0
- package/dist/core/sdd/skill-policy-pool.js +185 -0
- package/dist/core/sdd/state.d.ts +22 -0
- package/dist/core/sdd/state.js +66 -41
- package/dist/core/sdd/structural-health.d.ts +42 -42
- package/dist/core/sdd/types.d.ts +33 -7
- package/dist/core/sdd/types.js +17 -0
- package/dist/core/sdd/upgrade-to-codesdd.d.ts +45 -0
- package/dist/core/sdd/upgrade-to-codesdd.js +179 -0
- package/dist/core/sdd/workspace-schemas.d.ts +285 -14
- package/dist/core/sdd/workspace-schemas.js +148 -0
- package/dist/core/sdd/write-manifest.js +22 -4
- package/dist/core/shared/skill-generation.d.ts +1 -1
- package/dist/core/shared/skill-generation.js +15 -15
- package/dist/core/shared/tool-detection.d.ts +3 -3
- package/dist/core/shared/tool-detection.js +14 -14
- package/dist/core/specs-apply.js +6 -6
- package/dist/core/templates/index.d.ts +1 -1
- package/dist/core/templates/index.js +1 -1
- package/dist/core/templates/workflows/apply-change.js +14 -14
- package/dist/core/templates/workflows/archive-change.js +32 -32
- package/dist/core/templates/workflows/bulk-archive-change.js +25 -25
- package/dist/core/templates/workflows/continue-change.js +12 -12
- package/dist/core/templates/workflows/explore.js +29 -29
- package/dist/core/templates/workflows/feedback.js +6 -6
- package/dist/core/templates/workflows/ff-change.js +24 -24
- package/dist/core/templates/workflows/new-change.js +20 -20
- package/dist/core/templates/workflows/onboard.js +33 -33
- package/dist/core/templates/workflows/propose.js +23 -23
- package/dist/core/templates/workflows/sdd.js +8 -8
- package/dist/core/templates/workflows/sync-specs.js +19 -19
- package/dist/core/templates/workflows/verify-change.js +17 -17
- package/dist/core/update.d.ts +2 -2
- package/dist/core/update.js +16 -15
- package/dist/core/validation/constants.d.ts +1 -1
- package/dist/core/validation/constants.js +1 -1
- package/dist/core/view.js +11 -11
- package/dist/telemetry/config.d.ts +2 -1
- package/dist/telemetry/config.js +17 -8
- package/dist/telemetry/index.d.ts +10 -2
- package/dist/telemetry/index.js +40 -7
- package/dist/ui/ascii-patterns.d.ts +2 -2
- package/dist/ui/ascii-patterns.js +2 -2
- package/dist/ui/welcome-screen.js +2 -2
- package/dist/utils/change-metadata.d.ts +4 -4
- package/dist/utils/change-metadata.js +6 -6
- package/dist/utils/change-utils.d.ts +3 -3
- package/dist/utils/change-utils.js +5 -5
- package/dist/utils/file-system.js +1 -1
- package/dist/utils/interactive.js +1 -1
- package/dist/utils/item-discovery.js +4 -4
- package/dist/utils/legacy-spec-compat.d.ts +2 -0
- package/dist/utils/legacy-spec-compat.js +2 -0
- package/dist/utils/shell-detection.d.ts +1 -0
- package/dist/utils/shell-detection.js +16 -0
- package/package.json +27 -17
- package/schemas/sdd/1-spec.schema.json +1 -1
- package/schemas/sdd/2-plan.schema.json +73 -1
- package/schemas/sdd/3-tasks.schema.json +73 -1
- package/schemas/sdd/4-changelog.schema.json +1 -1
- package/schemas/sdd/5-quality.schema.json +442 -2
- package/schemas/sdd/adr.schema.json +148 -0
- package/schemas/sdd/agent-binding-adapter.schema.json +210 -0
- package/schemas/sdd/agent-binding-resolution.schema.json +338 -0
- package/schemas/sdd/backlog-projection-plan.schema.json +180 -0
- package/schemas/sdd/backlog-provider-contract.schema.json +260 -0
- package/schemas/sdd/codesdd-plugin.schema.json +474 -0
- package/schemas/sdd/debate.schema.json +244 -0
- package/schemas/sdd/deepagent-decision-evidence.schema.json +58 -0
- package/schemas/sdd/deepagent-env-contract.schema.json +143 -0
- package/schemas/sdd/deepagent-quality-evidence.schema.json +108 -0
- package/schemas/sdd/deepagent-run-evidence.schema.json +192 -0
- package/schemas/sdd/deepagent-run-plan.schema.json +197 -0
- package/schemas/sdd/deepagent-run-request.schema.json +321 -0
- package/schemas/sdd/deepagent-subagent-evidence.schema.json +110 -0
- package/schemas/sdd/deepagent-tool-call-evidence.schema.json +78 -0
- package/schemas/sdd/discarded.schema.json +127 -0
- package/schemas/sdd/epic.schema.json +147 -0
- package/schemas/sdd/insight.schema.json +136 -0
- package/schemas/sdd/parallel-feat-automation-plan.schema.json +215 -0
- package/schemas/sdd/parallel-feat-automation-request.schema.json +109 -0
- package/schemas/sdd/plugin-artifact-manifest.schema.json +150 -0
- package/schemas/sdd/plugin-compliance-index.schema.json +136 -0
- package/schemas/sdd/plugin-dry-run-plan.schema.json +260 -0
- package/schemas/sdd/plugin-evidence-manifest.schema.json +569 -0
- package/schemas/sdd/plugin-policy-evaluation.schema.json +92 -0
- package/schemas/sdd/plugin-policy-pack-evaluation.schema.json +94 -0
- package/schemas/sdd/plugin-policy-pack.schema.json +196 -0
- package/schemas/sdd/plugin-registry.schema.json +558 -0
- package/schemas/sdd/plugin-rollback-manifest.schema.json +87 -0
- package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +845 -0
- package/schemas/sdd/plugin-skill-binding-resolution.schema.json +305 -0
- package/schemas/sdd/plugin-skill-binding.schema.json +88 -0
- package/schemas/sdd/plugin-validation-manifest.schema.json +123 -0
- package/schemas/sdd/quality-architecture-schema.schema.json +216 -0
- package/schemas/sdd/quality-evidence-bundle.schema.json +1228 -0
- package/schemas/sdd/quality-run.schema.json +197 -0
- package/schemas/sdd/quality-scenario.schema.json +252 -0
- package/schemas/sdd/workspace-catalog.schema.json +9841 -22
- package/schemas/spec-driven/schema.yaml +4 -4
- package/schemas/spec-driven/templates/proposal.md +1 -1
- package/dist/utils/openspec-compat.d.ts +0 -2
- package/dist/utils/openspec-compat.js +0 -2
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const insightFrontmatterSchema: z.ZodObject<{
|
|
3
|
+
schema_version: z.ZodLiteral<1>;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
title_canonical: z.ZodOptional<z.ZodString>;
|
|
6
|
+
status: z.ZodEnum<{
|
|
7
|
+
PLANNED: "PLANNED";
|
|
8
|
+
NEW: "NEW";
|
|
9
|
+
DEBATED: "DEBATED";
|
|
10
|
+
PROMOTED: "PROMOTED";
|
|
11
|
+
DROPPED: "DROPPED";
|
|
12
|
+
OPEN: "OPEN";
|
|
13
|
+
APPROVED: "APPROVED";
|
|
14
|
+
DISCARDED: "DISCARDED";
|
|
15
|
+
SUPERSEDED: "SUPERSEDED";
|
|
16
|
+
READY: "READY";
|
|
17
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
18
|
+
DONE: "DONE";
|
|
19
|
+
CANCELLED: "CANCELLED";
|
|
20
|
+
}>;
|
|
21
|
+
origin: z.ZodObject<{
|
|
22
|
+
type: z.ZodEnum<{
|
|
23
|
+
feature: "feature";
|
|
24
|
+
user_prompt: "user_prompt";
|
|
25
|
+
insight: "insight";
|
|
26
|
+
debate: "debate";
|
|
27
|
+
source_intake: "source_intake";
|
|
28
|
+
}>;
|
|
29
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
related_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
32
|
+
created_at: z.ZodString;
|
|
33
|
+
updated_at: z.ZodString;
|
|
34
|
+
quality_contract: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
35
|
+
artifact_type: z.ZodLiteral<"INS">;
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
source: z.ZodOptional<z.ZodString>;
|
|
38
|
+
motivation: z.ZodOptional<z.ZodString>;
|
|
39
|
+
initial_evidence: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
temporal_context: z.ZodOptional<z.ZodString>;
|
|
41
|
+
suggested_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
+
promoted_to: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export declare const debateFrontmatterSchema: z.ZodObject<{
|
|
45
|
+
schema_version: z.ZodLiteral<1>;
|
|
46
|
+
title: z.ZodString;
|
|
47
|
+
title_canonical: z.ZodOptional<z.ZodString>;
|
|
48
|
+
status: z.ZodEnum<{
|
|
49
|
+
PLANNED: "PLANNED";
|
|
50
|
+
NEW: "NEW";
|
|
51
|
+
DEBATED: "DEBATED";
|
|
52
|
+
PROMOTED: "PROMOTED";
|
|
53
|
+
DROPPED: "DROPPED";
|
|
54
|
+
OPEN: "OPEN";
|
|
55
|
+
APPROVED: "APPROVED";
|
|
56
|
+
DISCARDED: "DISCARDED";
|
|
57
|
+
SUPERSEDED: "SUPERSEDED";
|
|
58
|
+
READY: "READY";
|
|
59
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
60
|
+
DONE: "DONE";
|
|
61
|
+
CANCELLED: "CANCELLED";
|
|
62
|
+
}>;
|
|
63
|
+
origin: z.ZodObject<{
|
|
64
|
+
type: z.ZodEnum<{
|
|
65
|
+
feature: "feature";
|
|
66
|
+
user_prompt: "user_prompt";
|
|
67
|
+
insight: "insight";
|
|
68
|
+
debate: "debate";
|
|
69
|
+
source_intake: "source_intake";
|
|
70
|
+
}>;
|
|
71
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
related_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
|
+
created_at: z.ZodString;
|
|
75
|
+
updated_at: z.ZodString;
|
|
76
|
+
quality_contract: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
77
|
+
artifact_type: z.ZodLiteral<"DEB">;
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
decision: z.ZodObject<{
|
|
80
|
+
question: z.ZodString;
|
|
81
|
+
options: z.ZodArray<z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
label: z.ZodString;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
criteria: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
86
|
+
scoring: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
87
|
+
criterion: z.ZodString;
|
|
88
|
+
weight: z.ZodNumber;
|
|
89
|
+
scores: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
90
|
+
}, z.core.$strict>>>;
|
|
91
|
+
mediator: z.ZodObject<{
|
|
92
|
+
choice: z.ZodString;
|
|
93
|
+
rationale: z.ZodString;
|
|
94
|
+
accepted_risks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
95
|
+
risk: z.ZodString;
|
|
96
|
+
mitigation: z.ZodString;
|
|
97
|
+
}, z.core.$strict>>>;
|
|
98
|
+
reversal_conditions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
output: z.ZodEnum<{
|
|
101
|
+
APPROVED: "APPROVED";
|
|
102
|
+
DISCARDED: "DISCARDED";
|
|
103
|
+
}>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
export declare const epicFrontmatterSchema: z.ZodObject<{
|
|
107
|
+
schema_version: z.ZodLiteral<1>;
|
|
108
|
+
title: z.ZodString;
|
|
109
|
+
title_canonical: z.ZodOptional<z.ZodString>;
|
|
110
|
+
status: z.ZodEnum<{
|
|
111
|
+
PLANNED: "PLANNED";
|
|
112
|
+
NEW: "NEW";
|
|
113
|
+
DEBATED: "DEBATED";
|
|
114
|
+
PROMOTED: "PROMOTED";
|
|
115
|
+
DROPPED: "DROPPED";
|
|
116
|
+
OPEN: "OPEN";
|
|
117
|
+
APPROVED: "APPROVED";
|
|
118
|
+
DISCARDED: "DISCARDED";
|
|
119
|
+
SUPERSEDED: "SUPERSEDED";
|
|
120
|
+
READY: "READY";
|
|
121
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
122
|
+
DONE: "DONE";
|
|
123
|
+
CANCELLED: "CANCELLED";
|
|
124
|
+
}>;
|
|
125
|
+
origin: z.ZodObject<{
|
|
126
|
+
type: z.ZodEnum<{
|
|
127
|
+
feature: "feature";
|
|
128
|
+
user_prompt: "user_prompt";
|
|
129
|
+
insight: "insight";
|
|
130
|
+
debate: "debate";
|
|
131
|
+
source_intake: "source_intake";
|
|
132
|
+
}>;
|
|
133
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
related_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
136
|
+
created_at: z.ZodString;
|
|
137
|
+
updated_at: z.ZodString;
|
|
138
|
+
quality_contract: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
139
|
+
artifact_type: z.ZodLiteral<"EPIC">;
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
approved_summary: z.ZodString;
|
|
142
|
+
lock_domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
143
|
+
produces: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
144
|
+
consumes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
145
|
+
breakdown_policy: z.ZodDefault<z.ZodEnum<{
|
|
146
|
+
flat: "flat";
|
|
147
|
+
graph: "graph";
|
|
148
|
+
}>>;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
export declare const discardedFrontmatterSchema: z.ZodObject<{
|
|
151
|
+
schema_version: z.ZodLiteral<1>;
|
|
152
|
+
title: z.ZodString;
|
|
153
|
+
title_canonical: z.ZodOptional<z.ZodString>;
|
|
154
|
+
status: z.ZodEnum<{
|
|
155
|
+
PLANNED: "PLANNED";
|
|
156
|
+
NEW: "NEW";
|
|
157
|
+
DEBATED: "DEBATED";
|
|
158
|
+
PROMOTED: "PROMOTED";
|
|
159
|
+
DROPPED: "DROPPED";
|
|
160
|
+
OPEN: "OPEN";
|
|
161
|
+
APPROVED: "APPROVED";
|
|
162
|
+
DISCARDED: "DISCARDED";
|
|
163
|
+
SUPERSEDED: "SUPERSEDED";
|
|
164
|
+
READY: "READY";
|
|
165
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
166
|
+
DONE: "DONE";
|
|
167
|
+
CANCELLED: "CANCELLED";
|
|
168
|
+
}>;
|
|
169
|
+
origin: z.ZodObject<{
|
|
170
|
+
type: z.ZodEnum<{
|
|
171
|
+
feature: "feature";
|
|
172
|
+
user_prompt: "user_prompt";
|
|
173
|
+
insight: "insight";
|
|
174
|
+
debate: "debate";
|
|
175
|
+
source_intake: "source_intake";
|
|
176
|
+
}>;
|
|
177
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
related_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
180
|
+
created_at: z.ZodString;
|
|
181
|
+
updated_at: z.ZodString;
|
|
182
|
+
quality_contract: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
183
|
+
artifact_type: z.ZodLiteral<"Discarded">;
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
discarded_from: z.ZodString;
|
|
186
|
+
discard_reason: z.ZodString;
|
|
187
|
+
discarded_at: z.ZodString;
|
|
188
|
+
discarded_by: z.ZodString;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
export declare const adrFrontmatterSchema: z.ZodObject<{
|
|
191
|
+
schema_version: z.ZodLiteral<1>;
|
|
192
|
+
title: z.ZodString;
|
|
193
|
+
title_canonical: z.ZodOptional<z.ZodString>;
|
|
194
|
+
status: z.ZodEnum<{
|
|
195
|
+
PLANNED: "PLANNED";
|
|
196
|
+
NEW: "NEW";
|
|
197
|
+
DEBATED: "DEBATED";
|
|
198
|
+
PROMOTED: "PROMOTED";
|
|
199
|
+
DROPPED: "DROPPED";
|
|
200
|
+
OPEN: "OPEN";
|
|
201
|
+
APPROVED: "APPROVED";
|
|
202
|
+
DISCARDED: "DISCARDED";
|
|
203
|
+
SUPERSEDED: "SUPERSEDED";
|
|
204
|
+
READY: "READY";
|
|
205
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
206
|
+
DONE: "DONE";
|
|
207
|
+
CANCELLED: "CANCELLED";
|
|
208
|
+
}>;
|
|
209
|
+
origin: z.ZodObject<{
|
|
210
|
+
type: z.ZodEnum<{
|
|
211
|
+
feature: "feature";
|
|
212
|
+
user_prompt: "user_prompt";
|
|
213
|
+
insight: "insight";
|
|
214
|
+
debate: "debate";
|
|
215
|
+
source_intake: "source_intake";
|
|
216
|
+
}>;
|
|
217
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
related_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
220
|
+
created_at: z.ZodString;
|
|
221
|
+
updated_at: z.ZodString;
|
|
222
|
+
quality_contract: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
223
|
+
artifact_type: z.ZodLiteral<"ADR">;
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
feature_id: z.ZodString;
|
|
226
|
+
decision_status: z.ZodDefault<z.ZodEnum<{
|
|
227
|
+
SUPERSEDED: "SUPERSEDED";
|
|
228
|
+
PROPOSED: "PROPOSED";
|
|
229
|
+
ACCEPTED: "ACCEPTED";
|
|
230
|
+
}>>;
|
|
231
|
+
supersedes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
232
|
+
superseded_by: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
233
|
+
references: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
export type InsightFrontmatter = z.infer<typeof insightFrontmatterSchema>;
|
|
236
|
+
export type DebateFrontmatter = z.infer<typeof debateFrontmatterSchema>;
|
|
237
|
+
export type EpicFrontmatter = z.infer<typeof epicFrontmatterSchema>;
|
|
238
|
+
export type DiscardedFrontmatter = z.infer<typeof discardedFrontmatterSchema>;
|
|
239
|
+
export type AdrFrontmatter = z.infer<typeof adrFrontmatterSchema>;
|
|
240
|
+
export declare function parseInsightFrontmatter(value: unknown): InsightFrontmatter;
|
|
241
|
+
export declare function parseDebateFrontmatter(value: unknown): DebateFrontmatter;
|
|
242
|
+
export declare function parseEpicFrontmatter(value: unknown): EpicFrontmatter;
|
|
243
|
+
export declare function parseDiscardedFrontmatter(value: unknown): DiscardedFrontmatter;
|
|
244
|
+
export declare function parseAdrFrontmatter(value: unknown): AdrFrontmatter;
|
|
245
|
+
//# sourceMappingURL=governance-schemas.d.ts.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const governanceStatusSchema = z.enum([
|
|
3
|
+
'NEW',
|
|
4
|
+
'OPEN',
|
|
5
|
+
'DEBATED',
|
|
6
|
+
'PROMOTED',
|
|
7
|
+
'DROPPED',
|
|
8
|
+
'APPROVED',
|
|
9
|
+
'DISCARDED',
|
|
10
|
+
'SUPERSEDED',
|
|
11
|
+
'READY',
|
|
12
|
+
'PLANNED',
|
|
13
|
+
'IN_PROGRESS',
|
|
14
|
+
'DONE',
|
|
15
|
+
'CANCELLED',
|
|
16
|
+
]);
|
|
17
|
+
const governanceOriginSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
type: z.enum(['user_prompt', 'insight', 'debate', 'feature', 'source_intake']),
|
|
20
|
+
ref: z.string().min(1).optional(),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
const governanceCommonSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
schema_version: z.literal(1),
|
|
26
|
+
id: z.string().regex(/^[A-Z]+(?:-[A-Z]+)?-\d{3,4}$/),
|
|
27
|
+
title: z.string().min(1),
|
|
28
|
+
title_canonical: z.string().min(1).optional(),
|
|
29
|
+
status: governanceStatusSchema,
|
|
30
|
+
origin: governanceOriginSchema,
|
|
31
|
+
related_ids: z.array(z.string().min(1)).default([]),
|
|
32
|
+
created_at: z.string().datetime(),
|
|
33
|
+
updated_at: z.string().datetime(),
|
|
34
|
+
quality_contract: z.record(z.string(), z.unknown()).optional(),
|
|
35
|
+
})
|
|
36
|
+
.strict();
|
|
37
|
+
export const insightFrontmatterSchema = governanceCommonSchema
|
|
38
|
+
.extend({
|
|
39
|
+
artifact_type: z.literal('INS'),
|
|
40
|
+
id: z.string().regex(/^INS-\d{4}$/),
|
|
41
|
+
source: z.string().min(1).optional(),
|
|
42
|
+
motivation: z.string().min(1).optional(),
|
|
43
|
+
initial_evidence: z.array(z.string().min(1)).optional(),
|
|
44
|
+
temporal_context: z.string().min(1).optional(),
|
|
45
|
+
suggested_agents: z.array(z.string().min(1)).optional(),
|
|
46
|
+
promoted_to: z.string().min(1).optional(),
|
|
47
|
+
})
|
|
48
|
+
.strict();
|
|
49
|
+
const debateOptionSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
id: z.string().regex(/^[A-Z]$/),
|
|
52
|
+
label: z.string().min(1),
|
|
53
|
+
})
|
|
54
|
+
.strict();
|
|
55
|
+
const debateScoringSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
criterion: z.string().min(1),
|
|
58
|
+
weight: z.number(),
|
|
59
|
+
scores: z.record(z.string().regex(/^[A-Z]$/), z.number()),
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
62
|
+
const debateAcceptedRiskSchema = z
|
|
63
|
+
.object({
|
|
64
|
+
risk: z.string().min(1),
|
|
65
|
+
mitigation: z.string().min(1),
|
|
66
|
+
})
|
|
67
|
+
.strict();
|
|
68
|
+
const debateDecisionSchema = z
|
|
69
|
+
.object({
|
|
70
|
+
question: z.string().min(1),
|
|
71
|
+
options: z.array(debateOptionSchema).min(1),
|
|
72
|
+
criteria: z.array(z.string().min(1)).default([]),
|
|
73
|
+
scoring: z.array(debateScoringSchema).default([]),
|
|
74
|
+
mediator: z
|
|
75
|
+
.object({
|
|
76
|
+
choice: z.string().regex(/^[A-Z]$/),
|
|
77
|
+
rationale: z.string().min(1),
|
|
78
|
+
accepted_risks: z.array(debateAcceptedRiskSchema).default([]),
|
|
79
|
+
reversal_conditions: z.array(z.string().min(1)).default([]),
|
|
80
|
+
})
|
|
81
|
+
.strict(),
|
|
82
|
+
output: z.enum(['APPROVED', 'DISCARDED']),
|
|
83
|
+
})
|
|
84
|
+
.strict();
|
|
85
|
+
export const debateFrontmatterSchema = governanceCommonSchema
|
|
86
|
+
.extend({
|
|
87
|
+
artifact_type: z.literal('DEB'),
|
|
88
|
+
id: z.string().regex(/^DEB-\d{4}$/),
|
|
89
|
+
decision: debateDecisionSchema,
|
|
90
|
+
})
|
|
91
|
+
.strict();
|
|
92
|
+
export const epicFrontmatterSchema = governanceCommonSchema
|
|
93
|
+
.extend({
|
|
94
|
+
artifact_type: z.literal('EPIC'),
|
|
95
|
+
id: z.string().regex(/^EPIC-\d{4}$/),
|
|
96
|
+
approved_summary: z.string().min(1),
|
|
97
|
+
lock_domains: z.array(z.string().min(1)).default([]),
|
|
98
|
+
produces: z.array(z.string().min(1)).default([]),
|
|
99
|
+
consumes: z.array(z.string().min(1)).default([]),
|
|
100
|
+
breakdown_policy: z.enum(['graph', 'flat']).default('graph'),
|
|
101
|
+
})
|
|
102
|
+
.strict();
|
|
103
|
+
export const discardedFrontmatterSchema = governanceCommonSchema
|
|
104
|
+
.extend({
|
|
105
|
+
artifact_type: z.literal('Discarded'),
|
|
106
|
+
id: z.string().regex(/^DEB-\d{4}$/),
|
|
107
|
+
discarded_from: z.string().regex(/^DEB-\d{4}$/),
|
|
108
|
+
discard_reason: z.string().min(1),
|
|
109
|
+
discarded_at: z.string().datetime(),
|
|
110
|
+
discarded_by: z.string().min(1),
|
|
111
|
+
})
|
|
112
|
+
.strict()
|
|
113
|
+
.refine((value) => value.id === value.discarded_from, {
|
|
114
|
+
message: 'Discarded artifact id must match discarded_from',
|
|
115
|
+
path: ['id'],
|
|
116
|
+
});
|
|
117
|
+
export const adrFrontmatterSchema = governanceCommonSchema
|
|
118
|
+
.extend({
|
|
119
|
+
artifact_type: z.literal('ADR'),
|
|
120
|
+
id: z.string().regex(/^ADR-FEAT-\d{3,4}$/),
|
|
121
|
+
feature_id: z.string().regex(/^FEAT-\d{3,4}$/),
|
|
122
|
+
decision_status: z.enum(['PROPOSED', 'ACCEPTED', 'SUPERSEDED']).default('PROPOSED'),
|
|
123
|
+
supersedes: z.array(z.string().regex(/^ADR-FEAT-\d{3,4}$/)).default([]),
|
|
124
|
+
superseded_by: z.array(z.string().regex(/^ADR-FEAT-\d{3,4}$/)).default([]),
|
|
125
|
+
references: z.array(z.string().min(1)).default([]),
|
|
126
|
+
})
|
|
127
|
+
.strict();
|
|
128
|
+
export function parseInsightFrontmatter(value) {
|
|
129
|
+
return insightFrontmatterSchema.parse(value);
|
|
130
|
+
}
|
|
131
|
+
export function parseDebateFrontmatter(value) {
|
|
132
|
+
return debateFrontmatterSchema.parse(value);
|
|
133
|
+
}
|
|
134
|
+
export function parseEpicFrontmatter(value) {
|
|
135
|
+
return epicFrontmatterSchema.parse(value);
|
|
136
|
+
}
|
|
137
|
+
export function parseDiscardedFrontmatter(value) {
|
|
138
|
+
return discardedFrontmatterSchema.parse(value);
|
|
139
|
+
}
|
|
140
|
+
export function parseAdrFrontmatter(value) {
|
|
141
|
+
return adrFrontmatterSchema.parse(value);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=governance-schemas.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface SddImportLegacySpecOptions {
|
|
2
2
|
dryRun?: boolean;
|
|
3
3
|
remove?: boolean;
|
|
4
4
|
yes?: boolean;
|
|
5
5
|
render?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface ImportedLegacySpecFile {
|
|
8
8
|
source_path: string;
|
|
9
9
|
target_path: string;
|
|
10
10
|
sha256: string;
|
|
@@ -12,7 +12,7 @@ export interface ImportedOpenSpecFile {
|
|
|
12
12
|
category: string;
|
|
13
13
|
indexed_source_id: string;
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
15
|
+
export interface SddImportLegacySpecResult {
|
|
16
16
|
project_root: string;
|
|
17
17
|
source_root: string;
|
|
18
18
|
target_root: string;
|
|
@@ -23,9 +23,9 @@ export interface SddImportOpenSpecResult {
|
|
|
23
23
|
files_copied: number;
|
|
24
24
|
sources_indexed: number;
|
|
25
25
|
categories: Record<string, number>;
|
|
26
|
-
files:
|
|
26
|
+
files: ImportedLegacySpecFile[];
|
|
27
27
|
}
|
|
28
|
-
export declare class
|
|
29
|
-
execute(projectRoot: string, options?:
|
|
28
|
+
export declare class SddImportLegacySpecCommand {
|
|
29
|
+
execute(projectRoot: string, options?: SddImportLegacySpecOptions): Promise<SddImportLegacySpecResult>;
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=import-
|
|
31
|
+
//# sourceMappingURL=import-legacy-spec.d.ts.map
|
|
@@ -5,7 +5,7 @@ import { stringify as stringifyYaml } from 'yaml';
|
|
|
5
5
|
import { loadProjectSddConfig, loadStateSnapshot, resolveSddPaths, saveSourceIndexState, } from './state.js';
|
|
6
6
|
import { renderViews } from './views.js';
|
|
7
7
|
import { nextSourceId } from './legacy-operations.js';
|
|
8
|
-
import {
|
|
8
|
+
import { LEGACY_SPEC_CAPABILITY, resolveLegacyCapabilityImportedDepositoRoot, resolveLegacyCapabilityLiveRoot, } from './services/legacy-capability.service.js';
|
|
9
9
|
async function pathExists(filePath) {
|
|
10
10
|
try {
|
|
11
11
|
await fs.access(filePath);
|
|
@@ -41,7 +41,7 @@ async function sha256(filePath) {
|
|
|
41
41
|
function normalizePath(value) {
|
|
42
42
|
return value.replace(/\\/g, '/');
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function categoryForLegacySpecPath(relativePath) {
|
|
45
45
|
const normalized = normalizePath(relativePath).toLowerCase();
|
|
46
46
|
if (normalized.startsWith('specs/'))
|
|
47
47
|
return 'spec';
|
|
@@ -58,22 +58,22 @@ function categoryForOpenSpecPath(relativePath) {
|
|
|
58
58
|
}
|
|
59
59
|
return 'other';
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function titleFromLegacySpecPath(relativePath) {
|
|
62
62
|
const normalized = normalizePath(relativePath);
|
|
63
63
|
const parts = normalized.split('/');
|
|
64
64
|
const meaningful = parts.length >= 2 ? parts.slice(0, -1).join(' / ') : normalized;
|
|
65
|
-
return `Legacy spec corpus: ${meaningful
|
|
65
|
+
return `Legacy spec corpus: ${meaningful}`;
|
|
66
66
|
}
|
|
67
67
|
function targetRelativePath(relativePath) {
|
|
68
68
|
return normalizePath(relativePath);
|
|
69
69
|
}
|
|
70
|
-
export class
|
|
70
|
+
export class SddImportLegacySpecCommand {
|
|
71
71
|
async execute(projectRoot, options = {}) {
|
|
72
72
|
const config = await loadProjectSddConfig(projectRoot);
|
|
73
73
|
const paths = resolveSddPaths(projectRoot, config);
|
|
74
|
-
const sourceRoot = resolveLegacyCapabilityLiveRoot(projectRoot,
|
|
75
|
-
const targetRoot = resolveLegacyCapabilityImportedDepositoRoot(paths.depositoDir,
|
|
76
|
-
const reportPath = path.join(targetRoot, '
|
|
74
|
+
const sourceRoot = resolveLegacyCapabilityLiveRoot(projectRoot, LEGACY_SPEC_CAPABILITY);
|
|
75
|
+
const targetRoot = resolveLegacyCapabilityImportedDepositoRoot(paths.depositoDir, LEGACY_SPEC_CAPABILITY);
|
|
76
|
+
const reportPath = path.join(targetRoot, '_legacy-spec-import-report.yaml');
|
|
77
77
|
const dryRun = options.dryRun ?? false;
|
|
78
78
|
if (!(await pathExists(sourceRoot))) {
|
|
79
79
|
return {
|
|
@@ -91,7 +91,7 @@ export class SddImportOpenSpecCommand {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
if (options.remove && !options.yes) {
|
|
94
|
-
throw new Error('Refusing to remove
|
|
94
|
+
throw new Error('Refusing to remove legacy-spec/. Re-run with --remove --yes after reviewing the import report.');
|
|
95
95
|
}
|
|
96
96
|
const absoluteFiles = await listFiles(sourceRoot);
|
|
97
97
|
const snapshot = await loadStateSnapshot(paths, config);
|
|
@@ -102,10 +102,10 @@ export class SddImportOpenSpecCommand {
|
|
|
102
102
|
let filesCopied = 0;
|
|
103
103
|
let sourcesIndexed = 0;
|
|
104
104
|
for (const absoluteSource of absoluteFiles) {
|
|
105
|
-
const
|
|
106
|
-
const relativeTarget = targetRelativePath(
|
|
105
|
+
const relativeLegacySpec = normalizePath(path.relative(sourceRoot, absoluteSource));
|
|
106
|
+
const relativeTarget = targetRelativePath(relativeLegacySpec);
|
|
107
107
|
const absoluteTarget = path.join(targetRoot, relativeTarget);
|
|
108
|
-
const category =
|
|
108
|
+
const category = categoryForLegacySpecPath(relativeLegacySpec);
|
|
109
109
|
const sourceHash = await sha256(absoluteSource);
|
|
110
110
|
const indexedPath = normalizePath(path.relative(projectRoot, absoluteTarget));
|
|
111
111
|
const now = new Date().toISOString();
|
|
@@ -116,7 +116,7 @@ export class SddImportOpenSpecCommand {
|
|
|
116
116
|
id: nextSourceId(sourceIndex.sources.map((source) => source.id)),
|
|
117
117
|
type: 'legado',
|
|
118
118
|
path: indexedPath,
|
|
119
|
-
title:
|
|
119
|
+
title: titleFromLegacySpecPath(relativeLegacySpec),
|
|
120
120
|
status: 'INDEXED',
|
|
121
121
|
source_version: 1,
|
|
122
122
|
source_fingerprint: sourceHash.hash,
|
|
@@ -128,7 +128,7 @@ export class SddImportOpenSpecCommand {
|
|
|
128
128
|
verification_status: 'verified',
|
|
129
129
|
verification_notes: 'Imported from repository-local legacy spec corpus.',
|
|
130
130
|
legal_validation_required: false,
|
|
131
|
-
summary: `Imported from legacy-spec/${
|
|
131
|
+
summary: `Imported from legacy-spec/${relativeLegacySpec}`,
|
|
132
132
|
imported_at: now,
|
|
133
133
|
updated_at: now,
|
|
134
134
|
used_by: [],
|
|
@@ -142,30 +142,22 @@ export class SddImportOpenSpecCommand {
|
|
|
142
142
|
}
|
|
143
143
|
sourceRecord.type = 'legado';
|
|
144
144
|
sourceRecord.status = 'INDEXED';
|
|
145
|
-
sourceRecord.source_version = sourceRecord.source_version || 1;
|
|
146
145
|
sourceRecord.source_fingerprint = sourceHash.hash;
|
|
147
|
-
sourceRecord.authority = sourceRecord.authority || 'internal';
|
|
148
|
-
sourceRecord.source_url = sourceRecord.source_url || '';
|
|
149
|
-
sourceRecord.source_classification = sourceRecord.source_classification || 'technical_best_practice';
|
|
150
|
-
sourceRecord.jurisdiction_tags = Array.isArray(sourceRecord.jurisdiction_tags)
|
|
151
|
-
? sourceRecord.jurisdiction_tags
|
|
152
|
-
: [];
|
|
153
146
|
sourceRecord.last_verified_at = sourceRecord.last_verified_at || now.slice(0, 10);
|
|
154
|
-
sourceRecord.verification_status = sourceRecord.verification_status || 'verified';
|
|
155
147
|
sourceRecord.verification_notes =
|
|
156
148
|
sourceRecord.verification_notes || 'Imported from repository-local legacy spec corpus.';
|
|
157
149
|
sourceRecord.legal_validation_required = Boolean(sourceRecord.legal_validation_required);
|
|
158
|
-
sourceRecord.summary = `Imported from legacy-spec/${
|
|
150
|
+
sourceRecord.summary = `Imported from legacy-spec/${relativeLegacySpec}`;
|
|
159
151
|
sourceRecord.updated_at = now;
|
|
160
152
|
sourceRecord.notes = Array.from(new Set([
|
|
161
|
-
...sourceRecord.notes.filter((note) => !note.startsWith('
|
|
162
|
-
`legacy-spec-import:source=legacy-spec/${
|
|
153
|
+
...sourceRecord.notes.filter((note) => !note.startsWith('legacy-spec-import:')),
|
|
154
|
+
`legacy-spec-import:source=legacy-spec/${relativeLegacySpec}`,
|
|
163
155
|
`legacy-spec-import:category=${category}`,
|
|
164
156
|
`legacy-spec-import:sha256=${sourceHash.hash}`,
|
|
165
157
|
`legacy-spec-import:bytes=${sourceHash.bytes}`,
|
|
166
158
|
]));
|
|
167
159
|
sourceRecord.consolidation_targets = Array.from(new Set([
|
|
168
|
-
...sourceRecord.consolidation_targets.filter((target) => target !== 'legacy-
|
|
160
|
+
...sourceRecord.consolidation_targets.filter((target) => target !== 'legacy-spec-corpus-import'),
|
|
169
161
|
'source-index',
|
|
170
162
|
'legacy-spec-corpus-import',
|
|
171
163
|
category,
|
|
@@ -175,12 +167,12 @@ export class SddImportOpenSpecCommand {
|
|
|
175
167
|
await fs.copyFile(absoluteSource, absoluteTarget);
|
|
176
168
|
const copiedHash = await sha256(absoluteTarget);
|
|
177
169
|
if (copiedHash.hash !== sourceHash.hash) {
|
|
178
|
-
throw new Error(`
|
|
170
|
+
throw new Error(`Legacy spec import checksum mismatch for ${relativeLegacySpec}`);
|
|
179
171
|
}
|
|
180
172
|
filesCopied += 1;
|
|
181
173
|
}
|
|
182
174
|
imported.push({
|
|
183
|
-
source_path: `legacy-spec/${
|
|
175
|
+
source_path: `legacy-spec/${relativeLegacySpec}`,
|
|
184
176
|
target_path: indexedPath,
|
|
185
177
|
sha256: sourceHash.hash,
|
|
186
178
|
bytes: sourceHash.bytes,
|
|
@@ -229,4 +221,4 @@ export class SddImportOpenSpecCommand {
|
|
|
229
221
|
};
|
|
230
222
|
}
|
|
231
223
|
}
|
|
232
|
-
//# sourceMappingURL=import-
|
|
224
|
+
//# sourceMappingURL=import-legacy-spec.js.map
|
package/dist/core/sdd/init.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export interface SddInitContextOptions {
|
|
|
20
20
|
mode?: 'merge' | 'replace';
|
|
21
21
|
deep?: boolean;
|
|
22
22
|
render?: boolean;
|
|
23
|
+
frontendEnabled?: boolean;
|
|
24
|
+
language?: SddLanguage;
|
|
25
|
+
layout?: SddLayout;
|
|
23
26
|
}
|
|
24
27
|
export interface SddInitContextResult {
|
|
25
28
|
projectRoot: string;
|
package/dist/core/sdd/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadStateSnapshot, ensureBaseFiles, ensureBaseStructure, resolveSddPaths, upsertProjectSddConfig, } from './state.js';
|
|
2
2
|
import { renderViews } from './views.js';
|
|
3
3
|
import { syncSddGuideDocs } from './docs-sync.js';
|
|
4
4
|
import { bootstrapInitialContext } from './bootstrap.js';
|
|
@@ -39,9 +39,12 @@ export class SddInitCommand {
|
|
|
39
39
|
}
|
|
40
40
|
export class SddInitContextCommand {
|
|
41
41
|
async execute(projectRoot, options = {}) {
|
|
42
|
-
const config = await
|
|
42
|
+
const config = await upsertProjectSddConfig(projectRoot, {
|
|
43
|
+
frontendEnabled: options.frontendEnabled,
|
|
44
|
+
language: options.language,
|
|
45
|
+
layout: options.layout,
|
|
46
|
+
});
|
|
43
47
|
const paths = resolveSddPaths(projectRoot, config);
|
|
44
|
-
const stores = createSddStores(paths);
|
|
45
48
|
await ensureBaseStructure(paths);
|
|
46
49
|
await ensureBaseFiles(paths, config);
|
|
47
50
|
const sddBootstrap = await bootstrapInitialContext(projectRoot, paths, config, {
|