@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,23 @@
|
|
|
1
|
+
import { SddStores } from "../store/sdd-stores.js";
|
|
2
|
+
export declare class FrontendGapService {
|
|
3
|
+
private readonly stores;
|
|
4
|
+
constructor(stores: SddStores);
|
|
5
|
+
add(projectRoot: string, title: string, options?: {
|
|
6
|
+
originFeature?: string;
|
|
7
|
+
routes?: string[];
|
|
8
|
+
menu?: string[];
|
|
9
|
+
render?: boolean;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
id: string;
|
|
12
|
+
}>;
|
|
13
|
+
resolve(projectRoot: string, gapId: string, options?: {
|
|
14
|
+
feature?: string;
|
|
15
|
+
files?: string[];
|
|
16
|
+
routes?: string[];
|
|
17
|
+
render?: boolean;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
id: string;
|
|
20
|
+
status: "DONE";
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=frontend-gap.service.d.ts.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { CLI_NAME } from "../../branding.js";
|
|
2
|
+
import { allocateEntityId, loadStateSnapshot, nowIso, saveStateTransaction } from "../state.js";
|
|
3
|
+
import { slugify, getRuntime, persistAndRender } from "../legacy-operations.js";
|
|
4
|
+
import { withStateLock } from "../state-lock.js";
|
|
5
|
+
export class FrontendGapService {
|
|
6
|
+
stores;
|
|
7
|
+
constructor(stores) {
|
|
8
|
+
this.stores = stores;
|
|
9
|
+
}
|
|
10
|
+
async add(projectRoot, title, options) {
|
|
11
|
+
if (!title.trim()) {
|
|
12
|
+
throw new Error('Titulo do gap vazio.');
|
|
13
|
+
}
|
|
14
|
+
const { config, paths } = await getRuntime(projectRoot);
|
|
15
|
+
if (!config.frontend.enabled) {
|
|
16
|
+
throw new Error(`Modulo de frontend desativado. Execute "${CLI_NAME} sdd init --frontend".`);
|
|
17
|
+
}
|
|
18
|
+
return withStateLock(paths.stateDir, async () => {
|
|
19
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
20
|
+
const id = await allocateEntityId(paths, 'FGAP');
|
|
21
|
+
const now = nowIso();
|
|
22
|
+
snapshot.frontendGaps.items.push({
|
|
23
|
+
id,
|
|
24
|
+
title: title.trim(),
|
|
25
|
+
status: 'OPEN',
|
|
26
|
+
origin_kind: 'manual',
|
|
27
|
+
detection_sources: ['manual'],
|
|
28
|
+
origin_feature: options?.originFeature || '',
|
|
29
|
+
backend_refs: [],
|
|
30
|
+
frontend_scope: '',
|
|
31
|
+
route_targets: options?.routes || [],
|
|
32
|
+
menu_targets: options?.menu || [],
|
|
33
|
+
suggested_files: [],
|
|
34
|
+
implemented_files: [],
|
|
35
|
+
resolved_by_feature: '',
|
|
36
|
+
related_route_ids: [],
|
|
37
|
+
notes: '',
|
|
38
|
+
created_at: now,
|
|
39
|
+
updated_at: now,
|
|
40
|
+
});
|
|
41
|
+
for (const routePath of options?.routes || []) {
|
|
42
|
+
const routeId = `route-${slugify(routePath) || 'root'}`;
|
|
43
|
+
const existing = snapshot.frontendMap.routes.find((route) => route.id === routeId);
|
|
44
|
+
if (existing) {
|
|
45
|
+
existing.ui_status = existing.ui_status === 'OK' ? 'PARTIAL' : existing.ui_status;
|
|
46
|
+
existing.source_gap_ids = Array.from(new Set([...existing.source_gap_ids, id]));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
snapshot.frontendMap.routes.push({
|
|
50
|
+
id: routeId,
|
|
51
|
+
path: routePath,
|
|
52
|
+
parent_id: '',
|
|
53
|
+
label: '',
|
|
54
|
+
nav_surface: '',
|
|
55
|
+
ui_status: 'GAP',
|
|
56
|
+
source_gap_ids: [id],
|
|
57
|
+
implemented_files: [],
|
|
58
|
+
notes: '',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
await saveStateTransaction(paths, {
|
|
63
|
+
frontendGaps: snapshot.frontendGaps,
|
|
64
|
+
frontendMap: snapshot.frontendMap,
|
|
65
|
+
});
|
|
66
|
+
await persistAndRender(paths, config, options?.render);
|
|
67
|
+
return { id };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async resolve(projectRoot, gapId, options) {
|
|
71
|
+
const { config, paths } = await getRuntime(projectRoot);
|
|
72
|
+
if (!config.frontend.enabled) {
|
|
73
|
+
throw new Error(`Modulo de frontend desativado. Execute "${CLI_NAME} sdd init --frontend".`);
|
|
74
|
+
}
|
|
75
|
+
return withStateLock(paths.stateDir, async () => {
|
|
76
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
77
|
+
const gap = snapshot.frontendGaps.items.find((item) => item.id === gapId);
|
|
78
|
+
if (!gap) {
|
|
79
|
+
throw new Error(`Gap ${gapId} nao encontrado.`);
|
|
80
|
+
}
|
|
81
|
+
const now = nowIso();
|
|
82
|
+
gap.status = 'DONE';
|
|
83
|
+
gap.resolved_by_feature = options?.feature || '';
|
|
84
|
+
gap.implemented_files = options?.files || [];
|
|
85
|
+
gap.updated_at = now;
|
|
86
|
+
const routeTargets = new Set([...(gap.route_targets || []), ...(options?.routes || [])]);
|
|
87
|
+
for (const routePath of routeTargets) {
|
|
88
|
+
const routeId = `route-${slugify(routePath) || 'root'}`;
|
|
89
|
+
const route = snapshot.frontendMap.routes.find((entry) => entry.id === routeId);
|
|
90
|
+
if (!route) {
|
|
91
|
+
snapshot.frontendMap.routes.push({
|
|
92
|
+
id: routeId,
|
|
93
|
+
path: routePath,
|
|
94
|
+
parent_id: '',
|
|
95
|
+
label: '',
|
|
96
|
+
nav_surface: '',
|
|
97
|
+
ui_status: 'OK',
|
|
98
|
+
source_gap_ids: [gap.id],
|
|
99
|
+
implemented_files: options?.files || [],
|
|
100
|
+
notes: '',
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
route.ui_status = 'OK';
|
|
105
|
+
route.implemented_files = Array.from(new Set([...(route.implemented_files || []), ...(options?.files || [])]));
|
|
106
|
+
route.source_gap_ids = Array.from(new Set([...(route.source_gap_ids || []), gap.id]));
|
|
107
|
+
}
|
|
108
|
+
await saveStateTransaction(paths, {
|
|
109
|
+
frontendGaps: snapshot.frontendGaps,
|
|
110
|
+
frontendMap: snapshot.frontendMap,
|
|
111
|
+
});
|
|
112
|
+
await persistAndRender(paths, config, options?.render);
|
|
113
|
+
return { id: gap.id, status: gap.status };
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=frontend-gap.service.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SddStores } from "../store/sdd-stores.js";
|
|
2
|
+
export declare class FrontendImpactService {
|
|
3
|
+
private readonly stores;
|
|
4
|
+
constructor(stores: SddStores);
|
|
5
|
+
execute(projectRoot: string, featureId: string, options: {
|
|
6
|
+
status: 'unknown' | 'none' | 'required';
|
|
7
|
+
reason?: string;
|
|
8
|
+
routes?: string[];
|
|
9
|
+
surfaces?: string[];
|
|
10
|
+
render?: boolean;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
feature_id: string;
|
|
13
|
+
frontend_impact_status: "unknown" | "none" | "required";
|
|
14
|
+
frontend_impact_reason: string;
|
|
15
|
+
frontend_impact_declared_at: string;
|
|
16
|
+
frontend_surface_tokens: string[];
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=frontend-impact.service.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CLI_NAME } from "../../branding.js";
|
|
2
|
+
import { loadStateSnapshot, nowIso, saveBacklogState } from "../state.js";
|
|
3
|
+
import { getRuntime, persistAndRender, resolveFeat } from "../legacy-operations.js";
|
|
4
|
+
import { withStateLock } from "../state-lock.js";
|
|
5
|
+
export class FrontendImpactService {
|
|
6
|
+
stores;
|
|
7
|
+
constructor(stores) {
|
|
8
|
+
this.stores = stores;
|
|
9
|
+
}
|
|
10
|
+
async execute(projectRoot, featureId, options) {
|
|
11
|
+
const { config, paths } = await getRuntime(projectRoot);
|
|
12
|
+
if (!config.frontend.enabled && options.status !== 'none') {
|
|
13
|
+
throw new Error(`Modulo de frontend desativado. Execute "${CLI_NAME} sdd init --frontend".`);
|
|
14
|
+
}
|
|
15
|
+
return withStateLock(paths.stateDir, async () => {
|
|
16
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
17
|
+
const feature = resolveFeat(snapshot.backlog.items, featureId);
|
|
18
|
+
const status = options.status;
|
|
19
|
+
const reason = (options.reason || '').trim();
|
|
20
|
+
if (status === 'none' && reason.length < 20) {
|
|
21
|
+
throw new Error('Para frontend_impact=none, informe --reason com no minimo 20 caracteres.');
|
|
22
|
+
}
|
|
23
|
+
const routeTokens = (options.routes || [])
|
|
24
|
+
.map((route) => route.trim())
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.map((route) => (route.startsWith('/') ? route : `/${route}`))
|
|
27
|
+
.map((route) => `route:${route}`);
|
|
28
|
+
const extraSurfaces = (options.surfaces || []).map((surface) => surface.trim()).filter(Boolean);
|
|
29
|
+
feature.frontend_surface_tokens = Array.from(new Set([...(feature.frontend_surface_tokens || []), ...routeTokens, ...extraSurfaces]));
|
|
30
|
+
feature.frontend_impact_status = status;
|
|
31
|
+
feature.frontend_impact_reason = reason;
|
|
32
|
+
feature.frontend_impact_declared_at = nowIso();
|
|
33
|
+
feature.last_sync_at = feature.frontend_impact_declared_at;
|
|
34
|
+
await saveBacklogState(paths, snapshot.backlog);
|
|
35
|
+
await persistAndRender(paths, config, options.render);
|
|
36
|
+
return {
|
|
37
|
+
feature_id: feature.id,
|
|
38
|
+
frontend_impact_status: feature.frontend_impact_status,
|
|
39
|
+
frontend_impact_reason: feature.frontend_impact_reason || '',
|
|
40
|
+
frontend_impact_declared_at: feature.frontend_impact_declared_at || '',
|
|
41
|
+
frontend_surface_tokens: feature.frontend_surface_tokens,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=frontend-impact.service.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FlowMode, Scale } from "../types.js";
|
|
2
|
+
import { SddStores } from "../store/sdd-stores.js";
|
|
3
|
+
export declare class IngestDepositoService {
|
|
4
|
+
private readonly stores;
|
|
5
|
+
constructor(stores: SddStores);
|
|
6
|
+
private computeSourceFingerprint;
|
|
7
|
+
execute(projectRoot: string, options?: {
|
|
8
|
+
sourceDir?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
radarId?: string;
|
|
11
|
+
titles?: string[];
|
|
12
|
+
scale?: Scale;
|
|
13
|
+
flowMode?: FlowMode;
|
|
14
|
+
start?: boolean;
|
|
15
|
+
render?: boolean;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
source_dir: string;
|
|
18
|
+
scanned_files: number;
|
|
19
|
+
indexed_created: number;
|
|
20
|
+
indexed_updated: number;
|
|
21
|
+
radar_id: string;
|
|
22
|
+
created_features: string[];
|
|
23
|
+
linked_existing: string[];
|
|
24
|
+
started_feature_id: string;
|
|
25
|
+
active_path: string;
|
|
26
|
+
generated_docs: string[];
|
|
27
|
+
start_warning: string;
|
|
28
|
+
used_skills: string[];
|
|
29
|
+
recommended_prompt: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ingest-deposito.service.d.ts.map
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
import { CLI_NAME } from "../../branding.js";
|
|
4
|
+
import { allocateEntityId, loadStateSnapshot, nowIso, saveStateTransaction } from "../state.js";
|
|
5
|
+
import { slugify, markdownRadarFromDepositoTemplate, sourceTypeFromRelativePath, defaultConsolidationTargets, deriveInitialFeatureTitles, listFilesRecursively, sourceTitleFromPath, normalizeSourceStatus, nextSourceId, extractSourceSummary, syncCounterFromId, getRuntime, persistAndRender, relProjectPath, resolveRadar, featureReadiness, pathExists } from "../legacy-operations.js";
|
|
6
|
+
import { BreakdownService } from "./breakdown.service.js";
|
|
7
|
+
import { StartService } from "./start.service.js";
|
|
8
|
+
import { withStateLock } from "../state-lock.js";
|
|
9
|
+
export class IngestDepositoService {
|
|
10
|
+
stores;
|
|
11
|
+
constructor(stores) {
|
|
12
|
+
this.stores = stores;
|
|
13
|
+
}
|
|
14
|
+
computeSourceFingerprint(type, title, summary) {
|
|
15
|
+
const normalized = `${type}|${title}|${summary}`.trim().toLowerCase();
|
|
16
|
+
let hash = 0;
|
|
17
|
+
for (let i = 0; i < normalized.length; i += 1) {
|
|
18
|
+
hash = ((hash << 5) - hash + normalized.charCodeAt(i)) | 0;
|
|
19
|
+
}
|
|
20
|
+
return `fp-${Math.abs(hash)}`;
|
|
21
|
+
}
|
|
22
|
+
async execute(projectRoot, options) {
|
|
23
|
+
const { config, paths } = await getRuntime(projectRoot);
|
|
24
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
25
|
+
const now = nowIso();
|
|
26
|
+
const sourceDir = options?.sourceDir
|
|
27
|
+
? path.resolve(projectRoot, options.sourceDir)
|
|
28
|
+
: paths.depositoDir;
|
|
29
|
+
const sourceDirExists = await pathExists(sourceDir);
|
|
30
|
+
if (!sourceDirExists) {
|
|
31
|
+
throw new Error(`Diretorio de deposito nao encontrado: ${sourceDir}`);
|
|
32
|
+
}
|
|
33
|
+
const scannedFiles = (await listFilesRecursively(sourceDir))
|
|
34
|
+
.filter((filePath) => !path.basename(filePath).startsWith('.'))
|
|
35
|
+
.filter((filePath) => path.basename(filePath).toLowerCase() !== 'readme.md')
|
|
36
|
+
.sort((a, b) => a.localeCompare(b));
|
|
37
|
+
if (scannedFiles.length === 0) {
|
|
38
|
+
throw new Error('Nenhuma fonte encontrada no deposito. Adicione arquivos e rode novamente.');
|
|
39
|
+
}
|
|
40
|
+
const sourceByPath = new Map(snapshot.sourceIndex.sources.map((source) => [source.path.replace(/\\/g, '/'), source]));
|
|
41
|
+
const scannedSourceRefs = new Set();
|
|
42
|
+
let indexedCreated = 0;
|
|
43
|
+
let indexedUpdated = 0;
|
|
44
|
+
for (const filePath of scannedFiles) {
|
|
45
|
+
const relative = relProjectPath(paths, filePath);
|
|
46
|
+
const normalizedPath = relative.replace(/\\/g, '/');
|
|
47
|
+
const type = sourceTypeFromRelativePath(normalizedPath);
|
|
48
|
+
const title = sourceTitleFromPath(filePath);
|
|
49
|
+
const summary = await extractSourceSummary(filePath);
|
|
50
|
+
const fingerprint = this.computeSourceFingerprint(type, title, summary || '');
|
|
51
|
+
const existing = sourceByPath.get(normalizedPath);
|
|
52
|
+
if (!existing) {
|
|
53
|
+
const id = nextSourceId(snapshot.sourceIndex.sources.map((source) => source.id));
|
|
54
|
+
const created = {
|
|
55
|
+
id,
|
|
56
|
+
type,
|
|
57
|
+
path: normalizedPath,
|
|
58
|
+
title,
|
|
59
|
+
status: 'INDEXED',
|
|
60
|
+
source_version: 1,
|
|
61
|
+
source_fingerprint: fingerprint,
|
|
62
|
+
authority: 'unknown',
|
|
63
|
+
source_url: '',
|
|
64
|
+
source_classification: 'other',
|
|
65
|
+
jurisdiction_tags: [],
|
|
66
|
+
last_verified_at: '',
|
|
67
|
+
verification_status: 'unverified',
|
|
68
|
+
verification_notes: '',
|
|
69
|
+
legal_validation_required: false,
|
|
70
|
+
summary,
|
|
71
|
+
imported_at: now,
|
|
72
|
+
updated_at: now,
|
|
73
|
+
used_by: [],
|
|
74
|
+
notes: [],
|
|
75
|
+
consolidation_targets: defaultConsolidationTargets(type),
|
|
76
|
+
};
|
|
77
|
+
snapshot.sourceIndex.sources.push(created);
|
|
78
|
+
const versionEvent = {
|
|
79
|
+
id: `${created.id}-v1`,
|
|
80
|
+
source_id: created.id,
|
|
81
|
+
version: 1,
|
|
82
|
+
changed_at: now,
|
|
83
|
+
reason: 'ingest_create',
|
|
84
|
+
actor: CLI_NAME,
|
|
85
|
+
summary: `Initial source registration from ${normalizedPath}`,
|
|
86
|
+
};
|
|
87
|
+
snapshot.sourceIndex.version_events.push(versionEvent);
|
|
88
|
+
sourceByPath.set(normalizedPath, created);
|
|
89
|
+
scannedSourceRefs.add(created.id);
|
|
90
|
+
indexedCreated += 1;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const previousFingerprint = existing.source_fingerprint || '';
|
|
94
|
+
const previousVersion = typeof existing.source_version === 'number' && existing.source_version > 0
|
|
95
|
+
? existing.source_version
|
|
96
|
+
: 1;
|
|
97
|
+
existing.type = type;
|
|
98
|
+
existing.title = existing.title || title;
|
|
99
|
+
existing.status = normalizeSourceStatus(existing.status, 'INDEXED');
|
|
100
|
+
existing.summary = existing.summary || summary;
|
|
101
|
+
existing.updated_at = now;
|
|
102
|
+
existing.source_classification = existing.source_classification || 'other';
|
|
103
|
+
existing.authority = existing.authority || 'unknown';
|
|
104
|
+
existing.verification_status = existing.verification_status || 'unverified';
|
|
105
|
+
existing.jurisdiction_tags = Array.isArray(existing.jurisdiction_tags)
|
|
106
|
+
? existing.jurisdiction_tags
|
|
107
|
+
: [];
|
|
108
|
+
existing.legal_validation_required = Boolean(existing.legal_validation_required);
|
|
109
|
+
existing.source_fingerprint = existing.source_fingerprint || previousFingerprint;
|
|
110
|
+
existing.source_version = previousVersion;
|
|
111
|
+
existing.consolidation_targets = Array.from(new Set([...existing.consolidation_targets, ...defaultConsolidationTargets(type)]));
|
|
112
|
+
if (!existing.source_fingerprint || existing.source_fingerprint !== fingerprint) {
|
|
113
|
+
existing.source_version = previousVersion + 1;
|
|
114
|
+
existing.source_fingerprint = fingerprint;
|
|
115
|
+
snapshot.sourceIndex.version_events.push({
|
|
116
|
+
id: `${existing.id}-v${existing.source_version}`,
|
|
117
|
+
source_id: existing.id,
|
|
118
|
+
version: existing.source_version,
|
|
119
|
+
changed_at: now,
|
|
120
|
+
reason: 'ingest_update',
|
|
121
|
+
actor: CLI_NAME,
|
|
122
|
+
summary: `Source metadata or summary changed for ${normalizedPath}`,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
scannedSourceRefs.add(existing.id);
|
|
126
|
+
indexedUpdated += 1;
|
|
127
|
+
}
|
|
128
|
+
let radarId = options?.radarId || '';
|
|
129
|
+
let radar = radarId
|
|
130
|
+
? snapshot.discoveryIndex.records.find((record) => record.id === radarId && (record.type === 'RAD' || record.type === 'EPIC'))
|
|
131
|
+
: undefined;
|
|
132
|
+
if (!radar) {
|
|
133
|
+
radarId = await allocateEntityId(paths, 'EPIC');
|
|
134
|
+
syncCounterFromId(snapshot.discoveryIndex, radarId);
|
|
135
|
+
radar = {
|
|
136
|
+
id: radarId,
|
|
137
|
+
type: 'EPIC',
|
|
138
|
+
title: (options?.title || 'Planejamento inicial a partir do deposito').slice(0, 120),
|
|
139
|
+
status: 'READY',
|
|
140
|
+
origin_prompt: `Gerado por ingestao de deposito em ${now}`,
|
|
141
|
+
related_ids: [],
|
|
142
|
+
warning_links: [],
|
|
143
|
+
created_at: now,
|
|
144
|
+
updated_at: now,
|
|
145
|
+
};
|
|
146
|
+
snapshot.discoveryIndex.records.push(radar);
|
|
147
|
+
const radarPath = path.join(paths.discoveryEpicDir, `${radarId}-${slugify(radar.title)}.md`);
|
|
148
|
+
await fs.writeFile(radarPath, markdownRadarFromDepositoTemplate(radarId, radar.title, scannedFiles.length, options?.title), 'utf-8');
|
|
149
|
+
}
|
|
150
|
+
resolveRadar(radar);
|
|
151
|
+
await withStateLock(paths.stateDir, async () => {
|
|
152
|
+
await saveStateTransaction(paths, {
|
|
153
|
+
discoveryIndex: snapshot.discoveryIndex,
|
|
154
|
+
sourceIndex: snapshot.sourceIndex,
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
const plannedTitles = options?.titles && options.titles.length > 0
|
|
158
|
+
? options.titles.filter((title) => title.trim().length > 0)
|
|
159
|
+
: deriveInitialFeatureTitles(snapshot.sourceIndex.sources.filter((source) => scannedSourceRefs.has(source.id)), config.frontend.enabled);
|
|
160
|
+
const breakdownResult = await new BreakdownService(this.stores).execute(projectRoot, radarId, {
|
|
161
|
+
titles: plannedTitles,
|
|
162
|
+
scale: options?.scale || 'STANDARD',
|
|
163
|
+
mode: 'graph',
|
|
164
|
+
incremental: true,
|
|
165
|
+
dedupe: 'normal',
|
|
166
|
+
render: false,
|
|
167
|
+
});
|
|
168
|
+
const postPlan = await loadStateSnapshot(paths, config);
|
|
169
|
+
const usedByRefs = [radarId, ...breakdownResult.created, ...breakdownResult.linked_existing];
|
|
170
|
+
for (const source of postPlan.sourceIndex.sources) {
|
|
171
|
+
if (!scannedSourceRefs.has(source.id))
|
|
172
|
+
continue;
|
|
173
|
+
source.used_by = Array.from(new Set([...source.used_by, ...usedByRefs]));
|
|
174
|
+
source.status = normalizeSourceStatus(source.status, 'PLANNED');
|
|
175
|
+
source.updated_at = nowIso();
|
|
176
|
+
source.consolidation_targets = Array.from(new Set([...source.consolidation_targets, 'radar', 'backlog']));
|
|
177
|
+
}
|
|
178
|
+
await withStateLock(paths.stateDir, async () => {
|
|
179
|
+
await saveStateTransaction(paths, { sourceIndex: postPlan.sourceIndex });
|
|
180
|
+
});
|
|
181
|
+
const shouldStart = options?.start ?? true;
|
|
182
|
+
let startedFeatureId = '';
|
|
183
|
+
let activePath = '';
|
|
184
|
+
let generatedDocs = [];
|
|
185
|
+
let startWarning = '';
|
|
186
|
+
if (shouldStart) {
|
|
187
|
+
const candidateIds = new Set([...breakdownResult.created, ...breakdownResult.linked_existing]);
|
|
188
|
+
const candidates = postPlan.backlog.items
|
|
189
|
+
.filter((item) => candidateIds.has(item.id))
|
|
190
|
+
.filter((item) => featureReadiness(item, postPlan.backlog.items) === 'READY')
|
|
191
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
192
|
+
const candidate = candidates[0];
|
|
193
|
+
if (candidate) {
|
|
194
|
+
const started = await new StartService(this.stores).execute(projectRoot, candidate.id, {
|
|
195
|
+
scale: options?.scale,
|
|
196
|
+
flowMode: options?.flowMode,
|
|
197
|
+
render: false,
|
|
198
|
+
});
|
|
199
|
+
startedFeatureId = started.featureId;
|
|
200
|
+
activePath = started.active_path;
|
|
201
|
+
generatedDocs = started.generated_docs;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
startWarning =
|
|
205
|
+
'Nenhuma FEAT pronta para iniciar automaticamente (dependencias/locks pendentes). Use "opensdd sdd next".';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
await persistAndRender(paths, config, options?.render);
|
|
209
|
+
return {
|
|
210
|
+
source_dir: relProjectPath(paths, sourceDir),
|
|
211
|
+
scanned_files: scannedFiles.length,
|
|
212
|
+
indexed_created: indexedCreated,
|
|
213
|
+
indexed_updated: indexedUpdated,
|
|
214
|
+
radar_id: radarId,
|
|
215
|
+
created_features: breakdownResult.created,
|
|
216
|
+
linked_existing: breakdownResult.linked_existing,
|
|
217
|
+
started_feature_id: startedFeatureId,
|
|
218
|
+
active_path: activePath,
|
|
219
|
+
generated_docs: generatedDocs,
|
|
220
|
+
start_warning: startWarning,
|
|
221
|
+
used_skills: [
|
|
222
|
+
'source-intake-sdd',
|
|
223
|
+
'business-extractor-sdd',
|
|
224
|
+
'frontend-extractor-sdd',
|
|
225
|
+
'planning-normalizer-sdd',
|
|
226
|
+
],
|
|
227
|
+
recommended_prompt: relProjectPath(paths, path.join(paths.promptsDir, '01-ingestao-deposito.md')),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=ingest-deposito.service.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SddStores } from "../store/sdd-stores.js";
|
|
2
|
+
export declare class InsightService {
|
|
3
|
+
private readonly stores;
|
|
4
|
+
constructor(stores: SddStores);
|
|
5
|
+
execute(projectRoot: string, text: string, options?: {
|
|
6
|
+
title?: string;
|
|
7
|
+
render?: boolean;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
filePath: string;
|
|
12
|
+
warnings: {
|
|
13
|
+
level: "warning";
|
|
14
|
+
entity_id: string;
|
|
15
|
+
score: number;
|
|
16
|
+
message: string;
|
|
17
|
+
}[];
|
|
18
|
+
reused: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=insight.service.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
import { allocateEntityId, loadStateSnapshot, nowIso, saveStateTransaction } from "../state.js";
|
|
4
|
+
import { normalizeSemanticText, warnAndLink } from "../dedup.js";
|
|
5
|
+
import { slugify, computeCanonicalTitle, markdownInsightTemplate, syncCounterFromId, getRuntime, persistAndRender } from "../legacy-operations.js";
|
|
6
|
+
import { withStateLock } from "../state-lock.js";
|
|
7
|
+
export class InsightService {
|
|
8
|
+
stores;
|
|
9
|
+
constructor(stores) {
|
|
10
|
+
this.stores = stores;
|
|
11
|
+
}
|
|
12
|
+
async execute(projectRoot, text, options) {
|
|
13
|
+
const trimmed = text.trim();
|
|
14
|
+
if (!trimmed) {
|
|
15
|
+
throw new Error('Insight vazio. Informe um texto para registrar.');
|
|
16
|
+
}
|
|
17
|
+
const { config, paths } = await getRuntime(projectRoot);
|
|
18
|
+
return withStateLock(paths.stateDir, async () => {
|
|
19
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
20
|
+
const title = (options?.title || trimmed.split('\n')[0] || 'Insight sem titulo').slice(0, 120);
|
|
21
|
+
const titleCanonical = computeCanonicalTitle(title);
|
|
22
|
+
const promptCanonical = normalizeSemanticText(trimmed);
|
|
23
|
+
const existingInsight = snapshot.discoveryIndex.records.find((existing) => existing.type === 'INS' &&
|
|
24
|
+
normalizeSemanticText(existing.origin_prompt || '') === promptCanonical &&
|
|
25
|
+
(existing.title_canonical || computeCanonicalTitle(existing.title)) === titleCanonical);
|
|
26
|
+
if (existingInsight) {
|
|
27
|
+
return {
|
|
28
|
+
id: existingInsight.id,
|
|
29
|
+
title: existingInsight.title,
|
|
30
|
+
filePath: path.join(paths.discoveryInsightsDir, `${existingInsight.id}-${slugify(existingInsight.title)}.md`),
|
|
31
|
+
warnings: [],
|
|
32
|
+
reused: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const id = await allocateEntityId(paths, 'INS');
|
|
36
|
+
syncCounterFromId(snapshot.discoveryIndex, id);
|
|
37
|
+
const now = nowIso();
|
|
38
|
+
const record = {
|
|
39
|
+
id,
|
|
40
|
+
type: 'INS',
|
|
41
|
+
title,
|
|
42
|
+
title_canonical: titleCanonical,
|
|
43
|
+
status: 'NEW',
|
|
44
|
+
origin_prompt: trimmed,
|
|
45
|
+
related_ids: [],
|
|
46
|
+
warning_links: [],
|
|
47
|
+
created_at: now,
|
|
48
|
+
updated_at: now,
|
|
49
|
+
};
|
|
50
|
+
const semanticWarning = warnAndLink('INS', titleCanonical, snapshot.discoveryIndex.records
|
|
51
|
+
.filter((existing) => existing.type === 'INS' || existing.type === 'DEB')
|
|
52
|
+
.map((existing) => ({
|
|
53
|
+
id: existing.id,
|
|
54
|
+
title: existing.title_canonical || existing.title,
|
|
55
|
+
})));
|
|
56
|
+
if (semanticWarning.severity === 'warning') {
|
|
57
|
+
record.warning_links = semanticWarning.warningLinks;
|
|
58
|
+
}
|
|
59
|
+
snapshot.discoveryIndex.records.push(record);
|
|
60
|
+
await saveStateTransaction(paths, { discoveryIndex: snapshot.discoveryIndex });
|
|
61
|
+
const filePath = path.join(paths.discoveryInsightsDir, `${id}-${slugify(title)}.md`);
|
|
62
|
+
await fs.writeFile(filePath, markdownInsightTemplate(id, title, trimmed), 'utf-8');
|
|
63
|
+
await persistAndRender(paths, config, options?.render);
|
|
64
|
+
return {
|
|
65
|
+
id,
|
|
66
|
+
title,
|
|
67
|
+
filePath,
|
|
68
|
+
warnings: semanticWarning.severity === 'warning'
|
|
69
|
+
? semanticWarning.candidates.map((candidate) => ({
|
|
70
|
+
level: 'warning',
|
|
71
|
+
entity_id: candidate.id,
|
|
72
|
+
score: candidate.score,
|
|
73
|
+
message: `Possível duplicidade semântica com ${candidate.id} (${candidate.score.toFixed(2)})`,
|
|
74
|
+
}))
|
|
75
|
+
: [],
|
|
76
|
+
reused: false,
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=insight.service.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface LegacyCapabilityDefinition {
|
|
2
|
+
id: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
liveRootDir: string;
|
|
5
|
+
importedRootSegments: string[];
|
|
6
|
+
importedDepositoSegments: string[];
|
|
7
|
+
deprecatedImportedRootSegments?: string[][];
|
|
8
|
+
}
|
|
9
|
+
export declare const OPENSPEC_LEGACY_CAPABILITY: LegacyCapabilityDefinition;
|
|
10
|
+
export declare const LEGACY_OPENSPEC_DIR: string;
|
|
11
|
+
export declare const IMPORTED_OPENSPEC_DIR: string;
|
|
12
|
+
export declare function resolveLegacyCapabilityLiveRoot(projectRoot: string, capability?: LegacyCapabilityDefinition): string;
|
|
13
|
+
export declare function resolveLegacyCapabilityLiveSubpath(projectRoot: string, capability: LegacyCapabilityDefinition, ...segments: string[]): string;
|
|
14
|
+
export declare function resolveLegacyCapabilityImportedRoot(projectRoot: string, capability?: LegacyCapabilityDefinition): string;
|
|
15
|
+
export declare function resolveLegacyCapabilityDeprecatedImportedRoots(projectRoot: string, capability?: LegacyCapabilityDefinition): string[];
|
|
16
|
+
export declare function resolveLegacyCapabilityImportedDepositoRoot(depositoDir: string, capability?: LegacyCapabilityDefinition): string;
|
|
17
|
+
export declare function resolveLegacyCapabilityRoot(projectRoot?: string, capability?: LegacyCapabilityDefinition): string;
|
|
18
|
+
export declare function resolveLegacyCapabilitySubpath(projectRoot: string, capability: LegacyCapabilityDefinition, ...segments: string[]): string;
|
|
19
|
+
export declare function displayLegacyCapabilityPath(capability: LegacyCapabilityDefinition, ...segments: string[]): string;
|
|
20
|
+
export declare function resolveOpenSpecRoot(projectRoot?: string): string;
|
|
21
|
+
export declare function resolveOpenSpecSubpath(projectRoot: string, ...segments: string[]): string;
|
|
22
|
+
export declare function resolveOpenSpecLiveSubpath(projectRoot: string, ...segments: string[]): string;
|
|
23
|
+
export declare function displayLegacyOpenSpecPath(...segments: string[]): string;
|
|
24
|
+
//# sourceMappingURL=legacy-capability.service.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export const OPENSPEC_LEGACY_CAPABILITY = {
|
|
4
|
+
id: 'openspec',
|
|
5
|
+
displayName: 'OpenSpec',
|
|
6
|
+
liveRootDir: 'openspec',
|
|
7
|
+
importedRootSegments: ['.sdd', 'sources', 'legacy', 'spec-corpus'],
|
|
8
|
+
importedDepositoSegments: ['legacy', 'spec-corpus'],
|
|
9
|
+
deprecatedImportedRootSegments: [['.sdd', 'sources', 'legado', 'openspec']],
|
|
10
|
+
};
|
|
11
|
+
export const LEGACY_OPENSPEC_DIR = OPENSPEC_LEGACY_CAPABILITY.liveRootDir;
|
|
12
|
+
export const IMPORTED_OPENSPEC_DIR = path.join(...OPENSPEC_LEGACY_CAPABILITY.importedRootSegments);
|
|
13
|
+
export function resolveLegacyCapabilityLiveRoot(projectRoot, capability = OPENSPEC_LEGACY_CAPABILITY) {
|
|
14
|
+
return path.join(projectRoot, capability.liveRootDir);
|
|
15
|
+
}
|
|
16
|
+
export function resolveLegacyCapabilityLiveSubpath(projectRoot, capability, ...segments) {
|
|
17
|
+
return path.join(resolveLegacyCapabilityLiveRoot(projectRoot, capability), ...segments);
|
|
18
|
+
}
|
|
19
|
+
export function resolveLegacyCapabilityImportedRoot(projectRoot, capability = OPENSPEC_LEGACY_CAPABILITY) {
|
|
20
|
+
return path.join(projectRoot, ...capability.importedRootSegments);
|
|
21
|
+
}
|
|
22
|
+
export function resolveLegacyCapabilityDeprecatedImportedRoots(projectRoot, capability = OPENSPEC_LEGACY_CAPABILITY) {
|
|
23
|
+
return (capability.deprecatedImportedRootSegments || []).map((segments) => path.join(projectRoot, ...segments));
|
|
24
|
+
}
|
|
25
|
+
export function resolveLegacyCapabilityImportedDepositoRoot(depositoDir, capability = OPENSPEC_LEGACY_CAPABILITY) {
|
|
26
|
+
return path.join(depositoDir, ...capability.importedDepositoSegments);
|
|
27
|
+
}
|
|
28
|
+
export function resolveLegacyCapabilityRoot(projectRoot = process.cwd(), capability = OPENSPEC_LEGACY_CAPABILITY) {
|
|
29
|
+
const liveRoot = resolveLegacyCapabilityLiveRoot(projectRoot, capability);
|
|
30
|
+
if (existsSync(liveRoot))
|
|
31
|
+
return liveRoot;
|
|
32
|
+
const importedRoot = resolveLegacyCapabilityImportedRoot(projectRoot, capability);
|
|
33
|
+
if (existsSync(importedRoot))
|
|
34
|
+
return importedRoot;
|
|
35
|
+
for (const deprecatedRoot of resolveLegacyCapabilityDeprecatedImportedRoots(projectRoot, capability)) {
|
|
36
|
+
if (existsSync(deprecatedRoot))
|
|
37
|
+
return deprecatedRoot;
|
|
38
|
+
}
|
|
39
|
+
return liveRoot;
|
|
40
|
+
}
|
|
41
|
+
export function resolveLegacyCapabilitySubpath(projectRoot, capability, ...segments) {
|
|
42
|
+
return path.join(resolveLegacyCapabilityRoot(projectRoot, capability), ...segments);
|
|
43
|
+
}
|
|
44
|
+
export function displayLegacyCapabilityPath(capability, ...segments) {
|
|
45
|
+
return path.join(capability.liveRootDir, ...segments);
|
|
46
|
+
}
|
|
47
|
+
export function resolveOpenSpecRoot(projectRoot = process.cwd()) {
|
|
48
|
+
return resolveLegacyCapabilityRoot(projectRoot, OPENSPEC_LEGACY_CAPABILITY);
|
|
49
|
+
}
|
|
50
|
+
export function resolveOpenSpecSubpath(projectRoot, ...segments) {
|
|
51
|
+
return resolveLegacyCapabilitySubpath(projectRoot, OPENSPEC_LEGACY_CAPABILITY, ...segments);
|
|
52
|
+
}
|
|
53
|
+
export function resolveOpenSpecLiveSubpath(projectRoot, ...segments) {
|
|
54
|
+
return resolveLegacyCapabilityLiveSubpath(projectRoot, OPENSPEC_LEGACY_CAPABILITY, ...segments);
|
|
55
|
+
}
|
|
56
|
+
export function displayLegacyOpenSpecPath(...segments) {
|
|
57
|
+
return displayLegacyCapabilityPath(OPENSPEC_LEGACY_CAPABILITY, ...segments);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=legacy-capability.service.js.map
|