@devtrack-solution/codesdd 1.2.2
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 +2751 -0
- package/.sdd/skills/curated/devtrack-api/SKILL.md +137 -0
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +4 -0
- package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +381 -0
- package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +219 -0
- package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +359 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +127 -0
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +207 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +167 -0
- package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +334 -0
- package/LICENSE +21 -0
- package/README.md +842 -0
- package/bin/codesdd.js +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +560 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +296 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +258 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +552 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +184 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +870 -0
- package/dist/commands/sdd/execution.d.ts +3 -0
- package/dist/commands/sdd/execution.js +409 -0
- package/dist/commands/sdd/shared.d.ts +9 -0
- package/dist/commands/sdd/shared.js +84 -0
- package/dist/commands/sdd/skills.d.ts +3 -0
- package/dist/commands/sdd/skills.js +154 -0
- package/dist/commands/sdd.d.ts +3 -0
- package/dist/commands/sdd.js +769 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +133 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +228 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +295 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +383 -0
- package/dist/commands/workflow/new-change.d.ts +11 -0
- package/dist/commands/workflow/new-change.js +45 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/shared.d.ts +57 -0
- package/dist/commands/workflow/shared.js +117 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +76 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +68 -0
- package/dist/core/archive.d.ts +16 -0
- package/dist/core/archive.js +487 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +7 -0
- package/dist/core/artifact-graph/index.js +13 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +143 -0
- package/dist/core/artifact-graph/instruction-loader.js +215 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +258 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +54 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/available-tools.d.ts +16 -0
- package/dist/core/available-tools.js +30 -0
- package/dist/core/branding.d.ts +8 -0
- package/dist/core/branding.js +12 -0
- package/dist/core/cli/command-matrix.d.ts +23 -0
- package/dist/core/cli/command-matrix.js +123 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +29 -0
- package/dist/core/command-generation/adapters/index.js +29 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
- package/dist/core/command-generation/adapters/kiro.js +26 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +29 -0
- package/dist/core/command-generation/adapters/pi.d.ts +14 -0
- package/dist/core/command-generation/adapters/pi.js +41 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +92 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.js +461 -0
- package/dist/core/completions/completion-provider.d.ts +60 -0
- package/dist/core/completions/completion-provider.js +102 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +32 -0
- package/dist/core/completions/generators/bash-generator.js +174 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +157 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +33 -0
- package/dist/core/completions/generators/powershell-generator.js +207 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +44 -0
- package/dist/core/completions/generators/zsh-generator.js +250 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +88 -0
- package/dist/core/completions/installers/powershell-installer.js +327 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +125 -0
- package/dist/core/completions/installers/zsh-installer.js +452 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +24 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +39 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +25 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +36 -0
- package/dist/core/completions/types.d.ts +79 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.js +33 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +44 -0
- package/dist/core/global-config.js +125 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/init.d.ts +36 -0
- package/dist/core/init.js +576 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +512 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +173 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +193 -0
- package/dist/core/parsers/markdown-parser.d.ts +22 -0
- package/dist/core/parsers/markdown-parser.js +187 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +201 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +41 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/sdd/adr-policy.d.ts +7 -0
- package/dist/core/sdd/adr-policy.js +47 -0
- package/dist/core/sdd/adr.d.ts +4 -0
- package/dist/core/sdd/adr.js +27 -0
- package/dist/core/sdd/bootstrap.d.ts +28 -0
- package/dist/core/sdd/bootstrap.js +353 -0
- package/dist/core/sdd/check.d.ts +51 -0
- package/dist/core/sdd/check.js +831 -0
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +73 -0
- package/dist/core/sdd/coordination/coordination-adapters.js +87 -0
- package/dist/core/sdd/coordination/index.d.ts +2 -0
- package/dist/core/sdd/coordination/index.js +2 -0
- package/dist/core/sdd/dedup.d.ts +23 -0
- package/dist/core/sdd/dedup.js +62 -0
- package/dist/core/sdd/default-bootstrap-files.d.ts +23 -0
- package/dist/core/sdd/default-bootstrap-files.js +385 -0
- package/dist/core/sdd/default-skills.d.ts +16 -0
- package/dist/core/sdd/default-skills.js +427 -0
- package/dist/core/sdd/diagnose.d.ts +25 -0
- package/dist/core/sdd/diagnose.js +1312 -0
- package/dist/core/sdd/docs-sync.d.ts +21 -0
- package/dist/core/sdd/docs-sync.js +231 -0
- package/dist/core/sdd/domain/helpers.d.ts +6 -0
- package/dist/core/sdd/domain/helpers.js +37 -0
- package/dist/core/sdd/domain/lifecycle-guardrails.d.ts +22 -0
- package/dist/core/sdd/domain/lifecycle-guardrails.js +31 -0
- package/dist/core/sdd/domain/lifecycle-hooks.d.ts +16 -0
- package/dist/core/sdd/domain/lifecycle-hooks.js +27 -0
- package/dist/core/sdd/domain/post-active-validation.d.ts +15 -0
- package/dist/core/sdd/domain/post-active-validation.js +71 -0
- package/dist/core/sdd/domain/traceability.d.ts +8 -0
- package/dist/core/sdd/domain/traceability.js +83 -0
- package/dist/core/sdd/domain/transition-engine.d.ts +49 -0
- package/dist/core/sdd/domain/transition-engine.js +120 -0
- package/dist/core/sdd/fingerprint.d.ts +23 -0
- package/dist/core/sdd/fingerprint.js +146 -0
- package/dist/core/sdd/import-openspec.d.ts +31 -0
- package/dist/core/sdd/import-openspec.js +232 -0
- package/dist/core/sdd/init.d.ts +36 -0
- package/dist/core/sdd/init.js +65 -0
- package/dist/core/sdd/json-schema.d.ts +6 -0
- package/dist/core/sdd/json-schema.js +59 -0
- package/dist/core/sdd/legacy-operations.d.ts +286 -0
- package/dist/core/sdd/legacy-operations.js +2175 -0
- package/dist/core/sdd/lenses.d.ts +14 -0
- package/dist/core/sdd/lenses.js +97 -0
- package/dist/core/sdd/merge-catalog.d.ts +9 -0
- package/dist/core/sdd/merge-catalog.js +70 -0
- package/dist/core/sdd/migrate-workspace.d.ts +36 -0
- package/dist/core/sdd/migrate-workspace.js +344 -0
- package/dist/core/sdd/migrate.d.ts +24 -0
- package/dist/core/sdd/migrate.js +385 -0
- package/dist/core/sdd/resolve-project-root.d.ts +15 -0
- package/dist/core/sdd/resolve-project-root.js +46 -0
- package/dist/core/sdd/root-resolver.d.ts +16 -0
- package/dist/core/sdd/root-resolver.js +62 -0
- package/dist/core/sdd/sanitize.d.ts +35 -0
- package/dist/core/sdd/sanitize.js +750 -0
- package/dist/core/sdd/services/approve.service.d.ts +20 -0
- package/dist/core/sdd/services/approve.service.js +82 -0
- package/dist/core/sdd/services/audit.service.d.ts +53 -0
- package/dist/core/sdd/services/audit.service.js +136 -0
- package/dist/core/sdd/services/breakdown.service.d.ts +35 -0
- package/dist/core/sdd/services/breakdown.service.js +185 -0
- package/dist/core/sdd/services/context.service.d.ts +346 -0
- package/dist/core/sdd/services/context.service.js +278 -0
- package/dist/core/sdd/services/debate.service.d.ts +16 -0
- package/dist/core/sdd/services/debate.service.js +73 -0
- package/dist/core/sdd/services/decide.service.d.ts +23 -0
- package/dist/core/sdd/services/decide.service.js +81 -0
- package/dist/core/sdd/services/dedup-apply.service.d.ts +39 -0
- package/dist/core/sdd/services/dedup-apply.service.js +259 -0
- package/dist/core/sdd/services/feature-lint.service.d.ts +29 -0
- package/dist/core/sdd/services/feature-lint.service.js +146 -0
- package/dist/core/sdd/services/finalize.service.d.ts +33 -0
- package/dist/core/sdd/services/finalize.service.js +707 -0
- package/dist/core/sdd/services/frontend-gap.service.d.ts +23 -0
- package/dist/core/sdd/services/frontend-gap.service.js +117 -0
- package/dist/core/sdd/services/frontend-impact.service.d.ts +19 -0
- package/dist/core/sdd/services/frontend-impact.service.js +46 -0
- package/dist/core/sdd/services/ingest-deposito.service.d.ts +32 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +231 -0
- package/dist/core/sdd/services/insight.service.d.ts +21 -0
- package/dist/core/sdd/services/insight.service.js +81 -0
- package/dist/core/sdd/services/legacy-capability.service.d.ts +24 -0
- package/dist/core/sdd/services/legacy-capability.service.js +59 -0
- package/dist/core/sdd/services/mcp-runtime.service.d.ts +42 -0
- package/dist/core/sdd/services/mcp-runtime.service.js +144 -0
- package/dist/core/sdd/services/metrics.service.d.ts +49 -0
- package/dist/core/sdd/services/metrics.service.js +181 -0
- package/dist/core/sdd/services/next.service.d.ts +35 -0
- package/dist/core/sdd/services/next.service.js +54 -0
- package/dist/core/sdd/services/onboard.service.d.ts +9 -0
- package/dist/core/sdd/services/onboard.service.js +165 -0
- package/dist/core/sdd/services/rebuild.service.d.ts +31 -0
- package/dist/core/sdd/services/rebuild.service.js +482 -0
- package/dist/core/sdd/services/scan-naming.service.d.ts +43 -0
- package/dist/core/sdd/services/scan-naming.service.js +246 -0
- package/dist/core/sdd/services/skills-invoke.service.d.ts +24 -0
- package/dist/core/sdd/services/skills-invoke.service.js +63 -0
- package/dist/core/sdd/services/skills-sync.service.d.ts +15 -0
- package/dist/core/sdd/services/skills-sync.service.js +117 -0
- package/dist/core/sdd/services/start.service.d.ts +26 -0
- package/dist/core/sdd/services/start.service.js +237 -0
- package/dist/core/sdd/skills.d.ts +15 -0
- package/dist/core/sdd/skills.js +46 -0
- package/dist/core/sdd/state-lock.d.ts +19 -0
- package/dist/core/sdd/state-lock.js +144 -0
- package/dist/core/sdd/state.d.ts +155 -0
- package/dist/core/sdd/state.js +1000 -0
- package/dist/core/sdd/store/in-memory-adapter.d.ts +12 -0
- package/dist/core/sdd/store/in-memory-adapter.js +27 -0
- package/dist/core/sdd/store/index.d.ts +5 -0
- package/dist/core/sdd/store/index.js +5 -0
- package/dist/core/sdd/store/sdd-stores.d.ts +25 -0
- package/dist/core/sdd/store/sdd-stores.js +59 -0
- package/dist/core/sdd/store/state-store.d.ts +32 -0
- package/dist/core/sdd/store/state-store.js +2 -0
- package/dist/core/sdd/store/yaml-file-adapter.d.ts +12 -0
- package/dist/core/sdd/store/yaml-file-adapter.js +43 -0
- package/dist/core/sdd/structural-health.d.ts +557 -0
- package/dist/core/sdd/structural-health.js +187 -0
- package/dist/core/sdd/transaction.d.ts +14 -0
- package/dist/core/sdd/transaction.js +100 -0
- package/dist/core/sdd/types.d.ts +1570 -0
- package/dist/core/sdd/types.js +617 -0
- package/dist/core/sdd/views.d.ts +3 -0
- package/dist/core/sdd/views.js +560 -0
- package/dist/core/sdd/workspace-schemas.d.ts +620 -0
- package/dist/core/sdd/workspace-schemas.js +254 -0
- package/dist/core/sdd/write-manifest.d.ts +25 -0
- package/dist/core/sdd/write-manifest.js +353 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +106 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +158 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +385 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +20 -0
- package/dist/core/templates/skill-templates.js +19 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +308 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +277 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +502 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +232 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +475 -0
- package/dist/core/templates/workflows/feedback.d.ts +9 -0
- package/dist/core/templates/workflows/feedback.js +108 -0
- package/dist/core/templates/workflows/ff-change.d.ts +10 -0
- package/dist/core/templates/workflows/ff-change.js +206 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +151 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +573 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +224 -0
- package/dist/core/templates/workflows/sdd.d.ts +10 -0
- package/dist/core/templates/workflows/sdd.js +107 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +286 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +346 -0
- package/dist/core/update.d.ts +77 -0
- package/dist/core/update.js +538 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +409 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +170 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/telemetry/config.d.ts +32 -0
- package/dist/telemetry/config.js +68 -0
- package/dist/telemetry/index.d.ts +44 -0
- package/dist/telemetry/index.js +207 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/change-metadata.d.ts +51 -0
- package/dist/utils/change-metadata.js +147 -0
- package/dist/utils/change-utils.d.ts +62 -0
- package/dist/utils/change-utils.js +121 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +36 -0
- package/dist/utils/file-system.js +281 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +73 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/openspec-compat.d.ts +2 -0
- package/dist/utils/openspec-compat.js +2 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +111 -0
- package/schemas/sdd/1-spec.schema.json +221 -0
- package/schemas/sdd/2-plan.schema.json +199 -0
- package/schemas/sdd/3-tasks.schema.json +102 -0
- package/schemas/sdd/4-changelog.schema.json +55 -0
- package/schemas/sdd/5-quality.schema.json +427 -0
- package/schemas/sdd/workspace-catalog.schema.json +1012 -0
- package/schemas/spec-driven/schema.yaml +153 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export class TransitionEngine {
|
|
2
|
+
transitionLogStore;
|
|
3
|
+
static allowedTransitions = {
|
|
4
|
+
INS: {
|
|
5
|
+
NEW: ['DEBATED', 'DISCARDED'],
|
|
6
|
+
},
|
|
7
|
+
DEB: {
|
|
8
|
+
OPEN: ['APPROVED', 'DISCARDED'],
|
|
9
|
+
},
|
|
10
|
+
EPIC: {
|
|
11
|
+
READY: ['PLANNED', 'SPLIT', 'IN_PROGRESS', 'ARCHIVED'],
|
|
12
|
+
PLANNED: ['IN_PROGRESS', 'ARCHIVED'],
|
|
13
|
+
SPLIT: ['DONE', 'ARCHIVED'],
|
|
14
|
+
IN_PROGRESS: ['DONE', 'ARCHIVED'],
|
|
15
|
+
DONE: ['ARCHIVED'],
|
|
16
|
+
},
|
|
17
|
+
RAD: {
|
|
18
|
+
READY: ['PLANNED', 'SPLIT', 'IN_PROGRESS', 'ARCHIVED'],
|
|
19
|
+
PLANNED: ['IN_PROGRESS', 'ARCHIVED'],
|
|
20
|
+
SPLIT: ['DONE', 'ARCHIVED'],
|
|
21
|
+
IN_PROGRESS: ['DONE', 'ARCHIVED'],
|
|
22
|
+
DONE: ['ARCHIVED'],
|
|
23
|
+
},
|
|
24
|
+
FEAT: {
|
|
25
|
+
READY: ['IN_PROGRESS', 'BLOCKED', 'ARCHIVED'],
|
|
26
|
+
BLOCKED: ['READY', 'IN_PROGRESS', 'ARCHIVED'],
|
|
27
|
+
IN_PROGRESS: ['DONE', 'BLOCKED', 'ARCHIVED'],
|
|
28
|
+
DONE: ['ARCHIVED'],
|
|
29
|
+
ARCHIVED: [],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
constructor(transitionLogStore) {
|
|
33
|
+
this.transitionLogStore = transitionLogStore;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Valida se a transição de estado desejada é logicamente permitida pelo grafo de transições,
|
|
37
|
+
* e bloqueia transições caso haja violações arquiteturais ou de lente documental.
|
|
38
|
+
*/
|
|
39
|
+
static assertValid(entityType, fromStatus, toStatus, options) {
|
|
40
|
+
const typeGraph = TransitionEngine.allowedTransitions[entityType];
|
|
41
|
+
if (!typeGraph) {
|
|
42
|
+
throw new Error(`Tipo de entidade não reconhecido pelo motor de transição: ${entityType}`);
|
|
43
|
+
}
|
|
44
|
+
const permittedTargets = typeGraph[fromStatus];
|
|
45
|
+
if (!permittedTargets) {
|
|
46
|
+
throw new Error(`Status de origem '${fromStatus}' inválido para a entidade ${entityType}.`);
|
|
47
|
+
}
|
|
48
|
+
if (!permittedTargets.includes(toStatus)) {
|
|
49
|
+
throw new Error(`Transição estrutural bloqueada (Transition Engine): ${entityType} não pode transitar de '${fromStatus}' para '${toStatus}'. (Permitidos: ${permittedTargets.join(', ')})`);
|
|
50
|
+
}
|
|
51
|
+
if (options?.lensViolations && options.lensViolations.length > 0) {
|
|
52
|
+
if (!options.forceTransition) {
|
|
53
|
+
throw new Error(`Transição de estado negada. Artefatos bloqueados pelas Lentes Estruturais:\n- ${options.lensViolations.join('\n- ')}\n\nUtilize a flag --force-transition se julgar tratar-se de um bypass válido.`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.warn(`[WARNING] Transição forçada de ${entityType} para ${toStatus} ignorando as seguintes violações de Lente:\n- ${options.lensViolations.join('\n- ')}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* LEGACY: Synchronous transition for operations.ts monolithic snapshot logic.
|
|
62
|
+
* Do not use in new Domain Services.
|
|
63
|
+
*/
|
|
64
|
+
static legacyApplyTransition(entityType, entity, toStatus, transitionLog, options) {
|
|
65
|
+
const fromStatus = entity.status;
|
|
66
|
+
TransitionEngine.assertValid(entityType, fromStatus, toStatus, options);
|
|
67
|
+
const event = {
|
|
68
|
+
entity_type: entityType,
|
|
69
|
+
entity_id: entity.id,
|
|
70
|
+
from: fromStatus,
|
|
71
|
+
to: toStatus,
|
|
72
|
+
actor: options?.actor || 'system',
|
|
73
|
+
reason: options?.reason || '',
|
|
74
|
+
timestamp: options?.timestamp || new Date().toISOString(),
|
|
75
|
+
source_command: options?.sourceCommand || 'unknown',
|
|
76
|
+
force_transition: Boolean(options?.forceTransition),
|
|
77
|
+
lens_violations: options?.lensViolations || [],
|
|
78
|
+
};
|
|
79
|
+
entity.status = toStatus;
|
|
80
|
+
options?.afterTransition?.(entity);
|
|
81
|
+
transitionLog.push(event);
|
|
82
|
+
return event;
|
|
83
|
+
}
|
|
84
|
+
async applyTransition(entityType, entity, toStatus, options) {
|
|
85
|
+
const fromStatus = entity.status;
|
|
86
|
+
TransitionEngine.assertValid(entityType, fromStatus, toStatus, options);
|
|
87
|
+
const event = {
|
|
88
|
+
entity_type: entityType,
|
|
89
|
+
entity_id: entity.id,
|
|
90
|
+
from: fromStatus,
|
|
91
|
+
to: toStatus,
|
|
92
|
+
actor: options?.actor || 'system',
|
|
93
|
+
reason: options?.reason || '',
|
|
94
|
+
timestamp: options?.timestamp || new Date().toISOString(),
|
|
95
|
+
source_command: options?.sourceCommand || 'unknown',
|
|
96
|
+
force_transition: Boolean(options?.forceTransition),
|
|
97
|
+
lens_violations: options?.lensViolations || [],
|
|
98
|
+
};
|
|
99
|
+
entity.status = toStatus;
|
|
100
|
+
options?.afterTransition?.(entity);
|
|
101
|
+
// Save to StateStore
|
|
102
|
+
const logState = await this.transitionLogStore.load();
|
|
103
|
+
logState.events.push(event);
|
|
104
|
+
await this.transitionLogStore.save(logState);
|
|
105
|
+
return event;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Validações de negócio granulares antes de finalizações ou progressos de FEAT.
|
|
109
|
+
*/
|
|
110
|
+
validateFeatureStartGuardrails(feature) {
|
|
111
|
+
// Estas são verificações já implementadas parcialmente nas operações,
|
|
112
|
+
// mas a extração as prepara para regras mais determinísticas futuramente.
|
|
113
|
+
return {
|
|
114
|
+
forced: false,
|
|
115
|
+
lock_check: { ok: true, conflicts: [] },
|
|
116
|
+
blocked_check: { ok: true, unresolved: [] },
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=transition-engine.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface RequirementFingerprint {
|
|
2
|
+
capability: string;
|
|
3
|
+
requirement_id: string;
|
|
4
|
+
base_hash: string;
|
|
5
|
+
base_text: string;
|
|
6
|
+
captured_at: string;
|
|
7
|
+
source_change_id: string;
|
|
8
|
+
reconstructed?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ChangeFingerprintMeta {
|
|
11
|
+
requirements: RequirementFingerprint[];
|
|
12
|
+
}
|
|
13
|
+
export interface CaptureFingerprintsOptions {
|
|
14
|
+
sourceChangeId?: string;
|
|
15
|
+
reconstructed?: boolean;
|
|
16
|
+
capturedAt?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function computeRequirementHash(text: string): string;
|
|
19
|
+
export declare function readMeta(changeDir: string): Promise<ChangeFingerprintMeta | null>;
|
|
20
|
+
export declare function writeMeta(changeDir: string, meta: ChangeFingerprintMeta): Promise<void>;
|
|
21
|
+
export declare function hasEquivalentRequirementsFingerprint(a: ChangeFingerprintMeta, b: ChangeFingerprintMeta): boolean;
|
|
22
|
+
export declare function captureFingerprintsForChange(changeDir: string, mainSpecsDir: string, options?: CaptureFingerprintsOptions): Promise<ChangeFingerprintMeta>;
|
|
23
|
+
//# sourceMappingURL=fingerprint.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Change fingerprint helpers.
|
|
3
|
+
*
|
|
4
|
+
* Fingerprints preserve the original requirement body used as the base for a change.
|
|
5
|
+
* They are used to detect stale deltas when parallel work edits the same
|
|
6
|
+
* requirement between validation and archive.
|
|
7
|
+
*/
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { promises as fs } from 'fs';
|
|
10
|
+
import { createHash } from 'crypto';
|
|
11
|
+
import { extractRequirementsSection, normalizeRequirementName, parseDeltaSpec, } from '../parsers/requirement-blocks.js';
|
|
12
|
+
import { findSpecUpdates } from '../specs-apply.js';
|
|
13
|
+
const META_FILE = 'meta.json';
|
|
14
|
+
export function computeRequirementHash(text) {
|
|
15
|
+
const normalized = text.replace(/\r\n?/g, '\n').trim();
|
|
16
|
+
return createHash('sha256').update(normalized).digest('hex');
|
|
17
|
+
}
|
|
18
|
+
function buildMetaPath(changeDir) {
|
|
19
|
+
return path.join(changeDir, META_FILE);
|
|
20
|
+
}
|
|
21
|
+
function normalizeRequirementForMap(name) {
|
|
22
|
+
return normalizeRequirementName(name);
|
|
23
|
+
}
|
|
24
|
+
function requirementKey(capability, name) {
|
|
25
|
+
return `${capability}::${normalizeRequirementForMap(name)}`;
|
|
26
|
+
}
|
|
27
|
+
function getTouchedRequirementsFromPlan(plan, capability) {
|
|
28
|
+
const touched = [];
|
|
29
|
+
for (const modified of plan.modified) {
|
|
30
|
+
touched.push({ capability, name: modified.name });
|
|
31
|
+
}
|
|
32
|
+
for (const removed of plan.removed) {
|
|
33
|
+
touched.push({ capability, name: removed });
|
|
34
|
+
}
|
|
35
|
+
for (const renamed of plan.renamed) {
|
|
36
|
+
touched.push({ capability, name: renamed.from });
|
|
37
|
+
}
|
|
38
|
+
return touched;
|
|
39
|
+
}
|
|
40
|
+
async function getCurrentRequirementBlock(specPath, requirementName) {
|
|
41
|
+
const content = await fs.readFile(specPath, 'utf-8');
|
|
42
|
+
const parts = extractRequirementsSection(content);
|
|
43
|
+
const key = normalizeRequirementForMap(requirementName);
|
|
44
|
+
for (const block of parts.bodyBlocks) {
|
|
45
|
+
if (normalizeRequirementForMap(block.name) === key) {
|
|
46
|
+
return { raw: block.raw };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
export async function readMeta(changeDir) {
|
|
52
|
+
const metaPath = buildMetaPath(changeDir);
|
|
53
|
+
try {
|
|
54
|
+
const raw = await fs.readFile(metaPath, 'utf-8');
|
|
55
|
+
const parsed = JSON.parse(raw);
|
|
56
|
+
if (!parsed || !Array.isArray(parsed.requirements)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const requirements = parsed.requirements.filter((entry) => {
|
|
60
|
+
return (entry &&
|
|
61
|
+
typeof entry.requirement_id === 'string' &&
|
|
62
|
+
typeof entry.base_hash === 'string' &&
|
|
63
|
+
typeof entry.base_text === 'string' &&
|
|
64
|
+
typeof entry.captured_at === 'string' &&
|
|
65
|
+
typeof entry.source_change_id === 'string');
|
|
66
|
+
});
|
|
67
|
+
if (requirements.length !== parsed.requirements.length) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return { requirements };
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (error?.code === 'ENOENT') {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export async function writeMeta(changeDir, meta) {
|
|
80
|
+
const metaPath = buildMetaPath(changeDir);
|
|
81
|
+
const payload = {
|
|
82
|
+
requirements: [...meta.requirements].sort((a, b) => `${a.capability}/${a.requirement_id}`.localeCompare(`${b.capability}/${b.requirement_id}`)),
|
|
83
|
+
};
|
|
84
|
+
await fs.writeFile(metaPath, JSON.stringify(payload, null, 2), 'utf-8');
|
|
85
|
+
}
|
|
86
|
+
export function hasEquivalentRequirementsFingerprint(a, b) {
|
|
87
|
+
const normalize = (meta) => {
|
|
88
|
+
const normalized = [...meta.requirements].sort((left, right) => `${left.capability}/${left.requirement_id}`.localeCompare(`${right.capability}/${right.requirement_id}`));
|
|
89
|
+
return normalized.map((entry) => [
|
|
90
|
+
entry.capability,
|
|
91
|
+
entry.requirement_id,
|
|
92
|
+
entry.base_hash,
|
|
93
|
+
entry.base_text,
|
|
94
|
+
entry.source_change_id,
|
|
95
|
+
].join('|'));
|
|
96
|
+
};
|
|
97
|
+
const left = normalize(a);
|
|
98
|
+
const right = normalize(b);
|
|
99
|
+
if (left.length !== right.length) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return left.every((value, index) => value === right[index]);
|
|
103
|
+
}
|
|
104
|
+
export async function captureFingerprintsForChange(changeDir, mainSpecsDir, options = {}) {
|
|
105
|
+
const changeId = options.sourceChangeId ?? path.basename(changeDir);
|
|
106
|
+
const capturedAt = options.capturedAt ?? new Date().toISOString();
|
|
107
|
+
const updates = await findSpecUpdates(changeDir, mainSpecsDir);
|
|
108
|
+
const requirementEntries = [];
|
|
109
|
+
const seen = new Set();
|
|
110
|
+
for (const update of updates) {
|
|
111
|
+
const capability = path.basename(path.dirname(update.target));
|
|
112
|
+
const plan = parseDeltaSpec(await fs.readFile(update.source, 'utf-8'));
|
|
113
|
+
const touched = getTouchedRequirementsFromPlan(plan, capability);
|
|
114
|
+
if (touched.length === 0) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
await fs.readFile(update.target, 'utf-8');
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
for (const item of touched) {
|
|
124
|
+
const key = requirementKey(item.capability, item.name);
|
|
125
|
+
if (seen.has(key)) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const block = await getCurrentRequirementBlock(update.target, item.name);
|
|
129
|
+
if (!block) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
requirementEntries.push({
|
|
133
|
+
capability: item.capability,
|
|
134
|
+
requirement_id: normalizeRequirementForMap(item.name),
|
|
135
|
+
base_hash: computeRequirementHash(block.raw),
|
|
136
|
+
base_text: block.raw,
|
|
137
|
+
captured_at: capturedAt,
|
|
138
|
+
source_change_id: changeId,
|
|
139
|
+
reconstructed: options.reconstructed,
|
|
140
|
+
});
|
|
141
|
+
seen.add(key);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return { requirements: requirementEntries };
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=fingerprint.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface SddImportOpenSpecOptions {
|
|
2
|
+
dryRun?: boolean;
|
|
3
|
+
remove?: boolean;
|
|
4
|
+
yes?: boolean;
|
|
5
|
+
render?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ImportedOpenSpecFile {
|
|
8
|
+
source_path: string;
|
|
9
|
+
target_path: string;
|
|
10
|
+
sha256: string;
|
|
11
|
+
bytes: number;
|
|
12
|
+
category: string;
|
|
13
|
+
indexed_source_id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SddImportOpenSpecResult {
|
|
16
|
+
project_root: string;
|
|
17
|
+
source_root: string;
|
|
18
|
+
target_root: string;
|
|
19
|
+
report_path: string;
|
|
20
|
+
dry_run: boolean;
|
|
21
|
+
removed_source_root: boolean;
|
|
22
|
+
files_seen: number;
|
|
23
|
+
files_copied: number;
|
|
24
|
+
sources_indexed: number;
|
|
25
|
+
categories: Record<string, number>;
|
|
26
|
+
files: ImportedOpenSpecFile[];
|
|
27
|
+
}
|
|
28
|
+
export declare class SddImportOpenSpecCommand {
|
|
29
|
+
execute(projectRoot: string, options?: SddImportOpenSpecOptions): Promise<SddImportOpenSpecResult>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=import-openspec.d.ts.map
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { stringify as stringifyYaml } from 'yaml';
|
|
5
|
+
import { loadProjectSddConfig, loadStateSnapshot, resolveSddPaths, saveSourceIndexState, } from './state.js';
|
|
6
|
+
import { renderViews } from './views.js';
|
|
7
|
+
import { nextSourceId } from './legacy-operations.js';
|
|
8
|
+
import { OPENSPEC_LEGACY_CAPABILITY, resolveLegacyCapabilityImportedDepositoRoot, resolveLegacyCapabilityLiveRoot, } from './services/legacy-capability.service.js';
|
|
9
|
+
async function pathExists(filePath) {
|
|
10
|
+
try {
|
|
11
|
+
await fs.access(filePath);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async function listFiles(rootDir) {
|
|
19
|
+
const entries = await fs.readdir(rootDir, { withFileTypes: true }).catch(() => []);
|
|
20
|
+
const files = [];
|
|
21
|
+
for (const entry of entries) {
|
|
22
|
+
const absolute = path.join(rootDir, entry.name);
|
|
23
|
+
if (entry.isDirectory()) {
|
|
24
|
+
files.push(...(await listFiles(absolute)));
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (entry.isFile()) {
|
|
28
|
+
files.push(absolute);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
files.sort((a, b) => a.localeCompare(b));
|
|
32
|
+
return files;
|
|
33
|
+
}
|
|
34
|
+
async function sha256(filePath) {
|
|
35
|
+
const content = await fs.readFile(filePath);
|
|
36
|
+
return {
|
|
37
|
+
hash: createHash('sha256').update(content).digest('hex'),
|
|
38
|
+
bytes: content.byteLength,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function normalizePath(value) {
|
|
42
|
+
return value.replace(/\\/g, '/');
|
|
43
|
+
}
|
|
44
|
+
function categoryForOpenSpecPath(relativePath) {
|
|
45
|
+
const normalized = normalizePath(relativePath).toLowerCase();
|
|
46
|
+
if (normalized.startsWith('specs/'))
|
|
47
|
+
return 'spec';
|
|
48
|
+
if (normalized.startsWith('changes/archive/'))
|
|
49
|
+
return 'archived-change';
|
|
50
|
+
if (normalized.startsWith('changes/'))
|
|
51
|
+
return 'active-change';
|
|
52
|
+
if (normalized.startsWith('schemas/'))
|
|
53
|
+
return 'schema';
|
|
54
|
+
if (normalized.startsWith('explorations/'))
|
|
55
|
+
return 'exploration';
|
|
56
|
+
if (normalized === 'config.yaml' || normalized === 'config.yml' || normalized === 'project.md') {
|
|
57
|
+
return 'project-config';
|
|
58
|
+
}
|
|
59
|
+
return 'other';
|
|
60
|
+
}
|
|
61
|
+
function titleFromOpenSpecPath(relativePath) {
|
|
62
|
+
const normalized = normalizePath(relativePath);
|
|
63
|
+
const parts = normalized.split('/');
|
|
64
|
+
const meaningful = parts.length >= 2 ? parts.slice(0, -1).join(' / ') : normalized;
|
|
65
|
+
return `Legacy spec corpus: ${meaningful || normalized}`;
|
|
66
|
+
}
|
|
67
|
+
function targetRelativePath(relativePath) {
|
|
68
|
+
return normalizePath(relativePath);
|
|
69
|
+
}
|
|
70
|
+
export class SddImportOpenSpecCommand {
|
|
71
|
+
async execute(projectRoot, options = {}) {
|
|
72
|
+
const config = await loadProjectSddConfig(projectRoot);
|
|
73
|
+
const paths = resolveSddPaths(projectRoot, config);
|
|
74
|
+
const sourceRoot = resolveLegacyCapabilityLiveRoot(projectRoot, OPENSPEC_LEGACY_CAPABILITY);
|
|
75
|
+
const targetRoot = resolveLegacyCapabilityImportedDepositoRoot(paths.depositoDir, OPENSPEC_LEGACY_CAPABILITY);
|
|
76
|
+
const reportPath = path.join(targetRoot, '_codesdd-import-report.yaml');
|
|
77
|
+
const dryRun = options.dryRun ?? false;
|
|
78
|
+
if (!(await pathExists(sourceRoot))) {
|
|
79
|
+
return {
|
|
80
|
+
project_root: projectRoot,
|
|
81
|
+
source_root: normalizePath(path.relative(projectRoot, sourceRoot)),
|
|
82
|
+
target_root: normalizePath(path.relative(projectRoot, targetRoot)),
|
|
83
|
+
report_path: normalizePath(path.relative(projectRoot, reportPath)),
|
|
84
|
+
dry_run: dryRun,
|
|
85
|
+
removed_source_root: false,
|
|
86
|
+
files_seen: 0,
|
|
87
|
+
files_copied: 0,
|
|
88
|
+
sources_indexed: 0,
|
|
89
|
+
categories: {},
|
|
90
|
+
files: [],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (options.remove && !options.yes) {
|
|
94
|
+
throw new Error('Refusing to remove openspec/. Re-run with --remove --yes after reviewing the import report.');
|
|
95
|
+
}
|
|
96
|
+
const absoluteFiles = await listFiles(sourceRoot);
|
|
97
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
98
|
+
const sourceIndex = snapshot.sourceIndex;
|
|
99
|
+
const existingByPath = new Map(sourceIndex.sources.map((source) => [source.path, source]));
|
|
100
|
+
const categories = {};
|
|
101
|
+
const imported = [];
|
|
102
|
+
let filesCopied = 0;
|
|
103
|
+
let sourcesIndexed = 0;
|
|
104
|
+
for (const absoluteSource of absoluteFiles) {
|
|
105
|
+
const relativeOpenSpec = normalizePath(path.relative(sourceRoot, absoluteSource));
|
|
106
|
+
const relativeTarget = targetRelativePath(relativeOpenSpec);
|
|
107
|
+
const absoluteTarget = path.join(targetRoot, relativeTarget);
|
|
108
|
+
const category = categoryForOpenSpecPath(relativeOpenSpec);
|
|
109
|
+
const sourceHash = await sha256(absoluteSource);
|
|
110
|
+
const indexedPath = normalizePath(path.relative(projectRoot, absoluteTarget));
|
|
111
|
+
const now = new Date().toISOString();
|
|
112
|
+
categories[category] = (categories[category] ?? 0) + 1;
|
|
113
|
+
let sourceRecord = existingByPath.get(indexedPath);
|
|
114
|
+
if (!sourceRecord) {
|
|
115
|
+
const created = {
|
|
116
|
+
id: nextSourceId(sourceIndex.sources.map((source) => source.id)),
|
|
117
|
+
type: 'legado',
|
|
118
|
+
path: indexedPath,
|
|
119
|
+
title: titleFromOpenSpecPath(relativeOpenSpec),
|
|
120
|
+
status: 'INDEXED',
|
|
121
|
+
source_version: 1,
|
|
122
|
+
source_fingerprint: sourceHash.hash,
|
|
123
|
+
authority: 'internal',
|
|
124
|
+
source_url: '',
|
|
125
|
+
source_classification: 'technical_best_practice',
|
|
126
|
+
jurisdiction_tags: [],
|
|
127
|
+
last_verified_at: now.slice(0, 10),
|
|
128
|
+
verification_status: 'verified',
|
|
129
|
+
verification_notes: 'Imported from repository-local legacy spec corpus.',
|
|
130
|
+
legal_validation_required: false,
|
|
131
|
+
summary: `Imported from legacy-spec/${relativeOpenSpec}`,
|
|
132
|
+
imported_at: now,
|
|
133
|
+
updated_at: now,
|
|
134
|
+
used_by: [],
|
|
135
|
+
notes: [],
|
|
136
|
+
consolidation_targets: ['source-index', 'legacy-spec-corpus-import', category],
|
|
137
|
+
};
|
|
138
|
+
sourceRecord = created;
|
|
139
|
+
sourceIndex.sources.push(sourceRecord);
|
|
140
|
+
existingByPath.set(indexedPath, sourceRecord);
|
|
141
|
+
sourcesIndexed += 1;
|
|
142
|
+
}
|
|
143
|
+
sourceRecord.type = 'legado';
|
|
144
|
+
sourceRecord.status = 'INDEXED';
|
|
145
|
+
sourceRecord.source_version = sourceRecord.source_version || 1;
|
|
146
|
+
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
|
+
sourceRecord.last_verified_at = sourceRecord.last_verified_at || now.slice(0, 10);
|
|
154
|
+
sourceRecord.verification_status = sourceRecord.verification_status || 'verified';
|
|
155
|
+
sourceRecord.verification_notes =
|
|
156
|
+
sourceRecord.verification_notes || 'Imported from repository-local legacy spec corpus.';
|
|
157
|
+
sourceRecord.legal_validation_required = Boolean(sourceRecord.legal_validation_required);
|
|
158
|
+
sourceRecord.summary = `Imported from legacy-spec/${relativeOpenSpec}`;
|
|
159
|
+
sourceRecord.updated_at = now;
|
|
160
|
+
sourceRecord.notes = Array.from(new Set([
|
|
161
|
+
...sourceRecord.notes.filter((note) => !note.startsWith('openspec-import:') && !note.startsWith('legacy-spec-import:')),
|
|
162
|
+
`legacy-spec-import:source=legacy-spec/${relativeOpenSpec}`,
|
|
163
|
+
`legacy-spec-import:category=${category}`,
|
|
164
|
+
`legacy-spec-import:sha256=${sourceHash.hash}`,
|
|
165
|
+
`legacy-spec-import:bytes=${sourceHash.bytes}`,
|
|
166
|
+
]));
|
|
167
|
+
sourceRecord.consolidation_targets = Array.from(new Set([
|
|
168
|
+
...sourceRecord.consolidation_targets.filter((target) => target !== 'legacy-openspec-import' && target !== 'legacy-spec-corpus-import'),
|
|
169
|
+
'source-index',
|
|
170
|
+
'legacy-spec-corpus-import',
|
|
171
|
+
category,
|
|
172
|
+
]));
|
|
173
|
+
if (!dryRun) {
|
|
174
|
+
await fs.mkdir(path.dirname(absoluteTarget), { recursive: true });
|
|
175
|
+
await fs.copyFile(absoluteSource, absoluteTarget);
|
|
176
|
+
const copiedHash = await sha256(absoluteTarget);
|
|
177
|
+
if (copiedHash.hash !== sourceHash.hash) {
|
|
178
|
+
throw new Error(`OpenSpec import checksum mismatch for ${relativeOpenSpec}`);
|
|
179
|
+
}
|
|
180
|
+
filesCopied += 1;
|
|
181
|
+
}
|
|
182
|
+
imported.push({
|
|
183
|
+
source_path: `legacy-spec/${relativeOpenSpec}`,
|
|
184
|
+
target_path: indexedPath,
|
|
185
|
+
sha256: sourceHash.hash,
|
|
186
|
+
bytes: sourceHash.bytes,
|
|
187
|
+
category,
|
|
188
|
+
indexed_source_id: sourceRecord.id,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const report = {
|
|
192
|
+
version: 1,
|
|
193
|
+
generated_at: new Date().toISOString(),
|
|
194
|
+
source_root: 'legacy-spec',
|
|
195
|
+
target_root: normalizePath(path.relative(projectRoot, targetRoot)),
|
|
196
|
+
dry_run: dryRun,
|
|
197
|
+
remove_requested: options.remove ?? false,
|
|
198
|
+
files_seen: imported.length,
|
|
199
|
+
files_copied: dryRun ? 0 : filesCopied,
|
|
200
|
+
sources_indexed: sourcesIndexed,
|
|
201
|
+
categories,
|
|
202
|
+
files: imported,
|
|
203
|
+
};
|
|
204
|
+
if (!dryRun) {
|
|
205
|
+
await saveSourceIndexState(paths, sourceIndex);
|
|
206
|
+
await fs.mkdir(targetRoot, { recursive: true });
|
|
207
|
+
await fs.writeFile(reportPath, stringifyYaml(report), 'utf-8');
|
|
208
|
+
if (options.remove) {
|
|
209
|
+
await fs.rm(sourceRoot, { recursive: true, force: true });
|
|
210
|
+
}
|
|
211
|
+
const shouldRender = options.render ?? config.views.autoRender;
|
|
212
|
+
if (shouldRender) {
|
|
213
|
+
const updated = await loadStateSnapshot(paths, config);
|
|
214
|
+
await renderViews(paths, config, updated);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
project_root: projectRoot,
|
|
219
|
+
source_root: 'legacy-spec',
|
|
220
|
+
target_root: normalizePath(path.relative(projectRoot, targetRoot)),
|
|
221
|
+
report_path: normalizePath(path.relative(projectRoot, reportPath)),
|
|
222
|
+
dry_run: dryRun,
|
|
223
|
+
removed_source_root: Boolean(options.remove && !dryRun),
|
|
224
|
+
files_seen: imported.length,
|
|
225
|
+
files_copied: dryRun ? 0 : filesCopied,
|
|
226
|
+
sources_indexed: sourcesIndexed,
|
|
227
|
+
categories,
|
|
228
|
+
files: imported,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=import-openspec.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type SddLanguage, type SddLayout } from './state.js';
|
|
2
|
+
import { type BootstrapContextReport } from './bootstrap.js';
|
|
3
|
+
export interface SddInitOptions {
|
|
4
|
+
frontendEnabled?: boolean;
|
|
5
|
+
language?: SddLanguage;
|
|
6
|
+
layout?: SddLayout;
|
|
7
|
+
render?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SddInitResult {
|
|
10
|
+
projectRoot: string;
|
|
11
|
+
memoryDir: string;
|
|
12
|
+
frontendEnabled: boolean;
|
|
13
|
+
rendered: boolean;
|
|
14
|
+
skillsSeeded: number;
|
|
15
|
+
localSkillsMaterialized: number;
|
|
16
|
+
syncedTools: string[];
|
|
17
|
+
sddBootstrap: BootstrapContextReport;
|
|
18
|
+
}
|
|
19
|
+
export interface SddInitContextOptions {
|
|
20
|
+
mode?: 'merge' | 'replace';
|
|
21
|
+
deep?: boolean;
|
|
22
|
+
render?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface SddInitContextResult {
|
|
25
|
+
projectRoot: string;
|
|
26
|
+
memoryDir: string;
|
|
27
|
+
rendered: boolean;
|
|
28
|
+
sddBootstrap: BootstrapContextReport;
|
|
29
|
+
}
|
|
30
|
+
export declare class SddInitCommand {
|
|
31
|
+
execute(projectRoot: string, options?: SddInitOptions): Promise<SddInitResult>;
|
|
32
|
+
}
|
|
33
|
+
export declare class SddInitContextCommand {
|
|
34
|
+
execute(projectRoot: string, options?: SddInitContextOptions): Promise<SddInitContextResult>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { loadProjectSddConfig, loadStateSnapshot, ensureBaseFiles, ensureBaseStructure, resolveSddPaths, upsertProjectSddConfig, } from './state.js';
|
|
2
|
+
import { renderViews } from './views.js';
|
|
3
|
+
import { syncSddGuideDocs } from './docs-sync.js';
|
|
4
|
+
import { bootstrapInitialContext } from './bootstrap.js';
|
|
5
|
+
import { SkillsSyncService } from './services/skills-sync.service.js';
|
|
6
|
+
import { createSddStores } from './store/sdd-stores.js';
|
|
7
|
+
export class SddInitCommand {
|
|
8
|
+
async execute(projectRoot, options = {}) {
|
|
9
|
+
const config = await upsertProjectSddConfig(projectRoot, {
|
|
10
|
+
frontendEnabled: options.frontendEnabled,
|
|
11
|
+
language: options.language,
|
|
12
|
+
layout: options.layout,
|
|
13
|
+
});
|
|
14
|
+
const paths = resolveSddPaths(projectRoot, config);
|
|
15
|
+
await ensureBaseStructure(paths);
|
|
16
|
+
await ensureBaseFiles(paths, config);
|
|
17
|
+
const sddBootstrap = await bootstrapInitialContext(projectRoot, paths, config, {
|
|
18
|
+
mode: 'empty-only',
|
|
19
|
+
deep: false,
|
|
20
|
+
});
|
|
21
|
+
const skillsSync = await new SkillsSyncService(createSddStores(paths)).execute(projectRoot, { all: true });
|
|
22
|
+
const shouldRender = options.render ?? config.views.autoRender;
|
|
23
|
+
if (shouldRender) {
|
|
24
|
+
const state = await loadStateSnapshot(paths, config);
|
|
25
|
+
await renderViews(paths, config, state);
|
|
26
|
+
}
|
|
27
|
+
await syncSddGuideDocs(projectRoot, paths, config);
|
|
28
|
+
return {
|
|
29
|
+
projectRoot,
|
|
30
|
+
memoryDir: paths.memoryRoot,
|
|
31
|
+
frontendEnabled: config.frontend.enabled,
|
|
32
|
+
rendered: shouldRender,
|
|
33
|
+
skillsSeeded: skillsSync.synced,
|
|
34
|
+
localSkillsMaterialized: skillsSync.local_synced,
|
|
35
|
+
syncedTools: skillsSync.tools,
|
|
36
|
+
sddBootstrap,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class SddInitContextCommand {
|
|
41
|
+
async execute(projectRoot, options = {}) {
|
|
42
|
+
const config = await loadProjectSddConfig(projectRoot);
|
|
43
|
+
const paths = resolveSddPaths(projectRoot, config);
|
|
44
|
+
const stores = createSddStores(paths);
|
|
45
|
+
await ensureBaseStructure(paths);
|
|
46
|
+
await ensureBaseFiles(paths, config);
|
|
47
|
+
const sddBootstrap = await bootstrapInitialContext(projectRoot, paths, config, {
|
|
48
|
+
mode: options.mode || 'merge',
|
|
49
|
+
deep: options.deep ?? true,
|
|
50
|
+
});
|
|
51
|
+
const shouldRender = options.render ?? config.views.autoRender;
|
|
52
|
+
if (shouldRender) {
|
|
53
|
+
const state = await loadStateSnapshot(paths, config);
|
|
54
|
+
await renderViews(paths, config, state);
|
|
55
|
+
}
|
|
56
|
+
await syncSddGuideDocs(projectRoot, paths, config);
|
|
57
|
+
return {
|
|
58
|
+
projectRoot,
|
|
59
|
+
memoryDir: paths.memoryRoot,
|
|
60
|
+
rendered: shouldRender,
|
|
61
|
+
sddBootstrap,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type WorkspaceDocumentFileName } from './workspace-schemas.js';
|
|
2
|
+
type JsonSchemaDocument = Record<string, unknown>;
|
|
3
|
+
export declare function buildWorkspaceJsonSchemas(): Record<WorkspaceDocumentFileName, JsonSchemaDocument>;
|
|
4
|
+
export declare function buildWorkspaceJsonSchemaCatalog(): Record<string, unknown>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=json-schema.d.ts.map
|