@openplanr/protocol 0.2.0
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/LICENSE +21 -0
- package/README.md +82 -0
- package/lib/dashboard/closed-json-contract.mjs +141 -0
- package/lib/dashboard/generated/operate-experience-surface-schema-data.mjs +67 -0
- package/lib/dashboard/generated/operate-review-schema-data.mjs +35 -0
- package/lib/dashboard/generated/operate-schema-token-codec.mjs +127 -0
- package/lib/dashboard/operate-experience-audit-display-contract.d.mts +196 -0
- package/lib/dashboard/operate-experience-audit-display-contract.mjs +700 -0
- package/lib/dashboard/operate-experience-display-contract.d.mts +572 -0
- package/lib/dashboard/operate-experience-display-contract.mjs +1007 -0
- package/lib/dashboard/operate-experience-surface-contract.d.mts +157 -0
- package/lib/dashboard/operate-experience-surface-contract.mjs +91 -0
- package/lib/dashboard/operate-review-contract.d.mts +34 -0
- package/lib/dashboard/operate-review-contract.mjs +175 -0
- package/lib/dashboard/operate-review-display-workspace-contract.d.mts +54 -0
- package/lib/dashboard/operate-review-display-workspace-contract.mjs +258 -0
- package/lib/dashboard/operate-review-payload-safety.d.mts +7 -0
- package/lib/dashboard/operate-review-payload-safety.mjs +42 -0
- package/lib/dashboard/operate-review-workspace-projection-v2.d.mts +218 -0
- package/lib/protocol/index.d.ts +2638 -0
- package/package.json +115 -0
- package/registries/commands.json +1952 -0
- package/registries/diagram-grammars.json +2407 -0
- package/registries/diagram-semantic-patterns.json +111 -0
- package/registries/output-paths.json +40 -0
- package/registries/outputs.json +864 -0
- package/registries/roles.json +661 -0
- package/registries/rules.json +261 -0
- package/registries/skill-host-profiles.json +247 -0
- package/registries/skill-modules.json +1112 -0
- package/registries/skill-routing.json +389 -0
- package/registries/skills.json +1545 -0
- package/registries/task-kinds.json +220 -0
- package/registry/adapters.json +110 -0
- package/registry/artifact-theme.json +60 -0
- package/registry/evaluation-graders.json +303 -0
- package/registry/evaluation-host-profiles.json +131 -0
- package/registry/frozen-commands.json +15 -0
- package/registry/landing-operations.json +20 -0
- package/registry/landing-workflows.json +70 -0
- package/registry/live-evidence-providers.json +1 -0
- package/registry/operate-v2-contracts.json +5965 -0
- package/registry/professional-skills.json +115 -0
- package/registry/roles.json +14 -0
- package/registry/ship-review-specialists.json +42 -0
- package/schemas/v1.0.0/design-approved.schema.json +35 -0
- package/schemas/v1.0.0/design-feedback.schema.json +169 -0
- package/schemas/v1.0.0/design-manifest.schema.json +90 -0
- package/schemas/v1.0.0/design-session.schema.json +73 -0
- package/schemas/v1.0.0/graph.schema.json +100 -0
- package/schemas/v1.0.0/pipeline-shipped.schema.json +154 -0
- package/schemas/v1.0.0/run-manifest.schema.json +81 -0
- package/schemas/v1.0.0/spec.schema.json +120 -0
- package/schemas/v1.0.0/stack.schema.json +184 -0
- package/schemas/v1.0.0/story.schema.json +95 -0
- package/schemas/v1.0.0/task.schema.json +171 -0
- package/schemas/v1.0.0/taste-profile.schema.json +96 -0
- package/schemas/v1.1.0/adapter-registry.schema.json +72 -0
- package/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
- package/schemas/v1.1.0/artifact-paste.schema.json +49 -0
- package/schemas/v1.1.0/artifact-review.schema.json +97 -0
- package/schemas/v1.1.0/artifact-room-descriptor.schema.json +39 -0
- package/schemas/v1.1.0/artifact-room-event.schema.json +184 -0
- package/schemas/v1.1.0/artifact-room-signed-event.schema.json +58 -0
- package/schemas/v1.1.0/artifact-theme.schema.json +139 -0
- package/schemas/v1.1.0/browser-qa-gate.schema.json +21 -0
- package/schemas/v1.1.0/browser-qa-result.schema.json +24 -0
- package/schemas/v1.1.0/browser-qa-session.schema.json +12 -0
- package/schemas/v1.1.0/ecosystem-manifest.schema.json +46 -0
- package/schemas/v1.1.0/investigation-diagnosis.schema.json +12 -0
- package/schemas/v1.1.0/investigation-event.schema.json +15 -0
- package/schemas/v1.1.0/investigation-experiment.schema.json +17 -0
- package/schemas/v1.1.0/investigation-fix.schema.json +11 -0
- package/schemas/v1.1.0/investigation-hypothesis.schema.json +6 -0
- package/schemas/v1.1.0/investigation-observation.schema.json +10 -0
- package/schemas/v1.1.0/investigation-receipt.schema.json +7 -0
- package/schemas/v1.1.0/investigation-record.schema.json +7 -0
- package/schemas/v1.1.0/investigation-request.schema.json +34 -0
- package/schemas/v1.1.0/planning-review-event.schema.json +64 -0
- package/schemas/v1.1.0/planning-review-receipt.schema.json +19 -0
- package/schemas/v1.1.0/planning-review-record.schema.json +176 -0
- package/schemas/v1.1.0/planning-review-state.schema.json +19 -0
- package/schemas/v1.1.0/professional-skills.schema.json +105 -0
- package/schemas/v1.1.0/professional-specification.schema.json +111 -0
- package/schemas/v1.1.0/provenance-event.schema.json +82 -0
- package/schemas/v1.1.0/role-registry.schema.json +28 -0
- package/schemas/v1.1.0/runtime-lock.schema.json +39 -0
- package/schemas/v1.1.0/ship-closure.schema.json +353 -0
- package/schemas/v1.1.0/ship-review-specialist-registry.schema.json +29 -0
- package/schemas/v1.1.0/ship-risk-classification.schema.json +48 -0
- package/schemas/v1.1.0/specialist-review-result.schema.json +19 -0
- package/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
- package/schemas/v1.10.0/design-review-context.schema.json +191 -0
- package/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
- package/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
- package/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
- package/schemas/v1.12.0/enterprise-access-context.schema.json +217 -0
- package/schemas/v1.12.0/enterprise-agent-handoff.schema.json +508 -0
- package/schemas/v1.12.0/enterprise-artifact-revision.schema.json +87 -0
- package/schemas/v1.12.0/enterprise-change-proposal.schema.json +359 -0
- package/schemas/v1.12.0/enterprise-evidence-reference.schema.json +147 -0
- package/schemas/v1.12.0/enterprise-review-thread.schema.json +278 -0
- package/schemas/v1.12.0/enterprise-sync-state.schema.json +169 -0
- package/schemas/v1.2.0/adapter-registry.schema.json +83 -0
- package/schemas/v1.2.0/dashboard-bootstrap.schema.json +219 -0
- package/schemas/v1.2.0/ecosystem-release-operation.schema.json +90 -0
- package/schemas/v1.2.0/ecosystem-saga.schema.json +54 -0
- package/schemas/v1.2.0/evidence-diagnostic.schema.json +77 -0
- package/schemas/v1.2.0/guided-answer-envelope.schema.json +73 -0
- package/schemas/v1.2.0/guided-confirmation.schema.json +128 -0
- package/schemas/v1.2.0/guided-question.schema.json +242 -0
- package/schemas/v1.2.0/guided-questionnaire.schema.json +278 -0
- package/schemas/v1.2.0/guided-session.schema.json +141 -0
- package/schemas/v1.2.0/landing-confirmation.schema.json +17 -0
- package/schemas/v1.2.0/landing-event.schema.json +12 -0
- package/schemas/v1.2.0/landing-operation-registry.schema.json +16 -0
- package/schemas/v1.2.0/landing-phase-receipt.schema.json +19 -0
- package/schemas/v1.2.0/landing-plan.schema.json +36 -0
- package/schemas/v1.2.0/landing-receipt.schema.json +12 -0
- package/schemas/v1.2.0/landing-workflow-catalog.schema.json +143 -0
- package/schemas/v1.2.0/operate-action-display-workspace.schema.json +119 -0
- package/schemas/v1.2.0/operate-cycle-display-workspace.schema.json +109 -0
- package/schemas/v1.2.0/operate-executive-board-display-surface.schema.json +72 -0
- package/schemas/v1.2.0/operate-experience-audit-display-surface.schema.json +328 -0
- package/schemas/v1.2.0/operate-experience-display-surface.schema.json +46 -0
- package/schemas/v1.2.0/operate-experience-surface.schema.json +590 -0
- package/schemas/v1.2.0/operate-recovery-display-surface.schema.json +85 -0
- package/schemas/v1.2.0/structured-action.schema.json +91 -0
- package/schemas/v1.3.0/adapter-registry.schema.json +84 -0
- package/schemas/v1.3.0/ecosystem-manifest.schema.json +120 -0
- package/schemas/v1.3.0/release-compatibility-claim.schema.json +46 -0
- package/schemas/v1.3.0/release-ledger-receipt.schema.json +45 -0
- package/schemas/v1.3.0/release-ledger.schema.json +60 -0
- package/schemas/v1.4.0/adapter-registry.schema.json +62 -0
- package/schemas/v1.4.0/evaluation-aggregate-report.schema.json +166 -0
- package/schemas/v1.4.0/evaluation-budget.schema.json +49 -0
- package/schemas/v1.4.0/evaluation-corpus.schema.json +93 -0
- package/schemas/v1.4.0/evaluation-fixture.schema.json +64 -0
- package/schemas/v1.4.0/evaluation-gate-policy.schema.json +33 -0
- package/schemas/v1.4.0/evaluation-grader-registration.schema.json +141 -0
- package/schemas/v1.4.0/evaluation-grader-registry.schema.json +20 -0
- package/schemas/v1.4.0/evaluation-host-profile-registry.schema.json +20 -0
- package/schemas/v1.4.0/evaluation-host-profile.schema.json +73 -0
- package/schemas/v1.4.0/evaluation-observation.schema.json +76 -0
- package/schemas/v1.4.0/evaluation-run-result.schema.json +84 -0
- package/schemas/v1.4.0/evaluation-scenario.schema.json +231 -0
- package/schemas/v1.4.0/evaluation-waiver.schema.json +65 -0
- package/schemas/v1.4.0/skill-certification-receipt.schema.json +103 -0
- package/schemas/v1.5.0/command-catalog.schema.json +296 -0
- package/schemas/v1.5.0/common.schema.json +261 -0
- package/schemas/v1.5.0/generated-asset-manifest.schema.json +313 -0
- package/schemas/v1.5.0/implementation-result.schema.json +152 -0
- package/schemas/v1.5.0/migration-preservation-manifest.schema.json +749 -0
- package/schemas/v1.5.0/output-catalog.schema.json +210 -0
- package/schemas/v1.5.0/output-path-catalog.schema.json +81 -0
- package/schemas/v1.5.0/role-registry.schema.json +261 -0
- package/schemas/v1.5.0/rule-catalog.schema.json +130 -0
- package/schemas/v1.5.0/skill-catalog.schema.json +303 -0
- package/schemas/v1.5.0/task-kind-registry.schema.json +167 -0
- package/schemas/v1.5.0/task-manifest.schema.json +373 -0
- package/schemas/v1.5.0/task-output-manifest.schema.json +462 -0
- package/schemas/v1.6.0/common.schema.json +462 -0
- package/schemas/v1.6.0/diagram-consumer-reference.schema.json +167 -0
- package/schemas/v1.6.0/diagram-document.schema.json +699 -0
- package/schemas/v1.6.0/diagram-fidelity-report.schema.json +137 -0
- package/schemas/v1.6.0/diagram-manifest.schema.json +162 -0
- package/schemas/v1.6.0/diagram-quality-report.schema.json +148 -0
- package/schemas/v1.6.0/diagram-review-binding.schema.json +132 -0
- package/schemas/v1.6.0/diagram-semantic-pattern-registry.schema.json +90 -0
- package/schemas/v1.6.0/diagram-type-registry.schema.json +373 -0
- package/schemas/v1.6.0/generated-asset-manifest.schema.json +103 -0
- package/schemas/v1.6.0/skill-catalog.schema.json +84 -0
- package/schemas/v1.6.0/skill-completion-receipt.schema.json +72 -0
- package/schemas/v1.6.0/skill-consent-record.schema.json +74 -0
- package/schemas/v1.6.0/skill-host-profile-registry.schema.json +526 -0
- package/schemas/v1.6.0/skill-learning-record.schema.json +116 -0
- package/schemas/v1.6.0/skill-module-registry.schema.json +108 -0
- package/schemas/v1.6.0/skill-routing-registry.schema.json +93 -0
- package/schemas/v1.6.0/skill-session.schema.json +73 -0
- package/schemas/v1.6.0/skill-source.schema.json +169 -0
- package/schemas/v1.7.0/common.schema.json +464 -0
- package/schemas/v1.7.0/generated-asset-manifest.schema.json +103 -0
- package/schemas/v1.7.0/planning-id-sequence.schema.json +50 -0
- package/schemas/v1.7.0/request-authority.schema.json +71 -0
- package/schemas/v1.7.0/skill-catalog.schema.json +84 -0
- package/schemas/v1.7.0/skill-completion-receipt.schema.json +72 -0
- package/schemas/v1.7.0/skill-consent-record.schema.json +74 -0
- package/schemas/v1.7.0/skill-host-profile-registry.schema.json +526 -0
- package/schemas/v1.7.0/skill-learning-record.schema.json +116 -0
- package/schemas/v1.7.0/skill-module-registry.schema.json +108 -0
- package/schemas/v1.7.0/skill-routing-registry.schema.json +93 -0
- package/schemas/v1.7.0/skill-session.schema.json +73 -0
- package/schemas/v1.7.0/skill-source.schema.json +169 -0
- package/schemas/v1.7.0/spec.schema.json +117 -0
- package/schemas/v1.7.0/story.schema.json +107 -0
- package/schemas/v1.7.0/task.schema.json +217 -0
- package/schemas/v1.8.0/common.schema.json +96 -0
- package/schemas/v1.8.0/skill-package.schema.json +63 -0
- package/schemas/v1.8.0/utility-command-catalog.schema.json +82 -0
- package/schemas/v1.9.0/design-document.schema.json +306 -0
- package/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
- package/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
- package/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
- package/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
- package/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
- package/schemas/v2.0.0/agent-runtime-manifest.schema.json +59 -0
- package/schemas/v2.0.0/business-operating-snapshot-projection.schema.json +14 -0
- package/schemas/v2.0.0/operate-allowed-action.schema.json +181 -0
- package/schemas/v2.0.0/operate-api-envelope.schema.json +225 -0
- package/schemas/v2.0.0/operate-capability-provider-registration.schema.json +30 -0
- package/schemas/v2.0.0/operate-domain-registration.schema.json +284 -0
- package/schemas/v2.0.0/operate-evidence-provider-registration.schema.json +55 -0
- package/schemas/v2.0.0/operate-evidence-resolver-registration.schema.json +46 -0
- package/schemas/v2.0.0/operate-executor-registration.schema.json +27 -0
- package/schemas/v2.0.0/operate-experience-live-patch.schema.json +47 -0
- package/schemas/v2.0.0/operate-experience-preview.schema.json +51 -0
- package/schemas/v2.0.0/operate-experience-view.schema.json +281 -0
- package/schemas/v2.0.0/operate-live-evidence-provider-registration.schema.json +48 -0
- package/schemas/v2.0.0/operate-live-evidence-provider-registry.schema.json +17 -0
- package/schemas/v2.0.0/operate-metric-provider-registration.schema.json +12 -0
- package/schemas/v2.0.0/operate-policy-provider-registration.schema.json +33 -0
- package/schemas/v2.0.0/operate-review-bound-submission.schema.json +29 -0
- package/schemas/v2.0.0/operate-review-display-workspace.schema.json +390 -0
- package/schemas/v2.0.0/operate-snapshot-provider-registration.schema.json +16 -0
- package/schemas/v2.0.0/operate-tool-call.schema.json +172 -0
- package/schemas/v2.0.0/operate-verification-provider-registration.schema.json +12 -0
- package/schemas/v2.0.0/operating-action-policy.schema.json +31 -0
- package/schemas/v2.0.0/operating-action-verification-plan.schema.json +13 -0
- package/schemas/v2.0.0/operating-action.schema.json +86 -0
- package/schemas/v2.0.0/operating-advisor-result.schema.json +394 -0
- package/schemas/v2.0.0/operating-approval-record.schema.json +23 -0
- package/schemas/v2.0.0/operating-approval-requirement.schema.json +31 -0
- package/schemas/v2.0.0/operating-artifact.schema.json +52 -0
- package/schemas/v2.0.0/operating-assignment.schema.json +437 -0
- package/schemas/v2.0.0/operating-assumption.schema.json +16 -0
- package/schemas/v2.0.0/operating-capability-availability.schema.json +15 -0
- package/schemas/v2.0.0/operating-capability-grant.schema.json +14 -0
- package/schemas/v2.0.0/operating-challenger-review.schema.json +204 -0
- package/schemas/v2.0.0/operating-checkpoint.schema.json +43 -0
- package/schemas/v2.0.0/operating-claim.schema.json +17 -0
- package/schemas/v2.0.0/operating-connector-checkpoint.schema.json +28 -0
- package/schemas/v2.0.0/operating-context-capture.schema.json +74 -0
- package/schemas/v2.0.0/operating-cycle-input-binding.schema.json +30 -0
- package/schemas/v2.0.0/operating-cycle.schema.json +42 -0
- package/schemas/v2.0.0/operating-decision-ledger.schema.json +237 -0
- package/schemas/v2.0.0/operating-decision.schema.json +137 -0
- package/schemas/v2.0.0/operating-delivery-evidence.schema.json +46 -0
- package/schemas/v2.0.0/operating-delivery-route.schema.json +43 -0
- package/schemas/v2.0.0/operating-delta.schema.json +13 -0
- package/schemas/v2.0.0/operating-domain-projection.schema.json +15 -0
- package/schemas/v2.0.0/operating-event-trigger.schema.json +11 -0
- package/schemas/v2.0.0/operating-event.schema.json +505 -0
- package/schemas/v2.0.0/operating-evidence-candidate.schema.json +88 -0
- package/schemas/v2.0.0/operating-evidence-edge.schema.json +39 -0
- package/schemas/v2.0.0/operating-evidence-graph.schema.json +25 -0
- package/schemas/v2.0.0/operating-evidence-observation.schema.json +48 -0
- package/schemas/v2.0.0/operating-evidence-ref.schema.json +51 -0
- package/schemas/v2.0.0/operating-evidence-resolution.schema.json +54 -0
- package/schemas/v2.0.0/operating-execution-result.schema.json +23 -0
- package/schemas/v2.0.0/operating-executive-board.schema.json +78 -0
- package/schemas/v2.0.0/operating-finding.schema.json +116 -0
- package/schemas/v2.0.0/operating-governed-operation.schema.json +54 -0
- package/schemas/v2.0.0/operating-intelligence-input-bundle.schema.json +128 -0
- package/schemas/v2.0.0/operating-intelligence-plan.schema.json +302 -0
- package/schemas/v2.0.0/operating-learning-receipt.schema.json +31 -0
- package/schemas/v2.0.0/operating-learning.schema.json +13 -0
- package/schemas/v2.0.0/operating-live-evidence-consent-record.schema.json +42 -0
- package/schemas/v2.0.0/operating-live-evidence-ingestion.schema.json +31 -0
- package/schemas/v2.0.0/operating-measurement-plan.schema.json +18 -0
- package/schemas/v2.0.0/operating-measurement-schedule-receipt.schema.json +7 -0
- package/schemas/v2.0.0/operating-measurement-schedule.schema.json +16 -0
- package/schemas/v2.0.0/operating-metric-observation.schema.json +15 -0
- package/schemas/v2.0.0/operating-metric.schema.json +18 -0
- package/schemas/v2.0.0/operating-model-state.schema.json +36 -0
- package/schemas/v2.0.0/operating-objective.schema.json +21 -0
- package/schemas/v2.0.0/operating-origin.schema.json +31 -0
- package/schemas/v2.0.0/operating-outcome-evaluation.schema.json +46 -0
- package/schemas/v2.0.0/operating-outcome.schema.json +13 -0
- package/schemas/v2.0.0/operating-planning-proposal.schema.json +45 -0
- package/schemas/v2.0.0/operating-policy-evaluation.schema.json +28 -0
- package/schemas/v2.0.0/operating-review-read.schema.json +217 -0
- package/schemas/v2.0.0/operating-review-receipt.schema.json +64 -0
- package/schemas/v2.0.0/operating-review.schema.json +47 -0
- package/schemas/v2.0.0/operating-risk.schema.json +96 -0
- package/schemas/v2.0.0/operating-rollback-plan.schema.json +10 -0
- package/schemas/v2.0.0/operating-rollback-result.schema.json +20 -0
- package/schemas/v2.0.0/operating-runtime-state.schema.json +289 -0
- package/schemas/v2.0.0/operating-scenario.schema.json +13 -0
- package/schemas/v2.0.0/operating-snapshot.schema.json +38 -0
- package/schemas/v2.0.0/operating-submission.schema.json +34 -0
- package/schemas/v2.0.0/operating-trace-matrix.schema.json +176 -0
- package/schemas/v2.0.0/operating-work-change-set.schema.json +89 -0
- package/schemas/v2.0.0/operating-work-ledger.schema.json +40 -0
- package/schemas/v2.0.0/software-operating-snapshot-projection.schema.json +14 -0
- package/src/browser-contracts.d.mts +5 -0
- package/src/browser-contracts.mjs +40 -0
- package/src/canonical-json.d.mts +5 -0
- package/src/canonical-json.mjs +142 -0
- package/src/compat/live-evidence-v2.mjs +1019 -0
- package/src/compat/operate-experience-live-patch.mjs +66 -0
- package/src/compat/operating-planning-contracts.mjs +114 -0
- package/src/contracts.d.mts +42 -0
- package/src/contracts.mjs +990 -0
- package/src/design-contracts.d.mts +62 -0
- package/src/design-contracts.mjs +186 -0
- package/src/design-publication-contracts.d.mts +4 -0
- package/src/design-publication-contracts.mjs +85 -0
- package/src/diagram-contracts.d.mts +19 -0
- package/src/diagram-contracts.mjs +28 -0
- package/src/enterprise-contracts.d.mts +107 -0
- package/src/enterprise-contracts.mjs +463 -0
- package/src/errors.d.mts +11 -0
- package/src/errors.mjs +109 -0
- package/src/generated/canonical-registries.mjs +5554 -0
- package/src/generated/contract-catalog-v2.mjs +7076 -0
- package/src/generated/diagram-registries.mjs +2529 -0
- package/src/index.d.mts +10 -0
- package/src/index.mjs +40 -0
- package/src/json-schema.d.mts +7 -0
- package/src/json-schema.mjs +283 -0
- package/src/planning-contracts.d.mts +10 -0
- package/src/planning-contracts.mjs +53 -0
- package/src/registries.d.mts +40 -0
- package/src/registries.mjs +261 -0
- package/src/review-experience-contracts.d.mts +11 -0
- package/src/review-experience-contracts.mjs +103 -0
- package/src/semver.d.mts +2 -0
- package/src/semver.mjs +7 -0
- package/src/skill-source-contracts.d.mts +25 -0
- package/src/skill-source-contracts.mjs +105 -0
- package/src/task-contracts.d.mts +7 -0
- package/src/task-contracts.mjs +130 -0
- package/src/workspace-contracts.d.mts +26 -0
- package/src/workspace-contracts.mjs +83 -0
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
import { validateJson } from './json-schema.mjs';
|
|
6
|
+
import { ENTERPRISE_SCHEMAS } from './enterprise-contracts.mjs';
|
|
7
|
+
import { OPERATE_CONTRACT_CATALOG_V2 } from './generated/contract-catalog-v2.mjs';
|
|
8
|
+
import { PipelineError } from './errors.mjs';
|
|
9
|
+
import {
|
|
10
|
+
PROTOCOL_V16_CONTRACT_FILES,
|
|
11
|
+
PROTOCOL_V17_CONTRACT_FILES,
|
|
12
|
+
PROTOCOL_V18_CONTRACT_FILES,
|
|
13
|
+
} from './skill-source-contracts.mjs';
|
|
14
|
+
|
|
15
|
+
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
16
|
+
|
|
17
|
+
// Versioned path for a Protocol 1.6 additive skill-source contract, derived from
|
|
18
|
+
// the one canonical kind -> file map shared with browser-contracts.mjs.
|
|
19
|
+
const v16Schema = (kind) => `schemas/v1.6.0/${PROTOCOL_V16_CONTRACT_FILES[kind]}`;
|
|
20
|
+
const v17Schema = (kind) => `schemas/v1.7.0/${PROTOCOL_V17_CONTRACT_FILES[kind]}`;
|
|
21
|
+
const v18Schema = (kind) => `schemas/v1.8.0/${PROTOCOL_V18_CONTRACT_FILES[kind]}`;
|
|
22
|
+
|
|
23
|
+
const foundationPaths = {
|
|
24
|
+
...Object.fromEntries(Object.keys(ENTERPRISE_SCHEMAS).map(name => [name, { '1.12.0': `schemas/v1.12.0/${name}.schema.json` }])),
|
|
25
|
+
'design-document': { '1.9.0': 'schemas/v1.9.0/design-document.schema.json' },
|
|
26
|
+
'design-review-workspace': { '1.9.0': 'schemas/v1.9.0/design-review-workspace.schema.json' },
|
|
27
|
+
'design-workspace-create': { '1.9.0': 'schemas/v1.9.0/design-workspace-create.schema.json' },
|
|
28
|
+
'design-workspace-revision': { '1.9.0': 'schemas/v1.9.0/design-workspace-revision.schema.json' },
|
|
29
|
+
'design-workspace-event': { '1.9.0': 'schemas/v1.9.0/design-workspace-event.schema.json' },
|
|
30
|
+
'design-review-bundle': { '1.9.0': 'schemas/v1.9.0/design-review-bundle.schema.json', '1.10.0': 'schemas/v1.10.0/design-review-bundle.schema.json' },
|
|
31
|
+
'design-review-context': { '1.10.0': 'schemas/v1.10.0/design-review-context.schema.json' },
|
|
32
|
+
'design-review-handoff': { '1.10.0': 'schemas/v1.10.0/design-review-handoff.schema.json' },
|
|
33
|
+
'design-review-metadata-payload': { '1.10.0': 'schemas/v1.10.0/design-review-metadata-payload.schema.json', '1.11.0': 'schemas/v1.11.0/design-review-metadata-payload.schema.json' },
|
|
34
|
+
|
|
35
|
+
spec: { '1.0.0': 'schemas/v1.0.0/spec.schema.json', '1.7.0': v17Schema('spec') },
|
|
36
|
+
story: { '1.0.0': 'schemas/v1.0.0/story.schema.json', '1.7.0': v17Schema('story') },
|
|
37
|
+
task: { '1.0.0': 'schemas/v1.0.0/task.schema.json', '1.7.0': v17Schema('task') },
|
|
38
|
+
'pipeline-shipped': { '1.0.0': 'schemas/v1.0.0/pipeline-shipped.schema.json' },
|
|
39
|
+
'run-manifest': { '1.0.0': 'schemas/v1.0.0/run-manifest.schema.json' },
|
|
40
|
+
'runtime-lock': { '1.1.0': 'schemas/v1.1.0/runtime-lock.schema.json' },
|
|
41
|
+
'provenance-event': { '1.1.0': 'schemas/v1.1.0/provenance-event.schema.json' },
|
|
42
|
+
'ship-closure': { '1.1.0': 'schemas/v1.1.0/ship-closure.schema.json' },
|
|
43
|
+
'professional-specification': { '1.1.0': 'schemas/v1.1.0/professional-specification.schema.json' },
|
|
44
|
+
'planning-review-record': { '1.1.0': 'schemas/v1.1.0/planning-review-record.schema.json' },
|
|
45
|
+
'planning-review-state': { '1.1.0': 'schemas/v1.1.0/planning-review-state.schema.json' },
|
|
46
|
+
'planning-review-event': { '1.1.0': 'schemas/v1.1.0/planning-review-event.schema.json' },
|
|
47
|
+
'planning-review-receipt': { '1.1.0': 'schemas/v1.1.0/planning-review-receipt.schema.json' },
|
|
48
|
+
'ship-review-specialist-registry': { '1.1.0': 'schemas/v1.1.0/ship-review-specialist-registry.schema.json' },
|
|
49
|
+
'specialist-review-result': { '1.1.0': 'schemas/v1.1.0/specialist-review-result.schema.json' },
|
|
50
|
+
'ship-risk-classification': { '1.1.0': 'schemas/v1.1.0/ship-risk-classification.schema.json' },
|
|
51
|
+
'browser-qa-session': { '1.1.0': 'schemas/v1.1.0/browser-qa-session.schema.json' },
|
|
52
|
+
'browser-qa-result': { '1.1.0': 'schemas/v1.1.0/browser-qa-result.schema.json' },
|
|
53
|
+
'browser-qa-gate': { '1.1.0': 'schemas/v1.1.0/browser-qa-gate.schema.json' },
|
|
54
|
+
'professional-skills': { '1.1.0': 'schemas/v1.1.0/professional-skills.schema.json' },
|
|
55
|
+
'investigation-request': { '1.1.0': 'schemas/v1.1.0/investigation-request.schema.json' },
|
|
56
|
+
'investigation-observation': { '1.1.0': 'schemas/v1.1.0/investigation-observation.schema.json' },
|
|
57
|
+
'investigation-hypothesis': { '1.1.0': 'schemas/v1.1.0/investigation-hypothesis.schema.json' },
|
|
58
|
+
'investigation-experiment': { '1.1.0': 'schemas/v1.1.0/investigation-experiment.schema.json' },
|
|
59
|
+
'investigation-diagnosis': { '1.1.0': 'schemas/v1.1.0/investigation-diagnosis.schema.json' },
|
|
60
|
+
'investigation-fix': { '1.1.0': 'schemas/v1.1.0/investigation-fix.schema.json' },
|
|
61
|
+
'investigation-event': { '1.1.0': 'schemas/v1.1.0/investigation-event.schema.json' },
|
|
62
|
+
'investigation-record': { '1.1.0': 'schemas/v1.1.0/investigation-record.schema.json' },
|
|
63
|
+
'investigation-receipt': { '1.1.0': 'schemas/v1.1.0/investigation-receipt.schema.json' },
|
|
64
|
+
'adapter-registry': {
|
|
65
|
+
'1.1.0': 'schemas/v1.1.0/adapter-registry.schema.json',
|
|
66
|
+
'1.4.0': 'schemas/v1.4.0/adapter-registry.schema.json',
|
|
67
|
+
},
|
|
68
|
+
'ecosystem-manifest': {
|
|
69
|
+
'1.1.0': 'schemas/v1.1.0/ecosystem-manifest.schema.json',
|
|
70
|
+
'1.3.0': 'schemas/v1.3.0/ecosystem-manifest.schema.json',
|
|
71
|
+
},
|
|
72
|
+
'release-ledger': { '1.3.0': 'schemas/v1.3.0/release-ledger.schema.json' },
|
|
73
|
+
'release-compatibility-claim': { '1.3.0': 'schemas/v1.3.0/release-compatibility-claim.schema.json' },
|
|
74
|
+
'release-ledger-receipt': { '1.3.0': 'schemas/v1.3.0/release-ledger-receipt.schema.json' },
|
|
75
|
+
'artifact-envelope': { '1.1.0': 'schemas/v1.1.0/artifact-envelope.schema.json' },
|
|
76
|
+
'artifact-review': { '1.1.0': 'schemas/v1.1.0/artifact-review.schema.json' },
|
|
77
|
+
'artifact-paste': { '1.1.0': 'schemas/v1.1.0/artifact-paste.schema.json' },
|
|
78
|
+
'artifact-room-event': { '1.1.0': 'schemas/v1.1.0/artifact-room-event.schema.json' },
|
|
79
|
+
'artifact-room-descriptor': { '1.1.0': 'schemas/v1.1.0/artifact-room-descriptor.schema.json' },
|
|
80
|
+
'artifact-room-signed-event': { '1.1.0': 'schemas/v1.1.0/artifact-room-signed-event.schema.json' },
|
|
81
|
+
'ecosystem-saga': { '1.2.0': 'schemas/v1.2.0/ecosystem-saga.schema.json' },
|
|
82
|
+
'ecosystem-release-operation': { '1.2.0': 'schemas/v1.2.0/ecosystem-release-operation.schema.json' },
|
|
83
|
+
'guided-question': { '1.2.0': 'schemas/v1.2.0/guided-question.schema.json' },
|
|
84
|
+
'guided-questionnaire': { '1.2.0': 'schemas/v1.2.0/guided-questionnaire.schema.json' },
|
|
85
|
+
'guided-answer-envelope': { '1.2.0': 'schemas/v1.2.0/guided-answer-envelope.schema.json' },
|
|
86
|
+
'guided-session': { '1.2.0': 'schemas/v1.2.0/guided-session.schema.json' },
|
|
87
|
+
'guided-confirmation': { '1.2.0': 'schemas/v1.2.0/guided-confirmation.schema.json' },
|
|
88
|
+
'structured-action': { '1.2.0': 'schemas/v1.2.0/structured-action.schema.json' },
|
|
89
|
+
'evidence-diagnostic': { '1.2.0': 'schemas/v1.2.0/evidence-diagnostic.schema.json' },
|
|
90
|
+
'dashboard-bootstrap': { '1.2.0': 'schemas/v1.2.0/dashboard-bootstrap.schema.json' },
|
|
91
|
+
'landing-plan': { '1.2.0': 'schemas/v1.2.0/landing-plan.schema.json' },
|
|
92
|
+
'landing-confirmation': { '1.2.0': 'schemas/v1.2.0/landing-confirmation.schema.json' },
|
|
93
|
+
'landing-event': { '1.2.0': 'schemas/v1.2.0/landing-event.schema.json' },
|
|
94
|
+
'landing-phase-receipt': { '1.2.0': 'schemas/v1.2.0/landing-phase-receipt.schema.json' },
|
|
95
|
+
'landing-receipt': { '1.2.0': 'schemas/v1.2.0/landing-receipt.schema.json' },
|
|
96
|
+
'landing-operation-registry': { '1.2.0': 'schemas/v1.2.0/landing-operation-registry.schema.json' },
|
|
97
|
+
'landing-workflow-catalog': { '1.2.0': 'schemas/v1.2.0/landing-workflow-catalog.schema.json' },
|
|
98
|
+
'evaluation-scenario': { '1.4.0': 'schemas/v1.4.0/evaluation-scenario.schema.json' },
|
|
99
|
+
'evaluation-corpus': { '1.4.0': 'schemas/v1.4.0/evaluation-corpus.schema.json' },
|
|
100
|
+
'evaluation-fixture': { '1.4.0': 'schemas/v1.4.0/evaluation-fixture.schema.json' },
|
|
101
|
+
'evaluation-host-profile': { '1.4.0': 'schemas/v1.4.0/evaluation-host-profile.schema.json' },
|
|
102
|
+
'evaluation-host-profile-registry': { '1.4.0': 'schemas/v1.4.0/evaluation-host-profile-registry.schema.json' },
|
|
103
|
+
'evaluation-grader-registration': { '1.4.0': 'schemas/v1.4.0/evaluation-grader-registration.schema.json' },
|
|
104
|
+
'evaluation-grader-registry': { '1.4.0': 'schemas/v1.4.0/evaluation-grader-registry.schema.json' },
|
|
105
|
+
'evaluation-budget': { '1.4.0': 'schemas/v1.4.0/evaluation-budget.schema.json' },
|
|
106
|
+
'evaluation-gate-policy': { '1.4.0': 'schemas/v1.4.0/evaluation-gate-policy.schema.json' },
|
|
107
|
+
'evaluation-observation': { '1.4.0': 'schemas/v1.4.0/evaluation-observation.schema.json' },
|
|
108
|
+
'evaluation-run-result': { '1.4.0': 'schemas/v1.4.0/evaluation-run-result.schema.json' },
|
|
109
|
+
'evaluation-aggregate-report': { '1.4.0': 'schemas/v1.4.0/evaluation-aggregate-report.schema.json' },
|
|
110
|
+
'evaluation-waiver': { '1.4.0': 'schemas/v1.4.0/evaluation-waiver.schema.json' },
|
|
111
|
+
'skill-certification-receipt': { '1.4.0': 'schemas/v1.4.0/skill-certification-receipt.schema.json' },
|
|
112
|
+
'role-registry': {
|
|
113
|
+
'1.1.0': 'schemas/v1.1.0/role-registry.schema.json',
|
|
114
|
+
'1.5.0': 'schemas/v1.5.0/role-registry.schema.json',
|
|
115
|
+
},
|
|
116
|
+
'task-kind-registry': { '1.5.0': 'schemas/v1.5.0/task-kind-registry.schema.json' },
|
|
117
|
+
'task-manifest': { '1.5.0': 'schemas/v1.5.0/task-manifest.schema.json' },
|
|
118
|
+
'task-output-manifest': { '1.5.0': 'schemas/v1.5.0/task-output-manifest.schema.json' },
|
|
119
|
+
'implementation-result': { '1.5.0': 'schemas/v1.5.0/implementation-result.schema.json' },
|
|
120
|
+
'rule-catalog': { '1.5.0': 'schemas/v1.5.0/rule-catalog.schema.json' },
|
|
121
|
+
'command-catalog': { '1.5.0': 'schemas/v1.5.0/command-catalog.schema.json' },
|
|
122
|
+
'skill-catalog': {
|
|
123
|
+
'1.5.0': 'schemas/v1.5.0/skill-catalog.schema.json',
|
|
124
|
+
'1.6.0': v16Schema('skill-catalog'),
|
|
125
|
+
'1.7.0': v17Schema('skill-catalog'),
|
|
126
|
+
},
|
|
127
|
+
'output-catalog': { '1.5.0': 'schemas/v1.5.0/output-catalog.schema.json' },
|
|
128
|
+
'output-path-catalog': { '1.5.0': 'schemas/v1.5.0/output-path-catalog.schema.json' },
|
|
129
|
+
'generated-asset-manifest': {
|
|
130
|
+
'1.5.0': 'schemas/v1.5.0/generated-asset-manifest.schema.json',
|
|
131
|
+
'1.6.0': v16Schema('generated-asset-manifest'),
|
|
132
|
+
'1.7.0': v17Schema('generated-asset-manifest'),
|
|
133
|
+
},
|
|
134
|
+
'migration-preservation-manifest': { '1.5.0': 'schemas/v1.5.0/migration-preservation-manifest.schema.json' },
|
|
135
|
+
'skill-source': { '1.6.0': v16Schema('skill-source'), '1.7.0': v17Schema('skill-source') },
|
|
136
|
+
'skill-module-registry': { '1.6.0': v16Schema('skill-module-registry'), '1.7.0': v17Schema('skill-module-registry') },
|
|
137
|
+
'skill-host-profile-registry': { '1.6.0': v16Schema('skill-host-profile-registry'), '1.7.0': v17Schema('skill-host-profile-registry') },
|
|
138
|
+
'skill-routing-registry': { '1.6.0': v16Schema('skill-routing-registry'), '1.7.0': v17Schema('skill-routing-registry') },
|
|
139
|
+
'skill-completion-receipt': { '1.6.0': v16Schema('skill-completion-receipt'), '1.7.0': v17Schema('skill-completion-receipt') },
|
|
140
|
+
'skill-consent-record': { '1.6.0': v16Schema('skill-consent-record'), '1.7.0': v17Schema('skill-consent-record') },
|
|
141
|
+
'skill-learning-record': { '1.6.0': v16Schema('skill-learning-record'), '1.7.0': v17Schema('skill-learning-record') },
|
|
142
|
+
'skill-session': { '1.6.0': v16Schema('skill-session'), '1.7.0': v17Schema('skill-session') },
|
|
143
|
+
'planning-id-sequence': { '1.7.0': v17Schema('planning-id-sequence') },
|
|
144
|
+
'request-authority': { '1.7.0': v17Schema('request-authority') },
|
|
145
|
+
'skill-package': { '1.8.0': v18Schema('skill-package') },
|
|
146
|
+
'utility-command-catalog': { '1.8.0': v18Schema('utility-command-catalog') },
|
|
147
|
+
'diagram-document': { '1.6.0': v16Schema('diagram-document') },
|
|
148
|
+
'diagram-fidelity-report': { '1.6.0': v16Schema('diagram-fidelity-report') },
|
|
149
|
+
'diagram-manifest': { '1.6.0': v16Schema('diagram-manifest') },
|
|
150
|
+
'diagram-consumer-reference': { '1.6.0': v16Schema('diagram-consumer-reference') },
|
|
151
|
+
'diagram-review-binding': { '1.6.0': v16Schema('diagram-review-binding') },
|
|
152
|
+
'diagram-quality-report': { '1.6.0': v16Schema('diagram-quality-report') },
|
|
153
|
+
'diagram-semantic-pattern-registry': { '1.6.0': v16Schema('diagram-semantic-pattern-registry') },
|
|
154
|
+
'diagram-type-registry': { '1.6.0': v16Schema('diagram-type-registry') },
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
function compiledOperatePaths() {
|
|
158
|
+
const catalog = OPERATE_CONTRACT_CATALOG_V2;
|
|
159
|
+
if (
|
|
160
|
+
catalog?.kind !== 'operate-contract-catalog'
|
|
161
|
+
|| catalog.protocol?.id !== 'operate'
|
|
162
|
+
|| catalog.protocol?.version !== '2.0.0'
|
|
163
|
+
|| catalog.protocol?.versionPolicy !== 'exact'
|
|
164
|
+
|| !Array.isArray(catalog.contracts)
|
|
165
|
+
) {
|
|
166
|
+
throw new PipelineError(
|
|
167
|
+
'E_SCHEMA_VERSION_UNSUPPORTED',
|
|
168
|
+
'The packaged Operate contract catalog is not an explicit Protocol 2.0.0 catalog.',
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
const entries = catalog.contracts.map(({ id, schemaPath }) => [id, { '2.0.0': schemaPath }]);
|
|
172
|
+
if (new Set(entries.map(([id]) => id)).size !== entries.length) {
|
|
173
|
+
throw new PipelineError('E_SCHEMA_UNKNOWN', 'The packaged Operate contract catalog contains duplicate contract IDs.');
|
|
174
|
+
}
|
|
175
|
+
return Object.fromEntries(entries);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function compiledOperateExperienceVocabulary() {
|
|
179
|
+
const experience = OPERATE_CONTRACT_CATALOG_V2?.experience;
|
|
180
|
+
const expectedKinds = [
|
|
181
|
+
'operate-experience-live-patch',
|
|
182
|
+
'operate-experience-preview',
|
|
183
|
+
'operate-experience-view',
|
|
184
|
+
'operate-review-bound-submission',
|
|
185
|
+
'operate-review-display-workspace',
|
|
186
|
+
'operating-delivery-evidence',
|
|
187
|
+
'operating-delivery-route',
|
|
188
|
+
'operating-origin',
|
|
189
|
+
'operating-planning-proposal',
|
|
190
|
+
];
|
|
191
|
+
const expectedRoutes = ['contained-execution', 'human-external', 'observe-only', 'planning-work'];
|
|
192
|
+
const kinds = Array.isArray(experience?.contracts)
|
|
193
|
+
? experience.contracts.map(({ id }) => id).sort()
|
|
194
|
+
: [];
|
|
195
|
+
const routes = Array.isArray(experience?.deliveryRoutes) ? [...experience.deliveryRoutes].sort() : [];
|
|
196
|
+
if (
|
|
197
|
+
JSON.stringify(kinds) !== JSON.stringify(expectedKinds)
|
|
198
|
+
|| JSON.stringify(routes) !== JSON.stringify(expectedRoutes)
|
|
199
|
+
|| experience.contracts.some(({ version, schemaPath }) => (
|
|
200
|
+
version !== '1.0.0' || typeof schemaPath !== 'string' || !schemaPath.startsWith('schemas/v2.0.0/')
|
|
201
|
+
))
|
|
202
|
+
) {
|
|
203
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate catalog does not declare the exact public experience contract family.');
|
|
204
|
+
}
|
|
205
|
+
return Object.freeze({
|
|
206
|
+
kinds: Object.freeze(kinds),
|
|
207
|
+
routes: Object.freeze(routes),
|
|
208
|
+
paths: Object.freeze(Object.fromEntries(experience.contracts.map(({ id, schemaPath }) => [id, schemaPath]))),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function compiledOperateRoleMandates() {
|
|
213
|
+
const catalog = OPERATE_CONTRACT_CATALOG_V2;
|
|
214
|
+
if (!Array.isArray(catalog?.roles)) {
|
|
215
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate contract catalog does not declare role mandates.');
|
|
216
|
+
}
|
|
217
|
+
const mandates = catalog.roles.map((role) => ({
|
|
218
|
+
id: role?.id,
|
|
219
|
+
version: role?.version,
|
|
220
|
+
output: role?.output,
|
|
221
|
+
limits: role?.limits,
|
|
222
|
+
}));
|
|
223
|
+
if (
|
|
224
|
+
mandates.some(({ id, version, output, limits }) => (
|
|
225
|
+
typeof id !== 'string'
|
|
226
|
+
|| version !== '2.0.0'
|
|
227
|
+
|| typeof output?.schemaId !== 'string'
|
|
228
|
+
|| output.schemaVersion !== '2.0.0'
|
|
229
|
+
|| !Number.isSafeInteger(output.maxBytes)
|
|
230
|
+
|| output.maxBytes < 1
|
|
231
|
+
|| !Number.isSafeInteger(limits?.maxProposals)
|
|
232
|
+
|| !Number.isSafeInteger(limits?.maxActions)
|
|
233
|
+
))
|
|
234
|
+
|| new Set(mandates.map(({ id, version }) => `${id}@${version}`)).size !== mandates.length
|
|
235
|
+
) {
|
|
236
|
+
throw new PipelineError('E_SCHEMA_UNKNOWN', 'The packaged Operate contract catalog has invalid role mandates.');
|
|
237
|
+
}
|
|
238
|
+
return mandates.map(({ id, version, output, limits }) => Object.freeze({
|
|
239
|
+
id,
|
|
240
|
+
version,
|
|
241
|
+
output: Object.freeze({ ...output }),
|
|
242
|
+
limits: Object.freeze({ ...limits }),
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function compiledOperateEvidenceVocabulary() {
|
|
247
|
+
const evidence = OPERATE_CONTRACT_CATALOG_V2?.evidence;
|
|
248
|
+
const fields = ['contractIds', 'kinds', 'edgeRelations', 'resolverErrorCodes'];
|
|
249
|
+
if (
|
|
250
|
+
!evidence
|
|
251
|
+
|| fields.some((field) => !Array.isArray(evidence[field]))
|
|
252
|
+
|| evidence.contractIds.length !== 7
|
|
253
|
+
|| evidence.kinds.length !== 4
|
|
254
|
+
|| evidence.edgeRelations.length !== 2
|
|
255
|
+
|| evidence.contractIds.some((id) => !OPERATE_CONTRACT_CATALOG_V2.contracts.some((contract) => contract.id === id))
|
|
256
|
+
|| new Set(evidence.contractIds).size !== evidence.contractIds.length
|
|
257
|
+
|| new Set(evidence.kinds).size !== evidence.kinds.length
|
|
258
|
+
|| new Set(evidence.edgeRelations).size !== evidence.edgeRelations.length
|
|
259
|
+
|| new Set(evidence.resolverErrorCodes).size !== evidence.resolverErrorCodes.length
|
|
260
|
+
) {
|
|
261
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate catalog does not declare the exact Phase 4 evidence vocabulary.');
|
|
262
|
+
}
|
|
263
|
+
return Object.freeze({
|
|
264
|
+
contractIds: Object.freeze([...evidence.contractIds]),
|
|
265
|
+
kinds: Object.freeze([...evidence.kinds]),
|
|
266
|
+
edgeRelations: Object.freeze([...evidence.edgeRelations]),
|
|
267
|
+
resolverErrorCodes: Object.freeze([...evidence.resolverErrorCodes]),
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function compiledOperateOperatingIntelligenceVocabulary() {
|
|
272
|
+
const vocabulary = OPERATE_CONTRACT_CATALOG_V2?.operatingIntelligence;
|
|
273
|
+
const fields = ['contractIds', 'projectionIdentities', 'providerRegistrationContractIds'];
|
|
274
|
+
if (
|
|
275
|
+
!vocabulary
|
|
276
|
+
|| fields.some((field) => !Array.isArray(vocabulary[field]))
|
|
277
|
+
|| vocabulary.contractIds.length !== 25
|
|
278
|
+
|| vocabulary.projectionIdentities.length !== 2
|
|
279
|
+
|| vocabulary.providerRegistrationContractIds.length !== 3
|
|
280
|
+
|| vocabulary.contractIds.some((id) => !OPERATE_CONTRACT_CATALOG_V2.contracts.some((contract) => contract.id === id))
|
|
281
|
+
|| new Set(vocabulary.contractIds).size !== vocabulary.contractIds.length
|
|
282
|
+
|| new Set(vocabulary.projectionIdentities).size !== vocabulary.projectionIdentities.length
|
|
283
|
+
|| new Set(vocabulary.providerRegistrationContractIds).size !== vocabulary.providerRegistrationContractIds.length
|
|
284
|
+
) {
|
|
285
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate catalog does not declare the exact Phase 5 operating-intelligence vocabulary.');
|
|
286
|
+
}
|
|
287
|
+
return Object.freeze({
|
|
288
|
+
contractIds: Object.freeze([...vocabulary.contractIds]),
|
|
289
|
+
projectionIdentities: Object.freeze([...vocabulary.projectionIdentities]),
|
|
290
|
+
providerRegistrationContractIds: Object.freeze([...vocabulary.providerRegistrationContractIds]),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function compiledOperateGovernedExecutionVocabulary() {
|
|
295
|
+
const vocabulary = OPERATE_CONTRACT_CATALOG_V2?.governedExecution;
|
|
296
|
+
const fields = [
|
|
297
|
+
'contractIds', 'providerRegistrationContractIds', 'effectClasses', 'policyOutcomes',
|
|
298
|
+
'policyTiers', 'coreProhibitions', 'operationStates', 'toolOperations',
|
|
299
|
+
];
|
|
300
|
+
if (
|
|
301
|
+
!vocabulary
|
|
302
|
+
|| fields.some((field) => !Array.isArray(vocabulary[field]))
|
|
303
|
+
|| vocabulary.contractIds.length !== 13
|
|
304
|
+
|| vocabulary.providerRegistrationContractIds.length !== 3
|
|
305
|
+
|| vocabulary.effectClasses.length !== 6
|
|
306
|
+
|| vocabulary.policyOutcomes.length !== 7
|
|
307
|
+
|| vocabulary.policyTiers.length !== 3
|
|
308
|
+
|| vocabulary.coreProhibitions.length !== 9
|
|
309
|
+
|| vocabulary.operationStates.length !== 10
|
|
310
|
+
|| vocabulary.toolOperations.length !== 3
|
|
311
|
+
|| vocabulary.contractIds.some((id) => !OPERATE_CONTRACT_CATALOG_V2.contracts.some((contract) => contract.id === id))
|
|
312
|
+
|| ['contractIds', 'providerRegistrationContractIds', 'effectClasses', 'policyOutcomes', 'coreProhibitions', 'operationStates']
|
|
313
|
+
.some((field) => new Set(vocabulary[field]).size !== vocabulary[field].length)
|
|
314
|
+
|| new Set(vocabulary.policyTiers.map(({ id }) => id)).size !== vocabulary.policyTiers.length
|
|
315
|
+
|| vocabulary.toolOperations.some(({ id }) => !OPERATE_CONTRACT_CATALOG_V2.operations.some((operation) => operation.id === id))
|
|
316
|
+
|| new Set(vocabulary.toolOperations.map(({ id }) => id)).size !== vocabulary.toolOperations.length
|
|
317
|
+
) {
|
|
318
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate catalog does not declare the exact Phase 6 governed-execution vocabulary.');
|
|
319
|
+
}
|
|
320
|
+
return Object.freeze(Object.fromEntries(fields.map((field) => [field, Object.freeze(
|
|
321
|
+
vocabulary[field].map((entry) => typeof entry === 'object' ? Object.freeze({ ...entry }) : entry),
|
|
322
|
+
)])));
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function compiledPublicOperateDomainContractBindings() {
|
|
326
|
+
const domains = OPERATE_CONTRACT_CATALOG_V2?.extensions?.domains;
|
|
327
|
+
const expected = {
|
|
328
|
+
business: { apiDomainId: 'business', id: 'business-domain', version: '1.0.0' },
|
|
329
|
+
software: { apiDomainId: 'software', id: 'software-domain', version: '1.0.0' },
|
|
330
|
+
};
|
|
331
|
+
if (!Array.isArray(domains)) {
|
|
332
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate catalog does not declare public domain registrations.');
|
|
333
|
+
}
|
|
334
|
+
const bindings = {};
|
|
335
|
+
for (const [domainId, binding] of Object.entries(expected)) {
|
|
336
|
+
const domain = domains.find((entry) => entry?.domainId === domainId && entry?.domainVersion === binding.version);
|
|
337
|
+
if (domain === undefined || JSON.stringify(domain.domainContract) !== JSON.stringify(binding)) {
|
|
338
|
+
throw new PipelineError('E_SCHEMA_VERSION_UNSUPPORTED', 'The packaged Operate catalog has an invalid explicit API-domain contract binding.');
|
|
339
|
+
}
|
|
340
|
+
bindings[domainId] = Object.freeze({ ...binding });
|
|
341
|
+
}
|
|
342
|
+
return Object.freeze(bindings);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const paths = {
|
|
346
|
+
...foundationPaths,
|
|
347
|
+
...compiledOperatePaths(),
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
const OPERATE_EXPERIENCE_VOCABULARY_V1 = compiledOperateExperienceVocabulary();
|
|
351
|
+
const experiencePaths = Object.freeze(Object.fromEntries(
|
|
352
|
+
Object.entries(OPERATE_EXPERIENCE_VOCABULARY_V1.paths).map(([kind, path]) => [kind, Object.freeze({ '2.0.0': path })]),
|
|
353
|
+
));
|
|
354
|
+
|
|
355
|
+
// Every Operate v2 identity is compiler-owned. Keeping this set derived avoids
|
|
356
|
+
// a second hand-maintained version boundary when the canonical registry grows.
|
|
357
|
+
const explicitProtocolVersionKinds = new Set(
|
|
358
|
+
[
|
|
359
|
+
...OPERATE_CONTRACT_CATALOG_V2.contracts.map(({ id }) => id),
|
|
360
|
+
'role-registry',
|
|
361
|
+
'task-kind-registry',
|
|
362
|
+
'task-manifest',
|
|
363
|
+
'task-output-manifest',
|
|
364
|
+
'rule-catalog',
|
|
365
|
+
'command-catalog',
|
|
366
|
+
'skill-catalog',
|
|
367
|
+
'output-catalog',
|
|
368
|
+
'output-path-catalog',
|
|
369
|
+
'generated-asset-manifest',
|
|
370
|
+
'migration-preservation-manifest',
|
|
371
|
+
'skill-source',
|
|
372
|
+
'skill-module-registry',
|
|
373
|
+
'skill-host-profile-registry',
|
|
374
|
+
'skill-routing-registry',
|
|
375
|
+
'skill-completion-receipt',
|
|
376
|
+
'skill-consent-record',
|
|
377
|
+
'skill-learning-record',
|
|
378
|
+
'skill-session',
|
|
379
|
+
],
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
export const PROTOCOL_SCHEMA_REGISTRY = Object.freeze(Object.fromEntries(
|
|
383
|
+
Object.entries(paths).map(([kind, versions]) => [kind, Object.freeze({ ...versions })]),
|
|
384
|
+
));
|
|
385
|
+
|
|
386
|
+
/** Closed public product-experience and Operate-to-Planning contract identities. */
|
|
387
|
+
export const OPERATE_EXPERIENCE_CONTRACT_KINDS_V2 = OPERATE_EXPERIENCE_VOCABULARY_V1.kinds;
|
|
388
|
+
/** The only delivery classifications accepted by the Operate-to-Planning bridge. */
|
|
389
|
+
export const OPERATING_DELIVERY_ROUTES_V1 = OPERATE_EXPERIENCE_VOCABULARY_V1.routes;
|
|
390
|
+
|
|
391
|
+
/** Compiler-owned, explicit Protocol 2.0 role mandates. */
|
|
392
|
+
export const OPERATE_ROLE_MANDATES_V2 = Object.freeze(compiledOperateRoleMandates());
|
|
393
|
+
|
|
394
|
+
/** Compiler-owned public extension record identities. */
|
|
395
|
+
export const OPERATE_EXTENSION_CONTRACT_KINDS_V2 = Object.freeze(
|
|
396
|
+
OPERATE_CONTRACT_CATALOG_V2.contracts
|
|
397
|
+
.filter(({ category }) => category === 'extension')
|
|
398
|
+
.map(({ id }) => id)
|
|
399
|
+
.sort(),
|
|
400
|
+
);
|
|
401
|
+
|
|
402
|
+
const OPERATE_EVIDENCE_VOCABULARY_V2 = compiledOperateEvidenceVocabulary();
|
|
403
|
+
/** Compiler-owned Phase 4 evidence record identities. */
|
|
404
|
+
export const OPERATE_EVIDENCE_CONTRACT_KINDS_V2 = OPERATE_EVIDENCE_VOCABULARY_V2.contractIds;
|
|
405
|
+
/** The four shipped local evidence source kinds. */
|
|
406
|
+
export const OPERATE_EVIDENCE_KINDS_V2 = OPERATE_EVIDENCE_VOCABULARY_V2.kinds;
|
|
407
|
+
/** The only Phase 4 source-Artifact-local evidence edge relations. */
|
|
408
|
+
export const OPERATE_EVIDENCE_EDGE_RELATIONS_V2 = OPERATE_EVIDENCE_VOCABULARY_V2.edgeRelations;
|
|
409
|
+
/** Stable, safe resolver failure reasons. */
|
|
410
|
+
export const OPERATE_EVIDENCE_RESOLVER_ERROR_CODES_V2 = OPERATE_EVIDENCE_VOCABULARY_V2.resolverErrorCodes;
|
|
411
|
+
|
|
412
|
+
const OPERATE_OPERATING_INTELLIGENCE_VOCABULARY_V2 = compiledOperateOperatingIntelligenceVocabulary();
|
|
413
|
+
/** Compiler-owned Phase 5 operating-intelligence record identities. */
|
|
414
|
+
export const OPERATE_OPERATING_INTELLIGENCE_CONTRACT_KINDS_V2 = OPERATE_OPERATING_INTELLIGENCE_VOCABULARY_V2.contractIds;
|
|
415
|
+
/** Exact public domain-projection identities; no implicit string derivation is allowed. */
|
|
416
|
+
export const OPERATE_OPERATING_PROJECTION_IDENTITIES_V2 = OPERATE_OPERATING_INTELLIGENCE_VOCABULARY_V2.projectionIdentities;
|
|
417
|
+
/** Public Phase 5 provider declaration identities. Registration grants no authority. */
|
|
418
|
+
export const OPERATE_OPERATING_PROVIDER_REGISTRATION_CONTRACT_KINDS_V2 = OPERATE_OPERATING_INTELLIGENCE_VOCABULARY_V2.providerRegistrationContractIds;
|
|
419
|
+
const OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2 = compiledOperateGovernedExecutionVocabulary();
|
|
420
|
+
/** Compiler-owned Phase 6 authority and execution contract identities. */
|
|
421
|
+
export const OPERATE_GOVERNED_EXECUTION_CONTRACT_KINDS_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.contractIds;
|
|
422
|
+
/** Data-only capability, policy, and executor registration identities. */
|
|
423
|
+
export const OPERATE_GOVERNED_PROVIDER_REGISTRATION_CONTRACT_KINDS_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.providerRegistrationContractIds;
|
|
424
|
+
/** Exact classification vocabulary; classification alone never grants authority. */
|
|
425
|
+
export const OPERATE_GOVERNED_EFFECT_CLASSES_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.effectClasses;
|
|
426
|
+
/** Exact closed policy disposition vocabulary. */
|
|
427
|
+
export const OPERATE_GOVERNED_POLICY_OUTCOMES_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.policyOutcomes;
|
|
428
|
+
/** Immutable core > project > narrowing domain policy precedence. */
|
|
429
|
+
export const OPERATE_GOVERNED_POLICY_TIERS_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.policyTiers;
|
|
430
|
+
/** Non-overridable reference policy prohibitions. */
|
|
431
|
+
export const OPERATE_GOVERNED_CORE_PROHIBITIONS_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.coreProhibitions;
|
|
432
|
+
/** Closed crash-recovery outcomes; none of these outcomes independently grants authority. */
|
|
433
|
+
export const OPERATE_GOVERNED_RECOVERY_CLASSIFICATIONS_V2 = Object.freeze([
|
|
434
|
+
'applied', 'not-applied', 'partial', 'unknown',
|
|
435
|
+
]);
|
|
436
|
+
|
|
437
|
+
const OPERATE_CORE_PROHIBITION_TOKEN_EXPANSIONS_V2 = Object.freeze(Object.assign(Object.create(null), {
|
|
438
|
+
credentials: ['credential'],
|
|
439
|
+
customers: ['customer'],
|
|
440
|
+
funds: ['fund'],
|
|
441
|
+
funding: ['fund'],
|
|
442
|
+
money: ['fund'],
|
|
443
|
+
monies: ['fund'],
|
|
444
|
+
payments: ['payment'],
|
|
445
|
+
pay: ['payment'],
|
|
446
|
+
pays: ['payment'],
|
|
447
|
+
paying: ['payment'],
|
|
448
|
+
paid: ['payment'],
|
|
449
|
+
payout: ['payment', 'transfer'],
|
|
450
|
+
payouts: ['payment', 'transfer'],
|
|
451
|
+
transfers: ['transfer'],
|
|
452
|
+
transferred: ['transfer'],
|
|
453
|
+
transferring: ['transfer'],
|
|
454
|
+
remits: ['transfer'],
|
|
455
|
+
remit: ['transfer'],
|
|
456
|
+
remitted: ['transfer'],
|
|
457
|
+
remitting: ['transfer'],
|
|
458
|
+
contacted: ['contact'],
|
|
459
|
+
contacting: ['contact'],
|
|
460
|
+
contacts: ['contact'],
|
|
461
|
+
message: ['contact'],
|
|
462
|
+
messages: ['contact'],
|
|
463
|
+
messaged: ['contact'],
|
|
464
|
+
messaging: ['contact'],
|
|
465
|
+
email: ['contact'],
|
|
466
|
+
emails: ['contact'],
|
|
467
|
+
emailed: ['contact'],
|
|
468
|
+
emailing: ['contact'],
|
|
469
|
+
reachout: ['contact'],
|
|
470
|
+
reachouts: ['contact'],
|
|
471
|
+
deployed: ['deploy'],
|
|
472
|
+
deploying: ['deploy'],
|
|
473
|
+
deploys: ['deploy'],
|
|
474
|
+
ship: ['deploy'],
|
|
475
|
+
ships: ['deploy'],
|
|
476
|
+
shipped: ['deploy'],
|
|
477
|
+
shipping: ['deploy'],
|
|
478
|
+
deliver: ['deploy'],
|
|
479
|
+
delivers: ['deploy'],
|
|
480
|
+
delivered: ['deploy'],
|
|
481
|
+
delivering: ['deploy'],
|
|
482
|
+
delivery: ['deploy'],
|
|
483
|
+
deliveries: ['deploy'],
|
|
484
|
+
merged: ['merge'],
|
|
485
|
+
merging: ['merge'],
|
|
486
|
+
merges: ['merge'],
|
|
487
|
+
published: ['publish'],
|
|
488
|
+
publishing: ['publish'],
|
|
489
|
+
publishes: ['publish'],
|
|
490
|
+
publication: ['publish'],
|
|
491
|
+
publications: ['publish'],
|
|
492
|
+
released: ['publish'],
|
|
493
|
+
release: ['publish'],
|
|
494
|
+
releasing: ['publish'],
|
|
495
|
+
releases: ['publish'],
|
|
496
|
+
rotated: ['rotate'],
|
|
497
|
+
rotating: ['rotate'],
|
|
498
|
+
mutated: ['mutate'],
|
|
499
|
+
mutating: ['mutate'],
|
|
500
|
+
changed: ['change'],
|
|
501
|
+
changing: ['change'],
|
|
502
|
+
sent: ['send'],
|
|
503
|
+
sending: ['send'],
|
|
504
|
+
destroyed: ['destroy'],
|
|
505
|
+
destroying: ['destroy'],
|
|
506
|
+
deletes: ['delete'],
|
|
507
|
+
deleting: ['delete'],
|
|
508
|
+
deleted: ['delete'],
|
|
509
|
+
erased: ['delete'],
|
|
510
|
+
erase: ['delete'],
|
|
511
|
+
erasing: ['delete'],
|
|
512
|
+
removed: ['delete'],
|
|
513
|
+
remove: ['delete'],
|
|
514
|
+
removing: ['delete'],
|
|
515
|
+
wiped: ['delete'],
|
|
516
|
+
wipe: ['delete'],
|
|
517
|
+
wiping: ['delete'],
|
|
518
|
+
secrets: ['secret'],
|
|
519
|
+
prod: ['production'],
|
|
520
|
+
}));
|
|
521
|
+
|
|
522
|
+
function operateCoreProhibitionTokens(value) {
|
|
523
|
+
if (typeof value !== 'string') return [];
|
|
524
|
+
const normalized = value.normalize('NFKC')
|
|
525
|
+
.replace(/([a-z0-9])([A-Z])/gu, '$1-$2')
|
|
526
|
+
.toLowerCase()
|
|
527
|
+
.replace(/[^a-z0-9]+/gu, '-')
|
|
528
|
+
.replace(/^-+|-+$/gu, '');
|
|
529
|
+
return normalized.split('-')
|
|
530
|
+
.filter((token) => token.length > 0 && !/^\d+$/u.test(token))
|
|
531
|
+
.flatMap((token) => OPERATE_CORE_PROHIBITION_TOKEN_EXPANSIONS_V2[token] ?? [token]);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Resolve one non-overridable governed-execution prohibition from semantic
|
|
536
|
+
* identifier fragments. Matching is normalized, order-independent, and
|
|
537
|
+
* intentionally shared by registration and contained-input validation.
|
|
538
|
+
*/
|
|
539
|
+
export function findOperateCoreProhibitionV2(values) {
|
|
540
|
+
const input = Array.isArray(values) ? values : [values];
|
|
541
|
+
const words = new Set(input.flatMap(operateCoreProhibitionTokens));
|
|
542
|
+
const matched = [
|
|
543
|
+
['credential-change', words.has('credential')],
|
|
544
|
+
['customer-contact', words.has('customer') && (
|
|
545
|
+
words.has('contact') || (words.has('reach') && words.has('out'))
|
|
546
|
+
)],
|
|
547
|
+
['destructive', ['destructive', 'destroy', 'delete'].some((word) => words.has(word))],
|
|
548
|
+
['funds-transfer', words.has('fund') && (words.has('transfer') || words.has('send'))],
|
|
549
|
+
['payment-transfer', words.has('payment') && (words.has('transfer') || words.has('send'))],
|
|
550
|
+
['production-deploy', words.has('production') && words.has('deploy')],
|
|
551
|
+
['production-merge', words.has('production') && words.has('merge')],
|
|
552
|
+
['publication', words.has('publish')],
|
|
553
|
+
['secret-mutation', words.has('secret')],
|
|
554
|
+
].find(([, present]) => present);
|
|
555
|
+
return matched && OPERATE_GOVERNED_CORE_PROHIBITIONS_V2.includes(matched[0]) ? matched[0] : null;
|
|
556
|
+
}
|
|
557
|
+
/** Exact durable governed-operation lifecycle vocabulary. */
|
|
558
|
+
export const OPERATE_GOVERNED_OPERATION_STATES_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.operationStates;
|
|
559
|
+
/** Terminal result-bearing states eligible for pure at-most-once replay. */
|
|
560
|
+
export const OPERATE_GOVERNED_OPERATION_TERMINAL_STATES_V2 = Object.freeze(
|
|
561
|
+
OPERATE_GOVERNED_OPERATION_STATES_V2
|
|
562
|
+
.filter((state) => ['succeeded', 'failed', 'partial', 'uncertain', 'blocked'].includes(state))
|
|
563
|
+
.sort(),
|
|
564
|
+
);
|
|
565
|
+
/** Result truth retained independently from the later Action hypothesis verdict. */
|
|
566
|
+
export const OPERATE_EXECUTION_VERIFICATION_STATUSES_V2 = Object.freeze([
|
|
567
|
+
'success', 'failure', 'blocked', 'uncertain', 'partial', 'cancelled', 'rolled-back',
|
|
568
|
+
]);
|
|
569
|
+
/** Bounded verification truth; `success` is intentionally absent. */
|
|
570
|
+
export const OPERATE_HYPOTHESIS_VERIFICATION_STATUSES_V2 = Object.freeze([
|
|
571
|
+
'pending', 'confirmed', 'failed', 'blocked', 'cancelled', 'revisit',
|
|
572
|
+
]);
|
|
573
|
+
/** Exact public tools owned by the canonical Phase 6 authority guard. */
|
|
574
|
+
export const OPERATE_GOVERNED_TOOL_OPERATIONS_V2 = OPERATE_GOVERNED_EXECUTION_VOCABULARY_V2.toolOperations;
|
|
575
|
+
/** Compiler-owned guard identities used by governed Review and Action authority. */
|
|
576
|
+
export const OPERATE_AUTHORITY_GUARD_IDS_V2 = Object.freeze(
|
|
577
|
+
OPERATE_CONTRACT_CATALOG_V2.guards
|
|
578
|
+
.filter(({ id }) => ['review-submit-authorized', 'action-approval-authorized', 'action-execution-authorized', 'action-rollback-authorized'].includes(id))
|
|
579
|
+
.map(({ id }) => id)
|
|
580
|
+
.sort(),
|
|
581
|
+
);
|
|
582
|
+
/** Exact compiler-owned public API-domain bindings; no string conversion is permitted. */
|
|
583
|
+
export const OPERATE_PUBLIC_DOMAIN_CONTRACT_BINDINGS_V2 = compiledPublicOperateDomainContractBindings();
|
|
584
|
+
|
|
585
|
+
const OPERATE_INTELLIGENCE_KERNEL_KINDS_V2 = Object.freeze(['advisor', 'challenger', 'chair']);
|
|
586
|
+
|
|
587
|
+
function sortedRoleIds(roles) {
|
|
588
|
+
return [...roles].map(({ roleId }) => roleId).sort();
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function assertCanonicalOperateIntelligencePlanTopologyV2(plan) {
|
|
592
|
+
const selected = plan.selectedRoles;
|
|
593
|
+
const omitted = plan.omittedRoles;
|
|
594
|
+
const advisors = selected.filter(({ roleKind }) => roleKind === 'advisor');
|
|
595
|
+
const challengers = selected.filter(({ roleKind }) => roleKind === 'challenger');
|
|
596
|
+
const chairs = selected.filter(({ roleKind }) => roleKind === 'chair');
|
|
597
|
+
const omittedChallengers = omitted.filter(({ roleKind }) => roleKind === 'challenger');
|
|
598
|
+
const omittedAdvisors = omitted.filter(({ roleKind }) => roleKind === 'advisor');
|
|
599
|
+
const advisorIds = sortedRoleIds(advisors);
|
|
600
|
+
const expectedSelectedIds = [
|
|
601
|
+
...advisorIds,
|
|
602
|
+
...(plan.challengerRequired ? sortedRoleIds(challengers) : []),
|
|
603
|
+
...sortedRoleIds(chairs),
|
|
604
|
+
];
|
|
605
|
+
const expectedOmittedIds = [
|
|
606
|
+
...sortedRoleIds(omittedAdvisors),
|
|
607
|
+
...(plan.challengerRequired ? [] : sortedRoleIds(omittedChallengers)),
|
|
608
|
+
];
|
|
609
|
+
const dependencyExpectation = (role) => {
|
|
610
|
+
if (role.roleKind === 'advisor') return [];
|
|
611
|
+
if (role.roleKind === 'challenger') return [...advisorIds];
|
|
612
|
+
if (role.roleKind === 'chair') {
|
|
613
|
+
return plan.challengerRequired
|
|
614
|
+
? [...advisorIds, challengers[0].roleId]
|
|
615
|
+
: [...advisorIds];
|
|
616
|
+
}
|
|
617
|
+
return null;
|
|
618
|
+
};
|
|
619
|
+
const outputSchemaByRoleKind = {
|
|
620
|
+
advisor: 'operating-advisor-result',
|
|
621
|
+
challenger: 'operating-challenger-review',
|
|
622
|
+
chair: 'operating-decision-ledger',
|
|
623
|
+
};
|
|
624
|
+
const topologyInvalid = advisors.length < 1
|
|
625
|
+
|| chairs.length !== 1
|
|
626
|
+
|| challengers.length !== (plan.challengerRequired ? 1 : 0)
|
|
627
|
+
|| omittedChallengers.length !== (plan.challengerRequired ? 0 : 1)
|
|
628
|
+
|| JSON.stringify(selected.map(({ roleId }) => roleId)) !== JSON.stringify(expectedSelectedIds)
|
|
629
|
+
|| JSON.stringify(omitted.map(({ roleId }) => roleId)) !== JSON.stringify(expectedOmittedIds)
|
|
630
|
+
|| selected.some((role) => {
|
|
631
|
+
const expectedDeps = dependencyExpectation(role);
|
|
632
|
+
return role.roleVersion !== '2.0.0'
|
|
633
|
+
|| role.outputContract.schemaId !== outputSchemaByRoleKind[role.roleKind]
|
|
634
|
+
|| role.outputContract.schemaVersion !== '2.0.0'
|
|
635
|
+
|| !OPERATE_INTELLIGENCE_KERNEL_KINDS_V2.includes(role.roleKind)
|
|
636
|
+
|| expectedDeps === null
|
|
637
|
+
|| JSON.stringify([...role.dependsOnRoleIds].sort()) !== JSON.stringify([...expectedDeps].sort());
|
|
638
|
+
})
|
|
639
|
+
|| omitted.some((role) => (
|
|
640
|
+
role.roleVersion !== '2.0.0'
|
|
641
|
+
|| !OPERATE_INTELLIGENCE_KERNEL_KINDS_V2.includes(role.roleKind)
|
|
642
|
+
|| typeof role.reason !== 'string'
|
|
643
|
+
|| !role.reason.startsWith('not-selected:')
|
|
644
|
+
));
|
|
645
|
+
if (topologyInvalid) {
|
|
646
|
+
throw new PipelineError(
|
|
647
|
+
'E_PROTOCOL_ARTIFACT_INVALID',
|
|
648
|
+
'The operating-intelligence plan does not use the canonical advisor fan-out, challenge, and Chair topology.',
|
|
649
|
+
'',
|
|
650
|
+
{ retryable: false, context: { planId: plan.planId } },
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** Validate the exact compiler-owned explainable-plan contract and canonical topology. */
|
|
656
|
+
export function assertOperateIntelligencePlanContractV2(value) {
|
|
657
|
+
const plan = assertProtocolArtifact('operating-intelligence-plan', value, {
|
|
658
|
+
protocolVersion: '2.0.0',
|
|
659
|
+
});
|
|
660
|
+
assertCanonicalOperateIntelligencePlanTopologyV2(plan);
|
|
661
|
+
return plan;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const schemaCache = new Map();
|
|
665
|
+
const canonicalSchemaPrefix = 'https://openplanr.dev/';
|
|
666
|
+
|
|
667
|
+
function loadSchema(path) {
|
|
668
|
+
if (!schemaCache.has(path)) {
|
|
669
|
+
schemaCache.set(path, JSON.parse(readFileSync(join(packageRoot, path), 'utf8')));
|
|
670
|
+
}
|
|
671
|
+
return schemaCache.get(path);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function assertCompiledOperateSchemaIdentities() {
|
|
675
|
+
for (const { id, version, schemaPath } of OPERATE_CONTRACT_CATALOG_V2.contracts) {
|
|
676
|
+
const schema = loadSchema(schemaPath);
|
|
677
|
+
const expectedId = `https://openplanr.dev/${schemaPath}`;
|
|
678
|
+
const declared = schema?.['x-openplanr-contract'];
|
|
679
|
+
if (
|
|
680
|
+
schema?.$schema !== 'https://json-schema.org/draft/2020-12/schema'
|
|
681
|
+
|| schema?.$id !== expectedId
|
|
682
|
+
|| declared?.id !== id
|
|
683
|
+
|| declared?.version !== version
|
|
684
|
+
) {
|
|
685
|
+
throw new PipelineError(
|
|
686
|
+
'E_SCHEMA_VERSION_UNSUPPORTED',
|
|
687
|
+
`The packaged Operate schema ${schemaPath} does not match compiler-owned identity ${id}@${version}.`,
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
assertCompiledOperateSchemaIdentities();
|
|
694
|
+
|
|
695
|
+
function requireOperateRoleMandate(roleId, roleVersion) {
|
|
696
|
+
if (typeof roleVersion !== 'string' || roleVersion.length === 0) {
|
|
697
|
+
throw new PipelineError(
|
|
698
|
+
'E_SCHEMA_VERSION_REQUIRED',
|
|
699
|
+
`Operate role mandate "${roleId}" requires an explicit version.`,
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
const mandate = OPERATE_ROLE_MANDATES_V2.find(({ id, version }) => id === roleId && version === roleVersion);
|
|
703
|
+
if (!mandate) {
|
|
704
|
+
throw new PipelineError(
|
|
705
|
+
'E_SCHEMA_VERSION_UNSUPPORTED',
|
|
706
|
+
`Operate role mandate "${roleId}" does not support version ${roleVersion}.`,
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
return mandate;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Resolve the exact mandate that an Operate Assignment can advertise. The
|
|
714
|
+
* caller supplies a role version deliberately; no previous role version is
|
|
715
|
+
* selected as a fallback.
|
|
716
|
+
*/
|
|
717
|
+
export function loadOperateRoleMandateV2(roleId, { roleVersion } = {}) {
|
|
718
|
+
const mandate = requireOperateRoleMandate(roleId, roleVersion);
|
|
719
|
+
return structuredClone(mandate);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Reject an advertised role output contract unless it is byte-for-byte equal
|
|
724
|
+
* to the compiler-owned schema identity, media type, and maximum byte budget.
|
|
725
|
+
* The runtime continues to validate the resulting Assignment at submission;
|
|
726
|
+
* this boundary makes the advertised template and that validation input one
|
|
727
|
+
* explicit, versioned contract.
|
|
728
|
+
*/
|
|
729
|
+
export function assertOperateRoleOutputContractV2(roleId, outputContract, { roleVersion } = {}) {
|
|
730
|
+
const mandate = requireOperateRoleMandate(roleId, roleVersion);
|
|
731
|
+
const expected = mandate.output;
|
|
732
|
+
const actual = outputContract ?? {};
|
|
733
|
+
for (const field of ['schemaId', 'schemaVersion', 'mediaType', 'maxBytes']) {
|
|
734
|
+
if (actual[field] !== expected[field]) {
|
|
735
|
+
throw new PipelineError(
|
|
736
|
+
'E_PROTOCOL_ARTIFACT_INVALID',
|
|
737
|
+
`Operate role mandate "${roleId}" has an invalid advertised output ${field}.`,
|
|
738
|
+
'',
|
|
739
|
+
{ roleId, roleVersion, field, expected: expected[field], actual: actual[field] },
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
const schema = resolveProtocolSchema(expected.schemaId, { protocolVersion: expected.schemaVersion });
|
|
744
|
+
return {
|
|
745
|
+
...structuredClone(expected),
|
|
746
|
+
path: schema.path,
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function referencedSchemaPath(basePath, reference) {
|
|
751
|
+
const referenceWithoutFragment = reference.split('#', 1)[0];
|
|
752
|
+
const requested = referenceWithoutFragment.startsWith(canonicalSchemaPrefix)
|
|
753
|
+
? referenceWithoutFragment.slice(canonicalSchemaPrefix.length)
|
|
754
|
+
: join(dirname(basePath), referenceWithoutFragment);
|
|
755
|
+
const absolute = resolve(packageRoot, requested);
|
|
756
|
+
// `relative` yields platform separators, so normalize to POSIX before any
|
|
757
|
+
// containment check. On Windows the raw value is `schemas\v1.2.0\...`, which
|
|
758
|
+
// both fails the `schemas/` prefix test and hides `\..\` from the traversal
|
|
759
|
+
// guard — the check has to be separator-independent to be either correct or
|
|
760
|
+
// safe.
|
|
761
|
+
const packageRelative = relative(packageRoot, absolute).split(sep).join('/');
|
|
762
|
+
if (
|
|
763
|
+
packageRelative.startsWith('..')
|
|
764
|
+
|| packageRelative.includes('/../')
|
|
765
|
+
|| !packageRelative.startsWith('schemas/')
|
|
766
|
+
) {
|
|
767
|
+
throw new PipelineError(
|
|
768
|
+
'E_SCHEMA_REFERENCE_UNSAFE',
|
|
769
|
+
`Schema reference "${reference}" escapes the packaged schema directory.`,
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
return packageRelative;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
function resolveSchemaFragment(schema, reference) {
|
|
776
|
+
const fragmentIndex = reference.indexOf('#');
|
|
777
|
+
if (fragmentIndex < 0 || reference.slice(fragmentIndex) === '#') return schema;
|
|
778
|
+
const fragment = reference.slice(fragmentIndex);
|
|
779
|
+
if (!fragment.startsWith('#/')) return null;
|
|
780
|
+
return fragment.slice(2).split('/').reduce(
|
|
781
|
+
(value, part) => value?.[part.replaceAll('~1', '/').replaceAll('~0', '~')],
|
|
782
|
+
schema,
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function compareProtocolVersions(left, right) {
|
|
787
|
+
const leftParts = left.split('.').map(Number);
|
|
788
|
+
const rightParts = right.split('.').map(Number);
|
|
789
|
+
for (let index = 0; index < Math.max(leftParts.length, rightParts.length); index += 1) {
|
|
790
|
+
const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
|
|
791
|
+
if (difference !== 0) return difference;
|
|
792
|
+
}
|
|
793
|
+
return 0;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function inferredVersion(kind, value, explicitVersion) {
|
|
797
|
+
if (explicitVersion) return explicitVersion;
|
|
798
|
+
if (typeof value?.protocolVersion === 'string') return value.protocolVersion;
|
|
799
|
+
if (explicitProtocolVersionKinds.has(kind)) {
|
|
800
|
+
throw new PipelineError(
|
|
801
|
+
'E_SCHEMA_VERSION_REQUIRED',
|
|
802
|
+
`Protocol artifact "${kind}" requires an explicit protocolVersion.`,
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
const versions = Object.keys(PROTOCOL_SCHEMA_REGISTRY[kind] ?? {});
|
|
806
|
+
if (versions.length === 1) return versions[0];
|
|
807
|
+
if (versions.length > 1) {
|
|
808
|
+
// The value is version-agnostic (for example the compact advisor response,
|
|
809
|
+
// which carries no protocol envelope). Additively resolve to the earliest
|
|
810
|
+
// registered version so a v1.2 reader keeps validating v1.2 artifacts
|
|
811
|
+
// unchanged; v1.3 callers pass protocolVersion explicitly.
|
|
812
|
+
return [...versions].sort(compareProtocolVersions)[0];
|
|
813
|
+
}
|
|
814
|
+
throw new PipelineError(
|
|
815
|
+
'E_SCHEMA_VERSION_REQUIRED',
|
|
816
|
+
`Protocol artifact "${kind}" supports multiple versions; pass protocolVersion explicitly.`,
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
export function listProtocolSchemas() {
|
|
821
|
+
return Object.entries(PROTOCOL_SCHEMA_REGISTRY).flatMap(([kind, versions]) => (
|
|
822
|
+
Object.entries(versions).map(([protocolVersion, path]) => ({ kind, protocolVersion, path }))
|
|
823
|
+
));
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
export function resolveProtocolSchema(kind, { protocolVersion } = {}) {
|
|
827
|
+
const versions = PROTOCOL_SCHEMA_REGISTRY[kind];
|
|
828
|
+
if (!versions) throw new PipelineError('E_SCHEMA_UNKNOWN', `Unknown protocol artifact kind: ${kind}`);
|
|
829
|
+
const path = versions[protocolVersion];
|
|
830
|
+
if (!path) {
|
|
831
|
+
throw new PipelineError(
|
|
832
|
+
'E_SCHEMA_VERSION_UNSUPPORTED',
|
|
833
|
+
`Protocol artifact "${kind}" does not support version ${protocolVersion}.`,
|
|
834
|
+
`Supported versions: ${Object.keys(versions).join(', ')}.`,
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
return { kind, protocolVersion, path, schema: structuredClone(loadSchema(path)) };
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/** Resolve a public experience schema without adding it to the 61-contract runtime kernel. */
|
|
841
|
+
export function resolveOperateExperienceSchemaV2(kind, { protocolVersion } = {}) {
|
|
842
|
+
const versions = experiencePaths[kind];
|
|
843
|
+
if (!versions) throw new PipelineError('E_SCHEMA_UNKNOWN', `Unknown Operate experience artifact kind: ${kind}`);
|
|
844
|
+
if (protocolVersion !== '2.0.0') {
|
|
845
|
+
throw new PipelineError(
|
|
846
|
+
protocolVersion ? 'E_SCHEMA_VERSION_UNSUPPORTED' : 'E_SCHEMA_VERSION_REQUIRED',
|
|
847
|
+
protocolVersion
|
|
848
|
+
? `Operate experience artifact "${kind}" does not support version ${protocolVersion}.`
|
|
849
|
+
: `Operate experience artifact "${kind}" requires an explicit protocolVersion.`,
|
|
850
|
+
'Supported versions: 2.0.0.',
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
const path = versions[protocolVersion];
|
|
854
|
+
return { kind, protocolVersion, path, schema: structuredClone(loadSchema(path)) };
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
function validateResolvedArtifact(value, resolved) {
|
|
858
|
+
return validateJson(value, resolved.schema, {
|
|
859
|
+
base: resolved.path,
|
|
860
|
+
resolveRef(reference, { base } = {}) {
|
|
861
|
+
const path = referencedSchemaPath(
|
|
862
|
+
typeof base === 'string' && !base.startsWith('https://') ? base : resolved.path,
|
|
863
|
+
reference,
|
|
864
|
+
);
|
|
865
|
+
const rootSchema = structuredClone(loadSchema(path));
|
|
866
|
+
const schema = resolveSchemaFragment(rootSchema, reference);
|
|
867
|
+
return { schema, rootSchema, base: path };
|
|
868
|
+
},
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
const GUIDED_ANSWER_COPY_FIELDS = Object.freeze([
|
|
873
|
+
'questionId',
|
|
874
|
+
'questionVersion',
|
|
875
|
+
'sensitivity',
|
|
876
|
+
]);
|
|
877
|
+
|
|
878
|
+
function guidedQuestionnaireCompatibilityErrors(value) {
|
|
879
|
+
const copyFields = value?.submission?.envelope?.dynamicFields?.answers?.copyFields;
|
|
880
|
+
if (
|
|
881
|
+
!Array.isArray(copyFields)
|
|
882
|
+
|| JSON.stringify(copyFields) === JSON.stringify(GUIDED_ANSWER_COPY_FIELDS)
|
|
883
|
+
) return [];
|
|
884
|
+
return [{
|
|
885
|
+
path: '$.submission.envelope.dynamicFields.answers.copyFields',
|
|
886
|
+
rule: 'exactAnswerCopyFields',
|
|
887
|
+
detail: 'answer copy fields must match the guided answer envelope schema',
|
|
888
|
+
}];
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
export function validateProtocolArtifact(kind, value, { protocolVersion } = {}) {
|
|
892
|
+
const version = inferredVersion(kind, value, protocolVersion);
|
|
893
|
+
const resolved = resolveProtocolSchema(kind, { protocolVersion: version });
|
|
894
|
+
const errors = validateResolvedArtifact(value, resolved);
|
|
895
|
+
if (kind === 'guided-questionnaire' && version === '1.2.0') {
|
|
896
|
+
errors.push(...guidedQuestionnaireCompatibilityErrors(value));
|
|
897
|
+
}
|
|
898
|
+
return errors;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Validate the dashboard bootstrap schema plus invariants JSON Schema cannot
|
|
903
|
+
* express, most importantly equality of the served and embedded build IDs.
|
|
904
|
+
*/
|
|
905
|
+
export function validateDashboardBootstrapV1(value) {
|
|
906
|
+
const errors = validateProtocolArtifact('dashboard-bootstrap', value, {
|
|
907
|
+
protocolVersion: '1.2.0',
|
|
908
|
+
});
|
|
909
|
+
if (errors.length) return errors;
|
|
910
|
+
|
|
911
|
+
const buildId = value.ui.buildId;
|
|
912
|
+
const expectedBuildId = value.ui.expectedBuildId;
|
|
913
|
+
const reasons = value.compatibility.reasonCodes;
|
|
914
|
+
const mismatch = buildId !== expectedBuildId;
|
|
915
|
+
const hasMismatchReason = reasons.includes('DASHBOARD_BUILD_MISMATCH');
|
|
916
|
+
if (mismatch !== hasMismatchReason) {
|
|
917
|
+
errors.push({
|
|
918
|
+
path: '$.compatibility.reasonCodes',
|
|
919
|
+
rule: 'semantic',
|
|
920
|
+
detail: 'DASHBOARD_BUILD_MISMATCH must exactly reflect unequal non-null build identities',
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
if (value.compatibility.status === 'compatible' && buildId !== expectedBuildId) {
|
|
924
|
+
errors.push({
|
|
925
|
+
path: '$.ui',
|
|
926
|
+
rule: 'semantic',
|
|
927
|
+
detail: 'compatible dashboard build identities must be equal',
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
for (const product of ['planning', 'operate']) {
|
|
931
|
+
const root = value.queryRoots[product];
|
|
932
|
+
if (root !== null && root.projectId !== value.project.projectId) {
|
|
933
|
+
errors.push({
|
|
934
|
+
path: `$.queryRoots.${product}.projectId`,
|
|
935
|
+
rule: 'semantic',
|
|
936
|
+
detail: 'dashboard query roots must belong to the exact bootstrap project',
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return errors;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
/** Assert the complete public dashboard bootstrap contract. */
|
|
944
|
+
export function assertDashboardBootstrapV1(value) {
|
|
945
|
+
const errors = validateDashboardBootstrapV1(value);
|
|
946
|
+
if (errors.length) {
|
|
947
|
+
throw new PipelineError(
|
|
948
|
+
'E_PROTOCOL_ARTIFACT_INVALID',
|
|
949
|
+
`dashboard-bootstrap: ${errors[0].path} ${errors[0].detail}`,
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
return value;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
export function validateOperateExperienceArtifactV2(kind, value) {
|
|
956
|
+
const resolved = resolveOperateExperienceSchemaV2(kind, { protocolVersion: '2.0.0' });
|
|
957
|
+
return validateResolvedArtifact(value, resolved);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
export function assertOperateExperienceArtifactV2(kind, value) {
|
|
961
|
+
const errors = validateOperateExperienceArtifactV2(kind, value);
|
|
962
|
+
if (errors.length) {
|
|
963
|
+
throw new PipelineError('E_PROTOCOL_ARTIFACT_INVALID', `${kind}: ${errors[0].path} ${errors[0].detail}`);
|
|
964
|
+
}
|
|
965
|
+
return value;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export function assertProtocolArtifact(kind, value, options) {
|
|
969
|
+
const errors = validateProtocolArtifact(kind, value, options);
|
|
970
|
+
if (errors.length) {
|
|
971
|
+
throw new PipelineError(
|
|
972
|
+
'E_PROTOCOL_ARTIFACT_INVALID',
|
|
973
|
+
`${kind}: ${errors[0].path} ${errors[0].detail}`,
|
|
974
|
+
'',
|
|
975
|
+
{ errors },
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
return value;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/** Validate only one of the three Phase 6 data-only registration contracts. */
|
|
982
|
+
export function assertOperateGovernedExtensionRegistrationV2(kind, value) {
|
|
983
|
+
if (!OPERATE_GOVERNED_PROVIDER_REGISTRATION_CONTRACT_KINDS_V2.includes(kind)) {
|
|
984
|
+
throw new PipelineError(
|
|
985
|
+
'E_SCHEMA_UNKNOWN',
|
|
986
|
+
`Unknown governed Operate extension registration kind: ${kind}`,
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
return assertProtocolArtifact(kind, value, { protocolVersion: '2.0.0' });
|
|
990
|
+
}
|