@devtrack-solution/codesdd 1.2.2 → 1.2.4-rc3
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 +170 -31
- package/.sdd/skills/curated/devtrack-api/agents/claude-code.yaml +8 -0
- package/.sdd/skills/curated/devtrack-api/agents/codex.yaml +8 -0
- package/.sdd/skills/curated/devtrack-api/agents/cursor.yaml +8 -0
- package/.sdd/skills/curated/devtrack-api/agents/gemini.yaml +8 -0
- package/.sdd/skills/curated/devtrack-api/agents/kimi.yaml +8 -0
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +4 -2
- package/.sdd/skills/curated/devtrack-api/agents/opencode.yaml +10 -0
- package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +2 -2
- 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 +372 -0
- package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +13 -13
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +95 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +294 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +5 -5
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +4 -0
- package/.sdd/skills/curated/devtrack-api/references/portable-agent-contract.md +41 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +2 -2
- package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +7 -9
- package/LICENSE +1 -1
- package/README.md +399 -53
- package/bin/codesdd.js +3 -2
- package/dist/applications/sdd/index.d.ts +16 -0
- package/dist/applications/sdd/index.js +16 -0
- 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 +320 -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 +489 -28
- package/dist/commands/sdd/plugin.d.ts +3 -0
- package/dist/commands/sdd/plugin.js +158 -0
- package/dist/commands/sdd/shared.d.ts +1 -0
- package/dist/commands/sdd/shared.js +11 -22
- package/dist/commands/sdd/skills.js +7 -0
- package/dist/commands/sdd.js +107 -15
- 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 +19 -1
- package/dist/core/cli-command-quality.d.ts +27 -0
- package/dist/core/cli-command-quality.js +180 -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 +200 -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 +20 -1
- package/dist/core/config-schema.js +70 -2
- package/dist/core/config.d.ts +3 -3
- package/dist/core/config.js +4 -4
- package/dist/core/global-config.d.ts +57 -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/agent-runtime-contract.d.ts +204 -0
- package/dist/core/sdd/agent-runtime-contract.js +200 -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 +44 -0
- package/dist/core/sdd/check.js +62 -24
- 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 +53 -8
- package/dist/core/sdd/coordination/coordination-adapters.js +182 -16
- package/dist/core/sdd/coordination/index.d.ts +1 -0
- package/dist/core/sdd/coordination/index.js +1 -0
- package/dist/core/sdd/coordination/redis-runtime.d.ts +131 -0
- package/dist/core/sdd/coordination/redis-runtime.js +698 -0
- package/dist/core/sdd/deepagent-contracts.d.ts +370 -0
- package/dist/core/sdd/deepagent-contracts.js +235 -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 +3 -3
- package/dist/core/sdd/default-bootstrap-files.js +50 -10
- package/dist/core/sdd/default-skills.d.ts +30 -0
- package/dist/core/sdd/default-skills.js +288 -8
- package/dist/core/sdd/devtrack-api-appliance.d.ts +91 -0
- package/dist/core/sdd/devtrack-api-appliance.js +280 -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 +54 -20
- package/dist/core/sdd/domain/capability-diff.d.ts +63 -0
- package/dist/core/sdd/domain/capability-diff.js +200 -0
- package/dist/core/sdd/domain/change-safety-guardrails.d.ts +74 -0
- package/dist/core/sdd/domain/change-safety-guardrails.js +333 -0
- 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/semantic-intent-classifier.d.ts +29 -0
- package/dist/core/sdd/domain/semantic-intent-classifier.js +117 -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/foundation-artifact-map-validator.d.ts +16 -0
- package/dist/core/sdd/foundation-artifact-map-validator.js +71 -0
- package/dist/core/sdd/foundation-layer-manifest.d.ts +24 -0
- package/dist/core/sdd/foundation-layer-manifest.js +117 -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/intent-guard.d.ts +22 -0
- package/dist/core/sdd/intent-guard.js +67 -0
- package/dist/core/sdd/json-schema.js +108 -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 +507 -44
- package/dist/core/sdd/lenses.d.ts +1 -0
- package/dist/core/sdd/lenses.js +29 -1
- package/dist/core/sdd/migrate-workspace.js +95 -2
- package/dist/core/sdd/migrate.d.ts +1 -1
- package/dist/core/sdd/migrate.js +36 -2
- package/dist/core/sdd/package-security-gates.d.ts +21 -0
- package/dist/core/sdd/package-security-gates.js +119 -0
- package/dist/core/sdd/package-structure-gate.d.ts +83 -0
- package/dist/core/sdd/package-structure-gate.js +357 -0
- package/dist/core/sdd/parallel-feat-automation.d.ts +330 -0
- package/dist/core/sdd/parallel-feat-automation.js +424 -0
- package/dist/core/sdd/plugin-broker.d.ts +777 -0
- package/dist/core/sdd/plugin-broker.js +492 -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 +139 -0
- package/dist/core/sdd/plugin-cli.js +265 -0
- package/dist/core/sdd/plugin-evidence.d.ts +348 -0
- package/dist/core/sdd/plugin-evidence.js +307 -0
- package/dist/core/sdd/plugin-manifest.d.ts +232 -0
- package/dist/core/sdd/plugin-manifest.js +225 -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 +447 -0
- package/dist/core/sdd/plugin-registry.js +138 -0
- package/dist/core/sdd/plugin-sdk-contract.d.ts +363 -0
- package/dist/core/sdd/plugin-sdk-contract.js +268 -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 +620 -0
- package/dist/core/sdd/quality-validation.js +239 -0
- package/dist/core/sdd/release-readiness.d.ts +19 -0
- package/dist/core/sdd/release-readiness.js +472 -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/runtime-boundary-contract.d.ts +45 -0
- package/dist/core/sdd/runtime-boundary-contract.js +90 -0
- package/dist/core/sdd/sanitize.d.ts +30 -1
- package/dist/core/sdd/sanitize.js +23 -23
- package/dist/core/sdd/sdk-agent-plugin-quality-gates.d.ts +150 -0
- package/dist/core/sdd/sdk-agent-plugin-quality-gates.js +258 -0
- package/dist/core/sdd/services/agent-run.service.d.ts +97 -0
- package/dist/core/sdd/services/agent-run.service.js +261 -0
- package/dist/core/sdd/services/breakdown.service.js +2 -1
- package/dist/core/sdd/services/capability-diff.service.d.ts +18 -0
- package/dist/core/sdd/services/capability-diff.service.js +26 -0
- package/dist/core/sdd/services/change-safety-preflight.service.d.ts +17 -0
- package/dist/core/sdd/services/change-safety-preflight.service.js +17 -0
- package/dist/core/sdd/services/context.service.d.ts +43 -340
- package/dist/core/sdd/services/context.service.js +341 -25
- 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 +105 -0
- package/dist/core/sdd/services/finalize.service.js +499 -38
- package/dist/core/sdd/services/frontend-gap.service.js +22 -7
- package/dist/core/sdd/services/frontend-impact.service.d.ts +1 -1
- 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/semantic-intent-classifier.service.d.ts +6 -0
- package/dist/core/sdd/services/semantic-intent-classifier.service.js +7 -0
- 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 +23 -0
- package/dist/core/sdd/state.js +313 -66
- package/dist/core/sdd/store/sdd-stores.js +2 -2
- package/dist/core/sdd/structural-health.d.ts +55 -55
- package/dist/core/sdd/types.d.ts +60 -19
- package/dist/core/sdd/types.js +21 -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/views.js +17 -0
- package/dist/core/sdd/workspace-schemas.d.ts +670 -19
- package/dist/core/sdd/workspace-schemas.js +285 -5
- 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/domains/sdd/index.d.ts +6 -0
- package/dist/domains/sdd/index.js +6 -0
- package/dist/infrastructures/sdd/index.d.ts +7 -0
- package/dist/infrastructures/sdd/index.js +6 -0
- package/dist/presentations/cli/sdd/index.d.ts +3 -0
- package/dist/presentations/cli/sdd/index.js +3 -0
- package/dist/shared/sdd/index.d.ts +3 -0
- package/dist/shared/sdd/index.js +2 -0
- 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 +34 -21
- package/schemas/sdd/1-spec.schema.json +1 -1
- package/schemas/sdd/2-plan.schema.json +280 -3
- 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 +701 -5
- 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/agent-runtime-command-plan.schema.json +212 -0
- package/schemas/sdd/agent-runtime-opencode-run-evidence.schema.json +270 -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 +645 -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 +637 -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 +304 -0
- package/schemas/sdd/parallel-feat-automation-request.schema.json +109 -0
- package/schemas/sdd/parallel-feat-scheduler-request.schema.json +116 -0
- package/schemas/sdd/parallel-feat-scheduler-result.schema.json +404 -0
- package/schemas/sdd/plugin-artifact-manifest.schema.json +259 -0
- package/schemas/sdd/plugin-artifact-map.schema.json +223 -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 +678 -0
- package/schemas/sdd/plugin-language-runtime.schema.json +103 -0
- package/schemas/sdd/plugin-package-governance.schema.json +74 -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 +729 -0
- package/schemas/sdd/plugin-rollback-manifest.schema.json +87 -0
- package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +954 -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 +1337 -0
- package/schemas/sdd/quality-run.schema.json +197 -0
- package/schemas/sdd/quality-scenario.schema.json +252 -0
- package/schemas/sdd/sdk-agent-plugin-quality-gate-input.schema.json +168 -0
- package/schemas/sdd/sdk-agent-plugin-quality-gate-report.schema.json +160 -0
- package/schemas/sdd/workspace-catalog.schema.json +13232 -35
- 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,225 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { toJSONSchema, z } from 'zod';
|
|
5
|
+
import { pluginPackageGovernanceSchema, pluginLanguageRuntimeSchema } from './plugin-sdk-contract.js';
|
|
6
|
+
const JSON_SCHEMA_DRAFT = 'https://json-schema.org/draft/2020-12/schema';
|
|
7
|
+
const PLUGIN_ID_PATTERN = /^codesdd-plugin-[a-z0-9][a-z0-9-]*$/;
|
|
8
|
+
const SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
|
|
9
|
+
const CAPABILITY_NAME_PATTERN = /^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+$/;
|
|
10
|
+
const WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\/]/;
|
|
11
|
+
const jsonObjectSchema = z.record(z.string(), z.unknown());
|
|
12
|
+
const safeRelativePathSchema = z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.refine((value) => isSafeRelativePath(value), {
|
|
16
|
+
message: 'Path must be relative to the project root and must not contain traversal segments.',
|
|
17
|
+
});
|
|
18
|
+
export const pluginCapabilitySchema = z
|
|
19
|
+
.object({
|
|
20
|
+
name: z.string().regex(CAPABILITY_NAME_PATTERN),
|
|
21
|
+
description: z.string().min(20),
|
|
22
|
+
input_schema: jsonObjectSchema,
|
|
23
|
+
output_schema: jsonObjectSchema,
|
|
24
|
+
deterministic: z.boolean(),
|
|
25
|
+
idempotent: z.boolean(),
|
|
26
|
+
supports_dry_run: z.boolean(),
|
|
27
|
+
supports_apply: z.boolean(),
|
|
28
|
+
supports_rollback: z.boolean().default(false),
|
|
29
|
+
write_scope: z.array(safeRelativePathSchema).default([]),
|
|
30
|
+
risk_tier: z.enum(['low', 'medium', 'high', 'critical']).default('medium'),
|
|
31
|
+
approval: z.enum(['none', 'maintainer', 'security', 'architecture-board']).default('maintainer'),
|
|
32
|
+
})
|
|
33
|
+
.superRefine((capability, context) => {
|
|
34
|
+
if (capability.supports_apply && !capability.supports_dry_run) {
|
|
35
|
+
context.addIssue({
|
|
36
|
+
code: 'custom',
|
|
37
|
+
path: ['supports_dry_run'],
|
|
38
|
+
message: 'Apply-capable plugin capabilities must support dry-run mode.',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export const pluginCompressionConfigSchema = z
|
|
43
|
+
.object({
|
|
44
|
+
enabled: z.boolean().default(false),
|
|
45
|
+
engine: z.enum(['rtk', 'headroom', 'builtin', 'none']).default('none'),
|
|
46
|
+
mode: z.literal('pretooluse').default('pretooluse'),
|
|
47
|
+
exclude_commands: z.array(z.string().min(1)).default([]),
|
|
48
|
+
tee: z.enum(['failures', 'always', 'never']).default('failures'),
|
|
49
|
+
max_output_tokens: z.number().int().positive().max(64000).default(4000),
|
|
50
|
+
})
|
|
51
|
+
.superRefine((compression, context) => {
|
|
52
|
+
if (compression.enabled && compression.engine === 'none') {
|
|
53
|
+
context.addIssue({
|
|
54
|
+
code: 'custom',
|
|
55
|
+
path: ['engine'],
|
|
56
|
+
message: 'Compression engine must not be none when compression is enabled.',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export const pluginManifestSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
id: z.string().regex(PLUGIN_ID_PATTERN),
|
|
63
|
+
name: z.string().min(3),
|
|
64
|
+
version: z.string().regex(SEMVER_PATTERN),
|
|
65
|
+
contract_version: z.literal(1),
|
|
66
|
+
vendor: z.string().min(2),
|
|
67
|
+
codesdd_compat: z.object({
|
|
68
|
+
versions: z.string().min(1),
|
|
69
|
+
sdd_contract_versions: z.array(z.number().int().positive()).min(1),
|
|
70
|
+
}),
|
|
71
|
+
technology: z.object({
|
|
72
|
+
language: z.string().min(1),
|
|
73
|
+
framework: z.string().optional(),
|
|
74
|
+
runtime: z.string().optional(),
|
|
75
|
+
package_manager: z.string().optional(),
|
|
76
|
+
min_versions: z.record(z.string(), z.string()).default({}),
|
|
77
|
+
}),
|
|
78
|
+
package_governance: pluginPackageGovernanceSchema.optional(),
|
|
79
|
+
language_runtime: pluginLanguageRuntimeSchema.optional(),
|
|
80
|
+
capabilities: z.array(pluginCapabilitySchema).min(1),
|
|
81
|
+
execution: z.object({
|
|
82
|
+
command: z.string().min(1),
|
|
83
|
+
args: z.array(z.string()).default([]),
|
|
84
|
+
timeout_seconds: z.number().int().positive().max(3600).default(120),
|
|
85
|
+
env_allowlist: z.array(z.string().regex(/^[A-Z_][A-Z0-9_]*$/)).default([]),
|
|
86
|
+
network: z.enum(['disabled', 'restricted', 'enabled']).default('disabled'),
|
|
87
|
+
process_spawn: z.enum(['forbidden', 'declared']).default('forbidden'),
|
|
88
|
+
working_directory: safeRelativePathSchema.default('.'),
|
|
89
|
+
}),
|
|
90
|
+
artifacts: z.object({
|
|
91
|
+
writes: z.array(safeRelativePathSchema).default([]),
|
|
92
|
+
forbidden_writes: z.array(safeRelativePathSchema).default([]),
|
|
93
|
+
naming_conventions: z.array(z.string().min(1)).default([]),
|
|
94
|
+
}),
|
|
95
|
+
supply_chain: z.object({
|
|
96
|
+
checksum: z.string().optional(),
|
|
97
|
+
signature: z.string().optional(),
|
|
98
|
+
provenance: z.string().optional(),
|
|
99
|
+
sbom: z.string().optional(),
|
|
100
|
+
}),
|
|
101
|
+
governance: z.object({
|
|
102
|
+
owner: z.string().min(2),
|
|
103
|
+
support_sla: z.string().min(1),
|
|
104
|
+
deprecation_window: z.string().min(1),
|
|
105
|
+
policy_packs: z.array(z.string().min(1)).default([]),
|
|
106
|
+
trust_tier: z.enum(['local-dev', 'experimental', 'enterprise-approved', 'blocked']),
|
|
107
|
+
allowed_domains: z.array(z.string().min(1)).default([]),
|
|
108
|
+
risk_tier: z.enum(['low', 'medium', 'high', 'critical']).default('medium'),
|
|
109
|
+
}),
|
|
110
|
+
validation: z.object({
|
|
111
|
+
commands: z.array(z.string().min(1)).min(1),
|
|
112
|
+
coverage_target: z.number().min(0).max(100).default(95),
|
|
113
|
+
security_checks: z.array(z.string().min(1)).default([]),
|
|
114
|
+
dependency_checks: z.array(z.string().min(1)).default([]),
|
|
115
|
+
}),
|
|
116
|
+
compression: pluginCompressionConfigSchema.default({
|
|
117
|
+
enabled: false,
|
|
118
|
+
engine: 'none',
|
|
119
|
+
mode: 'pretooluse',
|
|
120
|
+
exclude_commands: [],
|
|
121
|
+
tee: 'failures',
|
|
122
|
+
max_output_tokens: 4000,
|
|
123
|
+
}),
|
|
124
|
+
})
|
|
125
|
+
.superRefine((manifest, context) => {
|
|
126
|
+
if (manifest.language_runtime && manifest.language_runtime.language !== manifest.technology.language) {
|
|
127
|
+
context.addIssue({
|
|
128
|
+
code: 'custom',
|
|
129
|
+
path: ['language_runtime', 'language'],
|
|
130
|
+
message: 'Language runtime language must match technology.language.',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
const duplicateCapabilityNames = findDuplicates(manifest.capabilities.map((capability) => capability.name));
|
|
134
|
+
for (const duplicateName of duplicateCapabilityNames) {
|
|
135
|
+
context.addIssue({
|
|
136
|
+
code: 'custom',
|
|
137
|
+
path: ['capabilities'],
|
|
138
|
+
message: `Duplicate capability name: ${duplicateName}.`,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (manifest.governance.trust_tier === 'enterprise-approved') {
|
|
142
|
+
if (!manifest.supply_chain.checksum) {
|
|
143
|
+
context.addIssue({
|
|
144
|
+
code: 'custom',
|
|
145
|
+
path: ['supply_chain', 'checksum'],
|
|
146
|
+
message: 'Enterprise-approved plugins must declare a checksum.',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (!manifest.supply_chain.signature && !manifest.supply_chain.provenance) {
|
|
150
|
+
context.addIssue({
|
|
151
|
+
code: 'custom',
|
|
152
|
+
path: ['supply_chain', 'provenance'],
|
|
153
|
+
message: 'Enterprise-approved plugins must declare either a signature or provenance.',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (!manifest.supply_chain.sbom) {
|
|
157
|
+
context.addIssue({
|
|
158
|
+
code: 'custom',
|
|
159
|
+
path: ['supply_chain', 'sbom'],
|
|
160
|
+
message: 'Enterprise-approved plugins must declare SBOM metadata.',
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
export class PluginManifestValidationError extends Error {
|
|
166
|
+
issues;
|
|
167
|
+
constructor(sourceLabel, issues) {
|
|
168
|
+
super(`Plugin manifest validation failed for ${sourceLabel}: ${issues.join('; ')}`);
|
|
169
|
+
this.name = 'PluginManifestValidationError';
|
|
170
|
+
this.issues = issues;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export function parsePluginManifest(content, sourceLabel = 'codesdd-plugin.yaml') {
|
|
174
|
+
let parsed;
|
|
175
|
+
try {
|
|
176
|
+
parsed = parseYaml(content);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
throw new PluginManifestValidationError(sourceLabel, [`YAML parse failed: ${String(error)}`]);
|
|
180
|
+
}
|
|
181
|
+
return validatePluginManifest(parsed, sourceLabel);
|
|
182
|
+
}
|
|
183
|
+
export async function loadPluginManifest(filePath) {
|
|
184
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
185
|
+
return parsePluginManifest(content, path.basename(filePath));
|
|
186
|
+
}
|
|
187
|
+
export function validatePluginManifest(value, sourceLabel = 'codesdd-plugin.yaml') {
|
|
188
|
+
const result = pluginManifestSchema.safeParse(value);
|
|
189
|
+
if (!result.success) {
|
|
190
|
+
throw new PluginManifestValidationError(sourceLabel, formatIssues(result.error.issues));
|
|
191
|
+
}
|
|
192
|
+
return result.data;
|
|
193
|
+
}
|
|
194
|
+
export function buildPluginManifestJsonSchema() {
|
|
195
|
+
return {
|
|
196
|
+
...toJSONSchema(pluginManifestSchema),
|
|
197
|
+
$schema: JSON_SCHEMA_DRAFT,
|
|
198
|
+
title: 'CodeSDD Enterprise Plugin Manifest',
|
|
199
|
+
description: 'Machine-readable contract for a CodeSDD enterprise plugin manifest.',
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function isSafeRelativePath(value) {
|
|
203
|
+
if (value.startsWith('/') || WINDOWS_ABSOLUTE_PATH_PATTERN.test(value)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
return !value.split(/[\\/]+/).some((segment) => segment === '..');
|
|
207
|
+
}
|
|
208
|
+
function findDuplicates(values) {
|
|
209
|
+
const seen = new Set();
|
|
210
|
+
const duplicates = new Set();
|
|
211
|
+
for (const value of values) {
|
|
212
|
+
if (seen.has(value)) {
|
|
213
|
+
duplicates.add(value);
|
|
214
|
+
}
|
|
215
|
+
seen.add(value);
|
|
216
|
+
}
|
|
217
|
+
return [...duplicates];
|
|
218
|
+
}
|
|
219
|
+
function formatIssues(issues) {
|
|
220
|
+
return issues.map((issue) => {
|
|
221
|
+
const issuePath = issue.path.length > 0 ? issue.path.join('.') : '<root>';
|
|
222
|
+
return `${issuePath}: ${issue.message}`;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=plugin-manifest.js.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PluginManifest } from './plugin-manifest.js';
|
|
3
|
+
export declare const pluginPolicyPackSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
version: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
applies_to: z.ZodDefault<z.ZodObject<{
|
|
8
|
+
trust_tiers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
9
|
+
experimental: "experimental";
|
|
10
|
+
blocked: "blocked";
|
|
11
|
+
"local-dev": "local-dev";
|
|
12
|
+
"enterprise-approved": "enterprise-approved";
|
|
13
|
+
}>>>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
requirements: z.ZodDefault<z.ZodObject<{
|
|
16
|
+
max_risk_tier: z.ZodDefault<z.ZodEnum<{
|
|
17
|
+
low: "low";
|
|
18
|
+
medium: "medium";
|
|
19
|
+
high: "high";
|
|
20
|
+
critical: "critical";
|
|
21
|
+
}>>;
|
|
22
|
+
supply_chain: z.ZodDefault<z.ZodObject<{
|
|
23
|
+
checksum: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
signature_or_provenance: z.ZodDefault<z.ZodBoolean>;
|
|
25
|
+
sbom: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
sbom_formats: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
27
|
+
custom: "custom";
|
|
28
|
+
cyclonedx: "cyclonedx";
|
|
29
|
+
spdx: "spdx";
|
|
30
|
+
}>>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
validation: z.ZodDefault<z.ZodObject<{
|
|
33
|
+
min_coverage: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
security_checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
35
|
+
dependency_checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
execution: z.ZodDefault<z.ZodObject<{
|
|
38
|
+
network: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
disabled: "disabled";
|
|
40
|
+
enabled: "enabled";
|
|
41
|
+
restricted: "restricted";
|
|
42
|
+
}>>;
|
|
43
|
+
process_spawn: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
forbidden: "forbidden";
|
|
45
|
+
declared: "declared";
|
|
46
|
+
}>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const pluginPolicyPackIssueSchema: z.ZodObject<{
|
|
51
|
+
code: z.ZodString;
|
|
52
|
+
severity: z.ZodEnum<{
|
|
53
|
+
deny: "deny";
|
|
54
|
+
warn: "warn";
|
|
55
|
+
}>;
|
|
56
|
+
message: z.ZodString;
|
|
57
|
+
policy_pack: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export declare const pluginPolicyPackEvaluationSchema: z.ZodObject<{
|
|
60
|
+
schema_version: z.ZodLiteral<1>;
|
|
61
|
+
plugin_ref: z.ZodObject<{
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
version: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
decision: z.ZodEnum<{
|
|
66
|
+
deny: "deny";
|
|
67
|
+
warn: "warn";
|
|
68
|
+
allow: "allow";
|
|
69
|
+
}>;
|
|
70
|
+
declared_policy_packs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
71
|
+
applied_policy_packs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
|
+
issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
73
|
+
code: z.ZodString;
|
|
74
|
+
severity: z.ZodEnum<{
|
|
75
|
+
deny: "deny";
|
|
76
|
+
warn: "warn";
|
|
77
|
+
}>;
|
|
78
|
+
message: z.ZodString;
|
|
79
|
+
policy_pack: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export type PluginPolicyPack = z.infer<typeof pluginPolicyPackSchema>;
|
|
83
|
+
export type PluginPolicyPackIssue = z.infer<typeof pluginPolicyPackIssueSchema>;
|
|
84
|
+
export type PluginPolicyPackEvaluation = z.infer<typeof pluginPolicyPackEvaluationSchema>;
|
|
85
|
+
export declare const ENTERPRISE_DEFAULT_POLICY_PACK: PluginPolicyPack;
|
|
86
|
+
export declare const DEVTRACK_API_FOUNDATION_POLICY_PACK: PluginPolicyPack;
|
|
87
|
+
export declare function evaluatePluginPolicyPacks(manifest: PluginManifest, policyPacks: PluginPolicyPack[]): PluginPolicyPackEvaluation;
|
|
88
|
+
//# sourceMappingURL=plugin-policy-pack.d.ts.map
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pluginManifestSchema } from './plugin-manifest.js';
|
|
3
|
+
const SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
|
|
4
|
+
const riskRank = {
|
|
5
|
+
low: 1,
|
|
6
|
+
medium: 2,
|
|
7
|
+
high: 3,
|
|
8
|
+
critical: 4,
|
|
9
|
+
};
|
|
10
|
+
export const pluginPolicyPackSchema = z.object({
|
|
11
|
+
id: z.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
12
|
+
version: z.string().regex(SEMVER_PATTERN),
|
|
13
|
+
description: z.string().min(20),
|
|
14
|
+
applies_to: z
|
|
15
|
+
.object({
|
|
16
|
+
trust_tiers: z
|
|
17
|
+
.array(z.enum(['local-dev', 'experimental', 'enterprise-approved', 'blocked']))
|
|
18
|
+
.default(['enterprise-approved']),
|
|
19
|
+
})
|
|
20
|
+
.default({ trust_tiers: ['enterprise-approved'] }),
|
|
21
|
+
requirements: z
|
|
22
|
+
.object({
|
|
23
|
+
max_risk_tier: z.enum(['low', 'medium', 'high', 'critical']).default('medium'),
|
|
24
|
+
supply_chain: z
|
|
25
|
+
.object({
|
|
26
|
+
checksum: z.boolean().default(false),
|
|
27
|
+
signature_or_provenance: z.boolean().default(false),
|
|
28
|
+
sbom: z.boolean().default(false),
|
|
29
|
+
sbom_formats: z.array(z.enum(['cyclonedx', 'spdx', 'custom'])).default([]),
|
|
30
|
+
})
|
|
31
|
+
.default({ checksum: false, signature_or_provenance: false, sbom: false, sbom_formats: [] }),
|
|
32
|
+
validation: z
|
|
33
|
+
.object({
|
|
34
|
+
min_coverage: z.number().min(0).max(100).default(0),
|
|
35
|
+
security_checks: z.array(z.string().min(1)).default([]),
|
|
36
|
+
dependency_checks: z.array(z.string().min(1)).default([]),
|
|
37
|
+
})
|
|
38
|
+
.default({ min_coverage: 0, security_checks: [], dependency_checks: [] }),
|
|
39
|
+
execution: z
|
|
40
|
+
.object({
|
|
41
|
+
network: z.enum(['disabled', 'restricted', 'enabled']).optional(),
|
|
42
|
+
process_spawn: z.enum(['forbidden', 'declared']).optional(),
|
|
43
|
+
})
|
|
44
|
+
.default({}),
|
|
45
|
+
})
|
|
46
|
+
.default({
|
|
47
|
+
max_risk_tier: 'medium',
|
|
48
|
+
supply_chain: { checksum: false, signature_or_provenance: false, sbom: false, sbom_formats: [] },
|
|
49
|
+
validation: { min_coverage: 0, security_checks: [], dependency_checks: [] },
|
|
50
|
+
execution: {},
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
export const pluginPolicyPackIssueSchema = z.object({
|
|
54
|
+
code: z.string().min(1),
|
|
55
|
+
severity: z.enum(['deny', 'warn']),
|
|
56
|
+
message: z.string().min(1),
|
|
57
|
+
policy_pack: z.string().optional(),
|
|
58
|
+
});
|
|
59
|
+
export const pluginPolicyPackEvaluationSchema = z.object({
|
|
60
|
+
schema_version: z.literal(1),
|
|
61
|
+
plugin_ref: z.object({
|
|
62
|
+
id: z.string().min(1),
|
|
63
|
+
version: z.string().min(1),
|
|
64
|
+
}),
|
|
65
|
+
decision: z.enum(['allow', 'warn', 'deny']),
|
|
66
|
+
declared_policy_packs: z.array(z.string()).default([]),
|
|
67
|
+
applied_policy_packs: z.array(z.string()).default([]),
|
|
68
|
+
issues: z.array(pluginPolicyPackIssueSchema).default([]),
|
|
69
|
+
});
|
|
70
|
+
export const ENTERPRISE_DEFAULT_POLICY_PACK = pluginPolicyPackSchema.parse({
|
|
71
|
+
id: 'enterprise-default',
|
|
72
|
+
version: '1.0.0',
|
|
73
|
+
description: 'Default enterprise plugin policy for supply-chain, validation, and safe execution controls.',
|
|
74
|
+
applies_to: {
|
|
75
|
+
trust_tiers: ['enterprise-approved', 'local-dev', 'experimental'],
|
|
76
|
+
},
|
|
77
|
+
requirements: {
|
|
78
|
+
max_risk_tier: 'high',
|
|
79
|
+
supply_chain: {
|
|
80
|
+
checksum: true,
|
|
81
|
+
signature_or_provenance: true,
|
|
82
|
+
sbom: true,
|
|
83
|
+
sbom_formats: ['cyclonedx', 'spdx'],
|
|
84
|
+
},
|
|
85
|
+
validation: {
|
|
86
|
+
min_coverage: 95,
|
|
87
|
+
security_checks: ['dependency-audit'],
|
|
88
|
+
dependency_checks: ['lockfile-review'],
|
|
89
|
+
},
|
|
90
|
+
execution: {
|
|
91
|
+
network: 'disabled',
|
|
92
|
+
process_spawn: 'forbidden',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
export const DEVTRACK_API_FOUNDATION_POLICY_PACK = pluginPolicyPackSchema.parse({
|
|
97
|
+
id: 'devtrack-api-foundation',
|
|
98
|
+
version: '1.0.0',
|
|
99
|
+
description: 'DevTrack API Foundation appliance policy for TypeORM-only dependency and structural validation.',
|
|
100
|
+
applies_to: {
|
|
101
|
+
trust_tiers: ['enterprise-approved'],
|
|
102
|
+
},
|
|
103
|
+
requirements: {
|
|
104
|
+
max_risk_tier: 'high',
|
|
105
|
+
supply_chain: {
|
|
106
|
+
checksum: true,
|
|
107
|
+
signature_or_provenance: true,
|
|
108
|
+
sbom: true,
|
|
109
|
+
sbom_formats: ['cyclonedx'],
|
|
110
|
+
},
|
|
111
|
+
validation: {
|
|
112
|
+
min_coverage: 95,
|
|
113
|
+
security_checks: ['dependency-audit', 'no-secret-fixtures', 'no-out-of-root-writes'],
|
|
114
|
+
dependency_checks: ['lockfile-review', 'typeorm-only-persistence'],
|
|
115
|
+
},
|
|
116
|
+
execution: {
|
|
117
|
+
network: 'disabled',
|
|
118
|
+
process_spawn: 'forbidden',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
export function evaluatePluginPolicyPacks(manifest, policyPacks) {
|
|
123
|
+
const parsedManifest = pluginManifestSchema.parse(manifest);
|
|
124
|
+
const parsedPolicyPacks = policyPacks.map((pack) => pluginPolicyPackSchema.parse(pack));
|
|
125
|
+
const packById = new Map(parsedPolicyPacks.map((pack) => [pack.id, pack]));
|
|
126
|
+
const issues = [];
|
|
127
|
+
const appliedPolicyPacks = [];
|
|
128
|
+
if (parsedManifest.governance.policy_packs.length === 0) {
|
|
129
|
+
issues.push(warn('NO_POLICY_PACK_DECLARED', `Plugin ${parsedManifest.id} declares no policy packs.`));
|
|
130
|
+
}
|
|
131
|
+
for (const policyPackId of parsedManifest.governance.policy_packs) {
|
|
132
|
+
const policyPack = packById.get(policyPackId);
|
|
133
|
+
if (!policyPack) {
|
|
134
|
+
issues.push(deny('POLICY_PACK_NOT_AVAILABLE', `Policy pack ${policyPackId} is not available.`, policyPackId));
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
appliedPolicyPacks.push(policyPack.id);
|
|
138
|
+
issues.push(...evaluatePolicyPack(parsedManifest, policyPack));
|
|
139
|
+
}
|
|
140
|
+
return pluginPolicyPackEvaluationSchema.parse({
|
|
141
|
+
schema_version: 1,
|
|
142
|
+
plugin_ref: {
|
|
143
|
+
id: parsedManifest.id,
|
|
144
|
+
version: parsedManifest.version,
|
|
145
|
+
},
|
|
146
|
+
decision: issues.some((issue) => issue.severity === 'deny')
|
|
147
|
+
? 'deny'
|
|
148
|
+
: issues.some((issue) => issue.severity === 'warn')
|
|
149
|
+
? 'warn'
|
|
150
|
+
: 'allow',
|
|
151
|
+
declared_policy_packs: parsedManifest.governance.policy_packs,
|
|
152
|
+
applied_policy_packs: appliedPolicyPacks,
|
|
153
|
+
issues,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function evaluatePolicyPack(manifest, policyPack) {
|
|
157
|
+
const issues = [];
|
|
158
|
+
if (!policyPack.applies_to.trust_tiers.includes(manifest.governance.trust_tier)) {
|
|
159
|
+
issues.push(warn('POLICY_PACK_NOT_APPLICABLE', `Policy pack ${policyPack.id} does not target trust tier ${manifest.governance.trust_tier}.`, policyPack.id));
|
|
160
|
+
}
|
|
161
|
+
if (riskRank[manifest.governance.risk_tier] > riskRank[policyPack.requirements.max_risk_tier]) {
|
|
162
|
+
issues.push(deny('RISK_TIER_EXCEEDS_POLICY', `Plugin risk tier ${manifest.governance.risk_tier} exceeds policy maximum ${policyPack.requirements.max_risk_tier}.`, policyPack.id));
|
|
163
|
+
}
|
|
164
|
+
issues.push(...evaluateSupplyChainPolicy(manifest, policyPack));
|
|
165
|
+
issues.push(...evaluateValidationPolicy(manifest, policyPack));
|
|
166
|
+
issues.push(...evaluateExecutionPolicy(manifest, policyPack));
|
|
167
|
+
return issues;
|
|
168
|
+
}
|
|
169
|
+
function evaluateSupplyChainPolicy(manifest, policyPack) {
|
|
170
|
+
const requirements = policyPack.requirements.supply_chain;
|
|
171
|
+
const issues = [];
|
|
172
|
+
if (requirements.checksum && !manifest.supply_chain.checksum) {
|
|
173
|
+
issues.push(deny('CHECKSUM_REQUIRED', `Policy pack ${policyPack.id} requires a checksum.`, policyPack.id));
|
|
174
|
+
}
|
|
175
|
+
if (requirements.signature_or_provenance && !manifest.supply_chain.signature && !manifest.supply_chain.provenance) {
|
|
176
|
+
issues.push(deny('SIGNATURE_OR_PROVENANCE_REQUIRED', `Policy pack ${policyPack.id} requires signature or provenance.`, policyPack.id));
|
|
177
|
+
}
|
|
178
|
+
if (requirements.sbom && !manifest.supply_chain.sbom) {
|
|
179
|
+
issues.push(deny('SBOM_REQUIRED', `Policy pack ${policyPack.id} requires SBOM metadata.`, policyPack.id));
|
|
180
|
+
}
|
|
181
|
+
if (manifest.supply_chain.sbom && requirements.sbom_formats.length > 0) {
|
|
182
|
+
const format = resolveSbomFormat(manifest.supply_chain.sbom);
|
|
183
|
+
if (!requirements.sbom_formats.includes(format)) {
|
|
184
|
+
issues.push(deny('SBOM_FORMAT_NOT_ALLOWED', `SBOM format ${format} is not allowed by policy pack ${policyPack.id}.`, policyPack.id));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return issues;
|
|
188
|
+
}
|
|
189
|
+
function evaluateValidationPolicy(manifest, policyPack) {
|
|
190
|
+
const requirements = policyPack.requirements.validation;
|
|
191
|
+
const issues = [];
|
|
192
|
+
if (manifest.validation.coverage_target < requirements.min_coverage) {
|
|
193
|
+
issues.push(deny('COVERAGE_TARGET_TOO_LOW', `Coverage target ${manifest.validation.coverage_target}% is below policy minimum ${requirements.min_coverage}%.`, policyPack.id));
|
|
194
|
+
}
|
|
195
|
+
issues.push(...missingValues(requirements.security_checks, manifest.validation.security_checks).map((check) => deny('SECURITY_CHECK_REQUIRED', `Required security check ${check} is missing.`, policyPack.id)));
|
|
196
|
+
issues.push(...missingValues(requirements.dependency_checks, manifest.validation.dependency_checks).map((check) => deny('DEPENDENCY_CHECK_REQUIRED', `Required dependency check ${check} is missing.`, policyPack.id)));
|
|
197
|
+
return issues;
|
|
198
|
+
}
|
|
199
|
+
function evaluateExecutionPolicy(manifest, policyPack) {
|
|
200
|
+
const requirements = policyPack.requirements.execution;
|
|
201
|
+
const issues = [];
|
|
202
|
+
if (requirements.network && manifest.execution.network !== requirements.network) {
|
|
203
|
+
issues.push(deny('NETWORK_POLICY_MISMATCH', `Network policy ${manifest.execution.network} does not match required ${requirements.network}.`, policyPack.id));
|
|
204
|
+
}
|
|
205
|
+
if (requirements.process_spawn && manifest.execution.process_spawn !== requirements.process_spawn) {
|
|
206
|
+
issues.push(deny('PROCESS_SPAWN_POLICY_MISMATCH', `Process spawn policy ${manifest.execution.process_spawn} does not match required ${requirements.process_spawn}.`, policyPack.id));
|
|
207
|
+
}
|
|
208
|
+
return issues;
|
|
209
|
+
}
|
|
210
|
+
function resolveSbomFormat(sbom) {
|
|
211
|
+
const prefix = sbom.split(':', 1)[0]?.toLowerCase();
|
|
212
|
+
if (prefix === 'cyclonedx' || prefix === 'spdx') {
|
|
213
|
+
return prefix;
|
|
214
|
+
}
|
|
215
|
+
return 'custom';
|
|
216
|
+
}
|
|
217
|
+
function missingValues(required, actual) {
|
|
218
|
+
return required.filter((value) => !actual.includes(value));
|
|
219
|
+
}
|
|
220
|
+
function deny(code, message, policyPack) {
|
|
221
|
+
return {
|
|
222
|
+
code,
|
|
223
|
+
severity: 'deny',
|
|
224
|
+
message,
|
|
225
|
+
policy_pack: policyPack,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function warn(code, message, policyPack) {
|
|
229
|
+
return {
|
|
230
|
+
code,
|
|
231
|
+
severity: 'warn',
|
|
232
|
+
message,
|
|
233
|
+
policy_pack: policyPack,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=plugin-policy-pack.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PluginManifest } from './plugin-manifest.js';
|
|
3
|
+
export declare const pluginPolicyEvaluationRequestSchema: z.ZodObject<{
|
|
4
|
+
capability: z.ZodString;
|
|
5
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
apply: "apply";
|
|
7
|
+
"dry-run": "dry-run";
|
|
8
|
+
rollback: "rollback";
|
|
9
|
+
}>>;
|
|
10
|
+
approval_grants: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
11
|
+
maintainer: "maintainer";
|
|
12
|
+
security: "security";
|
|
13
|
+
"architecture-board": "architecture-board";
|
|
14
|
+
}>>>;
|
|
15
|
+
source_checksum: z.ZodOptional<z.ZodString>;
|
|
16
|
+
requested_write_scope: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
17
|
+
planned_writes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
18
|
+
requested_env: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
19
|
+
network_domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
20
|
+
process_spawn_requested: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
filesystem_checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
22
|
+
path: z.ZodString;
|
|
23
|
+
real_path: z.ZodString;
|
|
24
|
+
project_root: z.ZodString;
|
|
25
|
+
is_symlink: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const pluginPolicyIssueSchema: z.ZodObject<{
|
|
29
|
+
code: z.ZodString;
|
|
30
|
+
severity: z.ZodEnum<{
|
|
31
|
+
deny: "deny";
|
|
32
|
+
warn: "warn";
|
|
33
|
+
}>;
|
|
34
|
+
message: z.ZodString;
|
|
35
|
+
path: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const pluginPolicyEvaluationSchema: z.ZodObject<{
|
|
38
|
+
schema_version: z.ZodLiteral<1>;
|
|
39
|
+
plugin_ref: z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
version: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
capability: z.ZodString;
|
|
44
|
+
mode: z.ZodEnum<{
|
|
45
|
+
apply: "apply";
|
|
46
|
+
"dry-run": "dry-run";
|
|
47
|
+
rollback: "rollback";
|
|
48
|
+
}>;
|
|
49
|
+
decision: z.ZodEnum<{
|
|
50
|
+
deny: "deny";
|
|
51
|
+
warn: "warn";
|
|
52
|
+
allow: "allow";
|
|
53
|
+
}>;
|
|
54
|
+
issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
55
|
+
code: z.ZodString;
|
|
56
|
+
severity: z.ZodEnum<{
|
|
57
|
+
deny: "deny";
|
|
58
|
+
warn: "warn";
|
|
59
|
+
}>;
|
|
60
|
+
message: z.ZodString;
|
|
61
|
+
path: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type PluginPolicyEvaluationRequest = z.infer<typeof pluginPolicyEvaluationRequestSchema>;
|
|
65
|
+
export type PluginPolicyIssue = z.infer<typeof pluginPolicyIssueSchema>;
|
|
66
|
+
export type PluginPolicyEvaluation = z.infer<typeof pluginPolicyEvaluationSchema>;
|
|
67
|
+
export declare function evaluatePluginTrustPolicy(manifest: PluginManifest, request: PluginPolicyEvaluationRequest): PluginPolicyEvaluation;
|
|
68
|
+
//# sourceMappingURL=plugin-policy.d.ts.map
|