@devtrack-solution/codesdd 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.sdd/skills/curated/api-clean-flask-langgraph/SKILL.md +17 -17
- package/.sdd/skills/curated/devtrack-api/SKILL.md +160 -28
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +1 -1
- package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +8 -7
- package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +93 -0
- package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +317 -0
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +95 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +295 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +4 -4
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +4 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +2 -2
- package/LICENSE +1 -1
- package/README.md +243 -51
- package/bin/codesdd.js +3 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +11 -558
- package/dist/cli/program.d.ts +14 -0
- package/dist/cli/program.js +645 -0
- package/dist/commands/change.js +5 -5
- package/dist/commands/completion.d.ts +1 -1
- package/dist/commands/completion.js +9 -2
- package/dist/commands/config.js +159 -20
- package/dist/commands/feedback.js +1 -1
- package/dist/commands/schema.d.ts +63 -0
- package/dist/commands/schema.js +12 -12
- package/dist/commands/sdd/backlog.d.ts +3 -0
- package/dist/commands/sdd/backlog.js +54 -0
- package/dist/commands/sdd/execution.js +147 -16
- package/dist/commands/sdd/plugin.d.ts +3 -0
- package/dist/commands/sdd/plugin.js +153 -0
- package/dist/commands/sdd/shared.js +2 -23
- package/dist/commands/sdd/skills.js +7 -0
- package/dist/commands/sdd.js +69 -12
- package/dist/commands/spec.js +9 -9
- package/dist/commands/validate.js +6 -6
- package/dist/commands/workflow/instructions.js +6 -6
- package/dist/commands/workflow/new-change.js +3 -3
- package/dist/commands/workflow/shared.d.ts +1 -1
- package/dist/commands/workflow/shared.js +4 -4
- package/dist/core/archive.js +15 -5
- package/dist/core/artifact-graph/instruction-loader.d.ts +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +3 -3
- package/dist/core/artifact-graph/resolver.d.ts +4 -4
- package/dist/core/artifact-graph/resolver.js +6 -6
- package/dist/core/branding.js +3 -3
- package/dist/core/cli/command-matrix.js +10 -1
- package/dist/core/cli-command-quality.d.ts +27 -0
- package/dist/core/cli-command-quality.js +171 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +1 -1
- package/dist/core/command-generation/adapters/costrict.js +2 -2
- package/dist/core/command-generation/types.d.ts +1 -1
- package/dist/core/completions/command-registry.d.ts +1 -1
- package/dist/core/completions/command-registry.js +155 -12
- package/dist/core/completions/completion-provider.d.ts +14 -1
- package/dist/core/completions/completion-provider.js +29 -1
- package/dist/core/completions/generators/bash-generator.d.ts +1 -1
- package/dist/core/completions/generators/bash-generator.js +20 -12
- package/dist/core/completions/generators/fish-generator.d.ts +9 -1
- package/dist/core/completions/generators/fish-generator.js +39 -25
- package/dist/core/completions/generators/powershell-generator.d.ts +1 -1
- package/dist/core/completions/generators/powershell-generator.js +21 -11
- package/dist/core/completions/generators/zsh-generator.d.ts +3 -6
- package/dist/core/completions/generators/zsh-generator.js +21 -42
- package/dist/core/completions/installers/bash-installer.js +6 -6
- package/dist/core/completions/installers/fish-installer.js +1 -1
- package/dist/core/completions/installers/powershell-installer.js +14 -14
- package/dist/core/completions/installers/zsh-installer.d.ts +7 -1
- package/dist/core/completions/installers/zsh-installer.js +36 -8
- package/dist/core/completions/templates/bash-templates.d.ts +1 -1
- package/dist/core/completions/templates/bash-templates.js +12 -6
- package/dist/core/completions/templates/fish-templates.d.ts +2 -2
- package/dist/core/completions/templates/fish-templates.js +20 -9
- package/dist/core/completions/templates/powershell-templates.d.ts +1 -1
- package/dist/core/completions/templates/powershell-templates.js +13 -4
- package/dist/core/completions/templates/zsh-templates.d.ts +1 -1
- package/dist/core/completions/templates/zsh-templates.js +18 -9
- package/dist/core/config-schema.d.ts +3 -1
- package/dist/core/config-schema.js +26 -1
- package/dist/core/config.d.ts +3 -3
- package/dist/core/config.js +4 -4
- package/dist/core/global-config.d.ts +41 -12
- package/dist/core/global-config.js +344 -27
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/init.d.ts +6 -1
- package/dist/core/init.js +99 -77
- package/dist/core/legacy-cleanup.d.ts +17 -17
- package/dist/core/legacy-cleanup.js +96 -79
- package/dist/core/list.js +18 -4
- package/dist/core/migration.d.ts +3 -1
- package/dist/core/migration.js +7 -8
- package/dist/core/parsers/change-parser.js +1 -1
- package/dist/core/parsers/markdown-parser.js +2 -2
- package/dist/core/profile-sync-drift.d.ts +1 -1
- package/dist/core/profile-sync-drift.js +13 -13
- package/dist/core/project-config.d.ts +4 -4
- package/dist/core/project-config.js +11 -11
- package/dist/core/schemas/change.schema.d.ts +1 -1
- package/dist/core/schemas/change.schema.js +1 -1
- package/dist/core/schemas/spec.schema.d.ts +1 -1
- package/dist/core/schemas/spec.schema.js +1 -1
- package/dist/core/sdd/adr.js +23 -1
- package/dist/core/sdd/agent-binding.d.ts +346 -0
- package/dist/core/sdd/agent-binding.js +343 -0
- package/dist/core/sdd/backlog-cli.d.ts +16 -0
- package/dist/core/sdd/backlog-cli.js +146 -0
- package/dist/core/sdd/backlog-conflict-policy.d.ts +58 -0
- package/dist/core/sdd/backlog-conflict-policy.js +230 -0
- package/dist/core/sdd/backlog-projection.d.ts +8 -0
- package/dist/core/sdd/backlog-projection.js +89 -0
- package/dist/core/sdd/backlog-provider-contract.d.ts +252 -0
- package/dist/core/sdd/backlog-provider-contract.js +158 -0
- package/dist/core/sdd/bootstrap.js +2 -2
- package/dist/core/sdd/check.d.ts +42 -0
- package/dist/core/sdd/check.js +22 -22
- package/dist/core/sdd/contract.d.ts +13 -0
- package/dist/core/sdd/contract.js +36 -0
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +38 -0
- package/dist/core/sdd/coordination/coordination-adapters.js +139 -1
- package/dist/core/sdd/deepagent-contracts.d.ts +276 -0
- package/dist/core/sdd/deepagent-contracts.js +173 -0
- package/dist/core/sdd/deepagents/adr-governor.d.ts +2 -0
- package/dist/core/sdd/deepagents/adr-governor.js +30 -0
- package/dist/core/sdd/deepagents/backend.d.ts +63 -0
- package/dist/core/sdd/deepagents/backend.js +174 -0
- package/dist/core/sdd/deepagents/codesdd-tools.d.ts +39 -0
- package/dist/core/sdd/deepagents/codesdd-tools.js +83 -0
- package/dist/core/sdd/deepagents/evidence-mapper.d.ts +86 -0
- package/dist/core/sdd/deepagents/evidence-mapper.js +178 -0
- package/dist/core/sdd/deepagents/model-provider.d.ts +53 -0
- package/dist/core/sdd/deepagents/model-provider.js +379 -0
- package/dist/core/sdd/deepagents/policy-enforcement.d.ts +30 -0
- package/dist/core/sdd/deepagents/policy-enforcement.js +90 -0
- package/dist/core/sdd/deepagents/policy.d.ts +75 -0
- package/dist/core/sdd/deepagents/policy.js +358 -0
- package/dist/core/sdd/deepagents/quality-witness.d.ts +3 -0
- package/dist/core/sdd/deepagents/quality-witness.js +77 -0
- package/dist/core/sdd/deepagents/reversa-subagents.d.ts +75 -0
- package/dist/core/sdd/deepagents/reversa-subagents.js +182 -0
- package/dist/core/sdd/deepagents/runtime-factory.d.ts +90 -0
- package/dist/core/sdd/deepagents/runtime-factory.js +231 -0
- package/dist/core/sdd/deepagents/runtime-loader.d.ts +16 -0
- package/dist/core/sdd/deepagents/runtime-loader.js +65 -0
- package/dist/core/sdd/default-bootstrap-files.d.ts +2 -2
- package/dist/core/sdd/default-bootstrap-files.js +36 -2
- package/dist/core/sdd/default-skills.d.ts +30 -0
- package/dist/core/sdd/default-skills.js +181 -5
- package/dist/core/sdd/devtrack-api-appliance.d.ts +84 -0
- package/dist/core/sdd/devtrack-api-appliance.js +257 -0
- package/dist/core/sdd/devtrack-api-architecture.d.ts +31 -0
- package/dist/core/sdd/devtrack-api-architecture.js +608 -0
- package/dist/core/sdd/devtrack-api-import-boundary.d.ts +19 -0
- package/dist/core/sdd/devtrack-api-import-boundary.js +32 -0
- package/dist/core/sdd/diagnose.d.ts +59 -0
- package/dist/core/sdd/diagnose.js +37 -37
- package/dist/core/sdd/docs-sync.js +33 -5
- package/dist/core/sdd/domain/post-active-validation.d.ts +7 -0
- package/dist/core/sdd/domain/post-active-validation.js +61 -0
- package/dist/core/sdd/domain/transition-engine.js +1 -0
- package/dist/core/sdd/entity-reference.d.ts +5 -0
- package/dist/core/sdd/entity-reference.js +22 -0
- package/dist/core/sdd/governance-backfill.d.ts +31 -0
- package/dist/core/sdd/governance-backfill.js +359 -0
- package/dist/core/sdd/governance-parser.d.ts +21 -0
- package/dist/core/sdd/governance-parser.js +91 -0
- package/dist/core/sdd/governance-schemas.d.ts +245 -0
- package/dist/core/sdd/governance-schemas.js +143 -0
- package/dist/core/sdd/{import-openspec.d.ts → import-legacy-spec.d.ts} +7 -7
- package/dist/core/sdd/{import-openspec.js → import-legacy-spec.js} +21 -29
- package/dist/core/sdd/init.d.ts +3 -0
- package/dist/core/sdd/init.js +6 -3
- package/dist/core/sdd/json-schema.js +100 -6
- package/dist/core/sdd/knowledge-graph.d.ts +45 -0
- package/dist/core/sdd/knowledge-graph.js +288 -0
- package/dist/core/sdd/legacy-operations.js +431 -43
- package/dist/core/sdd/lenses.d.ts +1 -0
- package/dist/core/sdd/lenses.js +29 -1
- package/dist/core/sdd/migrate-workspace.js +56 -2
- package/dist/core/sdd/migrate.d.ts +1 -1
- package/dist/core/sdd/migrate.js +36 -2
- package/dist/core/sdd/package-structure-gate.d.ts +83 -0
- package/dist/core/sdd/package-structure-gate.js +362 -0
- package/dist/core/sdd/parallel-feat-automation.d.ts +152 -0
- package/dist/core/sdd/parallel-feat-automation.js +212 -0
- package/dist/core/sdd/plugin-broker.d.ts +558 -0
- package/dist/core/sdd/plugin-broker.js +482 -0
- package/dist/core/sdd/plugin-certification.d.ts +79 -0
- package/dist/core/sdd/plugin-certification.js +453 -0
- package/dist/core/sdd/plugin-cli.d.ts +109 -0
- package/dist/core/sdd/plugin-cli.js +198 -0
- package/dist/core/sdd/plugin-evidence.d.ts +275 -0
- package/dist/core/sdd/plugin-evidence.js +307 -0
- package/dist/core/sdd/plugin-manifest.d.ts +164 -0
- package/dist/core/sdd/plugin-manifest.js +215 -0
- package/dist/core/sdd/plugin-policy-pack.d.ts +88 -0
- package/dist/core/sdd/plugin-policy-pack.js +236 -0
- package/dist/core/sdd/plugin-policy.d.ts +68 -0
- package/dist/core/sdd/plugin-policy.js +212 -0
- package/dist/core/sdd/plugin-registry.d.ts +311 -0
- package/dist/core/sdd/plugin-registry.js +138 -0
- package/dist/core/sdd/plugin-skill-binding.d.ts +151 -0
- package/dist/core/sdd/plugin-skill-binding.js +339 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.d.ts +28 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.js +167 -0
- package/dist/core/sdd/quality-evidence-renderer.d.ts +65 -0
- package/dist/core/sdd/quality-evidence-renderer.js +218 -0
- package/dist/core/sdd/quality-scenario-runner.d.ts +42 -0
- package/dist/core/sdd/quality-scenario-runner.js +613 -0
- package/dist/core/sdd/quality-validation.d.ts +547 -0
- package/dist/core/sdd/quality-validation.js +239 -0
- package/dist/core/sdd/resolve-project-root.d.ts +2 -2
- package/dist/core/sdd/resolve-project-root.js +11 -5
- package/dist/core/sdd/sanitize.d.ts +30 -1
- package/dist/core/sdd/sanitize.js +23 -23
- package/dist/core/sdd/services/agent-run.service.d.ts +65 -0
- package/dist/core/sdd/services/agent-run.service.js +189 -0
- package/dist/core/sdd/services/breakdown.service.js +2 -1
- package/dist/core/sdd/services/context.service.js +18 -16
- package/dist/core/sdd/services/debate.service.js +15 -2
- package/dist/core/sdd/services/feature-lint.service.d.ts +22 -0
- package/dist/core/sdd/services/feature-lint.service.js +105 -5
- package/dist/core/sdd/services/finalize.service.d.ts +80 -0
- package/dist/core/sdd/services/finalize.service.js +323 -24
- package/dist/core/sdd/services/frontend-gap.service.js +22 -7
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.d.ts +17 -0
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.js +38 -0
- package/dist/core/sdd/services/governance-control-plane.service.d.ts +66 -0
- package/dist/core/sdd/services/governance-control-plane.service.js +134 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
- package/dist/core/sdd/services/legacy-capability.service.d.ts +10 -7
- package/dist/core/sdd/services/legacy-capability.service.js +38 -21
- package/dist/core/sdd/services/mcp-runtime.service.d.ts +123 -8
- package/dist/core/sdd/services/mcp-runtime.service.js +1085 -33
- package/dist/core/sdd/services/onboard.service.js +2 -1
- package/dist/core/sdd/services/rebuild.service.js +6 -1
- package/dist/core/sdd/services/skills-sync.service.d.ts +17 -5
- package/dist/core/sdd/services/skills-sync.service.js +55 -2
- package/dist/core/sdd/services/start.service.js +6 -4
- package/dist/core/sdd/skill-bundles-curation-schema.d.ts +66 -0
- package/dist/core/sdd/skill-bundles-curation-schema.js +52 -0
- package/dist/core/sdd/skill-evidence.d.ts +19 -0
- package/dist/core/sdd/skill-evidence.js +38 -0
- package/dist/core/sdd/skill-policy-pool.d.ts +46 -0
- package/dist/core/sdd/skill-policy-pool.js +185 -0
- package/dist/core/sdd/state.d.ts +22 -0
- package/dist/core/sdd/state.js +66 -41
- package/dist/core/sdd/structural-health.d.ts +42 -42
- package/dist/core/sdd/types.d.ts +33 -7
- package/dist/core/sdd/types.js +17 -0
- package/dist/core/sdd/upgrade-to-codesdd.d.ts +45 -0
- package/dist/core/sdd/upgrade-to-codesdd.js +179 -0
- package/dist/core/sdd/workspace-schemas.d.ts +285 -14
- package/dist/core/sdd/workspace-schemas.js +148 -0
- package/dist/core/sdd/write-manifest.js +22 -4
- package/dist/core/shared/skill-generation.d.ts +1 -1
- package/dist/core/shared/skill-generation.js +15 -15
- package/dist/core/shared/tool-detection.d.ts +3 -3
- package/dist/core/shared/tool-detection.js +14 -14
- package/dist/core/specs-apply.js +6 -6
- package/dist/core/templates/index.d.ts +1 -1
- package/dist/core/templates/index.js +1 -1
- package/dist/core/templates/workflows/apply-change.js +14 -14
- package/dist/core/templates/workflows/archive-change.js +32 -32
- package/dist/core/templates/workflows/bulk-archive-change.js +25 -25
- package/dist/core/templates/workflows/continue-change.js +12 -12
- package/dist/core/templates/workflows/explore.js +29 -29
- package/dist/core/templates/workflows/feedback.js +6 -6
- package/dist/core/templates/workflows/ff-change.js +24 -24
- package/dist/core/templates/workflows/new-change.js +20 -20
- package/dist/core/templates/workflows/onboard.js +33 -33
- package/dist/core/templates/workflows/propose.js +23 -23
- package/dist/core/templates/workflows/sdd.js +8 -8
- package/dist/core/templates/workflows/sync-specs.js +19 -19
- package/dist/core/templates/workflows/verify-change.js +17 -17
- package/dist/core/update.d.ts +2 -2
- package/dist/core/update.js +16 -15
- package/dist/core/validation/constants.d.ts +1 -1
- package/dist/core/validation/constants.js +1 -1
- package/dist/core/view.js +11 -11
- package/dist/telemetry/config.d.ts +2 -1
- package/dist/telemetry/config.js +17 -8
- package/dist/telemetry/index.d.ts +10 -2
- package/dist/telemetry/index.js +40 -7
- package/dist/ui/ascii-patterns.d.ts +2 -2
- package/dist/ui/ascii-patterns.js +2 -2
- package/dist/ui/welcome-screen.js +2 -2
- package/dist/utils/change-metadata.d.ts +4 -4
- package/dist/utils/change-metadata.js +6 -6
- package/dist/utils/change-utils.d.ts +3 -3
- package/dist/utils/change-utils.js +5 -5
- package/dist/utils/file-system.js +1 -1
- package/dist/utils/interactive.js +1 -1
- package/dist/utils/item-discovery.js +4 -4
- package/dist/utils/legacy-spec-compat.d.ts +2 -0
- package/dist/utils/legacy-spec-compat.js +2 -0
- package/dist/utils/shell-detection.d.ts +1 -0
- package/dist/utils/shell-detection.js +16 -0
- package/package.json +27 -17
- package/schemas/sdd/1-spec.schema.json +1 -1
- package/schemas/sdd/2-plan.schema.json +73 -1
- package/schemas/sdd/3-tasks.schema.json +73 -1
- package/schemas/sdd/4-changelog.schema.json +1 -1
- package/schemas/sdd/5-quality.schema.json +442 -2
- package/schemas/sdd/adr.schema.json +148 -0
- package/schemas/sdd/agent-binding-adapter.schema.json +210 -0
- package/schemas/sdd/agent-binding-resolution.schema.json +338 -0
- package/schemas/sdd/backlog-projection-plan.schema.json +180 -0
- package/schemas/sdd/backlog-provider-contract.schema.json +260 -0
- package/schemas/sdd/codesdd-plugin.schema.json +474 -0
- package/schemas/sdd/debate.schema.json +244 -0
- package/schemas/sdd/deepagent-decision-evidence.schema.json +58 -0
- package/schemas/sdd/deepagent-env-contract.schema.json +143 -0
- package/schemas/sdd/deepagent-quality-evidence.schema.json +108 -0
- package/schemas/sdd/deepagent-run-evidence.schema.json +192 -0
- package/schemas/sdd/deepagent-run-plan.schema.json +197 -0
- package/schemas/sdd/deepagent-run-request.schema.json +321 -0
- package/schemas/sdd/deepagent-subagent-evidence.schema.json +110 -0
- package/schemas/sdd/deepagent-tool-call-evidence.schema.json +78 -0
- package/schemas/sdd/discarded.schema.json +127 -0
- package/schemas/sdd/epic.schema.json +147 -0
- package/schemas/sdd/insight.schema.json +136 -0
- package/schemas/sdd/parallel-feat-automation-plan.schema.json +215 -0
- package/schemas/sdd/parallel-feat-automation-request.schema.json +109 -0
- package/schemas/sdd/plugin-artifact-manifest.schema.json +150 -0
- package/schemas/sdd/plugin-compliance-index.schema.json +136 -0
- package/schemas/sdd/plugin-dry-run-plan.schema.json +260 -0
- package/schemas/sdd/plugin-evidence-manifest.schema.json +569 -0
- package/schemas/sdd/plugin-policy-evaluation.schema.json +92 -0
- package/schemas/sdd/plugin-policy-pack-evaluation.schema.json +94 -0
- package/schemas/sdd/plugin-policy-pack.schema.json +196 -0
- package/schemas/sdd/plugin-registry.schema.json +558 -0
- package/schemas/sdd/plugin-rollback-manifest.schema.json +87 -0
- package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +845 -0
- package/schemas/sdd/plugin-skill-binding-resolution.schema.json +305 -0
- package/schemas/sdd/plugin-skill-binding.schema.json +88 -0
- package/schemas/sdd/plugin-validation-manifest.schema.json +123 -0
- package/schemas/sdd/quality-architecture-schema.schema.json +216 -0
- package/schemas/sdd/quality-evidence-bundle.schema.json +1228 -0
- package/schemas/sdd/quality-run.schema.json +197 -0
- package/schemas/sdd/quality-scenario.schema.json +252 -0
- package/schemas/sdd/workspace-catalog.schema.json +9841 -22
- package/schemas/spec-driven/schema.yaml +4 -4
- package/schemas/spec-driven/templates/proposal.md +1 -1
- package/dist/utils/openspec-compat.d.ts +0 -2
- package/dist/utils/openspec-compat.js +0 -2
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const SDD_REF_PATTERN = /^(INS|DEB|EPIC|FEAT)-\d{4}$/;
|
|
3
|
+
const PROVIDER_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
4
|
+
const PROVIDER_FIELD_PATTERN = /^[A-Za-z][A-Za-z0-9_.-]*$/;
|
|
5
|
+
export const backlogProviderIdSchema = z.enum([
|
|
6
|
+
'azure-devops',
|
|
7
|
+
'jira',
|
|
8
|
+
'trello',
|
|
9
|
+
'confluence',
|
|
10
|
+
'asana',
|
|
11
|
+
'generic',
|
|
12
|
+
]);
|
|
13
|
+
export const backlogEntityKindSchema = z.enum(['insight', 'debate', 'epic', 'feature', 'task']);
|
|
14
|
+
export const backlogProviderOperationSchema = z.enum(['create', 'update', 'link', 'query']);
|
|
15
|
+
export const backlogProjectionModeSchema = z.enum(['dry-run', 'apply']);
|
|
16
|
+
export const backlogProjectionDirectionSchema = z.enum(['push', 'pull', 'bidirectional']);
|
|
17
|
+
export const backlogAuthModeSchema = z.enum(['none', 'pat', 'oauth', 'managed-identity', 'app-installation']);
|
|
18
|
+
export const backlogProviderCapabilitySchema = z
|
|
19
|
+
.object({
|
|
20
|
+
operation: backlogProviderOperationSchema,
|
|
21
|
+
entity_kinds: z.array(backlogEntityKindSchema).min(1),
|
|
22
|
+
dry_run: z.boolean().default(true),
|
|
23
|
+
apply: z.boolean().default(false),
|
|
24
|
+
idempotent: z.boolean().default(true),
|
|
25
|
+
required_fields: z.array(z.string().regex(PROVIDER_FIELD_PATTERN)).default([]),
|
|
26
|
+
})
|
|
27
|
+
.superRefine((capability, context) => {
|
|
28
|
+
if (capability.apply && !capability.dry_run) {
|
|
29
|
+
context.addIssue({
|
|
30
|
+
code: 'custom',
|
|
31
|
+
path: ['dry_run'],
|
|
32
|
+
message: 'Apply-capable backlog provider operations must support dry-run.',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export const backlogProviderContractSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
schema_version: z.literal(1).default(1),
|
|
39
|
+
provider: backlogProviderIdSchema,
|
|
40
|
+
adapter_id: z.string().regex(PROVIDER_ID_PATTERN),
|
|
41
|
+
label: z.string().min(2),
|
|
42
|
+
status: z.enum(['active', 'experimental', 'disabled']).default('experimental'),
|
|
43
|
+
auth: z.object({
|
|
44
|
+
mode: backlogAuthModeSchema,
|
|
45
|
+
required_env: z.array(z.string().min(1)).default([]),
|
|
46
|
+
secret_fields: z.array(z.string().min(1)).default([]),
|
|
47
|
+
}),
|
|
48
|
+
capabilities: z.array(backlogProviderCapabilitySchema).min(1),
|
|
49
|
+
mapping: z.object({
|
|
50
|
+
external_project_field: z.string().regex(PROVIDER_FIELD_PATTERN).optional(),
|
|
51
|
+
external_id_field: z.string().regex(PROVIDER_FIELD_PATTERN),
|
|
52
|
+
external_url_field: z.string().regex(PROVIDER_FIELD_PATTERN).optional(),
|
|
53
|
+
canonical_ref_field: z.string().regex(PROVIDER_FIELD_PATTERN),
|
|
54
|
+
parent_ref_field: z.string().regex(PROVIDER_FIELD_PATTERN).optional(),
|
|
55
|
+
entity_type_field: z.string().regex(PROVIDER_FIELD_PATTERN),
|
|
56
|
+
title_field: z.string().regex(PROVIDER_FIELD_PATTERN),
|
|
57
|
+
status_field: z.string().regex(PROVIDER_FIELD_PATTERN),
|
|
58
|
+
}),
|
|
59
|
+
canonical_state_boundary: z.object({
|
|
60
|
+
source_of_truth: z.literal('codesdd'),
|
|
61
|
+
state_paths: z.array(z.string().min(1)).default(['.sdd/state/*.yaml']),
|
|
62
|
+
external_state_authoritative: z.literal(false),
|
|
63
|
+
hidden_state_allowed: z.literal(false),
|
|
64
|
+
}),
|
|
65
|
+
governance: z.object({
|
|
66
|
+
owner: z.string().min(2),
|
|
67
|
+
sync_requires_dry_run: z.boolean().default(true),
|
|
68
|
+
mutation_requires_approval: z.boolean().default(true),
|
|
69
|
+
audit_event: z.string().min(1).default('codesdd.backlog.projection'),
|
|
70
|
+
}),
|
|
71
|
+
})
|
|
72
|
+
.superRefine((contract, context) => {
|
|
73
|
+
const seenOperations = new Set();
|
|
74
|
+
for (const [index, capability] of contract.capabilities.entries()) {
|
|
75
|
+
const key = `${capability.operation}:${capability.entity_kinds.sort().join(',')}`;
|
|
76
|
+
if (seenOperations.has(key)) {
|
|
77
|
+
context.addIssue({
|
|
78
|
+
code: 'custom',
|
|
79
|
+
path: ['capabilities', index, 'operation'],
|
|
80
|
+
message: `Duplicate provider capability declaration: ${key}.`,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
seenOperations.add(key);
|
|
84
|
+
}
|
|
85
|
+
if (contract.auth.mode === 'none' && contract.auth.required_env.length > 0) {
|
|
86
|
+
context.addIssue({
|
|
87
|
+
code: 'custom',
|
|
88
|
+
path: ['auth', 'required_env'],
|
|
89
|
+
message: 'Providers using auth mode none must not require credential environment variables.',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
export const canonicalBacklogItemSchema = z.object({
|
|
94
|
+
ref: z.string().regex(SDD_REF_PATTERN),
|
|
95
|
+
kind: backlogEntityKindSchema.exclude(['task']),
|
|
96
|
+
title: z.string().min(1),
|
|
97
|
+
status: z.string().min(1),
|
|
98
|
+
parent_ref: z.string().regex(SDD_REF_PATTERN).optional(),
|
|
99
|
+
labels: z.array(z.string().min(1)).default([]),
|
|
100
|
+
url: z.string().url().optional(),
|
|
101
|
+
});
|
|
102
|
+
export const backlogProjectionItemSchema = z.object({
|
|
103
|
+
schema_version: z.literal(1).default(1),
|
|
104
|
+
provider: backlogProviderIdSchema,
|
|
105
|
+
canonical_ref: z.string().regex(SDD_REF_PATTERN),
|
|
106
|
+
entity_kind: backlogEntityKindSchema,
|
|
107
|
+
operation: z.enum(['create', 'update', 'link', 'noop']),
|
|
108
|
+
idempotency_key: z.string().min(1),
|
|
109
|
+
external_type: z.string().min(1),
|
|
110
|
+
fields: z.record(z.string().regex(PROVIDER_FIELD_PATTERN), z.union([z.string(), z.array(z.string())])),
|
|
111
|
+
links: z
|
|
112
|
+
.array(z.object({
|
|
113
|
+
rel: z.enum(['parent', 'trace', 'canonical']),
|
|
114
|
+
target_ref: z.string().regex(SDD_REF_PATTERN),
|
|
115
|
+
}))
|
|
116
|
+
.default([]),
|
|
117
|
+
});
|
|
118
|
+
export const backlogProjectionPlanSchema = z.object({
|
|
119
|
+
schema_version: z.literal(1).default(1),
|
|
120
|
+
created_at: z.string().datetime(),
|
|
121
|
+
provider: backlogProviderIdSchema,
|
|
122
|
+
mode: backlogProjectionModeSchema,
|
|
123
|
+
direction: backlogProjectionDirectionSchema,
|
|
124
|
+
source_of_truth: z.literal('codesdd'),
|
|
125
|
+
items: z.array(backlogProjectionItemSchema).default([]),
|
|
126
|
+
warnings: z.array(z.string()).default([]),
|
|
127
|
+
});
|
|
128
|
+
export function createBacklogProviderContract(input) {
|
|
129
|
+
return backlogProviderContractSchema.parse(input);
|
|
130
|
+
}
|
|
131
|
+
export function buildBacklogProjectionItem(input) {
|
|
132
|
+
const contract = createBacklogProviderContract(input.contract);
|
|
133
|
+
const item = canonicalBacklogItemSchema.parse(input.item);
|
|
134
|
+
const operation = input.operation ?? 'create';
|
|
135
|
+
const links = item.parent_ref ? [{ rel: 'parent', target_ref: item.parent_ref }] : [];
|
|
136
|
+
return backlogProjectionItemSchema.parse({
|
|
137
|
+
schema_version: 1,
|
|
138
|
+
provider: contract.provider,
|
|
139
|
+
canonical_ref: item.ref,
|
|
140
|
+
entity_kind: item.kind,
|
|
141
|
+
operation,
|
|
142
|
+
idempotency_key: `${contract.provider}:${item.ref}`,
|
|
143
|
+
external_type: input.external_type,
|
|
144
|
+
fields: {
|
|
145
|
+
[contract.mapping.canonical_ref_field]: item.ref,
|
|
146
|
+
[contract.mapping.entity_type_field]: item.kind,
|
|
147
|
+
[contract.mapping.title_field]: item.title,
|
|
148
|
+
[contract.mapping.status_field]: item.status,
|
|
149
|
+
...(contract.mapping.parent_ref_field && item.parent_ref
|
|
150
|
+
? { [contract.mapping.parent_ref_field]: item.parent_ref }
|
|
151
|
+
: {}),
|
|
152
|
+
...(contract.mapping.external_url_field && item.url ? { [contract.mapping.external_url_field]: item.url } : {}),
|
|
153
|
+
labels: item.labels,
|
|
154
|
+
},
|
|
155
|
+
links,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=backlog-provider-contract.js.map
|
|
@@ -114,7 +114,7 @@ function classifyRootEntry(name) {
|
|
|
114
114
|
test: { kind: 'test', notes: 'Testes automatizados' },
|
|
115
115
|
docs: { kind: 'docs', notes: 'Documentacao' },
|
|
116
116
|
config: { kind: 'config', notes: 'Configuracoes' },
|
|
117
|
-
|
|
117
|
+
codesdd: { kind: 'codesdd', notes: 'Runtime do CodeSDD' },
|
|
118
118
|
package_json: { kind: 'manifest', notes: 'Manifesto principal' },
|
|
119
119
|
};
|
|
120
120
|
return map[name] || { kind: 'directory', notes: 'Diretorio detectado no projeto' };
|
|
@@ -131,7 +131,7 @@ async function inferRepoMap(projectRoot, deep) {
|
|
|
131
131
|
'test',
|
|
132
132
|
'docs',
|
|
133
133
|
'config',
|
|
134
|
-
'
|
|
134
|
+
'codesdd',
|
|
135
135
|
];
|
|
136
136
|
for (const candidate of rootCandidates) {
|
|
137
137
|
if (await fileExists(path.join(projectRoot, candidate))) {
|
package/dist/core/sdd/check.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type BacklogItem, type DiscoveryRecord, type FrontendGapRecord, type TechDebtRecord } from './types.js';
|
|
2
|
+
import { type SddStateSnapshot } from './state.js';
|
|
1
3
|
export interface SddCheckOptions {
|
|
2
4
|
render?: boolean;
|
|
3
5
|
strict?: boolean;
|
|
@@ -45,6 +47,46 @@ export interface SddCheckReport {
|
|
|
45
47
|
};
|
|
46
48
|
};
|
|
47
49
|
}
|
|
50
|
+
export declare function checkUniqueIds<T extends {
|
|
51
|
+
id: string;
|
|
52
|
+
}>(items: T[], scope: string, errors: string[]): void;
|
|
53
|
+
export declare function hasForbiddenTitleToken(title: string): string | null;
|
|
54
|
+
export declare function validateDiscoveryRecords(records: DiscoveryRecord[], errors: string[]): void;
|
|
55
|
+
export declare function validateBacklog(items: BacklogItem[], errors: string[], warnings: string[]): void;
|
|
56
|
+
export declare function validateReferentialIntegrity(snapshot: SddStateSnapshot, errors: string[], warnings: string[], isStrict: boolean): void;
|
|
57
|
+
export declare function validateSkillOperationalIntegrity(snapshot: SddStateSnapshot, errors: string[]): void;
|
|
58
|
+
export declare function computeGraphSummary(items: BacklogItem[]): {
|
|
59
|
+
readyForParallel: number;
|
|
60
|
+
blocked: number;
|
|
61
|
+
lockConflicts: number;
|
|
62
|
+
};
|
|
63
|
+
export declare function roundPercent(done: number, total: number): number;
|
|
64
|
+
export declare function computeProgress(items: BacklogItem[]): {
|
|
65
|
+
progressGlobal: {
|
|
66
|
+
done: number;
|
|
67
|
+
total: number;
|
|
68
|
+
percent: number;
|
|
69
|
+
};
|
|
70
|
+
progressByRadar: Array<{
|
|
71
|
+
radar_id: string;
|
|
72
|
+
done: number;
|
|
73
|
+
total: number;
|
|
74
|
+
percent: number;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
export declare function validateTechDebt(items: TechDebtRecord[], errors: string[]): void;
|
|
78
|
+
export declare function validateFrontendReferences(gaps: FrontendGapRecord[], backlog: BacklogItem[], errors: string[], warnings: string[]): void;
|
|
79
|
+
export declare function validateActiveTaskChecklist(activeDir: string, items: BacklogItem[], warnings: string[]): Promise<void>;
|
|
80
|
+
export declare function validateWorkspaceCoherence(activeDir: string, archivedDir: string, items: BacklogItem[], warnings: string[]): Promise<void>;
|
|
81
|
+
export declare function isPrivacyComplianceBacklogItem(item: BacklogItem): boolean;
|
|
82
|
+
export declare function validatePrivacySourceRegistry(snapshot: SddStateSnapshot, warnings: string[]): void;
|
|
83
|
+
export declare function validatePrivacyWorkspaceChecklist(activeDir: string, items: BacklogItem[], warnings: string[]): Promise<void>;
|
|
84
|
+
export declare function validateTraceabilityWorkspaceChecklist(projectRoot: string, activeDir: string, items: BacklogItem[], warnings: string[]): Promise<void>;
|
|
85
|
+
export declare function featureRequiresQualityContract(item: BacklogItem): boolean;
|
|
86
|
+
export declare function detectMissingQualityArtifacts(activeDir: string, items: BacklogItem[]): Promise<string[]>;
|
|
87
|
+
export declare function parseRouteToken(value: string): string | null;
|
|
88
|
+
export declare function featureHasMetadataFrontendEvidence(item: BacklogItem): boolean;
|
|
89
|
+
export declare function validateCanonicalSddStructure(memoryRoot: string, errors: string[]): Promise<void>;
|
|
48
90
|
export declare class SddCheckCommand {
|
|
49
91
|
execute(projectRoot: string, options?: SddCheckOptions): Promise<SddCheckReport>;
|
|
50
92
|
}
|
package/dist/core/sdd/check.js
CHANGED
|
@@ -11,7 +11,7 @@ import { syncSddGuideDocs, validateSddGuideDocs } from './docs-sync.js';
|
|
|
11
11
|
import { evaluateWorkspaceTraceability } from './domain/traceability.js';
|
|
12
12
|
import { detectArchiveArchivedLifecycleCollisions } from './domain/post-active-validation.js';
|
|
13
13
|
import { parseWorkspaceYamlDocument, workspaceTasksSchema, } from './workspace-schemas.js';
|
|
14
|
-
function checkUniqueIds(items, scope, errors) {
|
|
14
|
+
export function checkUniqueIds(items, scope, errors) {
|
|
15
15
|
const seen = new Set();
|
|
16
16
|
for (const item of items) {
|
|
17
17
|
if (seen.has(item.id)) {
|
|
@@ -21,7 +21,7 @@ function checkUniqueIds(items, scope, errors) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
const FORBIDDEN_TITLE_PATTERNS = ['debate:', 'insight:', '(preencher', '(placeholder'];
|
|
24
|
-
function hasForbiddenTitleToken(title) {
|
|
24
|
+
export function hasForbiddenTitleToken(title) {
|
|
25
25
|
const lowered = title.toLowerCase();
|
|
26
26
|
for (const token of FORBIDDEN_TITLE_PATTERNS) {
|
|
27
27
|
if (lowered.includes(token))
|
|
@@ -29,7 +29,7 @@ function hasForbiddenTitleToken(title) {
|
|
|
29
29
|
}
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
function validateDiscoveryRecords(records, errors) {
|
|
32
|
+
export function validateDiscoveryRecords(records, errors) {
|
|
33
33
|
for (const record of records) {
|
|
34
34
|
if (record.type === 'INS' && !ID_PATTERNS.insight.test(record.id)) {
|
|
35
35
|
errors.push(`Discovery record ${record.id} is INS but does not follow INS-####`);
|
|
@@ -51,7 +51,7 @@ function validateDiscoveryRecords(records, errors) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function validateBacklog(items, errors, warnings) {
|
|
54
|
+
export function validateBacklog(items, errors, warnings) {
|
|
55
55
|
const ids = new Set(items.map((item) => item.id));
|
|
56
56
|
const lockOwners = new Map();
|
|
57
57
|
for (const item of items) {
|
|
@@ -79,7 +79,7 @@ function validateBacklog(items, errors, warnings) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function validateReferentialIntegrity(snapshot, errors, warnings, isStrict) {
|
|
82
|
+
export function validateReferentialIntegrity(snapshot, errors, warnings, isStrict) {
|
|
83
83
|
const discoveryIds = new Set(snapshot.discoveryIndex.records.map((record) => record.id));
|
|
84
84
|
const backlogIds = new Set(snapshot.backlog.items.map((item) => item.id));
|
|
85
85
|
const frontendGapIds = new Set(snapshot.frontendGaps?.items.map((gap) => gap.id) ?? []);
|
|
@@ -133,7 +133,7 @@ function validateReferentialIntegrity(snapshot, errors, warnings, isStrict) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
function validateSkillOperationalIntegrity(snapshot, errors) {
|
|
136
|
+
export function validateSkillOperationalIntegrity(snapshot, errors) {
|
|
137
137
|
const knownSkills = new Set((snapshot.skillCatalog?.skills || []).map((skill) => skill.id));
|
|
138
138
|
const currentBundles = new Map((snapshot.skillCatalog?.bundles || []).map((bundle) => [bundle.id, bundle]));
|
|
139
139
|
for (const defaultSkill of DEFAULT_CURATED_SKILL_CATALOG.skills) {
|
|
@@ -173,7 +173,7 @@ function validateSkillOperationalIntegrity(snapshot, errors) {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function computeGraphSummary(items) {
|
|
176
|
+
export function computeGraphSummary(items) {
|
|
177
177
|
const byId = new Map(items.map((item) => [item.id, item]));
|
|
178
178
|
const runnable = items.filter((item) => {
|
|
179
179
|
if (item.status === 'DONE' || item.status === 'ARCHIVED')
|
|
@@ -226,12 +226,12 @@ function computeGraphSummary(items) {
|
|
|
226
226
|
lockConflicts: conflictingIds.size,
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
function roundPercent(done, total) {
|
|
229
|
+
export function roundPercent(done, total) {
|
|
230
230
|
if (total <= 0)
|
|
231
231
|
return 0;
|
|
232
232
|
return Math.round((done / total) * 100);
|
|
233
233
|
}
|
|
234
|
-
function computeProgress(items) {
|
|
234
|
+
export function computeProgress(items) {
|
|
235
235
|
const activeItems = items.filter((item) => item.status !== 'ARCHIVED');
|
|
236
236
|
const total = activeItems.length;
|
|
237
237
|
const done = activeItems.filter((item) => item.status === 'DONE').length;
|
|
@@ -262,14 +262,14 @@ function computeProgress(items) {
|
|
|
262
262
|
progressByRadar,
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
function validateTechDebt(items, errors) {
|
|
265
|
+
export function validateTechDebt(items, errors) {
|
|
266
266
|
for (const item of items) {
|
|
267
267
|
if (!ID_PATTERNS.techDebt.test(item.id)) {
|
|
268
268
|
errors.push(`Technical debt item ${item.id} does not follow TD-###`);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function validateFrontendReferences(gaps, backlog, errors, warnings) {
|
|
272
|
+
export function validateFrontendReferences(gaps, backlog, errors, warnings) {
|
|
273
273
|
const gapIds = new Set(gaps.map((g) => g.id));
|
|
274
274
|
for (const item of backlog) {
|
|
275
275
|
for (const gapRef of item.frontend_gap_refs) {
|
|
@@ -285,7 +285,7 @@ function validateFrontendReferences(gaps, backlog, errors, warnings) {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
async function validateActiveTaskChecklist(activeDir, items, warnings) {
|
|
288
|
+
export async function validateActiveTaskChecklist(activeDir, items, warnings) {
|
|
289
289
|
for (const item of items) {
|
|
290
290
|
if (item.status !== 'IN_PROGRESS')
|
|
291
291
|
continue;
|
|
@@ -325,7 +325,7 @@ async function validateActiveTaskChecklist(activeDir, items, warnings) {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
async function validateWorkspaceCoherence(activeDir, archivedDir, items, warnings) {
|
|
328
|
+
export async function validateWorkspaceCoherence(activeDir, archivedDir, items, warnings) {
|
|
329
329
|
for (const item of items) {
|
|
330
330
|
const activePath = path.join(activeDir, item.id);
|
|
331
331
|
const archivedPath = path.join(archivedDir, item.id);
|
|
@@ -342,13 +342,13 @@ async function validateWorkspaceCoherence(activeDir, archivedDir, items, warning
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
function isPrivacyComplianceBacklogItem(item) {
|
|
345
|
+
export function isPrivacyComplianceBacklogItem(item) {
|
|
346
346
|
if (item.origin_ref === 'EPIC-0020' || item.origin_ref === 'EPIC-0021')
|
|
347
347
|
return true;
|
|
348
348
|
const refs = new Set(item.acceptance_refs || []);
|
|
349
349
|
return refs.has('EPIC-0020') || refs.has('EPIC-0021') || refs.has('DEB-0021') || refs.has('INS-0021');
|
|
350
350
|
}
|
|
351
|
-
function validatePrivacySourceRegistry(snapshot, warnings) {
|
|
351
|
+
export function validatePrivacySourceRegistry(snapshot, warnings) {
|
|
352
352
|
const privacyItems = snapshot.backlog.items.filter((item) => item.status !== 'DONE' && item.status !== 'ARCHIVED' && isPrivacyComplianceBacklogItem(item));
|
|
353
353
|
if (privacyItems.length === 0)
|
|
354
354
|
return;
|
|
@@ -385,7 +385,7 @@ function validatePrivacySourceRegistry(snapshot, warnings) {
|
|
|
385
385
|
warnings.push(`Privacy source registry metadata incomplete for: ${missingMetadata.slice(0, 12).join(', ')}${missingMetadata.length > 12 ? ' ...' : ''}`);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
async function validatePrivacyWorkspaceChecklist(activeDir, items, warnings) {
|
|
388
|
+
export async function validatePrivacyWorkspaceChecklist(activeDir, items, warnings) {
|
|
389
389
|
const privacyItems = items.filter((item) => item.status === 'IN_PROGRESS' && isPrivacyComplianceBacklogItem(item));
|
|
390
390
|
for (const item of privacyItems) {
|
|
391
391
|
const specPath = path.join(activeDir, item.id, '1-spec.yaml');
|
|
@@ -433,7 +433,7 @@ async function validatePrivacyWorkspaceChecklist(activeDir, items, warnings) {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
async function validateTraceabilityWorkspaceChecklist(projectRoot, activeDir, items, warnings) {
|
|
436
|
+
export async function validateTraceabilityWorkspaceChecklist(projectRoot, activeDir, items, warnings) {
|
|
437
437
|
const traceabilityItems = items.filter((item) => item.status === 'IN_PROGRESS');
|
|
438
438
|
for (const item of traceabilityItems) {
|
|
439
439
|
const specPath = path.join(activeDir, item.id, '1-spec.yaml');
|
|
@@ -458,12 +458,12 @@ async function validateTraceabilityWorkspaceChecklist(projectRoot, activeDir, it
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
function featureRequiresQualityContract(item) {
|
|
461
|
+
export function featureRequiresQualityContract(item) {
|
|
462
462
|
if (item.status === 'ARCHIVED' || item.status === 'DONE')
|
|
463
463
|
return false;
|
|
464
464
|
return Boolean(item.quality_contract) || item.status === 'IN_PROGRESS' || item.origin_ref === 'EPIC-0013';
|
|
465
465
|
}
|
|
466
|
-
async function detectMissingQualityArtifacts(activeDir, items) {
|
|
466
|
+
export async function detectMissingQualityArtifacts(activeDir, items) {
|
|
467
467
|
const missing = [];
|
|
468
468
|
for (const item of items) {
|
|
469
469
|
if (item.status !== 'IN_PROGRESS')
|
|
@@ -477,7 +477,7 @@ async function detectMissingQualityArtifacts(activeDir, items) {
|
|
|
477
477
|
}
|
|
478
478
|
return missing;
|
|
479
479
|
}
|
|
480
|
-
function parseRouteToken(value) {
|
|
480
|
+
export function parseRouteToken(value) {
|
|
481
481
|
const token = value.trim();
|
|
482
482
|
if (!token)
|
|
483
483
|
return null;
|
|
@@ -494,7 +494,7 @@ function parseRouteToken(value) {
|
|
|
494
494
|
return inlineRoute[0];
|
|
495
495
|
return null;
|
|
496
496
|
}
|
|
497
|
-
function featureHasMetadataFrontendEvidence(item) {
|
|
497
|
+
export function featureHasMetadataFrontendEvidence(item) {
|
|
498
498
|
const routes = [
|
|
499
499
|
...item.produces.map(parseRouteToken),
|
|
500
500
|
...item.consumes.map(parseRouteToken),
|
|
@@ -506,7 +506,7 @@ function featureHasMetadataFrontendEvidence(item) {
|
|
|
506
506
|
item.touches.includes('frontend') ||
|
|
507
507
|
item.execution_kind === 'frontend_coverage');
|
|
508
508
|
}
|
|
509
|
-
async function validateCanonicalSddStructure(memoryRoot, errors) {
|
|
509
|
+
export async function validateCanonicalSddStructure(memoryRoot, errors) {
|
|
510
510
|
const forbiddenTopLevelDirs = ['backlog', 'features', 'finalize', 'queue'];
|
|
511
511
|
for (const dirName of forbiddenTopLevelDirs) {
|
|
512
512
|
const candidate = path.join(memoryRoot, dirName);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const CURRENT_SDD_STATE_VERSION = 3;
|
|
2
|
+
export declare const CURRENT_SDD_CONTRACT_NAME = "codesdd-sdd";
|
|
3
|
+
export declare const CURRENT_CODESDD_MIN_CLI_VERSION = "1.2.2";
|
|
4
|
+
export declare const CURRENT_SDD_LEGACY_COMPATIBILITY = "migration-only";
|
|
5
|
+
export interface SddContractConfig {
|
|
6
|
+
name: string;
|
|
7
|
+
version: number;
|
|
8
|
+
min_cli_version: string;
|
|
9
|
+
legacy_compatibility: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function buildSddContractConfig(): SddContractConfig;
|
|
12
|
+
export declare function sddContractMismatchReasons(value: unknown): string[];
|
|
13
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const CURRENT_SDD_STATE_VERSION = 3;
|
|
2
|
+
export const CURRENT_SDD_CONTRACT_NAME = 'codesdd-sdd';
|
|
3
|
+
export const CURRENT_CODESDD_MIN_CLI_VERSION = '1.2.2';
|
|
4
|
+
export const CURRENT_SDD_LEGACY_COMPATIBILITY = 'migration-only';
|
|
5
|
+
export function buildSddContractConfig() {
|
|
6
|
+
return {
|
|
7
|
+
name: CURRENT_SDD_CONTRACT_NAME,
|
|
8
|
+
version: CURRENT_SDD_STATE_VERSION,
|
|
9
|
+
min_cli_version: CURRENT_CODESDD_MIN_CLI_VERSION,
|
|
10
|
+
legacy_compatibility: CURRENT_SDD_LEGACY_COMPATIBILITY,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function isRecord(value) {
|
|
14
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
15
|
+
}
|
|
16
|
+
export function sddContractMismatchReasons(value) {
|
|
17
|
+
if (!isRecord(value)) {
|
|
18
|
+
return ['sdd_contract ausente'];
|
|
19
|
+
}
|
|
20
|
+
const expected = buildSddContractConfig();
|
|
21
|
+
const reasons = [];
|
|
22
|
+
if (value.name !== expected.name) {
|
|
23
|
+
reasons.push(`name=${String(value.name || '') || '<empty>'}`);
|
|
24
|
+
}
|
|
25
|
+
if (value.version !== expected.version) {
|
|
26
|
+
reasons.push(`version=${String(value.version || '') || '<empty>'}`);
|
|
27
|
+
}
|
|
28
|
+
if (value.min_cli_version !== expected.min_cli_version) {
|
|
29
|
+
reasons.push(`min_cli_version=${String(value.min_cli_version || '') || '<empty>'}`);
|
|
30
|
+
}
|
|
31
|
+
if (value.legacy_compatibility !== expected.legacy_compatibility) {
|
|
32
|
+
reasons.push(`legacy_compatibility=${String(value.legacy_compatibility || '') || '<empty>'}`);
|
|
33
|
+
}
|
|
34
|
+
return reasons;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -31,6 +31,11 @@ export interface RedisBoundaryConfig {
|
|
|
31
31
|
}
|
|
32
32
|
export interface SddCoordinationAdapters {
|
|
33
33
|
mode: 'filesystem';
|
|
34
|
+
cacheTier: {
|
|
35
|
+
root: string;
|
|
36
|
+
projectFingerprint: string;
|
|
37
|
+
namespace: string;
|
|
38
|
+
};
|
|
34
39
|
redis: RedisBoundaryConfig & {
|
|
35
40
|
status: 'disabled' | 'requested-unavailable';
|
|
36
41
|
reason: string;
|
|
@@ -54,6 +59,36 @@ export declare class InMemoryCoordinationCache implements CoordinationCacheAdapt
|
|
|
54
59
|
delete(key: string): Promise<void>;
|
|
55
60
|
clear(): Promise<void>;
|
|
56
61
|
}
|
|
62
|
+
export declare class MultiTierCoordinationCache implements CoordinationCacheAdapter {
|
|
63
|
+
private readonly l1Cache;
|
|
64
|
+
private readonly projectFingerprint;
|
|
65
|
+
private readonly configFingerprint;
|
|
66
|
+
private readonly namespace;
|
|
67
|
+
private readonly l2Root;
|
|
68
|
+
constructor(options: {
|
|
69
|
+
projectRoot: string;
|
|
70
|
+
namespace?: string;
|
|
71
|
+
configFingerprint?: string;
|
|
72
|
+
cacheRootDir?: string;
|
|
73
|
+
});
|
|
74
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
75
|
+
set<T>(key: string, value: T, options?: {
|
|
76
|
+
ttlMs?: number;
|
|
77
|
+
}): Promise<void>;
|
|
78
|
+
delete(key: string): Promise<void>;
|
|
79
|
+
clear(): Promise<void>;
|
|
80
|
+
pruneExpired(): Promise<number>;
|
|
81
|
+
describeTierState(): {
|
|
82
|
+
root: string;
|
|
83
|
+
projectFingerprint: string;
|
|
84
|
+
namespace: string;
|
|
85
|
+
};
|
|
86
|
+
private toEntryPath;
|
|
87
|
+
private remainingTtlMs;
|
|
88
|
+
private listEntryFiles;
|
|
89
|
+
private readEntry;
|
|
90
|
+
private safeUnlink;
|
|
91
|
+
}
|
|
57
92
|
export declare class InMemoryCoordinationQueue<T = unknown> implements CoordinationQueueAdapter<T> {
|
|
58
93
|
private readonly topics;
|
|
59
94
|
enqueue(topic: string, item: T): Promise<void>;
|
|
@@ -68,6 +103,9 @@ export declare class InMemoryCoordinationEventBus implements CoordinationEventBu
|
|
|
68
103
|
export declare function resolveRedisBoundaryConfig(env?: NodeJS.ProcessEnv): RedisBoundaryConfig;
|
|
69
104
|
export declare function createFilesystemFirstCoordinationAdapters(options: {
|
|
70
105
|
stateDir: string;
|
|
106
|
+
projectRoot?: string;
|
|
107
|
+
configFingerprint?: string;
|
|
108
|
+
cacheRootDir?: string;
|
|
71
109
|
env?: NodeJS.ProcessEnv;
|
|
72
110
|
}): SddCoordinationAdapters;
|
|
73
111
|
//# sourceMappingURL=coordination-adapters.d.ts.map
|