@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,492 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pluginRegistryStateSchema, resolvePluginCapability, } from './plugin-registry.js';
|
|
3
|
+
import { evaluatePluginTrustPolicy, pluginPolicyEvaluationSchema } from './plugin-policy.js';
|
|
4
|
+
import { pluginArtifactKindSchema, pluginArtifactLayerSchema, pluginArtifactRoleSchema, pluginRuntimeLanguageSchema, } from './plugin-sdk-contract.js';
|
|
5
|
+
const FEATURE_REF_PATTERN = /^FEAT-\d{4}$/;
|
|
6
|
+
const OPERATION_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
7
|
+
const jsonObjectSchema = z.record(z.string(), z.unknown());
|
|
8
|
+
const pluginInvocationModeSchema = z.enum(['dry-run', 'apply', 'rollback']);
|
|
9
|
+
const approvalGrantSchema = z.enum(['maintainer', 'security', 'architecture-board']);
|
|
10
|
+
const artifactOperationSchema = z.enum(['planned', 'created', 'modified', 'deleted', 'unchanged', 'validated']);
|
|
11
|
+
export const pluginBrokerPlanRequestSchema = z.object({
|
|
12
|
+
feature_ref: z.string().regex(FEATURE_REF_PATTERN),
|
|
13
|
+
capability: z.string().min(1),
|
|
14
|
+
inputs: jsonObjectSchema.default({}),
|
|
15
|
+
skill_ref: z.string().min(1).optional(),
|
|
16
|
+
technology: z
|
|
17
|
+
.object({
|
|
18
|
+
language: z.string().min(1).optional(),
|
|
19
|
+
framework: z.string().min(1).optional(),
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
22
|
+
requested_write_scope: z.array(z.string().min(1)).default([]),
|
|
23
|
+
require_apply: z.boolean().default(false),
|
|
24
|
+
created_at: z.string().datetime().optional(),
|
|
25
|
+
});
|
|
26
|
+
export const pluginInvocationEnvelopeSchema = z.object({
|
|
27
|
+
schema_version: z.literal(1),
|
|
28
|
+
mode: z.literal('dry-run'),
|
|
29
|
+
feature_ref: z.string().regex(FEATURE_REF_PATTERN),
|
|
30
|
+
skill_ref: z.string().optional(),
|
|
31
|
+
plugin_ref: z.object({
|
|
32
|
+
id: z.string().min(1),
|
|
33
|
+
version: z.string().min(1),
|
|
34
|
+
}),
|
|
35
|
+
capability: z.string().min(1),
|
|
36
|
+
inputs: jsonObjectSchema,
|
|
37
|
+
command: z.object({
|
|
38
|
+
executable: z.string().min(1),
|
|
39
|
+
args: z.array(z.string()).default([]),
|
|
40
|
+
timeout_seconds: z.number().int().positive(),
|
|
41
|
+
env_allowlist: z.array(z.string()).default([]),
|
|
42
|
+
network: z.enum(['disabled', 'restricted', 'enabled']),
|
|
43
|
+
process_spawn: z.enum(['forbidden', 'declared']),
|
|
44
|
+
}),
|
|
45
|
+
write_scope: z.array(z.string()).default([]),
|
|
46
|
+
evidence_requirements: z.array(z.string()).default([]),
|
|
47
|
+
});
|
|
48
|
+
export const pluginArtifactManifestEntrySchema = z.object({
|
|
49
|
+
path: z.string().min(1),
|
|
50
|
+
operation: artifactOperationSchema,
|
|
51
|
+
reason: z.string().min(1),
|
|
52
|
+
checksum_before: z.string().optional(),
|
|
53
|
+
checksum_after: z.string().optional(),
|
|
54
|
+
content_type: z.string().optional(),
|
|
55
|
+
artifact_kind: pluginArtifactKindSchema.optional(),
|
|
56
|
+
role: pluginArtifactRoleSchema.optional(),
|
|
57
|
+
layer: pluginArtifactLayerSchema.optional(),
|
|
58
|
+
language: pluginRuntimeLanguageSchema.optional(),
|
|
59
|
+
context: z.string().min(1).optional(),
|
|
60
|
+
implementation: z.enum(['concrete', 'abstract', 'contract', 'generated', 'manual']).optional(),
|
|
61
|
+
decision_refs: z.array(z.string().regex(/^(?:ADR|DEB|EPIC|FEAT|INS)-\d{4}$/)).optional(),
|
|
62
|
+
source_refs: z.array(z.string().min(1)).optional(),
|
|
63
|
+
tags: z.array(z.string().min(1)).optional(),
|
|
64
|
+
});
|
|
65
|
+
export const pluginArtifactManifestSchema = z.object({
|
|
66
|
+
schema_version: z.literal(1),
|
|
67
|
+
operation_id: z.string().regex(OPERATION_ID_PATTERN),
|
|
68
|
+
generated_at: z.string().datetime(),
|
|
69
|
+
feature_ref: z.string().regex(FEATURE_REF_PATTERN),
|
|
70
|
+
plugin_ref: z.object({
|
|
71
|
+
id: z.string().min(1),
|
|
72
|
+
version: z.string().min(1),
|
|
73
|
+
}),
|
|
74
|
+
capability: z.string().min(1),
|
|
75
|
+
mode: pluginInvocationModeSchema,
|
|
76
|
+
status: z.enum(['planned', 'applied', 'rolled_back', 'failed']),
|
|
77
|
+
artifacts: z.array(pluginArtifactManifestEntrySchema).default([]),
|
|
78
|
+
validation_evidence: z
|
|
79
|
+
.array(z.object({
|
|
80
|
+
command: z.string().min(1),
|
|
81
|
+
status: z.enum(['pending', 'passed', 'failed', 'skipped']),
|
|
82
|
+
evidence_ref: z.string().optional(),
|
|
83
|
+
}))
|
|
84
|
+
.default([]),
|
|
85
|
+
});
|
|
86
|
+
export const pluginRollbackManifestSchema = z.object({
|
|
87
|
+
schema_version: z.literal(1),
|
|
88
|
+
operation_id: z.string().regex(OPERATION_ID_PATTERN),
|
|
89
|
+
generated_at: z.string().datetime(),
|
|
90
|
+
feature_ref: z.string().regex(FEATURE_REF_PATTERN),
|
|
91
|
+
plugin_ref: z.object({
|
|
92
|
+
id: z.string().min(1),
|
|
93
|
+
version: z.string().min(1),
|
|
94
|
+
}),
|
|
95
|
+
capability: z.string().min(1),
|
|
96
|
+
mode: pluginInvocationModeSchema,
|
|
97
|
+
status: z.enum(['planned', 'not-required']),
|
|
98
|
+
reason: z.string().min(1),
|
|
99
|
+
rollback_steps: z.array(z.string().min(1)).default([]),
|
|
100
|
+
});
|
|
101
|
+
export const pluginRuntimeInvocationRequestSchema = pluginBrokerPlanRequestSchema.extend({
|
|
102
|
+
mode: pluginInvocationModeSchema.default('dry-run'),
|
|
103
|
+
operation_id: z.string().regex(OPERATION_ID_PATTERN).optional(),
|
|
104
|
+
approval_grants: z.array(approvalGrantSchema).default([]),
|
|
105
|
+
source_checksum: z.string().optional(),
|
|
106
|
+
planned_writes: z.array(z.string().min(1)).default([]),
|
|
107
|
+
requested_env: z.array(z.string().min(1)).default([]),
|
|
108
|
+
network_domains: z.array(z.string().min(1)).default([]),
|
|
109
|
+
process_spawn_requested: z.boolean().default(false),
|
|
110
|
+
filesystem_checks: z
|
|
111
|
+
.array(z.object({
|
|
112
|
+
path: z.string().min(1),
|
|
113
|
+
real_path: z.string().min(1),
|
|
114
|
+
project_root: z.string().min(1),
|
|
115
|
+
is_symlink: z.boolean().default(false),
|
|
116
|
+
}))
|
|
117
|
+
.default([]),
|
|
118
|
+
});
|
|
119
|
+
export const pluginRuntimeInvocationEnvelopeSchema = z.object({
|
|
120
|
+
schema_version: z.literal(1),
|
|
121
|
+
operation_id: z.string().regex(OPERATION_ID_PATTERN),
|
|
122
|
+
created_at: z.string().datetime(),
|
|
123
|
+
mode: pluginInvocationModeSchema,
|
|
124
|
+
feature_ref: z.string().regex(FEATURE_REF_PATTERN),
|
|
125
|
+
skill_ref: z.string().optional(),
|
|
126
|
+
plugin_ref: z.object({
|
|
127
|
+
id: z.string().min(1),
|
|
128
|
+
version: z.string().min(1),
|
|
129
|
+
}),
|
|
130
|
+
capability: z.string().min(1),
|
|
131
|
+
inputs: jsonObjectSchema,
|
|
132
|
+
command: z.object({
|
|
133
|
+
executable: z.string().min(1),
|
|
134
|
+
args: z.array(z.string()).default([]),
|
|
135
|
+
timeout_seconds: z.number().int().positive(),
|
|
136
|
+
env_allowlist: z.array(z.string()).default([]),
|
|
137
|
+
network: z.enum(['disabled', 'restricted', 'enabled']),
|
|
138
|
+
process_spawn: z.enum(['forbidden', 'declared']),
|
|
139
|
+
working_directory: z.string().min(1),
|
|
140
|
+
}),
|
|
141
|
+
write_scope: z.array(z.string()).default([]),
|
|
142
|
+
policy: pluginPolicyEvaluationSchema,
|
|
143
|
+
expected_artifact_manifest: z.object({
|
|
144
|
+
path: z.string().min(1),
|
|
145
|
+
required_operations: z.array(artifactOperationSchema).default([]),
|
|
146
|
+
}),
|
|
147
|
+
expected_evidence_manifest: z.object({
|
|
148
|
+
path: z.string().min(1),
|
|
149
|
+
}),
|
|
150
|
+
expected_validation_manifest: z.object({
|
|
151
|
+
path: z.string().min(1),
|
|
152
|
+
required_statuses: z.array(z.enum(['passed', 'failed', 'partial'])).default([]),
|
|
153
|
+
}),
|
|
154
|
+
expected_rollback_manifest: z.object({
|
|
155
|
+
path: z.string().min(1),
|
|
156
|
+
required_for_mode: z.boolean(),
|
|
157
|
+
}),
|
|
158
|
+
evidence_requirements: z.array(z.string()).default([]),
|
|
159
|
+
});
|
|
160
|
+
export const pluginRuntimeInvocationPlanSchema = z.object({
|
|
161
|
+
schema_version: z.literal(1),
|
|
162
|
+
created_at: z.string().datetime(),
|
|
163
|
+
status: z.enum(['ready', 'blocked', 'unresolved']),
|
|
164
|
+
request: pluginRuntimeInvocationRequestSchema,
|
|
165
|
+
reasons: z.array(z.string()).default([]),
|
|
166
|
+
policy: pluginPolicyEvaluationSchema.optional(),
|
|
167
|
+
envelope: pluginRuntimeInvocationEnvelopeSchema.optional(),
|
|
168
|
+
artifact_manifest: pluginArtifactManifestSchema.optional(),
|
|
169
|
+
rollback_manifest: pluginRollbackManifestSchema.optional(),
|
|
170
|
+
});
|
|
171
|
+
export const pluginDryRunArtifactPlanEntrySchema = z.object({
|
|
172
|
+
path: z.string().min(1),
|
|
173
|
+
operation: z.enum(['plan']),
|
|
174
|
+
reason: z.string().min(1),
|
|
175
|
+
});
|
|
176
|
+
export const pluginDryRunExecutionPlanSchema = z.object({
|
|
177
|
+
schema_version: z.literal(1),
|
|
178
|
+
created_at: z.string().datetime(),
|
|
179
|
+
status: z.enum(['planned', 'unresolved']),
|
|
180
|
+
request: pluginBrokerPlanRequestSchema,
|
|
181
|
+
reasons: z.array(z.string()).default([]),
|
|
182
|
+
envelope: pluginInvocationEnvelopeSchema.optional(),
|
|
183
|
+
artifact_plan: z.array(pluginDryRunArtifactPlanEntrySchema).default([]),
|
|
184
|
+
});
|
|
185
|
+
export function buildPluginDryRunExecutionPlan(registryState, request) {
|
|
186
|
+
const parsedRegistry = pluginRegistryStateSchema.parse(registryState);
|
|
187
|
+
const parsedRequest = pluginBrokerPlanRequestSchema.parse(request);
|
|
188
|
+
const createdAt = parsedRequest.created_at ?? new Date().toISOString();
|
|
189
|
+
const resolution = resolvePluginCapability(parsedRegistry, toResolutionRequest(parsedRequest));
|
|
190
|
+
if (resolution.status === 'unresolved') {
|
|
191
|
+
return pluginDryRunExecutionPlanSchema.parse({
|
|
192
|
+
schema_version: 1,
|
|
193
|
+
created_at: createdAt,
|
|
194
|
+
status: 'unresolved',
|
|
195
|
+
request: {
|
|
196
|
+
...parsedRequest,
|
|
197
|
+
created_at: createdAt,
|
|
198
|
+
},
|
|
199
|
+
reasons: resolution.reasons,
|
|
200
|
+
artifact_plan: [],
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
const writeScopeCheck = resolveWriteScope(parsedRequest.requested_write_scope, resolution.capability.write_scope);
|
|
204
|
+
if (!writeScopeCheck.allowed) {
|
|
205
|
+
return pluginDryRunExecutionPlanSchema.parse({
|
|
206
|
+
schema_version: 1,
|
|
207
|
+
created_at: createdAt,
|
|
208
|
+
status: 'unresolved',
|
|
209
|
+
request: {
|
|
210
|
+
...parsedRequest,
|
|
211
|
+
created_at: createdAt,
|
|
212
|
+
},
|
|
213
|
+
reasons: writeScopeCheck.reasons,
|
|
214
|
+
artifact_plan: [],
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const envelope = pluginInvocationEnvelopeSchema.parse({
|
|
218
|
+
schema_version: 1,
|
|
219
|
+
mode: 'dry-run',
|
|
220
|
+
feature_ref: parsedRequest.feature_ref,
|
|
221
|
+
skill_ref: parsedRequest.skill_ref,
|
|
222
|
+
plugin_ref: {
|
|
223
|
+
id: resolution.entry.manifest.id,
|
|
224
|
+
version: resolution.entry.manifest.version,
|
|
225
|
+
},
|
|
226
|
+
capability: resolution.capability.name,
|
|
227
|
+
inputs: parsedRequest.inputs,
|
|
228
|
+
command: {
|
|
229
|
+
executable: resolution.entry.manifest.execution.command,
|
|
230
|
+
args: resolution.entry.manifest.execution.args,
|
|
231
|
+
timeout_seconds: resolution.entry.manifest.execution.timeout_seconds,
|
|
232
|
+
env_allowlist: resolution.entry.manifest.execution.env_allowlist,
|
|
233
|
+
network: resolution.entry.manifest.execution.network,
|
|
234
|
+
process_spawn: resolution.entry.manifest.execution.process_spawn,
|
|
235
|
+
},
|
|
236
|
+
write_scope: writeScopeCheck.writeScope,
|
|
237
|
+
evidence_requirements: [
|
|
238
|
+
'artifact_manifest',
|
|
239
|
+
'evidence_manifest',
|
|
240
|
+
...resolution.entry.manifest.validation.commands.map((command) => `validation:${command}`),
|
|
241
|
+
],
|
|
242
|
+
});
|
|
243
|
+
return pluginDryRunExecutionPlanSchema.parse({
|
|
244
|
+
schema_version: 1,
|
|
245
|
+
created_at: createdAt,
|
|
246
|
+
status: 'planned',
|
|
247
|
+
request: {
|
|
248
|
+
...parsedRequest,
|
|
249
|
+
created_at: createdAt,
|
|
250
|
+
},
|
|
251
|
+
reasons: resolution.reasons,
|
|
252
|
+
envelope,
|
|
253
|
+
artifact_plan: writeScopeCheck.writeScope.map((scope) => ({
|
|
254
|
+
path: scope,
|
|
255
|
+
operation: 'plan',
|
|
256
|
+
reason: `${resolution.entry.manifest.id}/${resolution.capability.name} may plan writes under ${scope}.`,
|
|
257
|
+
})),
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
export function buildPluginRuntimeInvocationPlan(registryState, request) {
|
|
261
|
+
const parsedRegistry = pluginRegistryStateSchema.parse(registryState);
|
|
262
|
+
const parsedRequest = pluginRuntimeInvocationRequestSchema.parse(request);
|
|
263
|
+
const createdAt = parsedRequest.created_at ?? new Date().toISOString();
|
|
264
|
+
const requestWithCreatedAt = {
|
|
265
|
+
...parsedRequest,
|
|
266
|
+
created_at: createdAt,
|
|
267
|
+
};
|
|
268
|
+
const resolution = resolvePluginCapability(parsedRegistry, toRuntimeResolutionRequest(parsedRequest));
|
|
269
|
+
if (resolution.status === 'unresolved') {
|
|
270
|
+
return pluginRuntimeInvocationPlanSchema.parse({
|
|
271
|
+
schema_version: 1,
|
|
272
|
+
created_at: createdAt,
|
|
273
|
+
status: 'unresolved',
|
|
274
|
+
request: requestWithCreatedAt,
|
|
275
|
+
reasons: resolution.reasons,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
const writeScopeCheck = resolveWriteScope(parsedRequest.requested_write_scope, resolution.capability.write_scope);
|
|
279
|
+
if (!writeScopeCheck.allowed) {
|
|
280
|
+
return pluginRuntimeInvocationPlanSchema.parse({
|
|
281
|
+
schema_version: 1,
|
|
282
|
+
created_at: createdAt,
|
|
283
|
+
status: 'unresolved',
|
|
284
|
+
request: requestWithCreatedAt,
|
|
285
|
+
reasons: writeScopeCheck.reasons,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
const policy = evaluatePluginTrustPolicy(resolution.entry.manifest, {
|
|
289
|
+
capability: resolution.capability.name,
|
|
290
|
+
mode: parsedRequest.mode,
|
|
291
|
+
approval_grants: parsedRequest.approval_grants,
|
|
292
|
+
source_checksum: parsedRequest.source_checksum ?? resolution.entry.source.checksum,
|
|
293
|
+
requested_write_scope: writeScopeCheck.writeScope,
|
|
294
|
+
planned_writes: parsedRequest.planned_writes,
|
|
295
|
+
requested_env: parsedRequest.requested_env,
|
|
296
|
+
network_domains: parsedRequest.network_domains,
|
|
297
|
+
process_spawn_requested: parsedRequest.process_spawn_requested,
|
|
298
|
+
filesystem_checks: parsedRequest.filesystem_checks,
|
|
299
|
+
});
|
|
300
|
+
const policyReasons = policy.issues.map((issue) => `${issue.severity}:${issue.code}: ${issue.message}`);
|
|
301
|
+
if (policy.decision === 'deny') {
|
|
302
|
+
return pluginRuntimeInvocationPlanSchema.parse({
|
|
303
|
+
schema_version: 1,
|
|
304
|
+
created_at: createdAt,
|
|
305
|
+
status: 'blocked',
|
|
306
|
+
request: requestWithCreatedAt,
|
|
307
|
+
reasons: [...resolution.reasons, ...policyReasons],
|
|
308
|
+
policy,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
const operationId = parsedRequest.operation_id ??
|
|
312
|
+
buildOperationId(parsedRequest.feature_ref, resolution.entry.manifest.id, resolution.capability.name, parsedRequest.mode, createdAt);
|
|
313
|
+
const pluginRef = {
|
|
314
|
+
id: resolution.entry.manifest.id,
|
|
315
|
+
version: resolution.entry.manifest.version,
|
|
316
|
+
};
|
|
317
|
+
const evidenceRequirements = [
|
|
318
|
+
'artifact_manifest',
|
|
319
|
+
'evidence_manifest',
|
|
320
|
+
'validation_manifest',
|
|
321
|
+
'policy_evaluation',
|
|
322
|
+
'rollback_manifest',
|
|
323
|
+
...resolution.entry.manifest.validation.commands.map((command) => `validation:${command}`),
|
|
324
|
+
];
|
|
325
|
+
const evidenceRoot = `.sdd/plugin-evidence/${parsedRequest.feature_ref}/${operationId}`;
|
|
326
|
+
const artifactManifestPath = `${evidenceRoot}/artifact-manifest.yaml`;
|
|
327
|
+
const evidenceManifestPath = `${evidenceRoot}/evidence-manifest.yaml`;
|
|
328
|
+
const validationManifestPath = `${evidenceRoot}/validation-manifest.yaml`;
|
|
329
|
+
const rollbackManifestPath = `${evidenceRoot}/rollback-manifest.yaml`;
|
|
330
|
+
const artifactManifest = buildPlannedArtifactManifest({
|
|
331
|
+
operationId,
|
|
332
|
+
createdAt,
|
|
333
|
+
featureRef: parsedRequest.feature_ref,
|
|
334
|
+
pluginRef,
|
|
335
|
+
capability: resolution.capability.name,
|
|
336
|
+
mode: parsedRequest.mode,
|
|
337
|
+
writeScope: writeScopeCheck.writeScope,
|
|
338
|
+
validationCommands: resolution.entry.manifest.validation.commands,
|
|
339
|
+
});
|
|
340
|
+
const rollbackManifest = buildPlannedRollbackManifest({
|
|
341
|
+
operationId,
|
|
342
|
+
createdAt,
|
|
343
|
+
featureRef: parsedRequest.feature_ref,
|
|
344
|
+
pluginRef,
|
|
345
|
+
capability: resolution.capability.name,
|
|
346
|
+
mode: parsedRequest.mode,
|
|
347
|
+
supportsRollback: resolution.capability.supports_rollback,
|
|
348
|
+
});
|
|
349
|
+
const envelope = pluginRuntimeInvocationEnvelopeSchema.parse({
|
|
350
|
+
schema_version: 1,
|
|
351
|
+
operation_id: operationId,
|
|
352
|
+
created_at: createdAt,
|
|
353
|
+
mode: parsedRequest.mode,
|
|
354
|
+
feature_ref: parsedRequest.feature_ref,
|
|
355
|
+
skill_ref: parsedRequest.skill_ref,
|
|
356
|
+
plugin_ref: pluginRef,
|
|
357
|
+
capability: resolution.capability.name,
|
|
358
|
+
inputs: parsedRequest.inputs,
|
|
359
|
+
command: {
|
|
360
|
+
executable: resolution.entry.manifest.execution.command,
|
|
361
|
+
args: resolution.entry.manifest.execution.args,
|
|
362
|
+
timeout_seconds: resolution.entry.manifest.execution.timeout_seconds,
|
|
363
|
+
env_allowlist: resolution.entry.manifest.execution.env_allowlist,
|
|
364
|
+
network: resolution.entry.manifest.execution.network,
|
|
365
|
+
process_spawn: resolution.entry.manifest.execution.process_spawn,
|
|
366
|
+
working_directory: resolution.entry.manifest.execution.working_directory,
|
|
367
|
+
},
|
|
368
|
+
write_scope: writeScopeCheck.writeScope,
|
|
369
|
+
policy,
|
|
370
|
+
expected_artifact_manifest: {
|
|
371
|
+
path: artifactManifestPath,
|
|
372
|
+
required_operations: ['planned'],
|
|
373
|
+
},
|
|
374
|
+
expected_evidence_manifest: {
|
|
375
|
+
path: evidenceManifestPath,
|
|
376
|
+
},
|
|
377
|
+
expected_validation_manifest: {
|
|
378
|
+
path: validationManifestPath,
|
|
379
|
+
required_statuses: ['passed', 'failed', 'partial'],
|
|
380
|
+
},
|
|
381
|
+
expected_rollback_manifest: {
|
|
382
|
+
path: rollbackManifestPath,
|
|
383
|
+
required_for_mode: parsedRequest.mode === 'apply' || parsedRequest.mode === 'rollback',
|
|
384
|
+
},
|
|
385
|
+
evidence_requirements: evidenceRequirements,
|
|
386
|
+
});
|
|
387
|
+
return pluginRuntimeInvocationPlanSchema.parse({
|
|
388
|
+
schema_version: 1,
|
|
389
|
+
created_at: createdAt,
|
|
390
|
+
status: 'ready',
|
|
391
|
+
request: requestWithCreatedAt,
|
|
392
|
+
reasons: [...resolution.reasons, ...policyReasons],
|
|
393
|
+
policy,
|
|
394
|
+
envelope,
|
|
395
|
+
artifact_manifest: artifactManifest,
|
|
396
|
+
rollback_manifest: rollbackManifest,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
function toResolutionRequest(request) {
|
|
400
|
+
return {
|
|
401
|
+
capability: request.capability,
|
|
402
|
+
technology: request.technology,
|
|
403
|
+
require_apply: request.require_apply,
|
|
404
|
+
require_dry_run: true,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function toRuntimeResolutionRequest(request) {
|
|
408
|
+
return {
|
|
409
|
+
capability: request.capability,
|
|
410
|
+
technology: request.technology,
|
|
411
|
+
require_apply: request.require_apply || request.mode === 'apply',
|
|
412
|
+
require_dry_run: true,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function resolveWriteScope(requestedWriteScope, capabilityWriteScope) {
|
|
416
|
+
const availableScope = [...new Set(capabilityWriteScope)].sort();
|
|
417
|
+
const requestedScope = [...new Set(requestedWriteScope)].sort();
|
|
418
|
+
if (requestedScope.length === 0) {
|
|
419
|
+
return {
|
|
420
|
+
allowed: true,
|
|
421
|
+
writeScope: availableScope,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
const denied = requestedScope.filter((scope) => !availableScope.includes(scope));
|
|
425
|
+
if (denied.length > 0) {
|
|
426
|
+
return {
|
|
427
|
+
allowed: false,
|
|
428
|
+
reasons: denied.map((scope) => `Requested write scope ${scope} is not advertised by the resolved capability.`),
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
return {
|
|
432
|
+
allowed: true,
|
|
433
|
+
writeScope: requestedScope,
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function buildOperationId(featureRef, pluginId, capability, mode, createdAt) {
|
|
437
|
+
const timestamp = createdAt.replace(/\D/gu, '');
|
|
438
|
+
return normalizeOperationSegment(['plugin-op', featureRef, pluginId, capability, mode, timestamp].join('-'));
|
|
439
|
+
}
|
|
440
|
+
function normalizeOperationSegment(value) {
|
|
441
|
+
return value
|
|
442
|
+
.toLowerCase()
|
|
443
|
+
.replace(/[^a-z0-9]+/gu, '-')
|
|
444
|
+
.replace(/^-+|-+$/gu, '');
|
|
445
|
+
}
|
|
446
|
+
function buildPlannedArtifactManifest(input) {
|
|
447
|
+
return pluginArtifactManifestSchema.parse({
|
|
448
|
+
schema_version: 1,
|
|
449
|
+
operation_id: input.operationId,
|
|
450
|
+
generated_at: input.createdAt,
|
|
451
|
+
feature_ref: input.featureRef,
|
|
452
|
+
plugin_ref: input.pluginRef,
|
|
453
|
+
capability: input.capability,
|
|
454
|
+
mode: input.mode,
|
|
455
|
+
status: 'planned',
|
|
456
|
+
artifacts: input.writeScope.map((scope) => ({
|
|
457
|
+
path: scope,
|
|
458
|
+
operation: 'planned',
|
|
459
|
+
reason: `${input.pluginRef.id}/${input.capability} is authorized to report artifact changes under ${scope}.`,
|
|
460
|
+
})),
|
|
461
|
+
validation_evidence: input.validationCommands.map((command) => ({
|
|
462
|
+
command,
|
|
463
|
+
status: 'pending',
|
|
464
|
+
})),
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
function buildPlannedRollbackManifest(input) {
|
|
468
|
+
const rollbackRequired = input.mode === 'apply' || input.mode === 'rollback';
|
|
469
|
+
const status = rollbackRequired && input.supportsRollback ? 'planned' : 'not-required';
|
|
470
|
+
return pluginRollbackManifestSchema.parse({
|
|
471
|
+
schema_version: 1,
|
|
472
|
+
operation_id: input.operationId,
|
|
473
|
+
generated_at: input.createdAt,
|
|
474
|
+
feature_ref: input.featureRef,
|
|
475
|
+
plugin_ref: input.pluginRef,
|
|
476
|
+
capability: input.capability,
|
|
477
|
+
mode: input.mode,
|
|
478
|
+
status,
|
|
479
|
+
reason: rollbackRequired
|
|
480
|
+
? input.supportsRollback
|
|
481
|
+
? 'Rollback evidence is required for mutating executions and rollback-capable capabilities.'
|
|
482
|
+
: 'Capability does not declare rollback support; rollback evidence is not required.'
|
|
483
|
+
: 'Rollback evidence is not required for dry-run mode.',
|
|
484
|
+
rollback_steps: rollbackRequired && input.supportsRollback
|
|
485
|
+
? [
|
|
486
|
+
'Capture pre-apply artifact checksums before mutation.',
|
|
487
|
+
'Record rollback command and approval evidence when rollback is triggered.',
|
|
488
|
+
]
|
|
489
|
+
: [],
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
//# sourceMappingURL=plugin-broker.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PluginRegistrySource } from './plugin-registry.js';
|
|
3
|
+
export declare const pluginCertificationLevelSchema: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
4
|
+
export declare const pluginCertificationAchievedLevelSchema: z.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
5
|
+
export declare const pluginCertificationCriterionSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
level: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
8
|
+
status: z.ZodEnum<{
|
|
9
|
+
warning: "warning";
|
|
10
|
+
failed: "failed";
|
|
11
|
+
passed: "passed";
|
|
12
|
+
}>;
|
|
13
|
+
evidence: z.ZodString;
|
|
14
|
+
remediation: z.ZodString;
|
|
15
|
+
issue_codes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const pluginCertificationResultSchema: z.ZodObject<{
|
|
18
|
+
schema_version: z.ZodLiteral<1>;
|
|
19
|
+
generated_at: z.ZodString;
|
|
20
|
+
feature_ref: z.ZodString;
|
|
21
|
+
plugin_ref: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
version: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
capability: z.ZodString;
|
|
26
|
+
stack: z.ZodDefault<z.ZodObject<{
|
|
27
|
+
language: z.ZodOptional<z.ZodString>;
|
|
28
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
requested_level: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
31
|
+
achieved_level: z.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
32
|
+
status: z.ZodEnum<{
|
|
33
|
+
warning: "warning";
|
|
34
|
+
failed: "failed";
|
|
35
|
+
certified: "certified";
|
|
36
|
+
}>;
|
|
37
|
+
warning_only: z.ZodLiteral<true>;
|
|
38
|
+
blocking: z.ZodLiteral<false>;
|
|
39
|
+
dry_run_plan: z.ZodOptional<z.ZodUnknown>;
|
|
40
|
+
apply_readiness_plan: z.ZodOptional<z.ZodUnknown>;
|
|
41
|
+
criteria: z.ZodArray<z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
level: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
44
|
+
status: z.ZodEnum<{
|
|
45
|
+
warning: "warning";
|
|
46
|
+
failed: "failed";
|
|
47
|
+
passed: "passed";
|
|
48
|
+
}>;
|
|
49
|
+
evidence: z.ZodString;
|
|
50
|
+
remediation: z.ZodString;
|
|
51
|
+
issue_codes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
visualization_markdown: z.ZodString;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type PluginCertificationLevel = z.infer<typeof pluginCertificationLevelSchema>;
|
|
56
|
+
export type PluginCertificationAchievedLevel = z.infer<typeof pluginCertificationAchievedLevelSchema>;
|
|
57
|
+
export type PluginCertificationCriterion = z.infer<typeof pluginCertificationCriterionSchema>;
|
|
58
|
+
export type PluginCertificationResult = z.infer<typeof pluginCertificationResultSchema>;
|
|
59
|
+
export interface BuildPluginCertificationInput {
|
|
60
|
+
manifest: unknown;
|
|
61
|
+
capability: string;
|
|
62
|
+
featureRef: string;
|
|
63
|
+
requestedLevel?: PluginCertificationLevel;
|
|
64
|
+
generatedAt?: string | Date;
|
|
65
|
+
skillRef?: string;
|
|
66
|
+
technology?: {
|
|
67
|
+
language?: string;
|
|
68
|
+
framework?: string;
|
|
69
|
+
};
|
|
70
|
+
inputs?: Record<string, unknown>;
|
|
71
|
+
requestedWriteScope?: string[];
|
|
72
|
+
plannedWrites?: string[];
|
|
73
|
+
approvalGrants?: Array<'maintainer' | 'security' | 'architecture-board'>;
|
|
74
|
+
sourceChecksum?: string;
|
|
75
|
+
registrySource?: PluginRegistrySource;
|
|
76
|
+
}
|
|
77
|
+
export declare function buildPluginCertification(input: BuildPluginCertificationInput): PluginCertificationResult;
|
|
78
|
+
export declare function renderPluginCertificationMatrix(result: Pick<PluginCertificationResult, 'plugin_ref' | 'capability' | 'requested_level' | 'achieved_level' | 'status' | 'criteria'>): string;
|
|
79
|
+
//# sourceMappingURL=plugin-certification.d.ts.map
|