@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,258 @@
|
|
|
1
|
+
import { validateJson } from '../../src/json-schema.mjs';
|
|
2
|
+
import { assertOperateReviewWorkspacePayloadSafeV1 } from './operate-review-payload-safety.mjs';
|
|
3
|
+
import {
|
|
4
|
+
contentHash,
|
|
5
|
+
deepFreeze,
|
|
6
|
+
exactEventHead,
|
|
7
|
+
exactJson,
|
|
8
|
+
jcsHash,
|
|
9
|
+
safeDataClone,
|
|
10
|
+
} from './closed-json-contract.mjs';
|
|
11
|
+
import {
|
|
12
|
+
OPERATE_ALLOWED_ACTION_SCHEMA_REVIEW_SLICE as allowedActionSchema,
|
|
13
|
+
OPERATE_EXPERIENCE_VIEW_SCHEMA_REVIEW_SLICE as experienceViewSchema,
|
|
14
|
+
OPERATE_REVIEW_DISPLAY_WORKSPACE_SCHEMA_REVIEW_SLICE as reviewWorkspaceSchema,
|
|
15
|
+
OPERATING_ASSIGNMENT_SCHEMA_REVIEW_SLICE as assignmentSchema,
|
|
16
|
+
OPERATING_EVIDENCE_RESOLUTION_SCHEMA_REVIEW_SLICE as evidenceResolutionSchema,
|
|
17
|
+
OPERATING_REVIEW_READ_SCHEMA_REVIEW_SLICE as reviewReadSchema,
|
|
18
|
+
OPERATING_REVIEW_RECEIPT_SCHEMA_REVIEW_SLICE as reviewReceiptSchema,
|
|
19
|
+
OPERATING_REVIEW_SCHEMA_REVIEW_SLICE as reviewSchema,
|
|
20
|
+
OPERATING_TRACE_MATRIX_SCHEMA_REVIEW_SLICE as traceMatrixSchema,
|
|
21
|
+
} from './generated/operate-review-schema-data.mjs';
|
|
22
|
+
|
|
23
|
+
export const OPERATE_REVIEW_DISPLAY_WORKSPACE_DOMAIN =
|
|
24
|
+
'openplanr:operate-review-display-workspace:1.0.0';
|
|
25
|
+
|
|
26
|
+
const schemas = new Map([
|
|
27
|
+
['operate-allowed-action.schema.json', allowedActionSchema],
|
|
28
|
+
['operate-experience-view.schema.json', experienceViewSchema],
|
|
29
|
+
['operate-review-display-workspace.schema.json', reviewWorkspaceSchema],
|
|
30
|
+
['operating-assignment.schema.json', assignmentSchema],
|
|
31
|
+
['operating-evidence-resolution.schema.json', evidenceResolutionSchema],
|
|
32
|
+
['operating-review-read.schema.json', reviewReadSchema],
|
|
33
|
+
['operating-review-receipt.schema.json', reviewReceiptSchema],
|
|
34
|
+
['operating-review.schema.json', reviewSchema],
|
|
35
|
+
['operating-trace-matrix.schema.json', traceMatrixSchema],
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
function jsonPointer(root, fragment) {
|
|
39
|
+
if (!fragment || fragment === '#') return root;
|
|
40
|
+
if (!fragment.startsWith('#/')) return null;
|
|
41
|
+
return fragment
|
|
42
|
+
.slice(2)
|
|
43
|
+
.split('/')
|
|
44
|
+
.map((part) => part.replaceAll('~1', '/').replaceAll('~0', '~'))
|
|
45
|
+
.reduce((value, part) => value?.[part], root);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function resolveSchemaRef(reference) {
|
|
49
|
+
const [path, pointer = ''] = reference.split('#');
|
|
50
|
+
const filename = path.split('/').at(-1);
|
|
51
|
+
const rootSchema = schemas.get(filename);
|
|
52
|
+
if (!rootSchema) return null;
|
|
53
|
+
return {
|
|
54
|
+
schema: jsonPointer(rootSchema, pointer ? `#${pointer}` : '#'),
|
|
55
|
+
rootSchema,
|
|
56
|
+
base: filename,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function invalid() {
|
|
61
|
+
return [{ path: '$', rule: 'closedContract', detail: 'does not satisfy the closed Review display workspace contract' }];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function unique(records, field) {
|
|
65
|
+
return new Set(records.map((record) => record[field])).size === records.length;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function exactExpected(payload, expected) {
|
|
69
|
+
if (!expected) return true;
|
|
70
|
+
return payload.actorId === expected.actorId
|
|
71
|
+
&& payload.scopeId === expected.scopeId
|
|
72
|
+
&& payload.domainId === expected.domainId
|
|
73
|
+
&& payload.domainVersion === expected.domainVersion
|
|
74
|
+
&& payload.cycleId === expected.cycleId
|
|
75
|
+
&& payload.reviewId === expected.reviewId
|
|
76
|
+
&& payload.sourceArtifactKind === expected.sourceArtifactKind
|
|
77
|
+
&& payload.sourceArtifactHash === expected.sourceArtifactHash
|
|
78
|
+
&& payload.sourceViewHash === expected.sourceViewHash
|
|
79
|
+
&& exactEventHead(payload.sourceEventHead, expected.sourceEventHead)
|
|
80
|
+
&& exactEventHead(payload.sourceReadEventHead, expected.sourceReadEventHead);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function validSummary(summary) {
|
|
84
|
+
const stageStates = ['complete', 'current', 'available', 'waiting', 'blocked', 'failed', 'skipped', 'uncertain', 'revisited'];
|
|
85
|
+
if (summary.stages.total !== summary.stages.cycles * 7
|
|
86
|
+
|| summary.stages.byStage.length !== 7
|
|
87
|
+
|| new Set(summary.stages.byStage.map(({ id }) => id)).size !== 7
|
|
88
|
+
|| stageStates.some((state) => summary.stages[state] !== summary.stages.byStage.reduce((total, stage) => total + stage[state], 0))
|
|
89
|
+
|| summary.seats.terminal !== summary.seats.validated + summary.seats.rejected + summary.seats.failed + summary.seats.abandoned
|
|
90
|
+
|| summary.seats.total !== summary.seats.terminal + summary.seats.active + summary.seats.pending
|
|
91
|
+
|| summary.evidence.total !== summary.evidence.available + summary.evidence.restricted
|
|
92
|
+
|| summary.evidence.total !== summary.evidence.current + summary.evidence.historical + summary.evidence.stale
|
|
93
|
+
|| summary.evidence.linked > summary.evidence.total
|
|
94
|
+
|| summary.proof.linkedEvidence !== summary.evidence.linked
|
|
95
|
+
|| summary.proof.restrictedEvidence !== summary.evidence.restricted
|
|
96
|
+
|| summary.proof.resolvedClaims !== summary.claims.supported + summary.claims.contradicted
|
|
97
|
+
|| summary.proof.unresolvedClaims !== summary.claims.uncertain + summary.claims.unknown + summary.claims.restricted
|
|
98
|
+
|| summary.claims.total !== summary.proof.resolvedClaims + summary.proof.unresolvedClaims
|
|
99
|
+
|| summary.verification.total !== summary.verification.verified + summary.verification.unverified
|
|
100
|
+
+ summary.verification.notRequired + summary.verification.insufficientEvidence
|
|
101
|
+
|| summary.proof.verifiedOutcomes !== summary.verification.verified
|
|
102
|
+
|| summary.proof.unverifiedOutcomes !== summary.verification.unverified + summary.verification.insufficientEvidence
|
|
103
|
+
|| summary.omissions.total !== summary.omissions.restricted + summary.omissions.absent) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function validChoice(choice, payload) {
|
|
110
|
+
return choice.choiceHash === jcsHash(choice.submitArguments)
|
|
111
|
+
&& choice.submitArguments.reviewId === payload.reviewId
|
|
112
|
+
&& choice.submitArguments.cycleId === payload.cycleId
|
|
113
|
+
&& choice.submitArguments.actor.actorId === payload.actorId
|
|
114
|
+
&& exactJson(choice.submitArguments.scope, {
|
|
115
|
+
scopeId: payload.scopeId,
|
|
116
|
+
domainId: payload.domainId,
|
|
117
|
+
domainVersion: payload.domainVersion,
|
|
118
|
+
})
|
|
119
|
+
&& exactJson(choice.requiredDispositions, choice.submitArguments.workDispositions)
|
|
120
|
+
&& choice.reversibility === 'immutable-review-event';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function validCapability(payload) {
|
|
124
|
+
const { capability, choices } = payload.data;
|
|
125
|
+
if (!capability.available) return capability.actions.length === 0 && payload.mutationEnabled === false;
|
|
126
|
+
if (payload.sourceArtifactKind !== 'operating-review-read'
|
|
127
|
+
|| payload.status !== 'ready'
|
|
128
|
+
|| payload.mutationEnabled !== true
|
|
129
|
+
|| capability.actions.length !== choices.length) return false;
|
|
130
|
+
const choiceByArguments = new Map(choices.map((choice) => [jcsHash(choice.submitArguments), choice]));
|
|
131
|
+
if (choiceByArguments.size !== choices.length) return false;
|
|
132
|
+
const matched = new Set();
|
|
133
|
+
for (const action of capability.actions) {
|
|
134
|
+
const digest = jcsHash(action.action.arguments);
|
|
135
|
+
if (action.subjectId !== payload.reviewId
|
|
136
|
+
|| action.action.tool !== 'operate.review.submit'
|
|
137
|
+
|| action.action.effect !== 'project-write'
|
|
138
|
+
|| !choiceByArguments.has(digest)) return false;
|
|
139
|
+
matched.add(digest);
|
|
140
|
+
}
|
|
141
|
+
return matched.size === choices.length;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function validTerminalDisposition(payload) {
|
|
145
|
+
const disposition = payload.data.terminalDisposition;
|
|
146
|
+
if (payload.sourceArtifactKind === 'operating-review-read') {
|
|
147
|
+
return disposition === null
|
|
148
|
+
&& payload.data.review.state === 'pending'
|
|
149
|
+
&& payload.data.review.disposition === null
|
|
150
|
+
&& payload.data.choices.length > 0
|
|
151
|
+
&& exactEventHead(payload.sourceReadEventHead, payload.sourceEventHead);
|
|
152
|
+
}
|
|
153
|
+
return payload.status === 'terminal'
|
|
154
|
+
&& payload.reasonCodes.includes('REVIEW_TERMINAL')
|
|
155
|
+
&& payload.mutationEnabled === false
|
|
156
|
+
&& payload.data.choices.length === 0
|
|
157
|
+
&& payload.data.capability.available === false
|
|
158
|
+
&& payload.data.capability.actions.length === 0
|
|
159
|
+
&& payload.data.capability.reason.code === 'REVIEW_TERMINAL'
|
|
160
|
+
&& disposition !== null
|
|
161
|
+
&& disposition.decision === payload.data.review.state
|
|
162
|
+
&& payload.data.review.disposition === disposition.decision
|
|
163
|
+
&& exactJson(payload.data.review.workDispositions, disposition.appliedWorkDispositions)
|
|
164
|
+
&& exactEventHead(disposition.readEventHead, payload.sourceReadEventHead)
|
|
165
|
+
&& exactEventHead(disposition.eventHead, payload.sourceEventHead);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function validWorkspaceSemantics(value, expected) {
|
|
169
|
+
const { payload, integrity } = value;
|
|
170
|
+
const { data } = payload;
|
|
171
|
+
if (integrity.domain !== OPERATE_REVIEW_DISPLAY_WORKSPACE_DOMAIN
|
|
172
|
+
|| integrity.sourceArtifactKind !== payload.sourceArtifactKind
|
|
173
|
+
|| integrity.sourceViewHash !== payload.sourceViewHash
|
|
174
|
+
|| integrity.sourceArtifactHash !== payload.sourceArtifactHash
|
|
175
|
+
|| data.review.reviewId !== payload.reviewId
|
|
176
|
+
|| data.review.cycleId !== payload.cycleId
|
|
177
|
+
|| data.policyBinding.ownerActorId !== data.review.ownerActorId
|
|
178
|
+
|| data.policyBinding.actorMatchesOwner !== (payload.actorId === data.review.ownerActorId)
|
|
179
|
+
|| data.policyBinding.actorMatchesOwner !== true
|
|
180
|
+
|| !exactEventHead(data.truthSummary.sourceEventHead, payload.sourceEventHead)
|
|
181
|
+
|| data.truthSummary.sourceViewHash !== payload.sourceViewHash
|
|
182
|
+
|| data.executiveSummary.decisionCount !== data.recommendation.items.length
|
|
183
|
+
|| data.executiveSummary.findingCount !== data.findings.length
|
|
184
|
+
|| data.executiveSummary.dissentCount !== data.dissent.length
|
|
185
|
+
|| data.executiveSummary.gapCount !== data.gaps.length
|
|
186
|
+
|| data.executiveSummary.uncertaintyCount !== data.uncertainty.length
|
|
187
|
+
|| !unique(data.choices, 'choiceId')
|
|
188
|
+
|| !unique(data.findings, 'findingId')
|
|
189
|
+
|| !unique(data.dissent, 'localDissentId')
|
|
190
|
+
|| !unique(data.uncertainty, 'uncertaintyId')
|
|
191
|
+
|| !unique(data.gaps, 'absenceId')
|
|
192
|
+
|| !unique(data.claims, 'claimId')
|
|
193
|
+
|| !unique(data.evidence, 'evidenceRefId')
|
|
194
|
+
|| data.choices.some((choice) => !validChoice(choice, payload))
|
|
195
|
+
|| !validCapability(payload)
|
|
196
|
+
|| !validTerminalDisposition(payload)
|
|
197
|
+
|| !validSummary(data.truthSummary)
|
|
198
|
+
|| !exactExpected(payload, expected)) return false;
|
|
199
|
+
try {
|
|
200
|
+
assertOperateReviewWorkspacePayloadSafeV1(payload);
|
|
201
|
+
} catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function validateOperateReviewDisplayWorkspaceV1(value, expected) {
|
|
208
|
+
try {
|
|
209
|
+
const clone = safeDataClone(value);
|
|
210
|
+
const errors = validateJson(clone, reviewWorkspaceSchema, {
|
|
211
|
+
base: 'schemas/v2.0.0/operate-review-display-workspace.schema.json',
|
|
212
|
+
resolveRef: resolveSchemaRef,
|
|
213
|
+
});
|
|
214
|
+
if (errors.length > 0 || !validWorkspaceSemantics(clone, expected)) {
|
|
215
|
+
return errors.length > 0 ? errors : invalid();
|
|
216
|
+
}
|
|
217
|
+
return clone.integrity.contentHash === contentHash(
|
|
218
|
+
clone.payload,
|
|
219
|
+
OPERATE_REVIEW_DISPLAY_WORKSPACE_DOMAIN,
|
|
220
|
+
) ? [] : invalid();
|
|
221
|
+
} catch {
|
|
222
|
+
return invalid();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function assertOperateReviewDisplayWorkspaceV1(value, expected) {
|
|
227
|
+
if (validateOperateReviewDisplayWorkspaceV1(value, expected).length > 0) {
|
|
228
|
+
const error = new TypeError('The Review display workspace does not satisfy its closed integrity contract.');
|
|
229
|
+
error.code = 'E_OPERATE_REVIEW_DISPLAY_INVALID';
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
return value;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function issueOperateReviewDisplayWorkspaceV1(payload) {
|
|
236
|
+
assertOperateReviewWorkspacePayloadSafeV1(payload);
|
|
237
|
+
const safePayload = safeDataClone(payload);
|
|
238
|
+
const issued = {
|
|
239
|
+
kind: 'operate-review-display-workspace',
|
|
240
|
+
schemaVersion: '1.0.0',
|
|
241
|
+
protocolVersion: '2.0.0',
|
|
242
|
+
payload: safePayload,
|
|
243
|
+
integrity: {
|
|
244
|
+
algorithm: 'sha-256-jcs',
|
|
245
|
+
domain: OPERATE_REVIEW_DISPLAY_WORKSPACE_DOMAIN,
|
|
246
|
+
sourceArtifactKind: safePayload.sourceArtifactKind,
|
|
247
|
+
sourceViewHash: safePayload.sourceViewHash,
|
|
248
|
+
sourceArtifactHash: safePayload.sourceArtifactHash,
|
|
249
|
+
contentHash: contentHash(safePayload, OPERATE_REVIEW_DISPLAY_WORKSPACE_DOMAIN),
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
assertOperateReviewDisplayWorkspaceV1(issued);
|
|
253
|
+
return deepFreeze(issued);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export const OPERATE_REVIEW_DISPLAY_WORKSPACE_SCHEMA_V1 = Object.freeze(
|
|
257
|
+
structuredClone(reviewWorkspaceSchema),
|
|
258
|
+
);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type OperateReviewUnsafeTextReasonV1 = 'private-path' | 'secret';
|
|
2
|
+
|
|
3
|
+
export function classifyOperateReviewUnsafeTextV1(
|
|
4
|
+
value: string,
|
|
5
|
+
): OperateReviewUnsafeTextReasonV1 | null;
|
|
6
|
+
|
|
7
|
+
export function assertOperateReviewWorkspacePayloadSafeV1<T>(payload: T): T;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const PRIVATE_PATH = /(?:\bfile:\/\/|(?:^|[\s"'(=])\/(?:Users|home|private|tmp|var|Volumes|etc|opt|root|srv)\/|\b[A-Za-z]:\\(?:Users|Documents and Settings|Windows|ProgramData)\\)/u;
|
|
2
|
+
const SECRET_BODY = /(?:-----BEGIN [A-Z ]*PRIVATE KEY-----|\b(?:api[_-]?key|access[_-]?token|refresh[_-]?token|password|passwd|authorization|client[_-]?secret)\s*[:=]\s*[^\s,;]+|\bBearer\s+[A-Za-z0-9._~+\/-]{12,})/iu;
|
|
3
|
+
|
|
4
|
+
function unsafeReviewWorkspaceError(path, reason) {
|
|
5
|
+
const error = new Error('Review workspace contains unsafe display text.');
|
|
6
|
+
error.name = 'PipelineError';
|
|
7
|
+
error.code = 'E_OPERATE_REVIEW_WORKSPACE_UNSAFE';
|
|
8
|
+
error.fix = '';
|
|
9
|
+
error.details = { retryable: false, context: { path, reason } };
|
|
10
|
+
error.toJSON = () => ({
|
|
11
|
+
ok: false,
|
|
12
|
+
code: error.code,
|
|
13
|
+
problem: error.message,
|
|
14
|
+
details: error.details,
|
|
15
|
+
});
|
|
16
|
+
return error;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function classifyOperateReviewUnsafeTextV1(value) {
|
|
20
|
+
if (PRIVATE_PATH.test(value)) return 'private-path';
|
|
21
|
+
if (SECRET_BODY.test(value)) return 'secret';
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function assertOperateReviewWorkspacePayloadSafeV1(payload) {
|
|
26
|
+
const walk = (value, path = '$') => {
|
|
27
|
+
if (typeof value === 'string') {
|
|
28
|
+
const reason = classifyOperateReviewUnsafeTextV1(value);
|
|
29
|
+
if (reason !== null) throw unsafeReviewWorkspaceError(path, reason);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
value.forEach((entry, index) => walk(entry, `${path}[${index}]`));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (value && typeof value === 'object') {
|
|
37
|
+
Object.entries(value).forEach(([field, nested]) => walk(nested, `${path}.${field}`));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
walk(payload);
|
|
41
|
+
return payload;
|
|
42
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
OperateAllowedActionV2,
|
|
3
|
+
OperateExperienceAccessLevelV1,
|
|
4
|
+
OperateExperienceClaimV1,
|
|
5
|
+
OperateExperienceEvidenceV1,
|
|
6
|
+
OperateExperienceEventHeadV1,
|
|
7
|
+
OperateExperienceViewV1,
|
|
8
|
+
OperatingReviewReadV2,
|
|
9
|
+
OperatingReviewReceiptV2,
|
|
10
|
+
OperatingReviewV2,
|
|
11
|
+
OperatingWorkDispositionV2,
|
|
12
|
+
OperatingTraceMatrixV2,
|
|
13
|
+
} from '../protocol/index.js';
|
|
14
|
+
|
|
15
|
+
export type OperateReviewWorkspaceSourceV1 =
|
|
16
|
+
| OperatingReviewReadV2
|
|
17
|
+
| OperatingReviewReceiptV2;
|
|
18
|
+
|
|
19
|
+
export type OperateSharedTruthEventHeadV1 =
|
|
20
|
+
| Readonly<{ sequence: 0; hash: null }>
|
|
21
|
+
| Readonly<{ sequence: number; hash: string }>;
|
|
22
|
+
|
|
23
|
+
export type OperateSharedTruthSummaryV1 = Readonly<{
|
|
24
|
+
kind: 'operate-shared-truth-summary';
|
|
25
|
+
schemaVersion: '1.0.0';
|
|
26
|
+
sourceEventHead: OperateSharedTruthEventHeadV1;
|
|
27
|
+
sourceViewHash: string;
|
|
28
|
+
stages: Readonly<{
|
|
29
|
+
cycles: number;
|
|
30
|
+
total: number;
|
|
31
|
+
complete: number;
|
|
32
|
+
current: number;
|
|
33
|
+
available: number;
|
|
34
|
+
waiting: number;
|
|
35
|
+
blocked: number;
|
|
36
|
+
failed: number;
|
|
37
|
+
skipped: number;
|
|
38
|
+
uncertain: number;
|
|
39
|
+
revisited: number;
|
|
40
|
+
byStage: ReadonlyArray<Readonly<{
|
|
41
|
+
id: 'observe' | 'understand' | 'decide' | 'govern' | 'act' | 'verify' | 'learn';
|
|
42
|
+
complete: number;
|
|
43
|
+
current: number;
|
|
44
|
+
available: number;
|
|
45
|
+
waiting: number;
|
|
46
|
+
blocked: number;
|
|
47
|
+
failed: number;
|
|
48
|
+
skipped: number;
|
|
49
|
+
uncertain: number;
|
|
50
|
+
revisited: number;
|
|
51
|
+
}>>;
|
|
52
|
+
}>;
|
|
53
|
+
proof: Readonly<{
|
|
54
|
+
status: 'verified' | 'unverified' | 'partial' | 'not-required';
|
|
55
|
+
linkedEvidence: number;
|
|
56
|
+
restrictedEvidence: number;
|
|
57
|
+
resolvedClaims: number;
|
|
58
|
+
unresolvedClaims: number;
|
|
59
|
+
verifiedOutcomes: number;
|
|
60
|
+
unverifiedOutcomes: number;
|
|
61
|
+
reasonCodes: readonly string[];
|
|
62
|
+
}>;
|
|
63
|
+
seats: Readonly<{
|
|
64
|
+
total: number;
|
|
65
|
+
terminal: number;
|
|
66
|
+
validated: number;
|
|
67
|
+
rejected: number;
|
|
68
|
+
failed: number;
|
|
69
|
+
abandoned: number;
|
|
70
|
+
active: number;
|
|
71
|
+
pending: number;
|
|
72
|
+
typedAbsences: number;
|
|
73
|
+
}>;
|
|
74
|
+
evidence: Readonly<{
|
|
75
|
+
total: number;
|
|
76
|
+
available: number;
|
|
77
|
+
restricted: number;
|
|
78
|
+
current: number;
|
|
79
|
+
historical: number;
|
|
80
|
+
stale: number;
|
|
81
|
+
linked: number;
|
|
82
|
+
omitted: number;
|
|
83
|
+
}>;
|
|
84
|
+
claims: Readonly<{
|
|
85
|
+
total: number;
|
|
86
|
+
supported: number;
|
|
87
|
+
contradicted: number;
|
|
88
|
+
uncertain: number;
|
|
89
|
+
unknown: number;
|
|
90
|
+
restricted: number;
|
|
91
|
+
}>;
|
|
92
|
+
verification: Readonly<{
|
|
93
|
+
total: number;
|
|
94
|
+
verified: number;
|
|
95
|
+
unverified: number;
|
|
96
|
+
notRequired: number;
|
|
97
|
+
insufficientEvidence: number;
|
|
98
|
+
}>;
|
|
99
|
+
attention: Readonly<{
|
|
100
|
+
total: number;
|
|
101
|
+
blocking: number;
|
|
102
|
+
actionable: number;
|
|
103
|
+
unavailable: number;
|
|
104
|
+
}>;
|
|
105
|
+
omissions: Readonly<{
|
|
106
|
+
total: number;
|
|
107
|
+
restricted: number;
|
|
108
|
+
absent: number;
|
|
109
|
+
reasonCodes: readonly string[];
|
|
110
|
+
}>;
|
|
111
|
+
}>;
|
|
112
|
+
|
|
113
|
+
export type OperateReviewDisplayChoiceV1 = Readonly<
|
|
114
|
+
OperatingReviewReadV2['dispositionChoices'][number] & {
|
|
115
|
+
consequence: string;
|
|
116
|
+
reversibility: 'immutable-review-event';
|
|
117
|
+
requiredDispositions: readonly OperatingWorkDispositionV2[];
|
|
118
|
+
}
|
|
119
|
+
>;
|
|
120
|
+
|
|
121
|
+
export type OperateReviewWorkspacePayloadV1 = Readonly<{
|
|
122
|
+
ok: true;
|
|
123
|
+
kind: 'operate-review-workspace';
|
|
124
|
+
schemaVersion: '1.0.0';
|
|
125
|
+
protocolVersion: '2.0.0';
|
|
126
|
+
readOnly: true;
|
|
127
|
+
mutationEnabled: boolean;
|
|
128
|
+
scopeId: string;
|
|
129
|
+
domainId: string;
|
|
130
|
+
domainVersion: string;
|
|
131
|
+
cycleId: string;
|
|
132
|
+
reviewId: string;
|
|
133
|
+
actorId: string;
|
|
134
|
+
accessLevel: OperateExperienceAccessLevelV1;
|
|
135
|
+
generatedAt: string;
|
|
136
|
+
sourceArtifactKind: OperateReviewWorkspaceSourceV1['kind'];
|
|
137
|
+
sourceArtifactHash: string;
|
|
138
|
+
sourceEventHead: OperateExperienceEventHeadV1;
|
|
139
|
+
sourceReadEventHead: OperateExperienceEventHeadV1;
|
|
140
|
+
sourceViewHash: string;
|
|
141
|
+
status: 'ready' | 'read-only' | 'stale' | 'partial' | 'blocked' | 'offline' | 'terminal';
|
|
142
|
+
reasonCodes: readonly string[];
|
|
143
|
+
data: Readonly<{
|
|
144
|
+
review: OperatingReviewV2;
|
|
145
|
+
policyBinding: Readonly<{
|
|
146
|
+
sourceContract: Readonly<{ id: 'operating-review'; version: '2.0.0' }>;
|
|
147
|
+
ownerActorId: string;
|
|
148
|
+
actorMatchesOwner: boolean;
|
|
149
|
+
authorityBoundary: 'review-only';
|
|
150
|
+
externalEffectsAuthorized: false;
|
|
151
|
+
}>;
|
|
152
|
+
executiveSummary: Readonly<{
|
|
153
|
+
text: string;
|
|
154
|
+
decisionCount: number;
|
|
155
|
+
actionCount: number;
|
|
156
|
+
findingCount: number;
|
|
157
|
+
dissentCount: number;
|
|
158
|
+
gapCount: number;
|
|
159
|
+
uncertaintyCount: number;
|
|
160
|
+
}>;
|
|
161
|
+
recommendation:
|
|
162
|
+
| Readonly<{ status: 'available'; items: ReadonlyArray<OperatingReviewReadV2['decisions'][number]>; absence: null }>
|
|
163
|
+
| Readonly<{ status: 'absent'; items: readonly []; absence: Readonly<{ code: string; message: string }> }>;
|
|
164
|
+
choices: readonly OperateReviewDisplayChoiceV1[];
|
|
165
|
+
findings: ReadonlyArray<OperatingReviewReadV2['findings'][number]>;
|
|
166
|
+
dissent: ReadonlyArray<OperatingReviewReadV2['dissent'][number]>;
|
|
167
|
+
uncertainty: ReadonlyArray<Readonly<{
|
|
168
|
+
uncertaintyId: string;
|
|
169
|
+
sourceKind: 'decision' | 'claim' | 'evidence' | 'gap';
|
|
170
|
+
sourceId: string;
|
|
171
|
+
statement: string;
|
|
172
|
+
}>>;
|
|
173
|
+
gaps: ReadonlyArray<OperatingReviewReadV2['gaps'][number]>;
|
|
174
|
+
claims: readonly OperateExperienceClaimV1[];
|
|
175
|
+
evidence: readonly OperateExperienceEvidenceV1[];
|
|
176
|
+
omissions: ReadonlyArray<Readonly<{
|
|
177
|
+
kind: 'restricted' | 'absent';
|
|
178
|
+
subject: 'evidence' | 'claim' | 'seat' | 'source';
|
|
179
|
+
count: number;
|
|
180
|
+
subjectIds: readonly string[];
|
|
181
|
+
reasonCode: string;
|
|
182
|
+
}>>;
|
|
183
|
+
traceMatrix: OperatingTraceMatrixV2 | null;
|
|
184
|
+
truthSummary: OperateSharedTruthSummaryV1;
|
|
185
|
+
terminalDisposition: null | Readonly<{
|
|
186
|
+
receiptId: string;
|
|
187
|
+
decision: OperatingReviewReceiptV2['decision'];
|
|
188
|
+
appliedChoiceId: string;
|
|
189
|
+
appliedChoiceHash: string;
|
|
190
|
+
appliedWorkDispositions: readonly OperatingWorkDispositionV2[];
|
|
191
|
+
readEventHead: OperateExperienceEventHeadV1;
|
|
192
|
+
eventHead: OperateExperienceEventHeadV1;
|
|
193
|
+
committedAt: string;
|
|
194
|
+
}>;
|
|
195
|
+
capability:
|
|
196
|
+
| Readonly<{
|
|
197
|
+
available: true;
|
|
198
|
+
actions: ReadonlyArray<Readonly<{ subjectId: string; action: OperateAllowedActionV2<'operate.review.submit'> }>>;
|
|
199
|
+
reason: null;
|
|
200
|
+
}>
|
|
201
|
+
| Readonly<{
|
|
202
|
+
available: false;
|
|
203
|
+
actions: readonly [];
|
|
204
|
+
reason: Readonly<{ code: string; message: string }>;
|
|
205
|
+
}>;
|
|
206
|
+
}>;
|
|
207
|
+
}>;
|
|
208
|
+
|
|
209
|
+
export function deriveOperateSharedTruthSummaryV1(
|
|
210
|
+
view: OperateExperienceViewV1,
|
|
211
|
+
): OperateSharedTruthSummaryV1;
|
|
212
|
+
|
|
213
|
+
export function assertOperateReviewWorkspacePayloadSafeV1<T>(payload: T): T;
|
|
214
|
+
|
|
215
|
+
export function buildOperateReviewWorkspacePayloadV1(
|
|
216
|
+
source: OperateReviewWorkspaceSourceV1,
|
|
217
|
+
view: OperateExperienceViewV1,
|
|
218
|
+
): OperateReviewWorkspacePayloadV1;
|