@wildo-ai/framework-knowledge 1.1.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 +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/framework-knowledge.definitions.d.ts +51 -0
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.definitions.js +1571 -0
- package/dist/esm/framework-knowledge.definitions.js.map +1 -0
- package/dist/esm/framework-knowledge.loader.d.ts +72 -0
- package/dist/esm/framework-knowledge.loader.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.loader.js +258 -0
- package/dist/esm/framework-knowledge.loader.js.map +1 -0
- package/dist/esm/framework-knowledge.schemas.d.ts +236 -0
- package/dist/esm/framework-knowledge.schemas.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.schemas.js +23 -0
- package/dist/esm/framework-knowledge.schemas.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +56 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts +200 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js +228 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +261 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +412 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +61 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +65 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +54 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts +43 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js +73 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +114 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +95 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +102 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts +258 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js +241 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts +241 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js +202 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts +82 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js +89 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts +56 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js +76 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts +30 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js +27 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts +31 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js +26 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +254 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +219 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts +180 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +302 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +249 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +286 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts +248 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js +227 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts +45 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js +48 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts +250 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +218 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -0
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -0
- package/dist/knowledge/manifest.json +45 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +407 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +69 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +556 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +47 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/method.md +344 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/playbook.json +43 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +259 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +83 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/method.md +321 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +79 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +185 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +66 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +737 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +44 -0
- package/dist/knowledge/playbooks/refinement.document-facts/method.md +261 -0
- package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +57 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/method.md +151 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +124 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/method.md +128 -0
- package/dist/knowledge/playbooks/top_down.business-model/playbook.json +102 -0
- package/dist/knowledge/playbooks/top_down.business-model/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +73 -0
- package/dist/knowledge/playbooks/top_down.capability-map/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/method.md +177 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/playbook.json +95 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/method.md +64 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/playbook.json +49 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/method.md +56 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/playbook.json +40 -0
- package/dist/knowledge/playbooks/top_down.market-research/method.md +68 -0
- package/dist/knowledge/playbooks/top_down.market-research/playbook.json +42 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +69 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/method.md +96 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +77 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +53 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +61 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/method.md +280 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/playbook.json +87 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/method.md +204 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/playbook.json +54 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +146 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +120 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/structured-artifact-action.json +1 -0
- package/dist/knowledge/references/application.database.migration-change-risk.md +28 -0
- package/dist/knowledge/references/assertions.authored-metadata.config.md +90 -0
- package/dist/knowledge/references/assertions.behaviors.wire-contracts.md +223 -0
- package/dist/knowledge/references/assertions.references.conventions.md +92 -0
- package/dist/knowledge/references/assertions.snapshot.validation.md +317 -0
- package/dist/knowledge/references/assertions.specification.config.md +287 -0
- package/dist/knowledge/references/brand.asset.config.md +167 -0
- package/dist/knowledge/references/brand.authored-metadata.config.md +51 -0
- package/dist/knowledge/references/brand.logo-direction.config.md +88 -0
- package/dist/knowledge/references/brand.name.config.md +46 -0
- package/dist/knowledge/references/brand.snapshot.config.md +76 -0
- package/dist/knowledge/references/brand.snapshot.validation.md +446 -0
- package/dist/knowledge/references/brand.visual-tone.config.md +56 -0
- package/dist/knowledge/references/build-plan.task-graph.config.md +198 -0
- package/dist/knowledge/references/business-model.authored-metadata.config.md +65 -0
- package/dist/knowledge/references/business-model.pricing-plan.config.md +122 -0
- package/dist/knowledge/references/business-model.references.conventions.md +99 -0
- package/dist/knowledge/references/business-model.snapshot.config.md +121 -0
- package/dist/knowledge/references/business-model.snapshot.validation.md +325 -0
- package/dist/knowledge/references/cli.market.generate-command.md +230 -0
- package/dist/knowledge/references/cli.market.utils.md +147 -0
- package/dist/knowledge/references/companion.introspection.behaviors.market.md +90 -0
- package/dist/knowledge/references/companion.introspection.handlers.market.md +42 -0
- package/dist/knowledge/references/companion.market.generation-service.md +270 -0
- package/dist/knowledge/references/companion.market.prompt-renderer.md +244 -0
- package/dist/knowledge/references/companion.technical-doc.service.md +809 -0
- package/dist/knowledge/references/engine.client-bundle.allow-list.md +125 -0
- package/dist/knowledge/references/engine.client-bundle.discipline.md +130 -0
- package/dist/knowledge/references/engine.client-bundle.external-connectors-public.discipline.md +55 -0
- package/dist/knowledge/references/engine.saas-technical-doc.config.md +215 -0
- package/dist/knowledge/references/engine.saas-website.config.md +331 -0
- package/dist/knowledge/references/example.authorization.unit-narrowing.declaration.md +24 -0
- package/dist/knowledge/references/example.backend.addon-wiring.module.md +55 -0
- package/dist/knowledge/references/example.backend.custom-operation.create-postfix.md +35 -0
- package/dist/knowledge/references/example.backend.operation.error-throw.md +17 -0
- package/dist/knowledge/references/example.config.app-shell.command-menu-items.md +63 -0
- package/dist/knowledge/references/example.config.app-shell.full.md +147 -0
- package/dist/knowledge/references/example.config.app-shell.hosted-components.md +45 -0
- package/dist/knowledge/references/example.config.app-shell.quick-switcher-fields.md +37 -0
- package/dist/knowledge/references/example.config.backend.billing-enable.md +20 -0
- package/dist/knowledge/references/example.config.backend.required-floors.md +46 -0
- package/dist/knowledge/references/example.config.design-system.full.md +162 -0
- package/dist/knowledge/references/example.config.navigation.full.md +71 -0
- package/dist/knowledge/references/example.config.provider.backend-scope-billing.md +27 -0
- package/dist/knowledge/references/example.data-seeding.minimal.md +114 -0
- package/dist/knowledge/references/example.email.template.minimal.md +54 -0
- package/dist/knowledge/references/example.engine.component-registration.lazy-load.md +16 -0
- package/dist/knowledge/references/example.engine.product-definitions.feature-and-profiles.md +146 -0
- package/dist/knowledge/references/example.flows-actors.chat-assistant.md +196 -0
- package/dist/knowledge/references/example.flows-actors.llm-agent-one-shot.md +174 -0
- package/dist/knowledge/references/example.i18n.label-generation.engine-barrel.md +15 -0
- package/dist/knowledge/references/example.infra.cdn.cloudflare.md +23 -0
- package/dist/knowledge/references/example.infra.cdn.generic.md +17 -0
- package/dist/knowledge/references/example.infra.environment-config.local.md +250 -0
- package/dist/knowledge/references/example.market.alternative.in-house-build.md +49 -0
- package/dist/knowledge/references/example.market.authored-metadata.md +32 -0
- package/dist/knowledge/references/example.market.buying-journey.core-icp.md +140 -0
- package/dist/knowledge/references/example.market.category.config.md +71 -0
- package/dist/knowledge/references/example.market.channel.community.md +39 -0
- package/dist/knowledge/references/example.market.feature-benefit.kano-threshold.md +67 -0
- package/dist/knowledge/references/example.market.feature-benefit.pain-reliever.md +65 -0
- package/dist/knowledge/references/example.market.icp.anti-target.md +47 -0
- package/dist/knowledge/references/example.market.icp.individual.md +82 -0
- package/dist/knowledge/references/example.market.icp.legal-entity-with-geographies.md +95 -0
- package/dist/knowledge/references/example.market.is-benefit-available.composition.md +40 -0
- package/dist/knowledge/references/example.market.job.emotional.md +27 -0
- package/dist/knowledge/references/example.market.job.functional.md +28 -0
- package/dist/knowledge/references/example.market.message-template.seeds.md +106 -0
- package/dist/knowledge/references/example.market.objection.pricing.md +39 -0
- package/dist/knowledge/references/example.market.persona.dmu-with-inheritance.md +62 -0
- package/dist/knowledge/references/example.market.persona.individual-self.md +51 -0
- package/dist/knowledge/references/example.market.positioning.per-icp.md +103 -0
- package/dist/knowledge/references/example.market.proof.metric.md +39 -0
- package/dist/knowledge/references/example.market.scoring.golden-case.md +46 -0
- package/dist/knowledge/references/example.market.scoring.no-coverage-zero.md +40 -0
- package/dist/knowledge/references/example.market.snapshot-validation.duplicate-journey-stage.md +36 -0
- package/dist/knowledge/references/example.market.snapshot-validation.errors-by-kind.md +55 -0
- package/dist/knowledge/references/example.market.snapshot-validation.objection-proof-benefit-mismatch.md +74 -0
- package/dist/knowledge/references/example.market.snapshot-validation.proof-without-support.md +32 -0
- package/dist/knowledge/references/example.market.snapshot-validation.threshold-without-job.md +44 -0
- package/dist/knowledge/references/example.market.snapshot.assembled.md +49 -0
- package/dist/knowledge/references/example.market.tone-of-voice.config.md +41 -0
- package/dist/knowledge/references/example.market.trigger.growth-milestone.md +43 -0
- package/dist/knowledge/references/example.module.companion-exports.full.md +142 -0
- package/dist/knowledge/references/example.module.registration.shared.md +16 -0
- package/dist/knowledge/references/example.module.relationships.actor-edge-back-to-scope-owner.md +47 -0
- package/dist/knowledge/references/example.module.relationships.discriminator.md +25 -0
- package/dist/knowledge/references/example.module.relationships.scope-membership-junction.md +25 -0
- package/dist/knowledge/references/example.provider.backend-module-shape.md +110 -0
- package/dist/knowledge/references/example.provider.contribution.backend-billing.md +12 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.contribution.md +30 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.module.md +21 -0
- package/dist/knowledge/references/example.rag.source-fields.declaration.md +83 -0
- package/dist/knowledge/references/example.rate-limit.custom-controller-surface.md +25 -0
- package/dist/knowledge/references/example.rate-limit.resource-operation-surface.md +24 -0
- package/dist/knowledge/references/example.resource.add-field.priority-enum.md +19 -0
- package/dist/knowledge/references/example.resource.add-resource.module-factory-map.md +21 -0
- package/dist/knowledge/references/example.resource.config-wiring.fk-relationship.md +33 -0
- package/dist/knowledge/references/example.resource.custom-view.read-host.md +28 -0
- package/dist/knowledge/references/example.resource.mcp-exposure.md +65 -0
- package/dist/knowledge/references/example.resource.reference-constraints.role-constrained.md +27 -0
- package/dist/knowledge/references/example.resource.ui-behavior.enum-badge.md +22 -0
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +43 -0
- package/dist/knowledge/references/example.spec.composite-view.workspace.md +72 -0
- package/dist/knowledge/references/example.spec.feature.flag-with-codehandling.md +64 -0
- package/dist/knowledge/references/example.spec.frontend-component.prop-vocabulary.md +88 -0
- package/dist/knowledge/references/example.spec.resource.semantic-field.md +23 -0
- package/dist/knowledge/references/example.views.app-level.composite-views-config.md +19 -0
- package/dist/knowledge/references/example.views.chart-view.resource-owned.md +69 -0
- package/dist/knowledge/references/example.views.composite-view.host-embeds.md +31 -0
- package/dist/knowledge/references/example.views.composite-view.workspace.md +65 -0
- package/dist/knowledge/references/example.views.custom-view.execution-host.md +41 -0
- package/dist/knowledge/references/example.views.execution-view.resource-owned.md +25 -0
- package/dist/knowledge/references/external-connectors.app.frontend-provider-module.md +42 -0
- package/dist/knowledge/references/market.alternative.config.md +68 -0
- package/dist/knowledge/references/market.alternative.kind.md +32 -0
- package/dist/knowledge/references/market.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/market.buying-journey.config.md +43 -0
- package/dist/knowledge/references/market.buying-journey.stage.md +33 -0
- package/dist/knowledge/references/market.category.config.md +63 -0
- package/dist/knowledge/references/market.channel.config.md +59 -0
- package/dist/knowledge/references/market.channel.kind.md +49 -0
- package/dist/knowledge/references/market.context-block.builder.md +544 -0
- package/dist/knowledge/references/market.context-block.response.md +57 -0
- package/dist/knowledge/references/market.feature-benefit.config.md +84 -0
- package/dist/knowledge/references/market.feature-benefit.kano.md +41 -0
- package/dist/knowledge/references/market.gain.config.md +50 -0
- package/dist/knowledge/references/market.generation.response.md +108 -0
- package/dist/knowledge/references/market.icp.config.md +162 -0
- package/dist/knowledge/references/market.icp.geographic-targeting.md +57 -0
- package/dist/knowledge/references/market.inherit-from.md +74 -0
- package/dist/knowledge/references/market.is-benefit-available.md +58 -0
- package/dist/knowledge/references/market.job.config.md +48 -0
- package/dist/knowledge/references/market.message-template.config.md +86 -0
- package/dist/knowledge/references/market.objection.config.md +56 -0
- package/dist/knowledge/references/market.objection.kind.md +34 -0
- package/dist/knowledge/references/market.pain.config.md +50 -0
- package/dist/knowledge/references/market.persona.config.md +64 -0
- package/dist/knowledge/references/market.positioning.config.md +84 -0
- package/dist/knowledge/references/market.proof.config.md +48 -0
- package/dist/knowledge/references/market.proof.kind.md +34 -0
- package/dist/knowledge/references/market.references.weighted-edges.md +105 -0
- package/dist/knowledge/references/market.scoring.fit.md +215 -0
- package/dist/knowledge/references/market.snapshot.config.md +34 -0
- package/dist/knowledge/references/market.snapshot.validation.md +1171 -0
- package/dist/knowledge/references/market.tone-of-voice.config.md +80 -0
- package/dist/knowledge/references/market.trigger.config.md +45 -0
- package/dist/knowledge/references/market.trigger.kind.md +35 -0
- package/dist/knowledge/references/placement-plan.config.md +330 -0
- package/dist/knowledge/references/platform.config.application-database.md +74 -0
- package/dist/knowledge/references/platform.config.application-modules.md +30 -0
- package/dist/knowledge/references/platform.config.backing-services.md +266 -0
- package/dist/knowledge/references/platform.config.cdn.md +167 -0
- package/dist/knowledge/references/platform.config.environment.deployment.md +263 -0
- package/dist/knowledge/references/platform.config.saas.md +405 -0
- package/dist/knowledge/references/presets.models.design-system.configuration.md +59 -0
- package/dist/knowledge/references/presets.models.design-system.source-config.md +72 -0
- package/dist/knowledge/references/presets.models.labelling.sections.md +64 -0
- package/dist/knowledge/references/presets.models.material.profile-contract.md +192 -0
- package/dist/knowledge/references/presets.models.material.runtime-policy.md +60 -0
- package/dist/knowledge/references/presets.models.surface-policy.defaults.md +613 -0
- package/dist/knowledge/references/presets.models.surface-policy.md +534 -0
- package/dist/knowledge/references/presets.models.surface-variant.md +56 -0
- package/dist/knowledge/references/requirements.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/requirements.functional-requirement.config.md +68 -0
- package/dist/knowledge/references/requirements.non-functional-requirement.config.md +100 -0
- package/dist/knowledge/references/requirements.references.conventions.md +125 -0
- package/dist/knowledge/references/requirements.snapshot.config.md +73 -0
- package/dist/knowledge/references/requirements.snapshot.validation.md +333 -0
- package/dist/knowledge/references/roadmap.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/roadmap.phase.config.md +149 -0
- package/dist/knowledge/references/roadmap.references.conventions.md +89 -0
- package/dist/knowledge/references/roadmap.snapshot.config.md +65 -0
- package/dist/knowledge/references/roadmap.snapshot.validation.md +325 -0
- package/dist/knowledge/references/saas.backend.app-config.backend-authored.md +32 -0
- package/dist/knowledge/references/saas.backend.application-initialization.assembly.md +38 -0
- package/dist/knowledge/references/saas.backend.billing.resolution-failure-reasons.md +45 -0
- package/dist/knowledge/references/saas.backend.custom-operation.authoritative-fields.md +53 -0
- package/dist/knowledge/references/saas.backend.custom-operation.transactional-core.md +120 -0
- package/dist/knowledge/references/saas.backend.domain-module.md +237 -0
- package/dist/knowledge/references/saas.backend.email-template.definition.md +69 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-agent-card.md +89 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-task-surface.md +118 -0
- package/dist/knowledge/references/saas.backend.flows-actors.function-tool.md +82 -0
- package/dist/knowledge/references/saas.backend.flows-actors.invoke-agent.md +48 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-read-tool.md +39 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-write-tool.md +67 -0
- package/dist/knowledge/references/saas.backend.pdf-template.bindings.md +52 -0
- package/dist/knowledge/references/saas.backend.pdf-template.definition.md +113 -0
- package/dist/knowledge/references/saas.backend.rate-limit-service.check-policy.md +75 -0
- package/dist/knowledge/references/saas.backend.system-access-service.md +994 -0
- package/dist/knowledge/references/saas.data-seeding.admin-endpoints.md +59 -0
- package/dist/knowledge/references/saas.data-seeding.bootstrap-wiring.md +184 -0
- package/dist/knowledge/references/saas.data-seeding.definition-input.md +95 -0
- package/dist/knowledge/references/saas.data-seeding.modes.md +72 -0
- package/dist/knowledge/references/saas.data-seeding.run-ledger.md +198 -0
- package/dist/knowledge/references/saas.data-seeding.run-status.md +35 -0
- package/dist/knowledge/references/saas.data-seeding.schedule.md +91 -0
- package/dist/knowledge/references/saas.data-seeding.scope-iteration-strategy.md +46 -0
- package/dist/knowledge/references/saas.external-providers.backend-provider-registry.runtime-filter.md +55 -0
- package/dist/knowledge/references/saas.external-providers.document-extraction.applicability.md +26 -0
- package/dist/knowledge/references/saas.external-providers.embeddings.applicability.md +30 -0
- package/dist/knowledge/references/saas.external-providers.llm.model-configuration.md +124 -0
- package/dist/knowledge/references/saas.external-providers.llm.operation-key.md +49 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.configuration.md +265 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.vocabulary.md +148 -0
- package/dist/knowledge/references/saas.frontend.app-shell.hosted-components.md +145 -0
- package/dist/knowledge/references/saas.frontend.chart-view.inserted-declaration.md +80 -0
- package/dist/knowledge/references/saas.frontend.command-menu.omnibox.md +88 -0
- package/dist/knowledge/references/saas.frontend.command-menu.search-resource.md +109 -0
- package/dist/knowledge/references/saas.frontend.component-registration.entry.md +21 -0
- package/dist/knowledge/references/saas.frontend.composite-view.authoring.md +102 -0
- package/dist/knowledge/references/saas.frontend.composite-view.define-helper.md +31 -0
- package/dist/knowledge/references/saas.frontend.domain-module.md +31 -0
- package/dist/knowledge/references/saas.frontend.embedded-resource-descent.md +37 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.per-action-retry-loop.md +115 -0
- package/dist/knowledge/references/saas.frontend.execution-view.definition.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.local-pane.md +109 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.md +55 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-state-contract.md +151 -0
- package/dist/knowledge/references/saas.frontend.execution-view.failure-handling-contract.md +302 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.md +89 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.md +231 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.shell-data-hydrator.md +174 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.md +96 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.resolution.md +45 -0
- package/dist/knowledge/references/saas.frontend.execution-view.outcome-emission-contract.md +71 -0
- package/dist/knowledge/references/saas.frontend.execution-view.participation-and-anchor.md +80 -0
- package/dist/knowledge/references/saas.frontend.execution-view.three-zone-contract.md +147 -0
- package/dist/knowledge/references/saas.frontend.flows-actors-view.md +40 -0
- package/dist/knowledge/references/saas.frontend.form-fields.file-provider-constraints.md +80 -0
- package/dist/knowledge/references/saas.frontend.full-custom-view.definition.md +64 -0
- package/dist/knowledge/references/saas.frontend.inserted-view.identity-bindings-descriptor.md +149 -0
- package/dist/knowledge/references/saas.frontend.operation-key-and-resource-config-like.md +63 -0
- package/dist/knowledge/references/saas.frontend.quick-switcher.scope-field.md +102 -0
- package/dist/knowledge/references/saas.frontend.related-resource-embeds.md +86 -0
- package/dist/knowledge/references/saas.frontend.related-resource-preview.md +23 -0
- package/dist/knowledge/references/saas.frontend.related-resource-sections.md +28 -0
- package/dist/knowledge/references/saas.frontend.resource-header-title.md +43 -0
- package/dist/knowledge/references/saas.frontend.resource-layout-templates.md +215 -0
- package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +531 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +210 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-preset-map.md +39 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.engine-destinations.md +58 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +118 -0
- package/dist/knowledge/references/saas.frontend.view-definition-scope.md +42 -0
- package/dist/knowledge/references/saas.market.generation-agent.md +104 -0
- package/dist/knowledge/references/saas.models.core-resource-operation.md +86 -0
- package/dist/knowledge/references/saas.models.data-mode-read-list.md +395 -0
- package/dist/knowledge/references/saas.models.engine-capabilities.md +114 -0
- package/dist/knowledge/references/saas.models.error-type.md +45 -0
- package/dist/knowledge/references/saas.models.external-data-pipeline.md +162 -0
- package/dist/knowledge/references/saas.models.feature-limit-semantic.md +51 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-configuration.md +127 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-definition.md +115 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-invocation.md +52 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-prompt-spec.md +188 -0
- package/dist/knowledge/references/saas.models.http-api-binding.md +237 -0
- package/dist/knowledge/references/saas.models.navigation.layout.md +149 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-containment.md +22 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-declaration.md +42 -0
- package/dist/knowledge/references/saas.models.polymorphism.optout-business-key.md +62 -0
- package/dist/knowledge/references/saas.models.polymorphism.variant-definition.md +74 -0
- package/dist/knowledge/references/saas.models.provider-capabilities.md +97 -0
- package/dist/knowledge/references/saas.models.rate-limit-configuration.md +67 -0
- package/dist/knowledge/references/saas.models.relationship-handling-contract.md +30 -0
- package/dist/knowledge/references/saas.models.relationship-handling-settings.md +62 -0
- package/dist/knowledge/references/saas.models.relationship-nature-and-models.md +112 -0
- package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +431 -0
- package/dist/knowledge/references/saas.models.resource-config.forwarded-label.md +88 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-api-call.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-base.md +79 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-mcp-exposure.md +49 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-path.md +27 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-union.md +26 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-variant-for-key.md +62 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-configuration.md +124 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-relationships-buckets.md +38 -0
- package/dist/knowledge/references/saas.models.resource-config.resources-registry.md +69 -0
- package/dist/knowledge/references/saas.models.resource-config.searchable-relation.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.system-access-policy.md +121 -0
- package/dist/knowledge/references/saas.models.resource-config.token-generation.md +145 -0
- package/dist/knowledge/references/saas.models.resource-field-identifier.md +25 -0
- package/dist/knowledge/references/saas.models.resource-operation-display-risk.md +77 -0
- package/dist/knowledge/references/saas.models.resource-operation-variant-runtime.md +58 -0
- package/dist/knowledge/references/saas.models.resource-primary-scope.md +36 -0
- package/dist/knowledge/references/saas.models.resource-relationship-access-scope.md +26 -0
- package/dist/knowledge/references/saas.models.resource-relationship-builder-parameters.md +100 -0
- package/dist/knowledge/references/saas.models.resource-relationship-cardinality.md +57 -0
- package/dist/knowledge/references/saas.models.resource-relationship-declaration.md +69 -0
- package/dist/knowledge/references/saas.models.resource-relationship-resolved-semantics.md +60 -0
- package/dist/knowledge/references/saas.models.resource-relationship-schema.md +172 -0
- package/dist/knowledge/references/saas.models.resource-server-instance.md +109 -0
- package/dist/knowledge/references/saas.models.resource-type.md +24 -0
- package/dist/knowledge/references/saas.models.schema-family-builder.md +242 -0
- package/dist/knowledge/references/saas.models.scope-membership.md +143 -0
- package/dist/knowledge/references/saas.models.shared-domain-module.md +36 -0
- package/dist/knowledge/references/saas.models.shared-saas-module.md +36 -0
- package/dist/knowledge/references/saas.public-runtime.contract.md +229 -0
- package/dist/knowledge/references/saas.rag.retrieval-bounds.md +106 -0
- package/dist/knowledge/references/saas.rag.retrieval-refusals.md +89 -0
- package/dist/knowledge/references/saas.rag.retrieval-request.md +130 -0
- package/dist/knowledge/references/saas.rag.retrieval-result.md +147 -0
- package/dist/knowledge/references/saas.rag.retrieval-scores.md +54 -0
- package/dist/knowledge/references/saas.specifications.application-document-fact-specification.contract.md +59 -0
- package/dist/knowledge/references/saas.specifications.application-document-publication.contract.md +74 -0
- package/dist/knowledge/references/saas.specifications.assurance-document-blueprint.contract.md +1158 -0
- package/dist/knowledge/references/saas.specifications.assurance-program.contract.md +2602 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.catalog-spec-shared.md +180 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.discriminated-union.md +138 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-rating.md +47 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-article.md +49 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-blog-posting.md +62 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-breadcrumb-list.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-faq-page.md +51 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-organization.md +48 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-product.md +59 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-review.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-website.md +46 -0
- package/dist/knowledge/references/saas.specifications.companion-exports.contract.md +530 -0
- package/dist/knowledge/references/saas.specifications.composite-view-specification.md +49 -0
- package/dist/knowledge/references/saas.specifications.error-message-specification.md +92 -0
- package/dist/knowledge/references/saas.specifications.family-specifications.md +109 -0
- package/dist/knowledge/references/saas.specifications.feature-specification.md +93 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-factory.md +113 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-model.md +366 -0
- package/dist/knowledge/references/saas.specifications.resource-frontend-configuration-aspect.md +41 -0
- package/dist/knowledge/references/saas.specifications.resource-operation-spec.md +1978 -0
- package/dist/knowledge/references/saas.specifications.resource-pdf-template-spec.md +58 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-code-handling.md +49 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-config.md +156 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-factory.md +171 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-config-type.md +54 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-prose.md +171 -0
- package/dist/knowledge/references/saas.website.astro.bridge.md +262 -0
- package/dist/knowledge/references/saas.website.astro.head-renderer.md +271 -0
- package/dist/knowledge/references/saas.website.astro.headers-renderer.md +41 -0
- package/dist/knowledge/references/saas.website.astro.i18n-helper.md +121 -0
- package/dist/knowledge/references/saas.website.astro.label-key-collector.md +117 -0
- package/dist/knowledge/references/saas.website.astro.label-loader.md +377 -0
- package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +46 -0
- package/dist/knowledge/references/saas.website.astro.pick-labels-for-page.md +90 -0
- package/dist/knowledge/references/saas.website.astro.robots-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.astro.runtime-helper.md +187 -0
- package/dist/knowledge/references/saas.website.astro.site-context.md +141 -0
- package/dist/knowledge/references/saas.website.astro.sitemap-coverage.md +188 -0
- package/dist/knowledge/references/saas.website.astro.structured-data-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.blog.bridge.md +396 -0
- package/dist/knowledge/references/saas.website.blog.collection-config.md +180 -0
- package/dist/knowledge/references/saas.website.blog.frontmatter.md +116 -0
- package/dist/knowledge/references/saas.website.blog.head-renderer.md +292 -0
- package/dist/knowledge/references/saas.website.blog.mdx-provider.md +100 -0
- package/dist/knowledge/references/saas.website.blog.post-renderer.md +291 -0
- package/dist/knowledge/references/saas.website.design-tokens.bundle.md +29 -0
- package/dist/knowledge/references/saas.website.design-tokens.colors.md +64 -0
- package/dist/knowledge/references/saas.website.design-tokens.radius.md +38 -0
- package/dist/knowledge/references/saas.website.factories.define-page-manifest.md +98 -0
- package/dist/knowledge/references/saas.website.factories.define-section.md +128 -0
- package/dist/knowledge/references/saas.website.label-keys.compose-helper.md +36 -0
- package/dist/knowledge/references/saas.website.label-keys.format.md +67 -0
- package/dist/knowledge/references/saas.website.label-pack.validator.md +206 -0
- package/dist/knowledge/references/saas.website.page-layout.component.md +217 -0
- package/dist/knowledge/references/saas.website.page-manifest.meta-label-keys.md +47 -0
- package/dist/knowledge/references/saas.website.page-manifest.route-path.md +49 -0
- package/dist/knowledge/references/saas.website.page-manifest.schema.md +186 -0
- package/dist/knowledge/references/saas.website.page-manifest.seo.md +46 -0
- package/dist/knowledge/references/saas.website.page.context.md +57 -0
- package/dist/knowledge/references/saas.website.primitives.button.md +123 -0
- package/dist/knowledge/references/saas.website.primitives.heading.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.image.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.internal-button.md +151 -0
- package/dist/knowledge/references/saas.website.primitives.internal-link.md +193 -0
- package/dist/knowledge/references/saas.website.primitives.link.md +78 -0
- package/dist/knowledge/references/saas.website.primitives.text.md +82 -0
- package/dist/knowledge/references/saas.website.refs.page.md +56 -0
- package/dist/knowledge/references/saas.website.refs.section.md +57 -0
- package/dist/knowledge/references/saas.website.root-config.navigation.md +37 -0
- package/dist/knowledge/references/saas.website.root-config.schema.md +192 -0
- package/dist/knowledge/references/saas.website.root-config.seo.md +98 -0
- package/dist/knowledge/references/saas.website.routing.localized-path.md +84 -0
- package/dist/knowledge/references/saas.website.runtime.context.md +174 -0
- package/dist/knowledge/references/saas.website.section.component.md +138 -0
- package/dist/knowledge/references/saas.website.section.context.md +63 -0
- package/dist/knowledge/references/saas.website.sections.category-enum.md +72 -0
- package/dist/knowledge/references/saas.website.sections.definition-schema.md +121 -0
- package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +37 -0
- package/dist/knowledge/references/saas.website.seo.robots-config.md +106 -0
- package/dist/knowledge/references/saas.website.seo.sitemap-config.md +73 -0
- package/dist/knowledge/references/saas.website.structured-data.payload-shape.md +71 -0
- package/dist/knowledge/references/saas.website.use-label-by-key.hook.md +45 -0
- package/dist/knowledge/references/saas.website.use-label.hook.md +82 -0
- package/dist/knowledge/references/saas.website.use-page.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-runtime.hook.md +36 -0
- package/dist/knowledge/references/saas.website.use-section.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-tokens.hook.md +32 -0
- package/dist/knowledge/references/vision.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/vision.constraint.config.md +66 -0
- package/dist/knowledge/references/vision.idea.config.md +45 -0
- package/dist/knowledge/references/vision.mission.config.md +46 -0
- package/dist/knowledge/references/vision.problem.config.md +51 -0
- package/dist/knowledge/references/vision.references.conventions.md +115 -0
- package/dist/knowledge/references/vision.snapshot.config.md +85 -0
- package/dist/knowledge/references/vision.snapshot.validation.md +226 -0
- package/dist/knowledge/references/vision.success-criterion.config.md +60 -0
- package/dist/knowledge/references/zod.decorators.chainable-runtime.md +550 -0
- package/dist/knowledge/references/zod.decorators.conditional-visibility.md +104 -0
- package/dist/knowledge/references/zod.decorators.data-categories.md +197 -0
- package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +436 -0
- package/dist/knowledge/references/zod.decorators.display-edit-modes.md +174 -0
- package/dist/knowledge/references/zod.decorators.enums.frontend-handling.md +101 -0
- package/dist/knowledge/references/zod.decorators.field-spec-params.md +317 -0
- package/dist/knowledge/references/zod.decorators.file-generation.md +36 -0
- package/dist/knowledge/references/zod.decorators.file-rag-source.md +56 -0
- package/dist/knowledge/references/zod.decorators.file-schema.md +319 -0
- package/dist/knowledge/references/zod.decorators.foreign-key-display-mode.md +83 -0
- package/dist/knowledge/references/zod.decorators.per-primitive-ui.md +459 -0
- package/dist/knowledge/references/zod.decorators.primitive-ui.md +123 -0
- package/dist/knowledge/references/zod.decorators.rag-source.md +164 -0
- package/dist/knowledge/references/zod.decorators.schema-metadata.md +122 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +152 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-params.md +314 -0
- package/dist/knowledge/references/zod.decorators.structural-lifecycle-params.md +529 -0
- package/dist/knowledge/references/zod.factories.bigdecimal.md +155 -0
- package/dist/knowledge/references/zod.factories.code.md +127 -0
- package/dist/knowledge/references/zod.factories.duration.md +246 -0
- package/dist/knowledge/references/zod.factories.money.md +166 -0
- package/dist/knowledge/references/zod.factories.phone.md +88 -0
- package/dist/knowledge/references/zod.factories.range.md +174 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +15 -0
- package/dist/knowledge/registries/framework-topics.json +5212 -0
- package/dist/knowledge/registries/playbooks.json +488 -0
- package/dist/knowledge/registries/source-tags.json +7664 -0
- package/dist/knowledge/rules/resource-schema-awareness.md +77 -0
- package/dist/knowledge/skills/INDEX.md +349 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/examples/domain-use-case-and-admin-task.example.md +49 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/references/source-and-ownership-routing.md +52 -0
- package/dist/knowledge/skills/application-database-migrations/SKILL.md +218 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-application-database-api.md +84 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-migration-change-risk-api.md +37 -0
- package/dist/knowledge/skills/application-database-migrations/references/migration-refusals.md +64 -0
- package/dist/knowledge/skills/application-database-migrations/references/postgresql-vs-mongodb-obligations.md +34 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +323 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/references/framework-unit-narrowing-declaration-api.md +84 -0
- package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +324 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/backend-di-routing.md +7 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/framework-backend-bootstrap-api.md +276 -0
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +374 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-error-handling-api.md +118 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-operation-base-and-path-api.md +107 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-transactional-core-api.md +134 -0
- package/dist/knowledge/skills/backend-custom-operation/references/operation-file-conventions.md +10 -0
- package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +192 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/brand-authoring-decisions.md +55 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-asset-api.md +184 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-snapshot-api.md +279 -0
- package/dist/knowledge/skills/compliance-document-authoring/SKILL.md +346 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-governance.md +160 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +518 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-service-terms.md +158 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-fact-specification-contract.md +95 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-publication-contract.md +100 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-assurance-document-blueprint-contract.md +1210 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-governed-document-after-drafting.md +40 -0
- package/dist/knowledge/skills/config-app-shell/SKILL.md +698 -0
- package/dist/knowledge/skills/config-app-shell/references/app-shell-surfaces.md +5 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-api.md +415 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-hosted-components-api.md +170 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-command-menu-omnibox-api.md +212 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-quick-switcher-scope-field-api.md +178 -0
- package/dist/knowledge/skills/config-design-system/SKILL.md +424 -0
- package/dist/knowledge/skills/config-design-system/references/design-system-file.md +10 -0
- package/dist/knowledge/skills/config-design-system/references/framework-design-system-configuration-api.md +77 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-profile-api.md +200 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-runtime-policy-api.md +68 -0
- package/dist/knowledge/skills/config-design-system/references/framework-surface-policy-api.md +1212 -0
- package/dist/knowledge/skills/config-design-system/references/surface-policy-authoring.md +92 -0
- package/dist/knowledge/skills/config-navigation/SKILL.md +249 -0
- package/dist/knowledge/skills/config-navigation/references/framework-navigation-layout-api.md +152 -0
- package/dist/knowledge/skills/config-navigation/references/navigation-zones.md +5 -0
- package/dist/knowledge/skills/config-saas/SKILL.md +209 -0
- package/dist/knowledge/skills/config-saas/references/framework-provider-capabilities-api.md +221 -0
- package/dist/knowledge/skills/config-saas/references/framework-wildo-saas-config-api.md +408 -0
- package/dist/knowledge/skills/config-saas/references/saas-config-scope.md +9 -0
- package/dist/knowledge/skills/config-saas-backend/SKILL.md +183 -0
- package/dist/knowledge/skills/config-saas-backend/references/framework-backend-authored-config-api.md +40 -0
- package/dist/knowledge/skills/configure-billing/SKILL.md +261 -0
- package/dist/knowledge/skills/configure-billing/references/config-chain-and-failure-map.md +90 -0
- package/dist/knowledge/skills/configure-billing/references/example-backend-provider-module-shape.md +122 -0
- package/dist/knowledge/skills/configure-billing/references/example-provider-contribution-and-backend-config.md +48 -0
- package/dist/knowledge/skills/configure-billing/references/framework-backend-provider-reachability-api.md +69 -0
- package/dist/knowledge/skills/configure-billing/references/framework-billing-resolution-failure-api.md +57 -0
- package/dist/knowledge/skills/email-add-template/SKILL.md +439 -0
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +9 -0
- package/dist/knowledge/skills/email-add-template/references/framework-email-template-api.md +72 -0
- package/dist/knowledge/skills/email-definition-wiring/SKILL.md +62 -0
- package/dist/knowledge/skills/email-labels-authoring/SKILL.md +64 -0
- package/dist/knowledge/skills/email-template-authoring/SKILL.md +62 -0
- package/dist/knowledge/skills/engine-component-registration/SKILL.md +257 -0
- package/dist/knowledge/skills/engine-component-registration/references/component-registration-file.md +7 -0
- package/dist/knowledge/skills/engine-component-registration/references/framework-component-registration-api.md +24 -0
- package/dist/knowledge/skills/engine-product-definitions/SKILL.md +429 -0
- package/dist/knowledge/skills/engine-product-definitions/references/framework-engine-product-definitions-api.md +287 -0
- package/dist/knowledge/skills/engine-product-definitions/references/product-registry-scope.md +5 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/SKILL.md +491 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-flows-actors-a2a-contract.md +227 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-named-a2a-agents-contract.md +143 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +368 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/examples/todo-assistant.example.md +226 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-tool-api.md +208 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-view-api.md +286 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +376 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-definition-api.md +262 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-invocation-api.md +130 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-prompt-spec-api.md +214 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-operation-and-model-api.md +195 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/operation-key-selection.md +60 -0
- package/dist/knowledge/skills/frontend-cdn-publish/SKILL.md +237 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/cloudflare-and-operator-setup.md +56 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/framework-cdn-config-api.md +176 -0
- package/dist/knowledge/skills/i18n-label-generation/SKILL.md +261 -0
- package/dist/knowledge/skills/i18n-label-generation/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-label-generation/references/label-placement.md +7 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +269 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/i18n-routing.md +9 -0
- package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +245 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/translation-workflow.md +17 -0
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +646 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-application-database-api.md +77 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-backing-services-api.md +282 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +265 -0
- package/dist/knowledge/skills/infra-environment-config/references/infra-config-files.md +7 -0
- package/dist/knowledge/skills/journey-approve/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-bootstrap-scope/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-next/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-report/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-run/SKILL.md +55 -0
- package/dist/knowledge/skills/journey-status/SKILL.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +370 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/initialization-recovery-recipe.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/local-environment-troubleshooting.md +409 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +247 -0
- package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +474 -0
- package/dist/knowledge/skills/market-add-feature-benefit/references/framework-feature-benefit-api.md +139 -0
- package/dist/knowledge/skills/market-alternatives/SKILL.md +543 -0
- package/dist/knowledge/skills/market-authoring-overview/SKILL.md +354 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-references-api.md +138 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-snapshot-api.md +129 -0
- package/dist/knowledge/skills/market-category/SKILL.md +290 -0
- package/dist/knowledge/skills/market-channels/SKILL.md +361 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +2752 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +2443 -0
- package/dist/knowledge/skills/market-generation-cli/SKILL.md +1484 -0
- package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +1230 -0
- package/dist/knowledge/skills/market-icp/SKILL.md +625 -0
- package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +352 -0
- package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/market-message-templates-authoring/references/framework-message-template-api.md +1439 -0
- package/dist/knowledge/skills/market-persona/SKILL.md +407 -0
- package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +392 -0
- package/dist/knowledge/skills/market-positioning-authoring/references/framework-positioning-api.md +97 -0
- package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +665 -0
- package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +620 -0
- package/dist/knowledge/skills/market-scoring-interpretation/references/framework-scoring-api.md +291 -0
- package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +1706 -0
- package/dist/knowledge/skills/market-snapshot-validation/references/framework-snapshot-validation-api.md +1228 -0
- package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +260 -0
- package/dist/knowledge/skills/market-triggers-and-journey/SKILL.md +579 -0
- package/dist/knowledge/skills/module-companion-exports/SKILL.md +318 -0
- package/dist/knowledge/skills/module-companion-exports/references/companion-exports-by-package.md +544 -0
- package/dist/knowledge/skills/module-registration/SKILL.md +212 -0
- package/dist/knowledge/skills/module-registration/references/framework-domain-modules-api.md +366 -0
- package/dist/knowledge/skills/module-registration/references/registry-files.md +9 -0
- package/dist/knowledge/skills/module-relationships/SKILL.md +523 -0
- package/dist/knowledge/skills/module-relationships/references/cross-resource-fk-checklist.md +7 -0
- package/dist/knowledge/skills/module-relationships/references/framework-resource-relationship-authoring-api.md +738 -0
- package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +174 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-api.md +203 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-spec-api.md +62 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +239 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-file-provider-constraints-api.md +90 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-provider-module-api.md +50 -0
- package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +652 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/framework-rate-limit-policy-api.md +182 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/scope-key-and-bucket-conventions.md +137 -0
- package/dist/knowledge/skills/resource-add-field/SKILL.md +272 -0
- package/dist/knowledge/skills/resource-add-field/examples/add-priority-field-to-todos.example.md +153 -0
- package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +845 -0
- package/dist/knowledge/skills/resource-add-module/SKILL.md +322 -0
- package/dist/knowledge/skills/resource-add-module/references/framework-new-module-wiring-api.md +67 -0
- package/dist/knowledge/skills/resource-add-module/references/module-scaffold-layout.md +15 -0
- package/dist/knowledge/skills/resource-add-resource/SKILL.md +222 -0
- package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +540 -0
- package/dist/knowledge/skills/resource-add-resource/references/scaffold-surfaces-checklist.md +25 -0
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +370 -0
- package/dist/knowledge/skills/resource-config-wiring/references/config-change-routing.md +11 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +622 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-operation-scope-enums-api.md +248 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +1769 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +1209 -0
- package/dist/knowledge/skills/resource-custom-view/SKILL.md +228 -0
- package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +693 -0
- package/dist/knowledge/skills/resource-external-data/SKILL.md +349 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-external-data-pipeline-api.md +187 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-http-api-binding-api.md +261 -0
- package/dist/knowledge/skills/resource-external-data/references/lane-selection.md +49 -0
- package/dist/knowledge/skills/resource-external-data/references/pipeline-destination-schema.md +43 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/SKILL.md +308 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-named-mcp-servers-contract.md +166 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-resource-mcp-exposure-contract.md +63 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-catalogue-withdrawal-and-verification.md +77 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-client-registration-postures.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/SKILL.md +424 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/corpus-field-selection.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-embeddings-capability-api.md +261 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-file-rag-source-api.md +117 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-retrieval-api.md +597 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-source-decorator-api.md +181 -0
- package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +318 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/add-enum-field-with-ui.example.md +132 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/basic-resource-schema.example.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/decorator-layer-map.md +63 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/field-type-selection.md +70 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +559 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-personal-data-category-api.md +245 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-polymorphic-resources-api.md +147 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-schema-family-api.md +247 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +164 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-structural-params-api.md +327 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +1286 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +1080 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/polymorphic-per-scope-resources.md +75 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/schema-variants-and-discriminators.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/shared-layer-decorator-checklist.md +69 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/special-factories.md +45 -0
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +389 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-conditional-visibility-api.md +106 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-display-edit-modes-api.md +176 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-enum-frontend-handling-api.md +103 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-foreign-key-ui-api.md +97 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +839 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-per-primitive-ui-api.md +461 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-primitive-ui-api.md +125 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-related-resource-embeds-api.md +245 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-resource-layout-templates-api.md +302 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/ui-layer-boundaries.md +13 -0
- package/dist/knowledge/skills/seeding-authoring/SKILL.md +569 -0
- package/dist/knowledge/skills/seeding-authoring/references/data-seeding-mode-picker.md +154 -0
- package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +176 -0
- package/dist/knowledge/skills/seeding-operations/SKILL.md +505 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-admin-runbook.md +337 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-cron-scheduler.md +171 -0
- package/dist/knowledge/skills/seeding-operations/references/framework-data-seeding-operations-api.md +662 -0
- package/dist/knowledge/skills/settings-placement-authoring/SKILL.md +134 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +65 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +127 -0
- package/dist/knowledge/skills/spec-catalog-authoring/SKILL.md +726 -0
- package/dist/knowledge/skills/spec-catalog-authoring/references/catalog-spec-pattern-overview.md +242 -0
- package/dist/knowledge/skills/spec-companion-exports/SKILL.md +362 -0
- package/dist/knowledge/skills/spec-companion-exports/references/companion-export-checklist.md +8 -0
- package/dist/knowledge/skills/spec-companion-exports/references/framework-companion-exports-contract-api.md +533 -0
- package/dist/knowledge/skills/spec-component-update/SKILL.md +315 -0
- package/dist/knowledge/skills/spec-component-update/references/component-spec-props.md +8 -0
- package/dist/knowledge/skills/spec-component-update/references/framework-frontend-component-spec-api.md +481 -0
- package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +283 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/composite-spec-sections.md +5 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/framework-composite-view-specification-api.md +51 -0
- package/dist/knowledge/skills/spec-family-update/SKILL.md +300 -0
- package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +13 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-error-message-specifications-api.md +108 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-family-specifications-api.md +111 -0
- package/dist/knowledge/skills/spec-feature-update/SKILL.md +306 -0
- package/dist/knowledge/skills/spec-feature-update/references/feature-spec-scope.md +5 -0
- package/dist/knowledge/skills/spec-feature-update/references/framework-feature-specification-api.md +95 -0
- package/dist/knowledge/skills/spec-resource-update/SKILL.md +220 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-field-spec-params-api.md +319 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-spec-resource-contracts-api.md +2610 -0
- package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +12 -0
- package/dist/knowledge/skills/spec-update-after-change/SKILL.md +195 -0
- package/dist/knowledge/skills/spec-update-after-change/references/framework-spec-factory-api.md +173 -0
- package/dist/knowledge/skills/spec-update-after-change/references/spec-maintenance-by-surface.md +33 -0
- package/dist/knowledge/skills/spec-update-after-change/references/surface-to-spec-routing.md +14 -0
- package/dist/knowledge/skills/views-add-composite-view/SKILL.md +259 -0
- package/dist/knowledge/skills/views-add-composite-view/references/composite-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-composite-view/references/framework-inserted-view-identity-api.md +151 -0
- package/dist/knowledge/skills/views-add-custom-view/SKILL.md +225 -0
- package/dist/knowledge/skills/views-add-custom-view/references/custom-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-custom-view/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-app-level/SKILL.md +201 -0
- package/dist/knowledge/skills/views-app-level/references/app-level-views-routing.md +9 -0
- package/dist/knowledge/skills/views-app-level/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +264 -0
- package/dist/knowledge/skills/views-chart-authoring/references/chart-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-chart-view-contracts-api.md +82 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-composite-authoring/SKILL.md +302 -0
- package/dist/knowledge/skills/views-composite-authoring/references/composite-embedding-checklist.md +23 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-composite-view-contracts-api.md +133 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-execution-authoring/SKILL.md +209 -0
- package/dist/knowledge/skills/views-execution-authoring/references/execution-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-execution-view-contracts-api.md +389 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/website-anonymous-session/SKILL.md +444 -0
- package/dist/knowledge/skills/website-blog-authoring/SKILL.md +587 -0
- package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +1426 -0
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +553 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/example-website-button-override.md +52 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +357 -0
- package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +511 -0
- package/dist/knowledge/skills/website-factory-advanced/SKILL.md +376 -0
- package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +304 -0
- package/dist/knowledge/skills/website-label-pack/SKILL.md +390 -0
- package/dist/knowledge/skills/website-layout-overrides/SKILL.md +461 -0
- package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +264 -0
- package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +414 -0
- package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +366 -0
- package/dist/knowledge/skills/website-page-authoring/SKILL.md +420 -0
- package/dist/knowledge/skills/website-page-variants/SKILL.md +256 -0
- package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +302 -0
- package/dist/knowledge/skills/website-section-contact/SKILL.md +950 -0
- package/dist/knowledge/skills/website-section-contact/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-cta/SKILL.md +822 -0
- package/dist/knowledge/skills/website-section-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-faq/SKILL.md +917 -0
- package/dist/knowledge/skills/website-section-faq/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +878 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +895 -0
- package/dist/knowledge/skills/website-section-feature-detail/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-footer-cta/SKILL.md +814 -0
- package/dist/knowledge/skills/website-section-footer-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-hero/SKILL.md +944 -0
- package/dist/knowledge/skills/website-section-hero/references/define-website-section-api.md +583 -0
- package/dist/knowledge/skills/website-section-pricing/SKILL.md +934 -0
- package/dist/knowledge/skills/website-section-pricing/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-social-proof/SKILL.md +912 -0
- package/dist/knowledge/skills/website-section-social-proof/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +624 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/aeo-api.md +633 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +193 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +790 -0
- package/dist/knowledge/topic-index.json +17510 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,2602 @@
|
|
|
1
|
+
# saas.specifications.assurance-program.contract
|
|
2
|
+
|
|
3
|
+
## Import Origins
|
|
4
|
+
|
|
5
|
+
- `@wildo-ai/saas-specifications`
|
|
6
|
+
|
|
7
|
+
## Source Excerpts
|
|
8
|
+
|
|
9
|
+
### Origin Package: `@wildo-ai/saas-specifications`
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
*
|
|
13
|
+
* Application-policy decision state. Missing knowledge remains explicit and cannot be interpreted as non-applicability.
|
|
14
|
+
*/
|
|
15
|
+
export enum AssuranceProgramApplicabilityStatus {
|
|
16
|
+
APPLICABLE = "APPLICABLE",
|
|
17
|
+
NOT_APPLICABLE = "NOT_APPLICABLE",
|
|
18
|
+
UNDETERMINED = "UNDETERMINED",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Declarative scope selector kinds. Live organization and user identities remain runtime facts. */
|
|
22
|
+
export enum AssuranceProgramScopeSelectorKind {
|
|
23
|
+
APPLICATION = "APPLICATION",
|
|
24
|
+
ORGANIZATION_POLICY = "ORGANIZATION_POLICY",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Honest capability-resolution vocabulary. None of these values is a compliance verdict. */
|
|
28
|
+
export enum AssuranceProgramCapabilityResolution {
|
|
29
|
+
IMPLEMENTABLE = "IMPLEMENTABLE",
|
|
30
|
+
PARTIAL = "PARTIAL",
|
|
31
|
+
HUMAN_OR_EXTERNAL = "HUMAN_OR_EXTERNAL",
|
|
32
|
+
UNSUPPORTED = "UNSUPPORTED",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Increasing proof stages without a flattened aggregate `COMPLIANT` state. */
|
|
36
|
+
export enum AssuranceProgramProofStage {
|
|
37
|
+
SELECTED = "SELECTED",
|
|
38
|
+
CONFIGURED = "CONFIGURED",
|
|
39
|
+
OPERATING = "OPERATING",
|
|
40
|
+
EVIDENCED = "EVIDENCED",
|
|
41
|
+
ASSESSED = "ASSESSED",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum AssuranceProgramCapabilityKind {
|
|
45
|
+
ENGINE = "ENGINE",
|
|
46
|
+
PROVIDER = "PROVIDER",
|
|
47
|
+
APPLICATION = "APPLICATION",
|
|
48
|
+
HUMAN_OR_EXTERNAL = "HUMAN_OR_EXTERNAL",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum AssuranceProgramFindingKind {
|
|
52
|
+
GAP = "GAP",
|
|
53
|
+
EXCEPTION = "EXCEPTION",
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Applicability of one Wildo obligation outcome, distinct from source-level applicability and runtime activation. */
|
|
57
|
+
export enum AssuranceProgramObligationApplicabilityStatus {
|
|
58
|
+
APPLICABLE = "APPLICABLE",
|
|
59
|
+
NOT_APPLICABLE = "NOT_APPLICABLE",
|
|
60
|
+
UNDETERMINED = "UNDETERMINED",
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Conditional enforcement effect once a later, separately governed lifecycle assessment activates the obligation. */
|
|
64
|
+
export enum AssuranceProgramObligationBlockingEffect {
|
|
65
|
+
HARD = "HARD",
|
|
66
|
+
ADVISORY = "ADVISORY",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Human review disposition for an exact obligation coverage claim retained inside the accepted program. */
|
|
70
|
+
export enum AssuranceProgramObligationCoverageReviewDisposition {
|
|
71
|
+
APPROVED = "APPROVED",
|
|
72
|
+
REJECTED = "REJECTED",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Whether shared responsibility has no actor precedence or names one actor whose decision prevails on conflict. */
|
|
76
|
+
export enum AssuranceProgramSharedResponsibilityPrecedenceMode {
|
|
77
|
+
SHARED_WITHOUT_PRECEDENCE = "SHARED_WITHOUT_PRECEDENCE",
|
|
78
|
+
NAMED_ACTOR_PRECEDENCE = "NAMED_ACTOR_PRECEDENCE",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export enum AssuranceProgramDocumentApprovalRequirement {
|
|
82
|
+
APPROVAL_REQUIRED = "APPROVAL_REQUIRED",
|
|
83
|
+
NO_APPROVAL_REQUIRED = "NO_APPROVAL_REQUIRED",
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** One source artifact contributing to an accepted implementation revision, by its stable ref. */
|
|
87
|
+
export const AssuranceProgramSourceRevisionArtifactSchema = z.strictObject({
|
|
88
|
+
artifactRef: AssuranceNamespacedRefSchema,
|
|
89
|
+
});
|
|
90
|
+
export type AssuranceProgramSourceRevisionArtifact = z.infer<typeof AssuranceProgramSourceRevisionArtifactSchema>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Content-addressed application-owned implementation fact supplied by the host at authority-composition time.
|
|
94
|
+
*
|
|
95
|
+
* Unlike `AssuranceProgramSourceRevisionArtifact`, this artifact does not claim to be framework implementation source. It binds the current configured application's
|
|
96
|
+
* compiled state (for example, its subject-export resource graph) into the private authority snapshot used to validate application-specific implementation claims.
|
|
97
|
+
*/
|
|
98
|
+
export const AssuranceProgramHostImplementationArtifactSchema = z.strictObject({
|
|
99
|
+
artifactRef: AssuranceNamespacedRefSchema,
|
|
100
|
+
artifactKindRef: AssuranceNamespacedRefSchema,
|
|
101
|
+
/**
|
|
102
|
+
* Exact portable canonical fact bytes, retained so a later reader can re-derive the claim.
|
|
103
|
+
*
|
|
104
|
+
* The material is the evidence; it carried a self-hash until 2026-08-27, which verified these
|
|
105
|
+
* bytes against a digest stored beside them and therefore proved nothing a reader could not see.
|
|
106
|
+
*/
|
|
107
|
+
canonicalMaterial: z.string().min(1),
|
|
108
|
+
});
|
|
109
|
+
export type AssuranceProgramHostImplementationArtifact = z.infer<typeof AssuranceProgramHostImplementationArtifactSchema>;
|
|
110
|
+
|
|
111
|
+
/** Implementation-source bundle: a named revision and the ordered artifact inventory it covers. */
|
|
112
|
+
export const AssuranceProgramSourceRevisionSchema = z
|
|
113
|
+
.strictObject({
|
|
114
|
+
sourceRevisionRef: AssuranceNamespacedRefSchema,
|
|
115
|
+
artifacts: z.array(AssuranceProgramSourceRevisionArtifactSchema).min(1),
|
|
116
|
+
})
|
|
117
|
+
.superRefine((revision, context) => {
|
|
118
|
+
addUniqueSortedIssue(
|
|
119
|
+
revision.artifacts.map((artifact) => artifact.artifactRef),
|
|
120
|
+
context,
|
|
121
|
+
["artifacts"],
|
|
122
|
+
"source revision artifact refs",
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
export type AssuranceProgramSourceRevision = z.infer<typeof AssuranceProgramSourceRevisionSchema>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Stable durable subject for one artifact occurrence in a retained v1 source revision.
|
|
129
|
+
*
|
|
130
|
+
* V1 permits the same `artifactRef` in several distinct source revisions. Durable divergence receipts key issues
|
|
131
|
+
* by `(kind, subjectRef)`, so the artifact ref alone would collapse those valid occurrences. A canonical JSON tuple
|
|
132
|
+
* preserves both identity axes without introducing delimiter ambiguity. Consumers must treat this value as opaque.
|
|
133
|
+
*/
|
|
134
|
+
const sourceRevisionArtifactSubjectRef = (sourceRevisionRef: string, artifactRef: string): string => JSON.stringify([sourceRevisionRef, artifactRef]);
|
|
135
|
+
|
|
136
|
+
const AssuranceProgramSourceRevisionIdentitySchema = z.strictObject({
|
|
137
|
+
sourceRevisionRef: AssuranceNamespacedRefSchema,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Stable identity of one framework-owned authority basis — `basisRef` at `basisVersion`.
|
|
142
|
+
*
|
|
143
|
+
* `basisVersion` is the declared COMPATIBILITY GENERATION: equal versions promise the same
|
|
144
|
+
* interpretation contract. An application pins this identity, so it re-accepts its controls when
|
|
145
|
+
* the framework's contract generation moves — not on every engine byte.
|
|
146
|
+
*
|
|
147
|
+
* There is deliberately no content digest. Until 2026-08-27 there was, and it cost a re-acceptance
|
|
148
|
+
* ritual four times in four days on one application: the pinned hash moved whenever any of the
|
|
149
|
+
* digested engine sources moved, including for purely additive changes that altered no control.
|
|
150
|
+
* Which BYTES an acceptance was made against is answered by the engine's committed git revision
|
|
151
|
+
* plus the commit that recorded the acceptance — both of which merge across branches, which a hash
|
|
152
|
+
* does not (`.claude/rules/one-source-of-truth.md`).
|
|
153
|
+
*/
|
|
154
|
+
export const AssuranceProgramAuthorityBasisIdentitySchema = z.strictObject({
|
|
155
|
+
basisRef: AssuranceNamespacedRefSchema,
|
|
156
|
+
basisVersion: z.number().int().positive(),
|
|
157
|
+
});
|
|
158
|
+
export type AssuranceProgramAuthorityBasisIdentity = z.infer<typeof AssuranceProgramAuthorityBasisIdentitySchema>;
|
|
159
|
+
|
|
160
|
+
/** Application-authored basis identity plus the exact engine artifact refs whose meaning it attests. */
|
|
161
|
+
export const AssuranceProgramAuthorityBasisReferenceSchema = AssuranceProgramAuthorityBasisIdentitySchema.extend({
|
|
162
|
+
attestedArtifactRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
163
|
+
}).superRefine((reference, context) => {
|
|
164
|
+
addUniqueSortedIssue(reference.attestedArtifactRefs, context, ["attestedArtifactRefs"], "attestedArtifactRefs");
|
|
165
|
+
});
|
|
166
|
+
export type AssuranceProgramAuthorityBasisReference = z.infer<typeof AssuranceProgramAuthorityBasisReferenceSchema>;
|
|
167
|
+
|
|
168
|
+
/** Application semantic role bound to one actual application role definition and its exact source revision. */
|
|
169
|
+
export const AssuranceProgramRoleAuthoritySchema = z.strictObject({
|
|
170
|
+
roleRef: AssuranceNamespacedRefSchema,
|
|
171
|
+
applicationRoleRef: z.string().trim().min(1),
|
|
172
|
+
definitionRevision: AssuranceProgramSourceRevisionIdentitySchema,
|
|
173
|
+
});
|
|
174
|
+
export type AssuranceProgramRoleAuthority = z.infer<typeof AssuranceProgramRoleAuthoritySchema>;
|
|
175
|
+
|
|
176
|
+
/** Current role authority bound to one exact framework authority basis rather than its internal inventory. */
|
|
177
|
+
export const AssuranceProgramRoleAuthorityV2Schema = z.strictObject({
|
|
178
|
+
roleRef: AssuranceNamespacedRefSchema,
|
|
179
|
+
applicationRoleRef: z.string().trim().min(1),
|
|
180
|
+
definitionAuthority: AssuranceProgramAuthorityBasisIdentitySchema,
|
|
181
|
+
});
|
|
182
|
+
export type AssuranceProgramRoleAuthorityV2 = z.infer<typeof AssuranceProgramRoleAuthorityV2Schema>;
|
|
183
|
+
|
|
184
|
+
/** Versioned implementation authority for a selectable engine, provider, application or human/external capability. */
|
|
185
|
+
export const AssuranceProgramCapabilityAuthoritySchema = z
|
|
186
|
+
.strictObject({
|
|
187
|
+
identity: AssuranceCapabilityIdentitySchema,
|
|
188
|
+
capabilityKind: z.enum(AssuranceProgramCapabilityKind),
|
|
189
|
+
implementationRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
190
|
+
implementationRevision: AssuranceProgramSourceRevisionIdentitySchema,
|
|
191
|
+
})
|
|
192
|
+
.superRefine((authority, context) => {
|
|
193
|
+
addUniqueSortedIssue(authority.implementationRefs, context, ["implementationRefs"], "implementationRefs");
|
|
194
|
+
});
|
|
195
|
+
export type AssuranceProgramCapabilityAuthority = z.infer<typeof AssuranceProgramCapabilityAuthoritySchema>;
|
|
196
|
+
|
|
197
|
+
/** Current capability authority bound to one exact framework authority basis rather than its internal inventory. */
|
|
198
|
+
export const AssuranceProgramCapabilityAuthorityV2Schema = z
|
|
199
|
+
.strictObject({
|
|
200
|
+
identity: AssuranceCapabilityIdentitySchema,
|
|
201
|
+
capabilityKind: z.enum(AssuranceProgramCapabilityKind),
|
|
202
|
+
implementationRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
203
|
+
implementationAuthority: AssuranceProgramAuthorityBasisIdentitySchema,
|
|
204
|
+
})
|
|
205
|
+
.superRefine((authority, context) => {
|
|
206
|
+
addUniqueSortedIssue(authority.implementationRefs, context, ["implementationRefs"], "implementationRefs");
|
|
207
|
+
});
|
|
208
|
+
export type AssuranceProgramCapabilityAuthorityV2 = z.infer<typeof AssuranceProgramCapabilityAuthorityV2Schema>;
|
|
209
|
+
|
|
210
|
+
export const AssuranceProgramFindingIdentitySchema = z.strictObject({
|
|
211
|
+
findingRef: AssuranceNamespacedRefSchema,
|
|
212
|
+
findingVersion: z.number().int().positive(),
|
|
213
|
+
});
|
|
214
|
+
export type AssuranceProgramFindingIdentity = z.infer<typeof AssuranceProgramFindingIdentitySchema>;
|
|
215
|
+
|
|
216
|
+
export const AssuranceProgramExpectationIdentitySchema = z.strictObject({
|
|
217
|
+
expectationRef: AssuranceNamespacedRefSchema,
|
|
218
|
+
expectationVersion: z.number().int().positive(),
|
|
219
|
+
});
|
|
220
|
+
export type AssuranceProgramExpectationIdentity = z.infer<typeof AssuranceProgramExpectationIdentitySchema>;
|
|
221
|
+
|
|
222
|
+
export const AssuranceProgramCapabilityProfileAuthoritySchema = z
|
|
223
|
+
.strictObject({
|
|
224
|
+
profileRef: AssuranceNamespacedRefSchema,
|
|
225
|
+
parameters: z.array(
|
|
226
|
+
z
|
|
227
|
+
.strictObject({
|
|
228
|
+
parameterRef: AssuranceNamespacedRefSchema,
|
|
229
|
+
allowedOptionRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
230
|
+
})
|
|
231
|
+
.superRefine((parameter, context) => addUniqueSortedIssue(parameter.allowedOptionRefs, context, ["allowedOptionRefs"], "allowedOptionRefs")),
|
|
232
|
+
),
|
|
233
|
+
})
|
|
234
|
+
.superRefine((profile, context) => {
|
|
235
|
+
addUniqueSortedIssue(
|
|
236
|
+
profile.parameters.map((parameter) => parameter.parameterRef),
|
|
237
|
+
context,
|
|
238
|
+
["parameters"],
|
|
239
|
+
"profile parameter refs",
|
|
240
|
+
);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
export const AssuranceProgramCapabilitySelectionAuthoritySchema = AssuranceProgramCapabilityAuthoritySchema.extend({
|
|
244
|
+
profiles: z.array(AssuranceProgramCapabilityProfileAuthoritySchema),
|
|
245
|
+
requiredHostArtifactKindRefs: z.array(AssuranceNamespacedRefSchema),
|
|
246
|
+
}).superRefine((authority, context) => {
|
|
247
|
+
addUniqueSortedIssue(
|
|
248
|
+
authority.profiles.map((profile) => profile.profileRef),
|
|
249
|
+
context,
|
|
250
|
+
["profiles"],
|
|
251
|
+
"capability profile refs",
|
|
252
|
+
);
|
|
253
|
+
addUniqueSortedIssue(authority.requiredHostArtifactKindRefs, context, ["requiredHostArtifactKindRefs"], "required host artifact kind refs");
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
export const AssuranceProgramSourceRequirementAuthoritySchema = z.strictObject({
|
|
257
|
+
source: AssuranceSourceIdentitySchema,
|
|
258
|
+
requirementRef: AssuranceNamespacedRefSchema,
|
|
259
|
+
requirementVersion: z.number().int().positive(),
|
|
260
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
261
|
+
canonicalLocator: z.url(),
|
|
262
|
+
reviewedByRef: AssuranceNamespacedRefSchema,
|
|
263
|
+
reviewedAt: AssuranceIsoDateTimeSchema,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export const AssuranceProgramImplementationExpectationAuthoritySchema = z
|
|
267
|
+
.strictObject({
|
|
268
|
+
identity: AssuranceProgramExpectationIdentitySchema,
|
|
269
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
270
|
+
requiredCapabilityRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
271
|
+
})
|
|
272
|
+
.superRefine((authority, context) => addUniqueSortedIssue(authority.requiredCapabilityRefs, context, ["requiredCapabilityRefs"], "requiredCapabilityRefs"));
|
|
273
|
+
|
|
274
|
+
export const AssuranceProgramEvidenceExpectationAuthoritySchema = z
|
|
275
|
+
.strictObject({
|
|
276
|
+
identity: AssuranceProgramExpectationIdentitySchema,
|
|
277
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
278
|
+
requiredStatementEvidenceRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
279
|
+
})
|
|
280
|
+
.superRefine((authority, context) =>
|
|
281
|
+
addUniqueSortedIssue(authority.requiredStatementEvidenceRefs, context, ["requiredStatementEvidenceRefs"], "requiredStatementEvidenceRefs"),
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
export const AssuranceProgramVerificationExpectationAuthoritySchema = z
|
|
285
|
+
.strictObject({
|
|
286
|
+
identity: AssuranceProgramExpectationIdentitySchema,
|
|
287
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
288
|
+
requiredStatementVerificationRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
289
|
+
})
|
|
290
|
+
.superRefine((authority, context) =>
|
|
291
|
+
addUniqueSortedIssue(authority.requiredStatementVerificationRefs, context, ["requiredStatementVerificationRefs"], "requiredStatementVerificationRefs"),
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
export const AssuranceProgramValidationAuthoritySnapshotSchema = z
|
|
295
|
+
.strictObject({
|
|
296
|
+
schemaVersion: z.literal(1),
|
|
297
|
+
snapshotRef: AssuranceNamespacedRefSchema,
|
|
298
|
+
snapshotVersion: z.number().int().positive(),
|
|
299
|
+
evaluatedAt: AssuranceIsoDateTimeSchema,
|
|
300
|
+
requestedSourceUses: z.array(z.enum(AssuranceSourceUse)).min(1),
|
|
301
|
+
sourceRegistry: AssuranceSourceRegistrySchema,
|
|
302
|
+
/** Optional only so retained pre-document-system snapshots stay parseable. */
|
|
303
|
+
documentAuthorityCatalog: AssuranceDocumentAuthorityCatalogSchema.optional(),
|
|
304
|
+
objectiveCatalog: AssuranceObjectiveCatalogSchema,
|
|
305
|
+
applicationRoleRefs: z.array(z.string().trim().min(1)).min(1),
|
|
306
|
+
capabilityAuthorities: z.array(AssuranceProgramCapabilitySelectionAuthoritySchema),
|
|
307
|
+
implementationArtifacts: z.array(AssuranceProgramSourceRevisionArtifactSchema).min(1),
|
|
308
|
+
hostImplementationArtifacts: z.array(AssuranceProgramHostImplementationArtifactSchema),
|
|
309
|
+
sourceRequirementAuthorities: z.array(AssuranceProgramSourceRequirementAuthoritySchema),
|
|
310
|
+
implementationExpectationAuthorities: z.array(AssuranceProgramImplementationExpectationAuthoritySchema),
|
|
311
|
+
evidenceExpectationAuthorities: z.array(AssuranceProgramEvidenceExpectationAuthoritySchema),
|
|
312
|
+
verificationExpectationAuthorities: z.array(AssuranceProgramVerificationExpectationAuthoritySchema),
|
|
313
|
+
})
|
|
314
|
+
.superRefine((snapshot, context) => {
|
|
315
|
+
addUniqueSortedIssue(snapshot.requestedSourceUses, context, ["requestedSourceUses"], "requestedSourceUses");
|
|
316
|
+
addUniqueSortedIssue(snapshot.applicationRoleRefs, context, ["applicationRoleRefs"], "applicationRoleRefs");
|
|
317
|
+
addUniqueSortedIssue(
|
|
318
|
+
snapshot.capabilityAuthorities.map((authority) => `${authority.identity.capabilityRef}@${authority.identity.capabilityVersion}`),
|
|
319
|
+
context,
|
|
320
|
+
["capabilityAuthorities"],
|
|
321
|
+
"capability authority identities",
|
|
322
|
+
);
|
|
323
|
+
addUniqueSortedIssue(
|
|
324
|
+
snapshot.implementationArtifacts.map((artifact) => artifact.artifactRef),
|
|
325
|
+
context,
|
|
326
|
+
["implementationArtifacts"],
|
|
327
|
+
"implementation artifact refs",
|
|
328
|
+
);
|
|
329
|
+
const hostArtifactRefs = snapshot.hostImplementationArtifacts.map((artifact) => artifact.artifactRef);
|
|
330
|
+
const hostArtifactKindRefs = snapshot.hostImplementationArtifacts.map((artifact) => artifact.artifactKindRef);
|
|
331
|
+
if (!valuesAreUnique(hostArtifactRefs)) {
|
|
332
|
+
context.addIssue({ code: "custom", message: "host implementation artifact refs must be unique", path: ["hostImplementationArtifacts"] });
|
|
333
|
+
}
|
|
334
|
+
if (!valuesAreUnique(hostArtifactKindRefs)) {
|
|
335
|
+
context.addIssue({ code: "custom", message: "host implementation artifact kind refs must be unique", path: ["hostImplementationArtifacts"] });
|
|
336
|
+
}
|
|
337
|
+
if (!valuesAreLexicallySorted(snapshot.hostImplementationArtifacts.map(hostImplementationArtifactOrderKey))) {
|
|
338
|
+
context.addIssue({
|
|
339
|
+
code: "custom",
|
|
340
|
+
message: "host implementation artifacts must be sorted by artifact kind ref then artifact ref",
|
|
341
|
+
path: ["hostImplementationArtifacts"],
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
addUniqueSortedIssue(
|
|
345
|
+
snapshot.sourceRequirementAuthorities.map(
|
|
346
|
+
(authority) => `${authority.source.sourceRef}@${authority.source.sourceVersion}:${authority.requirementRef}@${authority.requirementVersion}`,
|
|
347
|
+
),
|
|
348
|
+
context,
|
|
349
|
+
["sourceRequirementAuthorities"],
|
|
350
|
+
"source requirement authority identities",
|
|
351
|
+
);
|
|
352
|
+
for (const [key, values] of [
|
|
353
|
+
["implementationExpectationAuthorities", snapshot.implementationExpectationAuthorities],
|
|
354
|
+
["evidenceExpectationAuthorities", snapshot.evidenceExpectationAuthorities],
|
|
355
|
+
["verificationExpectationAuthorities", snapshot.verificationExpectationAuthorities],
|
|
356
|
+
] as const)
|
|
357
|
+
addUniqueSortedIssue(
|
|
358
|
+
values.map((authority) => `${authority.identity.expectationRef}@${authority.identity.expectationVersion}`),
|
|
359
|
+
context,
|
|
360
|
+
[key],
|
|
361
|
+
`${key} identities`,
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
const rejectFutureAuthorityFact = (value: string, path: PropertyKey[], label: string): void => {
|
|
365
|
+
if (timestampIsAfter(value, snapshot.evaluatedAt)) {
|
|
366
|
+
context.addIssue({ code: "custom", message: `${label} cannot be later than evaluatedAt`, path });
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
rejectFutureAuthorityFact(snapshot.sourceRegistry.verifiedAt, ["sourceRegistry", "verifiedAt"], "source registry verification");
|
|
370
|
+
snapshot.sourceRegistry.sources.forEach((source, sourceIndex) => {
|
|
371
|
+
rejectFutureAuthorityFact(source.rights.reviewedAt, ["sourceRegistry", "sources", sourceIndex, "rights", "reviewedAt"], "source-rights review");
|
|
372
|
+
if (source.retrievedArtifact) {
|
|
373
|
+
rejectFutureAuthorityFact(
|
|
374
|
+
source.retrievedArtifact.retrievedAt,
|
|
375
|
+
["sourceRegistry", "sources", sourceIndex, "retrievedArtifact", "retrievedAt"],
|
|
376
|
+
"source-artifact retrieval",
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
snapshot.sourceRequirementAuthorities.forEach((authority, authorityIndex) =>
|
|
381
|
+
rejectFutureAuthorityFact(authority.reviewedAt, ["sourceRequirementAuthorities", authorityIndex, "reviewedAt"], "source-requirement review"),
|
|
382
|
+
);
|
|
383
|
+
if (snapshot.documentAuthorityCatalog) {
|
|
384
|
+
rejectFutureAuthorityFact(
|
|
385
|
+
snapshot.documentAuthorityCatalog.verifiedAt,
|
|
386
|
+
["documentAuthorityCatalog", "verifiedAt"],
|
|
387
|
+
"document authority catalog verification",
|
|
388
|
+
);
|
|
389
|
+
snapshot.documentAuthorityCatalog.sourceMonitoringPolicies.forEach((policy, policyIndex) =>
|
|
390
|
+
rejectFutureAuthorityFact(
|
|
391
|
+
policy.lastCheckedAt,
|
|
392
|
+
["documentAuthorityCatalog", "sourceMonitoringPolicies", policyIndex, "lastCheckedAt"],
|
|
393
|
+
"document source monitoring check",
|
|
394
|
+
),
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
export type AssuranceProgramValidationAuthoritySnapshot = z.infer<typeof AssuranceProgramValidationAuthoritySnapshotSchema>;
|
|
399
|
+
|
|
400
|
+
/** Exact application reference to a separately governed source-registry record. Normative bytes are never embedded here. */
|
|
401
|
+
export const AssuranceProgramSourceReferenceSchema = z.strictObject({
|
|
402
|
+
identity: AssuranceSourceIdentitySchema,
|
|
403
|
+
edition: z.string().trim().min(1),
|
|
404
|
+
authorityKind: z.enum(AssuranceSourceAuthorityKind),
|
|
405
|
+
authorityName: z.string().trim().min(1),
|
|
406
|
+
lifecycleStatus: z.enum(AssuranceSourceLifecycleStatus),
|
|
407
|
+
rightsRef: AssuranceNamespacedRefSchema,
|
|
408
|
+
rightsVersion: z.number().int().positive(),
|
|
409
|
+
});
|
|
410
|
+
export type AssuranceProgramSourceReference = z.infer<typeof AssuranceProgramSourceReferenceSchema>;
|
|
411
|
+
|
|
412
|
+
/** Reusable application-level scope policy. Runtime resolution supplies actual tenant and assignee identities. */
|
|
413
|
+
export const AssuranceProgramScopeSelectorSchema = z
|
|
414
|
+
.strictObject({
|
|
415
|
+
scopeSelectorRef: AssuranceNamespacedRefSchema,
|
|
416
|
+
scopeSelectorVersion: z.number().int().positive(),
|
|
417
|
+
kind: z.enum(AssuranceProgramScopeSelectorKind),
|
|
418
|
+
systemBoundaryRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
419
|
+
organizationScopeRuleRefs: z.array(AssuranceNamespacedRefSchema),
|
|
420
|
+
jurisdictionRefs: z.array(AssuranceNamespacedRefSchema),
|
|
421
|
+
dataCategoryRefs: z.array(AssuranceNamespacedRefSchema),
|
|
422
|
+
})
|
|
423
|
+
.superRefine((scope, context) => {
|
|
424
|
+
addUniqueSortedIssue(scope.systemBoundaryRefs, context, ["systemBoundaryRefs"], "systemBoundaryRefs");
|
|
425
|
+
addUniqueSortedIssue(scope.organizationScopeRuleRefs, context, ["organizationScopeRuleRefs"], "organizationScopeRuleRefs");
|
|
426
|
+
addUniqueSortedIssue(scope.jurisdictionRefs, context, ["jurisdictionRefs"], "jurisdictionRefs");
|
|
427
|
+
addUniqueSortedIssue(scope.dataCategoryRefs, context, ["dataCategoryRefs"], "dataCategoryRefs");
|
|
428
|
+
if (scope.kind === AssuranceProgramScopeSelectorKind.ORGANIZATION_POLICY && scope.organizationScopeRuleRefs.length === 0) {
|
|
429
|
+
context.addIssue({
|
|
430
|
+
code: "custom",
|
|
431
|
+
message: "organization-policy scope requires at least one organization scope rule",
|
|
432
|
+
path: ["organizationScopeRuleRefs"],
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
export type AssuranceProgramScopeSelector = z.infer<typeof AssuranceProgramScopeSelectorSchema>;
|
|
437
|
+
|
|
438
|
+
export const AssuranceProgramApplicabilityDecisionSchema = z
|
|
439
|
+
.strictObject({
|
|
440
|
+
decisionRef: AssuranceNamespacedRefSchema,
|
|
441
|
+
decisionVersion: z.number().int().positive(),
|
|
442
|
+
source: AssuranceSourceIdentitySchema,
|
|
443
|
+
scopeSelectorRef: AssuranceNamespacedRefSchema,
|
|
444
|
+
status: z.enum(AssuranceProgramApplicabilityStatus),
|
|
445
|
+
basis: z.string().trim().min(1),
|
|
446
|
+
authorityDecisionRef: AssuranceNamespacedRefSchema,
|
|
447
|
+
effectiveFrom: AssuranceIsoDateSchema,
|
|
448
|
+
effectiveUntil: AssuranceIsoDateSchema.optional(),
|
|
449
|
+
invalidationConditionRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
450
|
+
})
|
|
451
|
+
.superRefine((decision, context) => {
|
|
452
|
+
addUniqueSortedIssue(decision.invalidationConditionRefs, context, ["invalidationConditionRefs"], "invalidationConditionRefs");
|
|
453
|
+
if (decision.effectiveUntil && decision.effectiveUntil < decision.effectiveFrom) {
|
|
454
|
+
context.addIssue({ code: "custom", message: "effectiveUntil cannot precede effectiveFrom", path: ["effectiveUntil"] });
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
export type AssuranceProgramApplicabilityDecision = z.infer<typeof AssuranceProgramApplicabilityDecisionSchema>;
|
|
458
|
+
|
|
459
|
+
/** Exact identity of one retained source/scope applicability decision consumed by a v3 obligation. */
|
|
460
|
+
export const AssuranceProgramSourceApplicabilityDecisionIdentitySchema = z.strictObject({
|
|
461
|
+
decisionRef: AssuranceNamespacedRefSchema,
|
|
462
|
+
decisionVersion: z.number().int().positive(),
|
|
463
|
+
});
|
|
464
|
+
export type AssuranceProgramSourceApplicabilityDecisionIdentity = z.infer<typeof AssuranceProgramSourceApplicabilityDecisionIdentitySchema>;
|
|
465
|
+
|
|
466
|
+
export const AssuranceProgramSourceRequirementReferenceSchema = z.strictObject({
|
|
467
|
+
source: AssuranceSourceIdentitySchema,
|
|
468
|
+
requirementRef: AssuranceNamespacedRefSchema,
|
|
469
|
+
requirementVersion: z.number().int().positive(),
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
const versionedSourceKey = (source: AssuranceSourceIdentity): string => `${source.sourceRef}@${source.sourceVersion}`;
|
|
473
|
+
const versionedObjectiveKey = (objective: { objectiveRef: string; objectiveVersion: number }): string =>
|
|
474
|
+
`${objective.objectiveRef}@${objective.objectiveVersion}`;
|
|
475
|
+
const versionedCapabilityKey = (capability: { capabilityRef: string; capabilityVersion: number }): string =>
|
|
476
|
+
`${capability.capabilityRef}@${capability.capabilityVersion}`;
|
|
477
|
+
const versionedDocumentKey = (document: { documentRef: string; documentVersion: number }): string => `${document.documentRef}@${document.documentVersion}`;
|
|
478
|
+
const sourceRevisionKey = (revision: { sourceRevisionRef: string }): string => revision.sourceRevisionRef;
|
|
479
|
+
const authorityBasisIdentityKey = (basis: { basisRef: string; basisVersion: number }): string => `${basis.basisRef}@${basis.basisVersion}`;
|
|
480
|
+
const applicabilitySubjectKey = (source: AssuranceSourceIdentity, scopeSelectorRef: string): string => `${versionedSourceKey(source)}::${scopeSelectorRef}`;
|
|
481
|
+
const versionedExpectationKey = (identity: { expectationRef: string; expectationVersion: number }): string =>
|
|
482
|
+
`${identity.expectationRef}@${identity.expectationVersion}`;
|
|
483
|
+
const versionedSourceRequirementKey = (reference: { source: AssuranceSourceIdentity; requirementRef: string; requirementVersion: number }): string =>
|
|
484
|
+
`${versionedSourceKey(reference.source)}:${reference.requirementRef}@${reference.requirementVersion}`;
|
|
485
|
+
|
|
486
|
+
/** Source-neutral Wildo objective binding. Relationships to restricted targets remain in external mapping packs. */
|
|
487
|
+
export const AssuranceProgramControlObjectiveBindingSchema = z
|
|
488
|
+
.strictObject({
|
|
489
|
+
bindingRef: AssuranceNamespacedRefSchema,
|
|
490
|
+
bindingVersion: z.number().int().positive(),
|
|
491
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
492
|
+
scopeSelectorRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
493
|
+
sourceRequirementRefs: z.array(AssuranceProgramSourceRequirementReferenceSchema),
|
|
494
|
+
implementationExpectationRefs: z.array(AssuranceProgramExpectationIdentitySchema).min(1),
|
|
495
|
+
evidenceExpectationRefs: z.array(AssuranceProgramExpectationIdentitySchema).min(1),
|
|
496
|
+
verificationExpectationRefs: z.array(AssuranceProgramExpectationIdentitySchema).min(1),
|
|
497
|
+
requiredProofStage: z.enum(AssuranceProgramProofStage),
|
|
498
|
+
})
|
|
499
|
+
.superRefine((binding, context) => {
|
|
500
|
+
addUniqueSortedIssue(binding.scopeSelectorRefs, context, ["scopeSelectorRefs"], "scopeSelectorRefs");
|
|
501
|
+
addUniqueSortedIssue(
|
|
502
|
+
binding.sourceRequirementRefs.map(
|
|
503
|
+
(reference) => `${reference.source.sourceRef}@${reference.source.sourceVersion}:${reference.requirementRef}@${reference.requirementVersion}`,
|
|
504
|
+
),
|
|
505
|
+
context,
|
|
506
|
+
["sourceRequirementRefs"],
|
|
507
|
+
"sourceRequirementRefs",
|
|
508
|
+
);
|
|
509
|
+
const expectationKey = (identity: AssuranceProgramExpectationIdentity): string => `${identity.expectationRef}@${identity.expectationVersion}`;
|
|
510
|
+
addUniqueSortedIssue(
|
|
511
|
+
binding.implementationExpectationRefs.map(expectationKey),
|
|
512
|
+
context,
|
|
513
|
+
["implementationExpectationRefs"],
|
|
514
|
+
"implementationExpectationRefs",
|
|
515
|
+
);
|
|
516
|
+
addUniqueSortedIssue(binding.evidenceExpectationRefs.map(expectationKey), context, ["evidenceExpectationRefs"], "evidenceExpectationRefs");
|
|
517
|
+
addUniqueSortedIssue(binding.verificationExpectationRefs.map(expectationKey), context, ["verificationExpectationRefs"], "verificationExpectationRefs");
|
|
518
|
+
});
|
|
519
|
+
export type AssuranceProgramControlObjectiveBinding = z.infer<typeof AssuranceProgramControlObjectiveBindingSchema>;
|
|
520
|
+
|
|
521
|
+
export const AssuranceProgramObligationIdentitySchema = z.strictObject({
|
|
522
|
+
obligationRef: AssuranceNamespacedRefSchema,
|
|
523
|
+
obligationVersion: z.number().int().positive(),
|
|
524
|
+
});
|
|
525
|
+
export type AssuranceProgramObligationIdentity = z.infer<typeof AssuranceProgramObligationIdentitySchema>;
|
|
526
|
+
|
|
527
|
+
export const AssuranceProgramObligationCoverageDecisionIdentitySchema = z.strictObject({
|
|
528
|
+
coverageDecisionRef: AssuranceNamespacedRefSchema,
|
|
529
|
+
coverageDecisionVersion: z.number().int().positive(),
|
|
530
|
+
});
|
|
531
|
+
export type AssuranceProgramObligationCoverageDecisionIdentity = z.infer<typeof AssuranceProgramObligationCoverageDecisionIdentitySchema>;
|
|
532
|
+
|
|
533
|
+
export const AssuranceProgramSharedResponsibilityRuleIdentitySchema = z.strictObject({
|
|
534
|
+
sharedResponsibilityRuleRef: AssuranceNamespacedRefSchema,
|
|
535
|
+
sharedResponsibilityRuleVersion: z.number().int().positive(),
|
|
536
|
+
});
|
|
537
|
+
export type AssuranceProgramSharedResponsibilityRuleIdentity = z.infer<typeof AssuranceProgramSharedResponsibilityRuleIdentitySchema>;
|
|
538
|
+
|
|
539
|
+
const AssuranceProgramSharedResponsibilityPrecedenceSchema = z.discriminatedUnion("mode", [
|
|
540
|
+
z.strictObject({ mode: z.literal(AssuranceProgramSharedResponsibilityPrecedenceMode.SHARED_WITHOUT_PRECEDENCE) }),
|
|
541
|
+
z.strictObject({
|
|
542
|
+
mode: z.literal(AssuranceProgramSharedResponsibilityPrecedenceMode.NAMED_ACTOR_PRECEDENCE),
|
|
543
|
+
precedenceActorKind: z.enum(AssuranceGovernanceActorKind),
|
|
544
|
+
}),
|
|
545
|
+
]);
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Program-owned reusable party-attribution rule. It is accepted atomically with the obligations that cite it;
|
|
549
|
+
* runtime people, organizations and review occurrences remain deliberately absent.
|
|
550
|
+
*/
|
|
551
|
+
export const AssuranceProgramSharedResponsibilityRuleSchema = z
|
|
552
|
+
.strictObject({
|
|
553
|
+
sharedResponsibilityRuleRef: AssuranceNamespacedRefSchema,
|
|
554
|
+
sharedResponsibilityRuleVersion: z.number().int().positive(),
|
|
555
|
+
scopeSelectorRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
556
|
+
governanceActorKinds: z.array(z.enum(AssuranceGovernanceActorKind)).min(2),
|
|
557
|
+
accountableRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
558
|
+
operatingRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
559
|
+
evidenceProviderRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
560
|
+
approvingRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
561
|
+
conflictResolutionRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
562
|
+
precedence: AssuranceProgramSharedResponsibilityPrecedenceSchema,
|
|
563
|
+
rationale: z.string().trim().min(1),
|
|
564
|
+
reviewedByRoleRef: AssuranceNamespacedRefSchema,
|
|
565
|
+
reviewedAt: AssuranceIsoDateTimeSchema,
|
|
566
|
+
})
|
|
567
|
+
.superRefine((rule, context) => {
|
|
568
|
+
addUniqueSortedIssue(rule.scopeSelectorRefs, context, ["scopeSelectorRefs"], "scopeSelectorRefs");
|
|
569
|
+
addUniqueSortedIssue(rule.governanceActorKinds, context, ["governanceActorKinds"], "governanceActorKinds");
|
|
570
|
+
for (const field of ["accountableRoleRefs", "operatingRoleRefs", "evidenceProviderRoleRefs", "approvingRoleRefs", "conflictResolutionRoleRefs"] as const)
|
|
571
|
+
addUniqueSortedIssue(rule[field], context, [field], field);
|
|
572
|
+
if (
|
|
573
|
+
rule.precedence.mode === AssuranceProgramSharedResponsibilityPrecedenceMode.NAMED_ACTOR_PRECEDENCE &&
|
|
574
|
+
!rule.governanceActorKinds.includes(rule.precedence.precedenceActorKind)
|
|
575
|
+
)
|
|
576
|
+
context.addIssue({
|
|
577
|
+
code: "custom",
|
|
578
|
+
message: "precedenceActorKind must occur in governanceActorKinds",
|
|
579
|
+
path: ["precedence", "precedenceActorKind"],
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
export type AssuranceProgramSharedResponsibilityRule = z.infer<typeof AssuranceProgramSharedResponsibilityRuleSchema>;
|
|
583
|
+
|
|
584
|
+
/** Exact human-reviewed coverage claim over one obligation and its complete cited source-requirement inventory. */
|
|
585
|
+
export const AssuranceProgramObligationCoverageDecisionSchema = z
|
|
586
|
+
.strictObject({
|
|
587
|
+
coverageDecisionRef: AssuranceNamespacedRefSchema,
|
|
588
|
+
coverageDecisionVersion: z.number().int().positive(),
|
|
589
|
+
obligation: AssuranceProgramObligationIdentitySchema,
|
|
590
|
+
sourceRequirementRefs: z.array(AssuranceProgramSourceRequirementReferenceSchema).min(1),
|
|
591
|
+
reviewDisposition: z.enum(AssuranceProgramObligationCoverageReviewDisposition),
|
|
592
|
+
reviewedByRoleRef: AssuranceNamespacedRefSchema,
|
|
593
|
+
reviewedAt: AssuranceIsoDateTimeSchema,
|
|
594
|
+
rationale: z.string().trim().min(1),
|
|
595
|
+
limitationRefs: z.array(AssuranceNamespacedRefSchema),
|
|
596
|
+
})
|
|
597
|
+
.superRefine((decision, context) => {
|
|
598
|
+
addUniqueSortedIssue(decision.sourceRequirementRefs.map(versionedSourceRequirementKey), context, ["sourceRequirementRefs"], "sourceRequirementRefs");
|
|
599
|
+
addUniqueSortedIssue(decision.limitationRefs, context, ["limitationRefs"], "limitationRefs");
|
|
600
|
+
});
|
|
601
|
+
export type AssuranceProgramObligationCoverageDecision = z.infer<typeof AssuranceProgramObligationCoverageDecisionSchema>;
|
|
602
|
+
|
|
603
|
+
const AssuranceProgramObligationApplicabilityDecisionCommonSchema = z.strictObject({
|
|
604
|
+
decisionRef: AssuranceNamespacedRefSchema,
|
|
605
|
+
decisionVersion: z.number().int().positive(),
|
|
606
|
+
rationale: z.string().trim().min(1),
|
|
607
|
+
reviewedByRoleRef: AssuranceNamespacedRefSchema,
|
|
608
|
+
decidedAt: AssuranceIsoDateTimeSchema,
|
|
609
|
+
evidenceRefs: z.array(AssuranceNamespacedRefSchema),
|
|
610
|
+
invalidationConditionRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
/** Outcome-level applicability. It cannot encode lifecycle activation, operating status or a compliance conclusion. */
|
|
614
|
+
export const AssuranceProgramObligationApplicabilityDecisionSchema = z
|
|
615
|
+
.discriminatedUnion("status", [
|
|
616
|
+
AssuranceProgramObligationApplicabilityDecisionCommonSchema.extend({ status: z.literal(AssuranceProgramObligationApplicabilityStatus.APPLICABLE) }),
|
|
617
|
+
AssuranceProgramObligationApplicabilityDecisionCommonSchema.extend({
|
|
618
|
+
status: z.literal(AssuranceProgramObligationApplicabilityStatus.NOT_APPLICABLE),
|
|
619
|
+
evidenceRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
620
|
+
}),
|
|
621
|
+
AssuranceProgramObligationApplicabilityDecisionCommonSchema.extend({ status: z.literal(AssuranceProgramObligationApplicabilityStatus.UNDETERMINED) }),
|
|
622
|
+
])
|
|
623
|
+
.superRefine((decision, context) => {
|
|
624
|
+
addUniqueSortedIssue(decision.evidenceRefs, context, ["evidenceRefs"], "evidenceRefs");
|
|
625
|
+
addUniqueSortedIssue(decision.invalidationConditionRefs, context, ["invalidationConditionRefs"], "invalidationConditionRefs");
|
|
626
|
+
});
|
|
627
|
+
export type AssuranceProgramObligationApplicabilityDecision = z.infer<typeof AssuranceProgramObligationApplicabilityDecisionSchema>;
|
|
628
|
+
|
|
629
|
+
/** One source-neutral application obligation. External framework ids and protected source bytes remain outside this contract. */
|
|
630
|
+
export const AssuranceProgramObligationEntrySchema = z
|
|
631
|
+
.strictObject({
|
|
632
|
+
obligationRef: AssuranceNamespacedRefSchema,
|
|
633
|
+
obligationVersion: z.number().int().positive(),
|
|
634
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
635
|
+
scopeSelectorRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
636
|
+
governanceActorKinds: z.array(z.enum(AssuranceGovernanceActorKind)).min(1),
|
|
637
|
+
sharedResponsibilityRule: AssuranceProgramSharedResponsibilityRuleIdentitySchema.optional(),
|
|
638
|
+
sourceRequirementRefs: z.array(AssuranceProgramSourceRequirementReferenceSchema).min(1),
|
|
639
|
+
sourceApplicabilityDecisionRefs: z.array(AssuranceProgramSourceApplicabilityDecisionIdentitySchema).min(1),
|
|
640
|
+
coverageDecision: AssuranceProgramObligationCoverageDecisionIdentitySchema,
|
|
641
|
+
applicability: AssuranceProgramObligationApplicabilityDecisionSchema,
|
|
642
|
+
responsibilityAssignmentRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
643
|
+
implementationExpectationRefs: z.array(AssuranceProgramExpectationIdentitySchema).min(1),
|
|
644
|
+
evidenceExpectationRefs: z.array(AssuranceProgramExpectationIdentitySchema).min(1),
|
|
645
|
+
verificationExpectationRefs: z.array(AssuranceProgramExpectationIdentitySchema).min(1),
|
|
646
|
+
requiredProofStage: z.enum(AssuranceProgramProofStage),
|
|
647
|
+
blockingEffect: z.enum(AssuranceProgramObligationBlockingEffect),
|
|
648
|
+
gapRefs: z.array(AssuranceProgramFindingIdentitySchema),
|
|
649
|
+
dependencyObligationRefs: z.array(AssuranceProgramObligationIdentitySchema),
|
|
650
|
+
reviewOwnerRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
651
|
+
reviewOn: AssuranceIsoDateSchema,
|
|
652
|
+
reviewTriggerRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
653
|
+
})
|
|
654
|
+
.superRefine((entry, context) => {
|
|
655
|
+
addUniqueSortedIssue(entry.scopeSelectorRefs, context, ["scopeSelectorRefs"], "scopeSelectorRefs");
|
|
656
|
+
addUniqueSortedIssue(entry.governanceActorKinds, context, ["governanceActorKinds"], "governanceActorKinds");
|
|
657
|
+
addUniqueSortedIssue(entry.sourceRequirementRefs.map(versionedSourceRequirementKey), context, ["sourceRequirementRefs"], "sourceRequirementRefs");
|
|
658
|
+
addUniqueSortedIssue(
|
|
659
|
+
entry.sourceApplicabilityDecisionRefs.map((identity) => `${identity.decisionRef}@${identity.decisionVersion}`),
|
|
660
|
+
context,
|
|
661
|
+
["sourceApplicabilityDecisionRefs"],
|
|
662
|
+
"sourceApplicabilityDecisionRefs",
|
|
663
|
+
);
|
|
664
|
+
addUniqueSortedIssue(entry.responsibilityAssignmentRefs, context, ["responsibilityAssignmentRefs"], "responsibilityAssignmentRefs");
|
|
665
|
+
for (const field of ["implementationExpectationRefs", "evidenceExpectationRefs", "verificationExpectationRefs"] as const)
|
|
666
|
+
addUniqueSortedIssue(entry[field].map(versionedExpectationKey), context, [field], field);
|
|
667
|
+
addUniqueSortedIssue(
|
|
668
|
+
entry.gapRefs.map((identity) => `${identity.findingRef}@${identity.findingVersion}`),
|
|
669
|
+
context,
|
|
670
|
+
["gapRefs"],
|
|
671
|
+
"gapRefs",
|
|
672
|
+
);
|
|
673
|
+
addUniqueSortedIssue(
|
|
674
|
+
entry.dependencyObligationRefs.map((identity) => `${identity.obligationRef}@${identity.obligationVersion}`),
|
|
675
|
+
context,
|
|
676
|
+
["dependencyObligationRefs"],
|
|
677
|
+
"dependencyObligationRefs",
|
|
678
|
+
);
|
|
679
|
+
addUniqueSortedIssue(entry.reviewOwnerRoleRefs, context, ["reviewOwnerRoleRefs"], "reviewOwnerRoleRefs");
|
|
680
|
+
addUniqueSortedIssue(entry.reviewTriggerRefs, context, ["reviewTriggerRefs"], "reviewTriggerRefs");
|
|
681
|
+
if (entry.governanceActorKinds.length === 1 && entry.sharedResponsibilityRule)
|
|
682
|
+
context.addIssue({ code: "custom", message: "a single governance actor cannot cite a shared-responsibility rule", path: ["sharedResponsibilityRule"] });
|
|
683
|
+
if (entry.governanceActorKinds.length > 1 && !entry.sharedResponsibilityRule)
|
|
684
|
+
context.addIssue({
|
|
685
|
+
code: "custom",
|
|
686
|
+
message: "multiple governance actors require an exact shared-responsibility rule",
|
|
687
|
+
path: ["sharedResponsibilityRule"],
|
|
688
|
+
});
|
|
689
|
+
if (
|
|
690
|
+
entry.dependencyObligationRefs.some(
|
|
691
|
+
(identity) => identity.obligationRef === entry.obligationRef && identity.obligationVersion === entry.obligationVersion,
|
|
692
|
+
)
|
|
693
|
+
)
|
|
694
|
+
context.addIssue({ code: "custom", message: "an obligation cannot depend on itself", path: ["dependencyObligationRefs"] });
|
|
695
|
+
});
|
|
696
|
+
export type AssuranceProgramObligationEntry = z.infer<typeof AssuranceProgramObligationEntrySchema>;
|
|
697
|
+
|
|
698
|
+
/** Complete, content-addressed application obligation inventory. It is not the governed-document release register. */
|
|
699
|
+
export const AssuranceProgramObligationRegisterSchema = z
|
|
700
|
+
.strictObject({
|
|
701
|
+
schemaVersion: z.literal(1),
|
|
702
|
+
registerRef: AssuranceNamespacedRefSchema,
|
|
703
|
+
registerVersion: z.number().int().positive(),
|
|
704
|
+
entries: z.array(AssuranceProgramObligationEntrySchema).min(1),
|
|
705
|
+
})
|
|
706
|
+
.superRefine((register, context) =>
|
|
707
|
+
addUniqueSortedIssue(
|
|
708
|
+
register.entries.map((entry) => `${entry.obligationRef}@${entry.obligationVersion}`),
|
|
709
|
+
context,
|
|
710
|
+
["entries"],
|
|
711
|
+
"obligation identities",
|
|
712
|
+
),
|
|
713
|
+
);
|
|
714
|
+
export type AssuranceProgramObligationRegister = z.infer<typeof AssuranceProgramObligationRegisterSchema>;
|
|
715
|
+
|
|
716
|
+
const versionedObligationKey = (identity: { obligationRef: string; obligationVersion: number }): string =>
|
|
717
|
+
`${identity.obligationRef}@${identity.obligationVersion}`;
|
|
718
|
+
const versionedApplicabilityDecisionKey = (identity: { decisionRef: string; decisionVersion: number }): string =>
|
|
719
|
+
`${identity.decisionRef}@${identity.decisionVersion}`;
|
|
720
|
+
const versionedCoverageDecisionKey = (identity: { coverageDecisionRef: string; coverageDecisionVersion: number }): string =>
|
|
721
|
+
`${identity.coverageDecisionRef}@${identity.coverageDecisionVersion}`;
|
|
722
|
+
const versionedSharedResponsibilityRuleKey = (identity: { sharedResponsibilityRuleRef: string; sharedResponsibilityRuleVersion: number }): string =>
|
|
723
|
+
`${identity.sharedResponsibilityRuleRef}@${identity.sharedResponsibilityRuleVersion}`;
|
|
724
|
+
|
|
725
|
+
/** A non-secret selected option. Values are references to accepted profiles/options rather than arbitrary credential-bearing blobs. */
|
|
726
|
+
export const AssuranceProgramSelectedOptionSchema = z.strictObject({
|
|
727
|
+
parameterRef: AssuranceNamespacedRefSchema,
|
|
728
|
+
selectedOptionRef: AssuranceNamespacedRefSchema,
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
export const AssuranceProgramCapabilitySelectionSchema = z
|
|
732
|
+
.strictObject({
|
|
733
|
+
capabilityKind: z.enum(AssuranceProgramCapabilityKind),
|
|
734
|
+
capabilityRef: AssuranceNamespacedRefSchema,
|
|
735
|
+
capabilityVersion: z.number().int().positive(),
|
|
736
|
+
profileRef: AssuranceNamespacedRefSchema.optional(),
|
|
737
|
+
selectedOptions: z.array(AssuranceProgramSelectedOptionSchema),
|
|
738
|
+
})
|
|
739
|
+
.superRefine((selection, context) => {
|
|
740
|
+
addUniqueSortedIssue(
|
|
741
|
+
selection.selectedOptions.map((option) => option.parameterRef),
|
|
742
|
+
context,
|
|
743
|
+
["selectedOptions"],
|
|
744
|
+
"selected option parameter refs",
|
|
745
|
+
);
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
export const AssuranceProgramImplementationDecisionSchema = z
|
|
749
|
+
.strictObject({
|
|
750
|
+
decisionRef: AssuranceNamespacedRefSchema,
|
|
751
|
+
decisionVersion: z.number().int().positive(),
|
|
752
|
+
objective: AssuranceObjectiveIdentitySchema,
|
|
753
|
+
scopeSelectorRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
754
|
+
resolution: z.enum(AssuranceProgramCapabilityResolution),
|
|
755
|
+
capabilitySelections: z.array(AssuranceProgramCapabilitySelectionSchema),
|
|
756
|
+
selectionAuthorityRef: AssuranceNamespacedRefSchema,
|
|
757
|
+
knownLimitations: z.array(z.string().trim().min(1)),
|
|
758
|
+
gapDisposition: z.enum(AssuranceGapDisposition),
|
|
759
|
+
gapRefs: z.array(AssuranceProgramFindingIdentitySchema),
|
|
760
|
+
})
|
|
761
|
+
.superRefine((decision, context) => {
|
|
762
|
+
addUniqueSortedIssue(decision.scopeSelectorRefs, context, ["scopeSelectorRefs"], "scopeSelectorRefs");
|
|
763
|
+
addUniqueSortedIssue(
|
|
764
|
+
decision.capabilitySelections.map((selection) => selection.capabilityRef),
|
|
765
|
+
context,
|
|
766
|
+
["capabilitySelections"],
|
|
767
|
+
"capability selection refs",
|
|
768
|
+
);
|
|
769
|
+
addUniqueSortedIssue(decision.knownLimitations, context, ["knownLimitations"], "knownLimitations");
|
|
770
|
+
addUniqueSortedIssue(
|
|
771
|
+
decision.gapRefs.map((identity) => `${identity.findingRef}@${identity.findingVersion}`),
|
|
772
|
+
context,
|
|
773
|
+
["gapRefs"],
|
|
774
|
+
"gapRefs",
|
|
775
|
+
);
|
|
776
|
+
if (
|
|
777
|
+
(decision.resolution === AssuranceProgramCapabilityResolution.IMPLEMENTABLE || decision.resolution === AssuranceProgramCapabilityResolution.PARTIAL) &&
|
|
778
|
+
decision.capabilitySelections.length === 0
|
|
779
|
+
)
|
|
780
|
+
context.addIssue({
|
|
781
|
+
code: "custom",
|
|
782
|
+
message: "IMPLEMENTABLE and PARTIAL resolutions require at least one selected capability",
|
|
783
|
+
path: ["capabilitySelections"],
|
|
784
|
+
});
|
|
785
|
+
if (decision.resolution === AssuranceProgramCapabilityResolution.UNSUPPORTED && decision.capabilitySelections.length > 0)
|
|
786
|
+
context.addIssue({ code: "custom", message: "UNSUPPORTED resolution cannot select an implementation capability", path: ["capabilitySelections"] });
|
|
787
|
+
if (
|
|
788
|
+
decision.resolution === AssuranceProgramCapabilityResolution.HUMAN_OR_EXTERNAL &&
|
|
789
|
+
!decision.capabilitySelections.some((selection) => selection.capabilityKind === AssuranceProgramCapabilityKind.HUMAN_OR_EXTERNAL)
|
|
790
|
+
)
|
|
791
|
+
context.addIssue({
|
|
792
|
+
code: "custom",
|
|
793
|
+
message: "HUMAN_OR_EXTERNAL resolution requires a human/external capability selection",
|
|
794
|
+
path: ["capabilitySelections"],
|
|
795
|
+
});
|
|
796
|
+
if (decision.gapDisposition === AssuranceGapDisposition.RESOLVED && decision.gapRefs.length > 0)
|
|
797
|
+
context.addIssue({ code: "custom", message: "RESOLVED disposition cannot retain open gap refs", path: ["gapRefs"] });
|
|
798
|
+
const openGapDisposition =
|
|
799
|
+
decision.gapDisposition === AssuranceGapDisposition.OPEN ||
|
|
800
|
+
decision.gapDisposition === AssuranceGapDisposition.RISK_ACCEPTED ||
|
|
801
|
+
decision.gapDisposition === AssuranceGapDisposition.REMEDIATION_PLANNED;
|
|
802
|
+
if (openGapDisposition && decision.gapRefs.length === 0)
|
|
803
|
+
context.addIssue({ code: "custom", message: "an open gap disposition requires explicit gap refs", path: ["gapRefs"] });
|
|
804
|
+
if (
|
|
805
|
+
(decision.gapDisposition === AssuranceGapDisposition.NOT_EVALUATED || decision.gapDisposition === AssuranceGapDisposition.NOT_APPLICABLE) &&
|
|
806
|
+
decision.gapRefs.length > 0
|
|
807
|
+
)
|
|
808
|
+
context.addIssue({ code: "custom", message: "NOT_EVALUATED and NOT_APPLICABLE dispositions cannot cite gap records", path: ["gapRefs"] });
|
|
809
|
+
if (decision.gapDisposition === AssuranceGapDisposition.NOT_APPLICABLE)
|
|
810
|
+
context.addIssue({
|
|
811
|
+
code: "custom",
|
|
812
|
+
message: "implementation decisions cannot use NOT_APPLICABLE; applicability is decided separately per source and scope",
|
|
813
|
+
path: ["gapDisposition"],
|
|
814
|
+
});
|
|
815
|
+
if (
|
|
816
|
+
(decision.resolution === AssuranceProgramCapabilityResolution.PARTIAL || decision.resolution === AssuranceProgramCapabilityResolution.UNSUPPORTED) &&
|
|
817
|
+
decision.knownLimitations.length === 0
|
|
818
|
+
)
|
|
819
|
+
context.addIssue({ code: "custom", message: "PARTIAL and UNSUPPORTED resolutions require known limitations", path: ["knownLimitations"] });
|
|
820
|
+
if (
|
|
821
|
+
(decision.resolution === AssuranceProgramCapabilityResolution.PARTIAL || decision.resolution === AssuranceProgramCapabilityResolution.UNSUPPORTED) &&
|
|
822
|
+
!openGapDisposition
|
|
823
|
+
)
|
|
824
|
+
context.addIssue({ code: "custom", message: "PARTIAL and UNSUPPORTED resolutions require an open gap disposition", path: ["gapDisposition"] });
|
|
825
|
+
});
|
|
826
|
+
export type AssuranceProgramImplementationDecision = z.infer<typeof AssuranceProgramImplementationDecisionSchema>;
|
|
827
|
+
|
|
828
|
+
/** Role policy, not a live assignment. Each responsibility remains semantically distinct. */
|
|
829
|
+
export const AssuranceProgramResponsibilityAssignmentSchema = z
|
|
830
|
+
.strictObject({
|
|
831
|
+
assignmentRef: AssuranceNamespacedRefSchema,
|
|
832
|
+
scopeSelectorRef: AssuranceNamespacedRefSchema,
|
|
833
|
+
responsibleRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
834
|
+
operatingRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
835
|
+
evidenceProviderRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
836
|
+
approvingRoleRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
837
|
+
escalationRoleRefs: z.array(AssuranceNamespacedRefSchema),
|
|
838
|
+
})
|
|
839
|
+
.superRefine((assignment, context) => {
|
|
840
|
+
for (const key of ["responsibleRoleRefs", "operatingRoleRefs", "evidenceProviderRoleRefs", "approvingRoleRefs", "escalationRoleRefs"] as const) {
|
|
841
|
+
addUniqueSortedIssue(assignment[key], context, [key], key);
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
export type AssuranceProgramResponsibilityAssignment = z.infer<typeof AssuranceProgramResponsibilityAssignmentSchema>;
|
|
845
|
+
|
|
846
|
+
export const AssuranceProgramGapOrExceptionSchema = z
|
|
847
|
+
.strictObject({
|
|
848
|
+
findingRef: AssuranceNamespacedRefSchema,
|
|
849
|
+
findingVersion: z.number().int().positive(),
|
|
850
|
+
kind: z.enum(AssuranceProgramFindingKind),
|
|
851
|
+
objective: AssuranceObjectiveIdentitySchema.optional(),
|
|
852
|
+
source: AssuranceSourceIdentitySchema.optional(),
|
|
853
|
+
scopeSelectorRef: AssuranceNamespacedRefSchema,
|
|
854
|
+
scopeSelectorVersion: z.number().int().positive(),
|
|
855
|
+
reason: z.string().trim().min(1),
|
|
856
|
+
ownerRoleRef: AssuranceNamespacedRefSchema,
|
|
857
|
+
compensatingControlRefs: z.array(AssuranceNamespacedRefSchema),
|
|
858
|
+
disposition: z.enum(AssuranceGapDisposition),
|
|
859
|
+
authorityDecisionRef: AssuranceNamespacedRefSchema.optional(),
|
|
860
|
+
reviewOn: AssuranceIsoDateSchema,
|
|
861
|
+
expiresOn: AssuranceIsoDateSchema.optional(),
|
|
862
|
+
reopenOnSourceChange: z.literal(true),
|
|
863
|
+
reopenOnScopeChange: z.literal(true),
|
|
864
|
+
})
|
|
865
|
+
.superRefine((finding, context) => {
|
|
866
|
+
addUniqueSortedIssue(finding.compensatingControlRefs, context, ["compensatingControlRefs"], "compensatingControlRefs");
|
|
867
|
+
if (finding.kind === AssuranceProgramFindingKind.EXCEPTION && (!finding.authorityDecisionRef || !finding.expiresOn)) {
|
|
868
|
+
context.addIssue({ code: "custom", message: "an exception requires explicit authority and expiry", path: ["authorityDecisionRef"] });
|
|
869
|
+
}
|
|
870
|
+
if (finding.disposition === AssuranceGapDisposition.RISK_ACCEPTED && !finding.authorityDecisionRef) {
|
|
871
|
+
context.addIssue({ code: "custom", message: "risk acceptance requires an authority decision", path: ["authorityDecisionRef"] });
|
|
872
|
+
}
|
|
873
|
+
if (finding.expiresOn && finding.reviewOn > finding.expiresOn) {
|
|
874
|
+
context.addIssue({ code: "custom", message: "reviewOn cannot follow expiresOn", path: ["reviewOn"] });
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
export type AssuranceProgramGapOrException = z.infer<typeof AssuranceProgramGapOrExceptionSchema>;
|
|
878
|
+
|
|
879
|
+
const AssuranceProgramDocumentationRequirementCommonSchema = z.strictObject({
|
|
880
|
+
requirementRef: AssuranceNamespacedRefSchema,
|
|
881
|
+
requirementVersion: z.number().int().positive(),
|
|
882
|
+
documentKindRef: AssuranceNamespacedRefSchema,
|
|
883
|
+
documentRef: AssuranceNamespacedRefSchema,
|
|
884
|
+
documentVersion: z.number().int().positive(),
|
|
885
|
+
requiredAcceptedFactRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
886
|
+
requiredVariableRefs: z.array(AssuranceNamespacedRefSchema),
|
|
887
|
+
classificationPolicyRef: AssuranceNamespacedRefSchema,
|
|
888
|
+
storagePolicyRef: AssuranceNamespacedRefSchema,
|
|
889
|
+
approvingRoleRefs: z.array(AssuranceNamespacedRefSchema),
|
|
890
|
+
sourceRefs: z.array(AssuranceSourceIdentitySchema),
|
|
891
|
+
contentIdentityRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
892
|
+
});
|
|
893
|
+
|
|
894
|
+
/** Retained pre-document-authority shape. Parse/replay only; current application authoring uses v2. */
|
|
895
|
+
export const AssuranceProgramDocumentationRequirementV1Schema = AssuranceProgramDocumentationRequirementCommonSchema.extend({
|
|
896
|
+
approvalRequirement: z.enum(AssuranceProgramDocumentApprovalRequirement),
|
|
897
|
+
}).superRefine((requirement, context) => {
|
|
898
|
+
addUniqueSortedIssue(requirement.requiredAcceptedFactRefs, context, ["requiredAcceptedFactRefs"], "requiredAcceptedFactRefs");
|
|
899
|
+
addUniqueSortedIssue(requirement.requiredVariableRefs, context, ["requiredVariableRefs"], "requiredVariableRefs");
|
|
900
|
+
addUniqueSortedIssue(requirement.approvingRoleRefs, context, ["approvingRoleRefs"], "approvingRoleRefs");
|
|
901
|
+
addUniqueSortedIssue(
|
|
902
|
+
requirement.sourceRefs.map((source) => `${source.sourceRef}@${source.sourceVersion}`),
|
|
903
|
+
context,
|
|
904
|
+
["sourceRefs"],
|
|
905
|
+
"sourceRefs",
|
|
906
|
+
);
|
|
907
|
+
addUniqueSortedIssue(requirement.contentIdentityRefs, context, ["contentIdentityRefs"], "contentIdentityRefs");
|
|
908
|
+
if (requirement.approvalRequirement === AssuranceProgramDocumentApprovalRequirement.APPROVAL_REQUIRED && requirement.approvingRoleRefs.length === 0) {
|
|
909
|
+
context.addIssue({ code: "custom", message: "approval-required documentation needs at least one approving role", path: ["approvingRoleRefs"] });
|
|
910
|
+
}
|
|
911
|
+
if (requirement.approvalRequirement === AssuranceProgramDocumentApprovalRequirement.NO_APPROVAL_REQUIRED && requirement.approvingRoleRefs.length > 0) {
|
|
912
|
+
context.addIssue({ code: "custom", message: "documentation without approval cannot declare approving roles", path: ["approvingRoleRefs"] });
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
/** Current document requirement bound to an engine-owned definition and an explicit application applicability decision. */
|
|
917
|
+
export const AssuranceProgramDocumentationRequirementV2Schema = AssuranceProgramDocumentationRequirementCommonSchema.extend({
|
|
918
|
+
schemaVersion: z.literal(2),
|
|
919
|
+
definition: GovernedDocumentDefinitionIdentitySchema,
|
|
920
|
+
governanceScope: GovernedDocumentGovernanceScopeSchema,
|
|
921
|
+
applicabilityStatus: z.enum(GovernedDocumentApplicabilityStatus),
|
|
922
|
+
applicabilityRationale: z.string().trim().min(1),
|
|
923
|
+
applicabilityDecidedByRef: AssuranceNamespacedRefSchema,
|
|
924
|
+
applicabilityDecidedAt: AssuranceIsoDateTimeSchema,
|
|
925
|
+
applicabilityDependencyRefs: z.array(AssuranceNamespacedRefSchema).min(1),
|
|
926
|
+
audienceKinds: z.array(z.enum(GovernedDocumentAudienceKind)).min(1),
|
|
927
|
+
requiredReviewKinds: z.array(z.enum(GovernedDocumentReviewKind)).min(1),
|
|
928
|
+
allowedInteractionKinds: z.array(z.enum(GovernedDocumentInteractionKind)),
|
|
929
|
+
publicationChannelKinds: z.array(z.enum(GovernedDocumentPublicationChannelKind)).min(1),
|
|
930
|
+
}).superRefine((requirement, context) => {
|
|
931
|
+
for (const [key, values] of [
|
|
932
|
+
["requiredAcceptedFactRefs", requirement.requiredAcceptedFactRefs],
|
|
933
|
+
["requiredVariableRefs", requirement.requiredVariableRefs],
|
|
934
|
+
["approvingRoleRefs", requirement.approvingRoleRefs],
|
|
935
|
+
["contentIdentityRefs", requirement.contentIdentityRefs],
|
|
936
|
+
["applicabilityDependencyRefs", requirement.applicabilityDependencyRefs],
|
|
937
|
+
["audienceKinds", requirement.audienceKinds],
|
|
938
|
+
["requiredReviewKinds", requirement.requiredReviewKinds],
|
|
939
|
+
["allowedInteractionKinds", requirement.allowedInteractionKinds],
|
|
940
|
+
["publicationChannelKinds", requirement.publicationChannelKinds],
|
|
941
|
+
] as const)
|
|
942
|
+
addUniqueSortedIssue(values, context, [key], key);
|
|
943
|
+
addUniqueSortedIssue(
|
|
944
|
+
requirement.sourceRefs.map((source) => `${source.sourceRef}@${source.sourceVersion}`),
|
|
945
|
+
context,
|
|
946
|
+
["sourceRefs"],
|
|
947
|
+
"sourceRefs",
|
|
948
|
+
);
|
|
949
|
+
if (requirement.applicabilityStatus === GovernedDocumentApplicabilityStatus.APPLICABLE && requirement.approvingRoleRefs.length === 0) {
|
|
950
|
+
context.addIssue({ code: "custom", message: "an applicable governed document requires at least one approving role", path: ["approvingRoleRefs"] });
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
export type AssuranceProgramDocumentationRequirementV2 = z.infer<typeof AssuranceProgramDocumentationRequirementV2Schema>;
|
|
954
|
+
|
|
955
|
+
export const AssuranceProgramDocumentationRequirementSchema = z.union([
|
|
956
|
+
AssuranceProgramDocumentationRequirementV1Schema,
|
|
957
|
+
AssuranceProgramDocumentationRequirementV2Schema,
|
|
958
|
+
]);
|
|
959
|
+
export type AssuranceProgramDocumentationRequirement = z.infer<typeof AssuranceProgramDocumentationRequirementSchema>;
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Whether an issue is a statement about the authored specification or about the host it was accepted against.
|
|
963
|
+
*
|
|
964
|
+
* An accepted assurance program is a point-in-time governance decision over exact implementation bytes. The host
|
|
965
|
+
* that resolves those bytes keeps moving underneath it. Collapsing both situations into one "invalid" verdict is
|
|
966
|
+
* what forces an operator to choose between a dead runtime and deleting the acceptance record — so the two are
|
|
967
|
+
* separated here, in the contract, rather than guessed at by each consumer.
|
|
968
|
+
*
|
|
969
|
+
* - `SPECIFICATION_DEFECT` — the authored bytes are wrong: an unknown objective, a self-inconsistent digest, an
|
|
970
|
+
* expired exception, a capability the host does not offer at all. Nothing the host can do makes these correct.
|
|
971
|
+
* Consumers must fail closed.
|
|
972
|
+
* - `HOST_ATTESTATION_INVALID` — the authored bytes are not implicated; the host's own authority snapshot fails
|
|
973
|
+
* its integrity checks. A corrupt attestation cannot authorize anything, so consumers must also fail closed —
|
|
974
|
+
* but the fault, and therefore the remediation, is the host's compiled basis, not the specification. This class
|
|
975
|
+
* exists so an operator is not sent to debug a specification that is fine.
|
|
976
|
+
* - `HOST_DIVERGENCE` — the authored bytes are well-formed and internally consistent, the host attestation is
|
|
977
|
+
* sound, and the host's view of the implementation has simply moved since acceptance. This is an assurance
|
|
978
|
+
* *finding* — the program needs re-accepting against the new implementation — and consumers that record it
|
|
979
|
+
* durably may continue operating.
|
|
980
|
+
*
|
|
981
|
+
* Two of the three classes fail closed. The classes are not a severity scale: they name *which artifact is at
|
|
982
|
+
* fault*, and only `HOST_DIVERGENCE` is re-acceptable. Do not collapse the two fail-closed classes back together
|
|
983
|
+
* on the grounds that they behave alike — the behaviour is shared, the diagnosis is not.
|
|
984
|
+
*
|
|
985
|
+
* Tolerating `HOST_DIVERGENCE` is only meaningful where a host authority exists to diverge from. A consumer
|
|
986
|
+
* validating a specification with no external authority never observes it.
|
|
987
|
+
*/
|
|
988
|
+
export enum AssuranceProgramSpecificationIssueClass {
|
|
989
|
+
SPECIFICATION_DEFECT = "SPECIFICATION_DEFECT",
|
|
990
|
+
HOST_ATTESTATION_INVALID = "HOST_ATTESTATION_INVALID",
|
|
991
|
+
HOST_DIVERGENCE = "HOST_DIVERGENCE",
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export enum AssuranceProgramSpecificationIssueKind {
|
|
995
|
+
AUTHORITY_SNAPSHOT_DIGEST_MISMATCH = "AUTHORITY_SNAPSHOT_DIGEST_MISMATCH",
|
|
996
|
+
AUTHORITY_SNAPSHOT_INVALID = "AUTHORITY_SNAPSHOT_INVALID",
|
|
997
|
+
AMBIGUOUS_APPLICABILITY = "AMBIGUOUS_APPLICABILITY",
|
|
998
|
+
/**
|
|
999
|
+
* The host offers this exact capability with the same kind and implementation refs, but its implementation
|
|
1000
|
+
* revision has moved since the program was accepted. The control is still present and still the same control —
|
|
1001
|
+
* only the bytes implementing it changed. Distinct from `UNKNOWN_CAPABILITY`, which means the host does not
|
|
1002
|
+
* offer the claimed capability at all.
|
|
1003
|
+
*/
|
|
1004
|
+
HOST_CAPABILITY_IMPLEMENTATION_DRIFT = "HOST_CAPABILITY_IMPLEMENTATION_DRIFT",
|
|
1005
|
+
/** The host supplies a valid authority basis, but it is not the exact basis identity accepted by the v2/v3 program. */
|
|
1006
|
+
HOST_AUTHORITY_BASIS_DRIFT = "HOST_AUTHORITY_BASIS_DRIFT",
|
|
1007
|
+
/**
|
|
1008
|
+
* An artifact pinned by an accepted source revision no longer matches the host-resolved implementation bytes.
|
|
1009
|
+
* Distinct from `UNKNOWN_SOURCE_REVISION`, which means the specification references a revision it never declared
|
|
1010
|
+
* — an internal inconsistency in the authored bytes rather than a statement about the host.
|
|
1011
|
+
*/
|
|
1012
|
+
HOST_IMPLEMENTATION_ARTIFACT_DRIFT = "HOST_IMPLEMENTATION_ARTIFACT_DRIFT",
|
|
1013
|
+
AMBIGUOUS_CONTROL_BINDING = "AMBIGUOUS_CONTROL_BINDING",
|
|
1014
|
+
AMBIGUOUS_OBLIGATION_BINDING = "AMBIGUOUS_OBLIGATION_BINDING",
|
|
1015
|
+
AMBIGUOUS_SHARED_RESPONSIBILITY_RULE = "AMBIGUOUS_SHARED_RESPONSIBILITY_RULE",
|
|
1016
|
+
AMBIGUOUS_IMPLEMENTATION_DECISION = "AMBIGUOUS_IMPLEMENTATION_DECISION",
|
|
1017
|
+
INCOMPLETE_APPLICABILITY = "INCOMPLETE_APPLICABILITY",
|
|
1018
|
+
INCOMPLETE_IMPLEMENTATION_DECISION = "INCOMPLETE_IMPLEMENTATION_DECISION",
|
|
1019
|
+
INCOMPLETE_RESPONSIBILITY_ASSIGNMENT = "INCOMPLETE_RESPONSIBILITY_ASSIGNMENT",
|
|
1020
|
+
DOCUMENT_AUTHORITY_CATALOG_DIGEST_MISMATCH = "DOCUMENT_AUTHORITY_CATALOG_DIGEST_MISMATCH",
|
|
1021
|
+
DOCUMENT_AUTHORITY_CATALOG_INVALID = "DOCUMENT_AUTHORITY_CATALOG_INVALID",
|
|
1022
|
+
OBJECTIVE_CATALOG_DIGEST_MISMATCH = "OBJECTIVE_CATALOG_DIGEST_MISMATCH",
|
|
1023
|
+
OBLIGATION_DEPENDENCY_CYCLE = "OBLIGATION_DEPENDENCY_CYCLE",
|
|
1024
|
+
OBLIGATION_GOVERNANCE_DIGEST_MISMATCH = "OBLIGATION_GOVERNANCE_DIGEST_MISMATCH",
|
|
1025
|
+
OBLIGATION_REGISTER_DIGEST_MISMATCH = "OBLIGATION_REGISTER_DIGEST_MISMATCH",
|
|
1026
|
+
RELATIONSHIP_MISMATCH = "RELATIONSHIP_MISMATCH",
|
|
1027
|
+
SOURCE_AUTHORITY_MISMATCH = "SOURCE_AUTHORITY_MISMATCH",
|
|
1028
|
+
SOURCE_IDENTITY_DIGEST_MISMATCH = "SOURCE_IDENTITY_DIGEST_MISMATCH",
|
|
1029
|
+
SOURCE_LIFECYCLE_CONFLICT = "SOURCE_LIFECYCLE_CONFLICT",
|
|
1030
|
+
SOURCE_REGISTRY_DIGEST_MISMATCH = "SOURCE_REGISTRY_DIGEST_MISMATCH",
|
|
1031
|
+
SOURCE_RIGHTS_UNAUTHORIZED = "SOURCE_RIGHTS_UNAUTHORIZED",
|
|
1032
|
+
SOURCE_REVISION_DIGEST_MISMATCH = "SOURCE_REVISION_DIGEST_MISMATCH",
|
|
1033
|
+
TEMPORAL_POLICY_CONFLICT = "TEMPORAL_POLICY_CONFLICT",
|
|
1034
|
+
UNKNOWN_APPLICABILITY_SOURCE = "UNKNOWN_APPLICABILITY_SOURCE",
|
|
1035
|
+
UNKNOWN_BINDING_SOURCE = "UNKNOWN_BINDING_SOURCE",
|
|
1036
|
+
/**
|
|
1037
|
+
* The host does not offer the claimed capability at all, offers it under a different capability kind, or resolves
|
|
1038
|
+
* it to different implementation refs. No host state makes the authored claim true. For a capability that is
|
|
1039
|
+
* present and unchanged except for its implementation revision, see `HOST_CAPABILITY_IMPLEMENTATION_DRIFT`.
|
|
1040
|
+
*/
|
|
1041
|
+
UNKNOWN_CAPABILITY = "UNKNOWN_CAPABILITY",
|
|
1042
|
+
UNKNOWN_DOCUMENT = "UNKNOWN_DOCUMENT",
|
|
1043
|
+
UNKNOWN_DOCUMENT_SOURCE = "UNKNOWN_DOCUMENT_SOURCE",
|
|
1044
|
+
UNKNOWN_FINDING = "UNKNOWN_FINDING",
|
|
1045
|
+
/** An authored v1 inventory or v2/v3 attested-ref set names an artifact which the host authority does not inventory. */
|
|
1046
|
+
UNKNOWN_IMPLEMENTATION_ARTIFACT = "UNKNOWN_IMPLEMENTATION_ARTIFACT",
|
|
1047
|
+
UNKNOWN_OBJECTIVE = "UNKNOWN_OBJECTIVE",
|
|
1048
|
+
UNKNOWN_OBLIGATION_GOVERNANCE_RECORD = "UNKNOWN_OBLIGATION_GOVERNANCE_RECORD",
|
|
1049
|
+
UNKNOWN_ROLE = "UNKNOWN_ROLE",
|
|
1050
|
+
UNKNOWN_SCOPE_SELECTOR = "UNKNOWN_SCOPE_SELECTOR",
|
|
1051
|
+
UNKNOWN_SOURCE_AUTHORITY = "UNKNOWN_SOURCE_AUTHORITY",
|
|
1052
|
+
UNKNOWN_SOURCE_REQUIREMENT = "UNKNOWN_SOURCE_REQUIREMENT",
|
|
1053
|
+
/**
|
|
1054
|
+
* The specification references a source revision it never declared — an internal inconsistency in the authored
|
|
1055
|
+
* bytes. For a declared revision whose artifact bytes no longer match the host, see
|
|
1056
|
+
* `HOST_IMPLEMENTATION_ARTIFACT_DRIFT`.
|
|
1057
|
+
*/
|
|
1058
|
+
UNKNOWN_SOURCE_REVISION = "UNKNOWN_SOURCE_REVISION",
|
|
1059
|
+
UNKNOWN_VALIDATION_AUTHORITY = "UNKNOWN_VALIDATION_AUTHORITY",
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
export interface AssuranceProgramSpecificationIssue {
|
|
1063
|
+
readonly kind: AssuranceProgramSpecificationIssueKind;
|
|
1064
|
+
readonly path: string;
|
|
1065
|
+
readonly message: string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Stable semantic subject of a recordable host-divergence issue.
|
|
1068
|
+
*
|
|
1069
|
+
* Required on every `HOST_DIVERGENCE` producer and deliberately independent of diagnostic prose and array-path
|
|
1070
|
+
* rendering. Durable replay compares `(kind, subjectRef)`; `message` remains operator-facing explanation only.
|
|
1071
|
+
* Non-recordable issues may omit it because they are always refused rather than persisted as accepted tolerance.
|
|
1072
|
+
*/
|
|
1073
|
+
readonly subjectRef?: string;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* The one runtime source classifying every issue kind.
|
|
1078
|
+
*
|
|
1079
|
+
* Exhaustive by construction: the `Record` key type is the enum itself, so adding a kind without deciding whether
|
|
1080
|
+
* it describes the specification or the host is a compile error rather than a silent default. Do not replace this
|
|
1081
|
+
* with a predicate over name prefixes — the classification is a semantic decision per kind, not a naming pattern.
|
|
1082
|
+
*
|
|
1083
|
+
* Every kind maps to exactly one class. That is only well-defined because kinds that previously carried both
|
|
1084
|
+
* meanings were split: `UNKNOWN_CAPABILITY` / `HOST_CAPABILITY_IMPLEMENTATION_DRIFT` and
|
|
1085
|
+
* `UNKNOWN_SOURCE_REVISION` / `HOST_IMPLEMENTATION_ARTIFACT_DRIFT`. Merging either pair back would make this
|
|
1086
|
+
* mapping lossy and silently re-enable tolerance of genuine specification defects.
|
|
1087
|
+
*/
|
|
1088
|
+
export const ASSURANCE_PROGRAM_SPECIFICATION_ISSUE_CLASS_BY_KIND: Readonly<
|
|
1089
|
+
Record<AssuranceProgramSpecificationIssueKind, AssuranceProgramSpecificationIssueClass>
|
|
1090
|
+
> = {
|
|
1091
|
+
[AssuranceProgramSpecificationIssueKind.HOST_CAPABILITY_IMPLEMENTATION_DRIFT]: AssuranceProgramSpecificationIssueClass.HOST_DIVERGENCE,
|
|
1092
|
+
[AssuranceProgramSpecificationIssueKind.HOST_AUTHORITY_BASIS_DRIFT]: AssuranceProgramSpecificationIssueClass.HOST_DIVERGENCE,
|
|
1093
|
+
[AssuranceProgramSpecificationIssueKind.HOST_IMPLEMENTATION_ARTIFACT_DRIFT]: AssuranceProgramSpecificationIssueClass.HOST_DIVERGENCE,
|
|
1094
|
+
[AssuranceProgramSpecificationIssueKind.AUTHORITY_SNAPSHOT_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1095
|
+
[AssuranceProgramSpecificationIssueKind.AUTHORITY_SNAPSHOT_INVALID]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1096
|
+
[AssuranceProgramSpecificationIssueKind.AMBIGUOUS_APPLICABILITY]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1097
|
+
[AssuranceProgramSpecificationIssueKind.AMBIGUOUS_CONTROL_BINDING]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1098
|
+
[AssuranceProgramSpecificationIssueKind.AMBIGUOUS_OBLIGATION_BINDING]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1099
|
+
[AssuranceProgramSpecificationIssueKind.AMBIGUOUS_SHARED_RESPONSIBILITY_RULE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1100
|
+
[AssuranceProgramSpecificationIssueKind.AMBIGUOUS_IMPLEMENTATION_DECISION]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1101
|
+
[AssuranceProgramSpecificationIssueKind.INCOMPLETE_APPLICABILITY]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1102
|
+
[AssuranceProgramSpecificationIssueKind.INCOMPLETE_IMPLEMENTATION_DECISION]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1103
|
+
[AssuranceProgramSpecificationIssueKind.INCOMPLETE_RESPONSIBILITY_ASSIGNMENT]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1104
|
+
[AssuranceProgramSpecificationIssueKind.DOCUMENT_AUTHORITY_CATALOG_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1105
|
+
[AssuranceProgramSpecificationIssueKind.DOCUMENT_AUTHORITY_CATALOG_INVALID]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1106
|
+
[AssuranceProgramSpecificationIssueKind.OBJECTIVE_CATALOG_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1107
|
+
[AssuranceProgramSpecificationIssueKind.OBLIGATION_DEPENDENCY_CYCLE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1108
|
+
[AssuranceProgramSpecificationIssueKind.OBLIGATION_GOVERNANCE_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1109
|
+
[AssuranceProgramSpecificationIssueKind.OBLIGATION_REGISTER_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1110
|
+
[AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1111
|
+
/*
|
|
1112
|
+
* Deliberately a specification defect, not host attestation: the host record is internally sound and the program
|
|
1113
|
+
* simply disagrees with it. That is equally consistent with a mis-transcribed reference and with host metadata
|
|
1114
|
+
* moving on, and tolerance is the dangerous direction — so this stays fail-closed and spec-pointing until a
|
|
1115
|
+
* concrete case proves it is drift.
|
|
1116
|
+
*/
|
|
1117
|
+
[AssuranceProgramSpecificationIssueKind.SOURCE_AUTHORITY_MISMATCH]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1118
|
+
/* The host registry record's own identity digest does not match its own canonical bytes — nothing to do with the program. */
|
|
1119
|
+
[AssuranceProgramSpecificationIssueKind.SOURCE_IDENTITY_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1120
|
+
[AssuranceProgramSpecificationIssueKind.SOURCE_LIFECYCLE_CONFLICT]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1121
|
+
[AssuranceProgramSpecificationIssueKind.SOURCE_REGISTRY_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.HOST_ATTESTATION_INVALID,
|
|
1122
|
+
[AssuranceProgramSpecificationIssueKind.SOURCE_RIGHTS_UNAUTHORIZED]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1123
|
+
[AssuranceProgramSpecificationIssueKind.SOURCE_REVISION_DIGEST_MISMATCH]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1124
|
+
[AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1125
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_APPLICABILITY_SOURCE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1126
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_BINDING_SOURCE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1127
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1128
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_DOCUMENT]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1129
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_DOCUMENT_SOURCE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1130
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_FINDING]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1131
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_IMPLEMENTATION_ARTIFACT]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1132
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_OBJECTIVE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1133
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1134
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_ROLE]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1135
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1136
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_SOURCE_AUTHORITY]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1137
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_SOURCE_REQUIREMENT]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1138
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_SOURCE_REVISION]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1139
|
+
[AssuranceProgramSpecificationIssueKind.UNKNOWN_VALIDATION_AUTHORITY]: AssuranceProgramSpecificationIssueClass.SPECIFICATION_DEFECT,
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
/** Classifies one issue as a statement about the specification or about the host. */
|
|
1143
|
+
export function classifyAssuranceProgramSpecificationIssue(issue: Pick<AssuranceProgramSpecificationIssue, "kind">): AssuranceProgramSpecificationIssueClass {
|
|
1144
|
+
return ASSURANCE_PROGRAM_SPECIFICATION_ISSUE_CLASS_BY_KIND[issue.kind];
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* True when every supplied issue is host divergence — the caller may record a finding and continue.
|
|
1149
|
+
*
|
|
1150
|
+
* Fails closed on an empty set: "no issues" is not host divergence, and a caller that reaches this helper with
|
|
1151
|
+
* nothing to classify has already lost the distinction it needs. Callers must gate on validity first.
|
|
1152
|
+
*/
|
|
1153
|
+
export function assuranceProgramIssuesAreOnlyHostDivergence(issues: readonly Pick<AssuranceProgramSpecificationIssue, "kind" | "subjectRef">[]): boolean {
|
|
1154
|
+
return (
|
|
1155
|
+
issues.length > 0 &&
|
|
1156
|
+
issues.every(
|
|
1157
|
+
(issue) =>
|
|
1158
|
+
classifyAssuranceProgramSpecificationIssue(issue) === AssuranceProgramSpecificationIssueClass.HOST_DIVERGENCE &&
|
|
1159
|
+
typeof issue.subjectRef === "string" &&
|
|
1160
|
+
issue.subjectRef.length > 0,
|
|
1161
|
+
)
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* External authorities required to validate claims that cannot be proven from application-authored bytes alone.
|
|
1167
|
+
* A host may supply a larger registry without changing the core model; source names never become branches.
|
|
1168
|
+
*/
|
|
1169
|
+
export interface AssuranceProgramValidationAuthorities {
|
|
1170
|
+
readonly snapshot: AssuranceProgramValidationAuthoritySnapshot;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/** Basis-pinned implementation statement used by current assurance-program versions. */
|
|
1174
|
+
export const AssuranceProgramImplementationStatementV2Schema = z
|
|
1175
|
+
.strictObject({
|
|
1176
|
+
schemaVersion: z.literal(2),
|
|
1177
|
+
...AssuranceImplementationStatementCommonFieldsSchema.shape,
|
|
1178
|
+
basisRef: AssuranceNamespacedRefSchema,
|
|
1179
|
+
basisVersion: z.number().int().positive(),
|
|
1180
|
+
})
|
|
1181
|
+
.superRefine(addAssuranceImplementationStatementCommonIssues);
|
|
1182
|
+
export type AssuranceProgramImplementationStatementV2 = z.infer<typeof AssuranceProgramImplementationStatementV2Schema>;
|
|
1183
|
+
|
|
1184
|
+
const AssuranceProgramCommonFieldsBeforeObjectiveBindingsSchema = z.strictObject({
|
|
1185
|
+
programRef: AssuranceNamespacedRefSchema,
|
|
1186
|
+
programVersion: z.number().int().positive(),
|
|
1187
|
+
sourceReferences: z.array(AssuranceProgramSourceReferenceSchema).min(1),
|
|
1188
|
+
scopeSelectors: z.array(AssuranceProgramScopeSelectorSchema).min(1),
|
|
1189
|
+
applicabilityDecisions: z.array(AssuranceProgramApplicabilityDecisionSchema).min(1),
|
|
1190
|
+
});
|
|
1191
|
+
|
|
1192
|
+
const AssuranceProgramCommonFieldsAfterObjectiveBindingsSchema = z.strictObject({
|
|
1193
|
+
implementationDecisions: z.array(AssuranceProgramImplementationDecisionSchema),
|
|
1194
|
+
responsibilityAssignments: z.array(AssuranceProgramResponsibilityAssignmentSchema).min(1),
|
|
1195
|
+
gapsAndExceptions: z.array(AssuranceProgramGapOrExceptionSchema),
|
|
1196
|
+
documentationRequirements: z.array(AssuranceProgramDocumentationRequirementSchema),
|
|
1197
|
+
knownProgramLimitations: z.array(z.string().trim().min(1)),
|
|
1198
|
+
});
|
|
1199
|
+
|
|
1200
|
+
/** Byte-identical common shape retained by v1/v2 programs. */
|
|
1201
|
+
const AssuranceProgramHistoricalCommonFieldsSchema = z.strictObject({
|
|
1202
|
+
...AssuranceProgramCommonFieldsBeforeObjectiveBindingsSchema.shape,
|
|
1203
|
+
controlObjectiveBindings: z.array(AssuranceProgramControlObjectiveBindingSchema).min(1),
|
|
1204
|
+
...AssuranceProgramCommonFieldsAfterObjectiveBindingsSchema.shape,
|
|
1205
|
+
});
|
|
1206
|
+
|
|
1207
|
+
/** Current program shape: obligation entries replace, rather than duplicate, historical control-objective bindings. */
|
|
1208
|
+
const AssuranceProgramV3CommonFieldsSchema = z.strictObject({
|
|
1209
|
+
...AssuranceProgramCommonFieldsBeforeObjectiveBindingsSchema.shape,
|
|
1210
|
+
obligationRegister: AssuranceProgramObligationRegisterSchema,
|
|
1211
|
+
obligationCoverageDecisions: z.array(AssuranceProgramObligationCoverageDecisionSchema).min(1),
|
|
1212
|
+
sharedResponsibilityRules: z.array(AssuranceProgramSharedResponsibilityRuleSchema),
|
|
1213
|
+
...AssuranceProgramCommonFieldsAfterObjectiveBindingsSchema.shape,
|
|
1214
|
+
});
|
|
1215
|
+
|
|
1216
|
+
/** Historical source-revision-pinned program. Retained payloads remain parseable and replayable but new authoring is forbidden by the repository pin checker. */
|
|
1217
|
+
export const AssuranceProgramSpecificationV1Schema = z
|
|
1218
|
+
.strictObject({
|
|
1219
|
+
schemaVersion: z.literal(1),
|
|
1220
|
+
...AssuranceProgramHistoricalCommonFieldsSchema.shape,
|
|
1221
|
+
sourceRevisions: z.array(AssuranceProgramSourceRevisionSchema).min(1),
|
|
1222
|
+
roleAuthorities: z.array(AssuranceProgramRoleAuthoritySchema).min(1),
|
|
1223
|
+
capabilityAuthorities: z.array(AssuranceProgramCapabilityAuthoritySchema),
|
|
1224
|
+
implementationStatements: z.array(AssuranceImplementationStatementSchema),
|
|
1225
|
+
})
|
|
1226
|
+
.superRefine(addAssuranceProgramSpecificationIssues);
|
|
1227
|
+
export type AssuranceProgramSpecificationV1 = z.infer<typeof AssuranceProgramSpecificationV1Schema>;
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Retained basis-pinned application program: exactly one basis identity plus readable refs to the attested engine artifacts.
|
|
1231
|
+
*
|
|
1232
|
+
* Validation authorities currently carry one sealed basis snapshot. Accepting several authored bases would make
|
|
1233
|
+
* every extra basis compare against the wrong inventory and could misclassify an unverified authority as tolerable
|
|
1234
|
+
* host drift. Multi-basis composition therefore requires a later schema version with basis-indexed snapshots. The
|
|
1235
|
+
* repository checker continues recognizing existing v2 application authoring only through the serialized pre-v3
|
|
1236
|
+
* transition; after Wonder accepts v3, v2 remains replayable rather than becoming a second current authoring shape.
|
|
1237
|
+
*/
|
|
1238
|
+
export const AssuranceProgramSpecificationV2Schema = z
|
|
1239
|
+
.strictObject({
|
|
1240
|
+
schemaVersion: z.literal(2),
|
|
1241
|
+
...AssuranceProgramHistoricalCommonFieldsSchema.shape,
|
|
1242
|
+
authorityBases: z.array(AssuranceProgramAuthorityBasisReferenceSchema).length(1),
|
|
1243
|
+
roleAuthorities: z.array(AssuranceProgramRoleAuthorityV2Schema).min(1),
|
|
1244
|
+
capabilityAuthorities: z.array(AssuranceProgramCapabilityAuthorityV2Schema),
|
|
1245
|
+
implementationStatements: z.array(AssuranceProgramImplementationStatementV2Schema),
|
|
1246
|
+
})
|
|
1247
|
+
.superRefine(addAssuranceProgramSpecificationIssues);
|
|
1248
|
+
export type AssuranceProgramSpecificationV2 = z.infer<typeof AssuranceProgramSpecificationV2Schema>;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Current application program. It preserves the v2 single-basis authority model while replacing the overlapping
|
|
1252
|
+
* control-objective-binding array with one complete, digest-bound obligation register and its program-owned review
|
|
1253
|
+
* records. Activation and operating/evidence truth remain deliberately unrepresentable.
|
|
1254
|
+
*/
|
|
1255
|
+
export const AssuranceProgramSpecificationV3Schema = z
|
|
1256
|
+
.strictObject({
|
|
1257
|
+
schemaVersion: z.literal(3),
|
|
1258
|
+
...AssuranceProgramV3CommonFieldsSchema.shape,
|
|
1259
|
+
authorityBases: z.array(AssuranceProgramAuthorityBasisReferenceSchema).length(1),
|
|
1260
|
+
roleAuthorities: z.array(AssuranceProgramRoleAuthorityV2Schema).min(1),
|
|
1261
|
+
capabilityAuthorities: z.array(AssuranceProgramCapabilityAuthorityV2Schema),
|
|
1262
|
+
implementationStatements: z.array(AssuranceProgramImplementationStatementV2Schema),
|
|
1263
|
+
})
|
|
1264
|
+
.superRefine(addAssuranceProgramSpecificationIssues);
|
|
1265
|
+
export type AssuranceProgramSpecificationV3 = z.infer<typeof AssuranceProgramSpecificationV3Schema>;
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Accepted application compliance policy. Organization-specific occurrences,
|
|
1269
|
+
* assignees, reviewer identities, evidence bytes and assessment claims are
|
|
1270
|
+
* intentionally unrepresentable and belong to authorized runtime records.
|
|
1271
|
+
*/
|
|
1272
|
+
export const AssuranceProgramSpecificationSchema = z.discriminatedUnion("schemaVersion", [
|
|
1273
|
+
AssuranceProgramSpecificationV1Schema,
|
|
1274
|
+
AssuranceProgramSpecificationV2Schema,
|
|
1275
|
+
AssuranceProgramSpecificationV3Schema,
|
|
1276
|
+
]);
|
|
1277
|
+
export type AssuranceProgramSpecification = z.infer<typeof AssuranceProgramSpecificationSchema>;
|
|
1278
|
+
|
|
1279
|
+
export type AssuranceProgramObjectiveBindingView = Readonly<{
|
|
1280
|
+
bindingRef: AssuranceProgramControlObjectiveBinding["bindingRef"];
|
|
1281
|
+
objective: AssuranceProgramControlObjectiveBinding["objective"];
|
|
1282
|
+
scopeSelectorRefs: AssuranceProgramControlObjectiveBinding["scopeSelectorRefs"];
|
|
1283
|
+
sourceRequirementRefs: AssuranceProgramControlObjectiveBinding["sourceRequirementRefs"];
|
|
1284
|
+
implementationExpectationRefs: AssuranceProgramControlObjectiveBinding["implementationExpectationRefs"];
|
|
1285
|
+
evidenceExpectationRefs: AssuranceProgramControlObjectiveBinding["evidenceExpectationRefs"];
|
|
1286
|
+
verificationExpectationRefs: AssuranceProgramControlObjectiveBinding["verificationExpectationRefs"];
|
|
1287
|
+
requiredProofStage: AssuranceProgramProofStage;
|
|
1288
|
+
}>;
|
|
1289
|
+
|
|
1290
|
+
/** One normalized read view keeps historical control bindings and current obligation entries on the same validator path. */
|
|
1291
|
+
export const resolveAssuranceProgramObjectiveBindings = (program: AssuranceProgramSpecification): readonly AssuranceProgramObjectiveBindingView[] =>
|
|
1292
|
+
program.schemaVersion === 3
|
|
1293
|
+
? program.obligationRegister.entries.map((entry) => ({
|
|
1294
|
+
bindingRef: entry.obligationRef,
|
|
1295
|
+
objective: entry.objective,
|
|
1296
|
+
scopeSelectorRefs: entry.scopeSelectorRefs,
|
|
1297
|
+
sourceRequirementRefs: entry.sourceRequirementRefs,
|
|
1298
|
+
implementationExpectationRefs: entry.implementationExpectationRefs,
|
|
1299
|
+
evidenceExpectationRefs: entry.evidenceExpectationRefs,
|
|
1300
|
+
verificationExpectationRefs: entry.verificationExpectationRefs,
|
|
1301
|
+
requiredProofStage: entry.requiredProofStage,
|
|
1302
|
+
}))
|
|
1303
|
+
: program.controlObjectiveBindings;
|
|
1304
|
+
|
|
1305
|
+
const assuranceProgramObjectiveBindingCollectionPath = (program: AssuranceProgramSpecification): string =>
|
|
1306
|
+
program.schemaVersion === 3 ? "obligationRegister.entries" : "controlObjectiveBindings";
|
|
1307
|
+
|
|
1308
|
+
const stringSetsIntersectOrEitherIsWildcard = (left: readonly string[], right: readonly string[]): boolean =>
|
|
1309
|
+
left.length === 0 || right.length === 0 || left.some((value) => right.includes(value));
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Conservative source-level overlap proof for obligation uniqueness.
|
|
1313
|
+
*
|
|
1314
|
+
* Empty jurisdiction/data/organization-rule dimensions are wildcards. A false result proves disjointness from the
|
|
1315
|
+
* authored selectors; a true result only means they may overlap and therefore cannot independently govern the same
|
|
1316
|
+
* objective without creating two accepted answers for one subject.
|
|
1317
|
+
*/
|
|
1318
|
+
const assuranceProgramScopeSelectorsMayOverlap = (left: AssuranceProgramScopeSelector, right: AssuranceProgramScopeSelector): boolean =>
|
|
1319
|
+
left.systemBoundaryRefs.some((value) => right.systemBoundaryRefs.includes(value)) &&
|
|
1320
|
+
stringSetsIntersectOrEitherIsWildcard(left.jurisdictionRefs, right.jurisdictionRefs) &&
|
|
1321
|
+
stringSetsIntersectOrEitherIsWildcard(left.dataCategoryRefs, right.dataCategoryRefs) &&
|
|
1322
|
+
stringSetsIntersectOrEitherIsWildcard(left.organizationScopeRuleRefs, right.organizationScopeRuleRefs);
|
|
1323
|
+
|
|
1324
|
+
function addAssuranceProgramSpecificationIssues(program: AssuranceProgramSpecification, context: z.RefinementCtx): void {
|
|
1325
|
+
const objectiveBindings = resolveAssuranceProgramObjectiveBindings(program);
|
|
1326
|
+
const objectiveBindingCollectionPath = assuranceProgramObjectiveBindingCollectionPath(program);
|
|
1327
|
+
const orderedRefs: Array<[readonly string[], PropertyKey[], string]> = [
|
|
1328
|
+
[
|
|
1329
|
+
program.schemaVersion === 1
|
|
1330
|
+
? program.sourceRevisions.map((revision) => revision.sourceRevisionRef)
|
|
1331
|
+
: program.authorityBases.map((basis) => `${basis.basisRef}@${basis.basisVersion}`),
|
|
1332
|
+
[program.schemaVersion === 1 ? "sourceRevisions" : "authorityBases"],
|
|
1333
|
+
program.schemaVersion === 1 ? "sourceRevisions" : "authorityBases",
|
|
1334
|
+
],
|
|
1335
|
+
[program.roleAuthorities.map((authority) => authority.roleRef), ["roleAuthorities"], "roleAuthorities"],
|
|
1336
|
+
[program.capabilityAuthorities.map((authority) => versionedCapabilityKey(authority.identity)), ["capabilityAuthorities"], "capabilityAuthorities"],
|
|
1337
|
+
[program.sourceReferences.map((source) => versionedSourceKey(source.identity)), ["sourceReferences"], "sourceReferences"],
|
|
1338
|
+
[program.scopeSelectors.map((scope) => scope.scopeSelectorRef), ["scopeSelectors"], "scopeSelectors"],
|
|
1339
|
+
[program.applicabilityDecisions.map((decision) => decision.decisionRef), ["applicabilityDecisions"], "applicabilityDecisions"],
|
|
1340
|
+
[objectiveBindings.map((binding) => binding.bindingRef), objectiveBindingCollectionPath.split("."), objectiveBindingCollectionPath],
|
|
1341
|
+
[program.implementationDecisions.map((decision) => decision.decisionRef), ["implementationDecisions"], "implementationDecisions"],
|
|
1342
|
+
[program.responsibilityAssignments.map((assignment) => assignment.assignmentRef), ["responsibilityAssignments"], "responsibilityAssignments"],
|
|
1343
|
+
[program.gapsAndExceptions.map((finding) => finding.findingRef), ["gapsAndExceptions"], "gapsAndExceptions"],
|
|
1344
|
+
[program.documentationRequirements.map((requirement) => requirement.requirementRef), ["documentationRequirements"], "documentationRequirements"],
|
|
1345
|
+
[program.implementationStatements.map((statement) => statement.statementRef), ["implementationStatements"], "implementationStatements"],
|
|
1346
|
+
[program.knownProgramLimitations, ["knownProgramLimitations"], "knownProgramLimitations"],
|
|
1347
|
+
];
|
|
1348
|
+
if (program.schemaVersion === 3) {
|
|
1349
|
+
orderedRefs.push(
|
|
1350
|
+
[
|
|
1351
|
+
program.obligationCoverageDecisions.map((decision) => `${decision.coverageDecisionRef}@${decision.coverageDecisionVersion}`),
|
|
1352
|
+
["obligationCoverageDecisions"],
|
|
1353
|
+
"obligationCoverageDecisions",
|
|
1354
|
+
],
|
|
1355
|
+
[
|
|
1356
|
+
program.sharedResponsibilityRules.map((rule) => `${rule.sharedResponsibilityRuleRef}@${rule.sharedResponsibilityRuleVersion}`),
|
|
1357
|
+
["sharedResponsibilityRules"],
|
|
1358
|
+
"sharedResponsibilityRules",
|
|
1359
|
+
],
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
orderedRefs.forEach(([values, path, label]) => addUniqueSortedIssue(values, context, path, label));
|
|
1363
|
+
const documentIdentities = program.documentationRequirements.map(versionedDocumentKey);
|
|
1364
|
+
if (!valuesAreUnique(documentIdentities))
|
|
1365
|
+
context.addIssue({ code: "custom", message: "document identities must be unique", path: ["documentationRequirements"] });
|
|
1366
|
+
const responsibilityScopes = program.responsibilityAssignments.map((assignment) => assignment.scopeSelectorRef);
|
|
1367
|
+
if (!valuesAreUnique(responsibilityScopes))
|
|
1368
|
+
context.addIssue({ code: "custom", message: "each scope can have only one responsibility assignment", path: ["responsibilityAssignments"] });
|
|
1369
|
+
collectAssuranceProgramSpecificationIssues(program).forEach((issue) => {
|
|
1370
|
+
context.addIssue({ code: "custom", message: `[${issue.kind}] ${issue.message}`, path: issue.path.split(".") });
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
function collectAssuranceProgramSpecificationIssues(program: AssuranceProgramSpecification): AssuranceProgramSpecificationIssue[] {
|
|
1375
|
+
const objectiveBindings = resolveAssuranceProgramObjectiveBindings(program);
|
|
1376
|
+
const objectiveBindingCollectionPath = assuranceProgramObjectiveBindingCollectionPath(program);
|
|
1377
|
+
const sourceKeys = new Set(program.sourceReferences.map((source) => versionedSourceKey(source.identity)));
|
|
1378
|
+
const scopeByRef = new Map(program.scopeSelectors.map((scope) => [scope.scopeSelectorRef, scope]));
|
|
1379
|
+
const objectiveKeys = new Set(objectiveBindings.map((binding) => versionedObjectiveKey(binding.objective)));
|
|
1380
|
+
const findingByKey = new Map(program.gapsAndExceptions.map((finding) => [`${finding.findingRef}@${finding.findingVersion}`, finding]));
|
|
1381
|
+
const capabilityAuthorityByKey = new Map<string, AssuranceProgramCapabilityAuthority | AssuranceProgramCapabilityAuthorityV2>(
|
|
1382
|
+
program.capabilityAuthorities.map((authority) => [versionedCapabilityKey(authority.identity), authority] as const),
|
|
1383
|
+
);
|
|
1384
|
+
const documentKeys = new Set(program.documentationRequirements.map(versionedDocumentKey));
|
|
1385
|
+
const roleRefs = new Set<string>(program.roleAuthorities.map((authority) => authority.roleRef));
|
|
1386
|
+
const sourceRevisionKeys = new Set(program.schemaVersion === 1 ? program.sourceRevisions.map(sourceRevisionKey) : []);
|
|
1387
|
+
const authorityBasisKeys = new Set(program.schemaVersion === 1 ? [] : program.authorityBases.map(authorityBasisIdentityKey));
|
|
1388
|
+
const applicabilityBySubject = new Map<string, AssuranceProgramApplicabilityDecision[]>();
|
|
1389
|
+
const controlBindingCountBySubject = new Map<string, number>();
|
|
1390
|
+
const implementationDecisionCountBySubject = new Map<string, number>();
|
|
1391
|
+
const issues: AssuranceProgramSpecificationIssue[] = [];
|
|
1392
|
+
const push = (kind: AssuranceProgramSpecificationIssueKind, path: string, message: string): void => {
|
|
1393
|
+
issues.push({ kind, path, message });
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
const requireRole = (roleRef: string, path: string): void => {
|
|
1397
|
+
if (!roleRefs.has(roleRef)) push(AssuranceProgramSpecificationIssueKind.UNKNOWN_ROLE, path, `role ${roleRef} has no declared application authority`);
|
|
1398
|
+
};
|
|
1399
|
+
const requireRevision = (revision: { sourceRevisionRef: string }, path: string): void => {
|
|
1400
|
+
if (!sourceRevisionKeys.has(sourceRevisionKey(revision)))
|
|
1401
|
+
push(AssuranceProgramSpecificationIssueKind.UNKNOWN_SOURCE_REVISION, path, "reference does not resolve to an exact declared source revision");
|
|
1402
|
+
};
|
|
1403
|
+
const requireBasis = (basis: { basisRef: string; basisVersion: number }, path: string): void => {
|
|
1404
|
+
if (!authorityBasisKeys.has(authorityBasisIdentityKey(basis)))
|
|
1405
|
+
push(AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH, path, "reference does not resolve to an exact declared authority basis");
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
if (program.schemaVersion === 1) {
|
|
1409
|
+
program.roleAuthorities.forEach((authority, index) => requireRevision(authority.definitionRevision, `roleAuthorities.${index}.definitionRevision`));
|
|
1410
|
+
program.capabilityAuthorities.forEach((authority, index) =>
|
|
1411
|
+
requireRevision(authority.implementationRevision, `capabilityAuthorities.${index}.implementationRevision`),
|
|
1412
|
+
);
|
|
1413
|
+
} else {
|
|
1414
|
+
program.roleAuthorities.forEach((authority, index) => requireBasis(authority.definitionAuthority, `roleAuthorities.${index}.definitionAuthority`));
|
|
1415
|
+
program.capabilityAuthorities.forEach((authority, index) =>
|
|
1416
|
+
requireBasis(authority.implementationAuthority, `capabilityAuthorities.${index}.implementationAuthority`),
|
|
1417
|
+
);
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
program.applicabilityDecisions.forEach((decision, index) => {
|
|
1421
|
+
if (!sourceKeys.has(versionedSourceKey(decision.source)))
|
|
1422
|
+
push(
|
|
1423
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_APPLICABILITY_SOURCE,
|
|
1424
|
+
`applicabilityDecisions.${index}.source`,
|
|
1425
|
+
"applicability decision references an undeclared source version",
|
|
1426
|
+
);
|
|
1427
|
+
if (!scopeByRef.has(decision.scopeSelectorRef))
|
|
1428
|
+
push(
|
|
1429
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1430
|
+
`applicabilityDecisions.${index}.scopeSelectorRef`,
|
|
1431
|
+
"applicability decision references an undeclared scope selector",
|
|
1432
|
+
);
|
|
1433
|
+
const key = applicabilitySubjectKey(decision.source, decision.scopeSelectorRef);
|
|
1434
|
+
const decisions = applicabilityBySubject.get(key) ?? [];
|
|
1435
|
+
decisions.push(decision);
|
|
1436
|
+
applicabilityBySubject.set(key, decisions);
|
|
1437
|
+
});
|
|
1438
|
+
|
|
1439
|
+
applicabilityBySubject.forEach((decisions) => {
|
|
1440
|
+
const byEffectiveFrom = [...decisions].sort((left, right) => compareCanonicalText(left.effectiveFrom, right.effectiveFrom));
|
|
1441
|
+
byEffectiveFrom.forEach((decision, index) => {
|
|
1442
|
+
const previous = byEffectiveFrom[index - 1];
|
|
1443
|
+
if (previous && (!previous.effectiveUntil || decision.effectiveFrom <= previous.effectiveUntil))
|
|
1444
|
+
push(
|
|
1445
|
+
AssuranceProgramSpecificationIssueKind.AMBIGUOUS_APPLICABILITY,
|
|
1446
|
+
"applicabilityDecisions",
|
|
1447
|
+
`applicability periods overlap for ${versionedSourceKey(decision.source)} and ${decision.scopeSelectorRef}`,
|
|
1448
|
+
);
|
|
1449
|
+
});
|
|
1450
|
+
});
|
|
1451
|
+
|
|
1452
|
+
const requiredApplicabilitySubjects = new Set<string>();
|
|
1453
|
+
objectiveBindings.forEach((binding, index) => {
|
|
1454
|
+
binding.scopeSelectorRefs.forEach((scopeRef) => {
|
|
1455
|
+
if (!scopeByRef.has(scopeRef))
|
|
1456
|
+
push(
|
|
1457
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1458
|
+
`${objectiveBindingCollectionPath}.${index}.scopeSelectorRefs`,
|
|
1459
|
+
`control binding references undeclared scope selector ${scopeRef}`,
|
|
1460
|
+
);
|
|
1461
|
+
const subject = `${versionedObjectiveKey(binding.objective)}::${scopeRef}`;
|
|
1462
|
+
controlBindingCountBySubject.set(subject, (controlBindingCountBySubject.get(subject) ?? 0) + 1);
|
|
1463
|
+
});
|
|
1464
|
+
binding.sourceRequirementRefs.forEach((reference) => {
|
|
1465
|
+
if (!sourceKeys.has(versionedSourceKey(reference.source)))
|
|
1466
|
+
push(
|
|
1467
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_BINDING_SOURCE,
|
|
1468
|
+
`${objectiveBindingCollectionPath}.${index}.sourceRequirementRefs`,
|
|
1469
|
+
"control binding references an undeclared source version",
|
|
1470
|
+
);
|
|
1471
|
+
binding.scopeSelectorRefs.forEach((scopeRef) => requiredApplicabilitySubjects.add(applicabilitySubjectKey(reference.source, scopeRef)));
|
|
1472
|
+
});
|
|
1473
|
+
});
|
|
1474
|
+
controlBindingCountBySubject.forEach((count, subject) => {
|
|
1475
|
+
if (count > 1)
|
|
1476
|
+
push(
|
|
1477
|
+
AssuranceProgramSpecificationIssueKind.AMBIGUOUS_CONTROL_BINDING,
|
|
1478
|
+
objectiveBindingCollectionPath,
|
|
1479
|
+
`objective/scope subject ${subject} has ${count} control bindings; exactly one is required`,
|
|
1480
|
+
);
|
|
1481
|
+
});
|
|
1482
|
+
if (program.schemaVersion === 3) {
|
|
1483
|
+
const entries = program.obligationRegister.entries;
|
|
1484
|
+
const applicabilityDecisionByKey = new Map(
|
|
1485
|
+
program.applicabilityDecisions.map((decision) => [versionedApplicabilityDecisionKey(decision), decision] as const),
|
|
1486
|
+
);
|
|
1487
|
+
const coverageDecisionByKey = new Map(program.obligationCoverageDecisions.map((decision) => [versionedCoverageDecisionKey(decision), decision] as const));
|
|
1488
|
+
const sharedResponsibilityRuleByKey = new Map(program.sharedResponsibilityRules.map((rule) => [versionedSharedResponsibilityRuleKey(rule), rule] as const));
|
|
1489
|
+
const responsibilityAssignmentByRef = new Map(program.responsibilityAssignments.map((assignment) => [assignment.assignmentRef, assignment] as const));
|
|
1490
|
+
const entryByKey = new Map(entries.map((entry) => [versionedObligationKey(entry), entry] as const));
|
|
1491
|
+
const usedCoverageDecisionKeys = new Set<string>();
|
|
1492
|
+
const usedSharedResponsibilityRuleKeys = new Set<string>();
|
|
1493
|
+
|
|
1494
|
+
entries.forEach((entry, entryIndex) => {
|
|
1495
|
+
const entryPath = `obligationRegister.entries.${entryIndex}`;
|
|
1496
|
+
const entryKey = versionedObligationKey(entry);
|
|
1497
|
+
requireRole(entry.applicability.reviewedByRoleRef, `${entryPath}.applicability.reviewedByRoleRef`);
|
|
1498
|
+
entry.reviewOwnerRoleRefs.forEach((roleRef) => requireRole(roleRef, `${entryPath}.reviewOwnerRoleRefs`));
|
|
1499
|
+
if (!entry.reviewOwnerRoleRefs.includes(entry.applicability.reviewedByRoleRef))
|
|
1500
|
+
push(
|
|
1501
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1502
|
+
`${entryPath}.applicability.reviewedByRoleRef`,
|
|
1503
|
+
`obligation ${entryKey} applicability reviewer is not permitted by its review policy`,
|
|
1504
|
+
);
|
|
1505
|
+
|
|
1506
|
+
const expectedApplicabilitySubjects = new Set(
|
|
1507
|
+
entry.sourceRequirementRefs.flatMap((reference) =>
|
|
1508
|
+
entry.scopeSelectorRefs.map((scopeSelectorRef) => applicabilitySubjectKey(reference.source, scopeSelectorRef)),
|
|
1509
|
+
),
|
|
1510
|
+
);
|
|
1511
|
+
const citedApplicabilitySubjects = new Set<string>();
|
|
1512
|
+
entry.sourceApplicabilityDecisionRefs.forEach((identity) => {
|
|
1513
|
+
const decision = applicabilityDecisionByKey.get(versionedApplicabilityDecisionKey(identity));
|
|
1514
|
+
if (!decision) {
|
|
1515
|
+
push(
|
|
1516
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD,
|
|
1517
|
+
`${entryPath}.sourceApplicabilityDecisionRefs`,
|
|
1518
|
+
`obligation ${entryKey} references undeclared source applicability decision ${versionedApplicabilityDecisionKey(identity)}`,
|
|
1519
|
+
);
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
const subject = applicabilitySubjectKey(decision.source, decision.scopeSelectorRef);
|
|
1523
|
+
citedApplicabilitySubjects.add(subject);
|
|
1524
|
+
if (!expectedApplicabilitySubjects.has(subject))
|
|
1525
|
+
push(
|
|
1526
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1527
|
+
`${entryPath}.sourceApplicabilityDecisionRefs`,
|
|
1528
|
+
`source applicability decision ${versionedApplicabilityDecisionKey(identity)} does not govern a cited source and obligation scope`,
|
|
1529
|
+
);
|
|
1530
|
+
});
|
|
1531
|
+
if (
|
|
1532
|
+
entry.sourceApplicabilityDecisionRefs.length !== expectedApplicabilitySubjects.size ||
|
|
1533
|
+
citedApplicabilitySubjects.size !== expectedApplicabilitySubjects.size ||
|
|
1534
|
+
[...expectedApplicabilitySubjects].some((subject) => !citedApplicabilitySubjects.has(subject))
|
|
1535
|
+
)
|
|
1536
|
+
push(
|
|
1537
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_APPLICABILITY,
|
|
1538
|
+
`${entryPath}.sourceApplicabilityDecisionRefs`,
|
|
1539
|
+
`obligation ${entryKey} must cite exactly one retained applicability decision for every cited source and scope subject`,
|
|
1540
|
+
);
|
|
1541
|
+
|
|
1542
|
+
const assignmentScopeRefs = new Set<string>();
|
|
1543
|
+
entry.responsibilityAssignmentRefs.forEach((assignmentRef) => {
|
|
1544
|
+
const assignment = responsibilityAssignmentByRef.get(assignmentRef);
|
|
1545
|
+
if (!assignment) {
|
|
1546
|
+
push(
|
|
1547
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_RESPONSIBILITY_ASSIGNMENT,
|
|
1548
|
+
`${entryPath}.responsibilityAssignmentRefs`,
|
|
1549
|
+
`obligation ${entryKey} references undeclared responsibility assignment ${assignmentRef}`,
|
|
1550
|
+
);
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
assignmentScopeRefs.add(assignment.scopeSelectorRef);
|
|
1554
|
+
});
|
|
1555
|
+
if (assignmentScopeRefs.size !== entry.scopeSelectorRefs.length || entry.scopeSelectorRefs.some((scopeRef) => !assignmentScopeRefs.has(scopeRef)))
|
|
1556
|
+
push(
|
|
1557
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_RESPONSIBILITY_ASSIGNMENT,
|
|
1558
|
+
`${entryPath}.responsibilityAssignmentRefs`,
|
|
1559
|
+
`obligation ${entryKey} responsibility assignments must cover exactly its scope selectors`,
|
|
1560
|
+
);
|
|
1561
|
+
|
|
1562
|
+
entry.gapRefs.forEach((identity) => {
|
|
1563
|
+
const findingKey = `${identity.findingRef}@${identity.findingVersion}`;
|
|
1564
|
+
const finding = findingByKey.get(findingKey);
|
|
1565
|
+
if (!finding)
|
|
1566
|
+
push(
|
|
1567
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_FINDING,
|
|
1568
|
+
`${entryPath}.gapRefs`,
|
|
1569
|
+
`obligation ${entryKey} references undeclared finding ${findingKey}`,
|
|
1570
|
+
);
|
|
1571
|
+
else if (
|
|
1572
|
+
!finding.objective ||
|
|
1573
|
+
versionedObjectiveKey(finding.objective) !== versionedObjectiveKey(entry.objective) ||
|
|
1574
|
+
!entry.scopeSelectorRefs.includes(finding.scopeSelectorRef)
|
|
1575
|
+
)
|
|
1576
|
+
push(
|
|
1577
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1578
|
+
`${entryPath}.gapRefs`,
|
|
1579
|
+
`finding ${findingKey} does not match obligation ${entryKey} objective and scope`,
|
|
1580
|
+
);
|
|
1581
|
+
});
|
|
1582
|
+
|
|
1583
|
+
const coverageDecisionKey = versionedCoverageDecisionKey(entry.coverageDecision);
|
|
1584
|
+
const coverageDecision = coverageDecisionByKey.get(coverageDecisionKey);
|
|
1585
|
+
if (!coverageDecision || coverageDecision.coverageDecisionVersion !== entry.coverageDecision.coverageDecisionVersion)
|
|
1586
|
+
push(
|
|
1587
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD,
|
|
1588
|
+
`${entryPath}.coverageDecision`,
|
|
1589
|
+
`obligation ${entryKey} coverage decision does not resolve by exact identity and digest`,
|
|
1590
|
+
);
|
|
1591
|
+
else {
|
|
1592
|
+
usedCoverageDecisionKeys.add(coverageDecisionKey);
|
|
1593
|
+
if (
|
|
1594
|
+
versionedObligationKey(coverageDecision.obligation) !== entryKey ||
|
|
1595
|
+
coverageDecision.reviewDisposition !== AssuranceProgramObligationCoverageReviewDisposition.APPROVED ||
|
|
1596
|
+
JSON.stringify(coverageDecision.sourceRequirementRefs) !== JSON.stringify(entry.sourceRequirementRefs)
|
|
1597
|
+
)
|
|
1598
|
+
push(
|
|
1599
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1600
|
+
`${entryPath}.coverageDecision`,
|
|
1601
|
+
`obligation ${entryKey} requires one approved coverage decision over its exact source-requirement inventory`,
|
|
1602
|
+
);
|
|
1603
|
+
if (!entry.reviewOwnerRoleRefs.includes(coverageDecision.reviewedByRoleRef))
|
|
1604
|
+
push(
|
|
1605
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1606
|
+
`${entryPath}.coverageDecision`,
|
|
1607
|
+
`obligation ${entryKey} coverage reviewer is not permitted by its review policy`,
|
|
1608
|
+
);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
if (entry.sharedResponsibilityRule) {
|
|
1612
|
+
const ruleKey = versionedSharedResponsibilityRuleKey(entry.sharedResponsibilityRule);
|
|
1613
|
+
const rule = sharedResponsibilityRuleByKey.get(ruleKey);
|
|
1614
|
+
if (!rule || rule.sharedResponsibilityRuleVersion !== entry.sharedResponsibilityRule.sharedResponsibilityRuleVersion)
|
|
1615
|
+
push(
|
|
1616
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD,
|
|
1617
|
+
`${entryPath}.sharedResponsibilityRule`,
|
|
1618
|
+
`obligation ${entryKey} shared-responsibility rule does not resolve by exact identity and digest`,
|
|
1619
|
+
);
|
|
1620
|
+
else {
|
|
1621
|
+
usedSharedResponsibilityRuleKeys.add(ruleKey);
|
|
1622
|
+
if (
|
|
1623
|
+
JSON.stringify(rule.scopeSelectorRefs) !== JSON.stringify(entry.scopeSelectorRefs) ||
|
|
1624
|
+
JSON.stringify(rule.governanceActorKinds) !== JSON.stringify(entry.governanceActorKinds)
|
|
1625
|
+
)
|
|
1626
|
+
push(
|
|
1627
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1628
|
+
`${entryPath}.sharedResponsibilityRule`,
|
|
1629
|
+
`shared-responsibility rule ${ruleKey} must govern the obligation's exact scope and actor set`,
|
|
1630
|
+
);
|
|
1631
|
+
if (!entry.reviewOwnerRoleRefs.includes(rule.reviewedByRoleRef))
|
|
1632
|
+
push(
|
|
1633
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1634
|
+
`${entryPath}.sharedResponsibilityRule`,
|
|
1635
|
+
`shared-responsibility rule ${ruleKey} reviewer is not permitted by obligation ${entryKey}'s review policy`,
|
|
1636
|
+
);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
entry.dependencyObligationRefs.forEach((dependency) => {
|
|
1641
|
+
if (!entryByKey.has(versionedObligationKey(dependency)))
|
|
1642
|
+
push(
|
|
1643
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD,
|
|
1644
|
+
`${entryPath}.dependencyObligationRefs`,
|
|
1645
|
+
`obligation ${entryKey} references undeclared dependency ${versionedObligationKey(dependency)}`,
|
|
1646
|
+
);
|
|
1647
|
+
});
|
|
1648
|
+
});
|
|
1649
|
+
|
|
1650
|
+
program.obligationCoverageDecisions.forEach((decision, decisionIndex) => {
|
|
1651
|
+
const decisionKey = versionedCoverageDecisionKey(decision);
|
|
1652
|
+
requireRole(decision.reviewedByRoleRef, `obligationCoverageDecisions.${decisionIndex}.reviewedByRoleRef`);
|
|
1653
|
+
if (!usedCoverageDecisionKeys.has(decisionKey))
|
|
1654
|
+
push(
|
|
1655
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD,
|
|
1656
|
+
`obligationCoverageDecisions.${decisionIndex}`,
|
|
1657
|
+
`coverage decision ${decisionKey} is not retained by an exact obligation entry`,
|
|
1658
|
+
);
|
|
1659
|
+
});
|
|
1660
|
+
program.sharedResponsibilityRules.forEach((rule, ruleIndex) => {
|
|
1661
|
+
const ruleKey = versionedSharedResponsibilityRuleKey(rule);
|
|
1662
|
+
for (const roleRef of [
|
|
1663
|
+
...rule.accountableRoleRefs,
|
|
1664
|
+
...rule.operatingRoleRefs,
|
|
1665
|
+
...rule.evidenceProviderRoleRefs,
|
|
1666
|
+
...rule.approvingRoleRefs,
|
|
1667
|
+
...rule.conflictResolutionRoleRefs,
|
|
1668
|
+
rule.reviewedByRoleRef,
|
|
1669
|
+
])
|
|
1670
|
+
requireRole(roleRef, `sharedResponsibilityRules.${ruleIndex}`);
|
|
1671
|
+
rule.scopeSelectorRefs.forEach((scopeRef) => {
|
|
1672
|
+
if (!scopeByRef.has(scopeRef))
|
|
1673
|
+
push(
|
|
1674
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1675
|
+
`sharedResponsibilityRules.${ruleIndex}.scopeSelectorRefs`,
|
|
1676
|
+
`shared-responsibility rule ${ruleKey} references undeclared scope ${scopeRef}`,
|
|
1677
|
+
);
|
|
1678
|
+
});
|
|
1679
|
+
if (!usedSharedResponsibilityRuleKeys.has(ruleKey))
|
|
1680
|
+
push(
|
|
1681
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBLIGATION_GOVERNANCE_RECORD,
|
|
1682
|
+
`sharedResponsibilityRules.${ruleIndex}`,
|
|
1683
|
+
`shared-responsibility rule ${ruleKey} is not retained by any obligation entry`,
|
|
1684
|
+
);
|
|
1685
|
+
});
|
|
1686
|
+
|
|
1687
|
+
for (let leftIndex = 0; leftIndex < program.sharedResponsibilityRules.length; leftIndex += 1) {
|
|
1688
|
+
const left = program.sharedResponsibilityRules[leftIndex]!;
|
|
1689
|
+
for (let rightIndex = leftIndex + 1; rightIndex < program.sharedResponsibilityRules.length; rightIndex += 1) {
|
|
1690
|
+
const right = program.sharedResponsibilityRules[rightIndex]!;
|
|
1691
|
+
if (JSON.stringify(left.governanceActorKinds) !== JSON.stringify(right.governanceActorKinds)) continue;
|
|
1692
|
+
const scopesMayOverlap = left.scopeSelectorRefs.some((leftRef) => {
|
|
1693
|
+
const leftScope = scopeByRef.get(leftRef);
|
|
1694
|
+
return (
|
|
1695
|
+
leftScope !== undefined &&
|
|
1696
|
+
right.scopeSelectorRefs.some((rightRef) => {
|
|
1697
|
+
const rightScope = scopeByRef.get(rightRef);
|
|
1698
|
+
return rightScope !== undefined && assuranceProgramScopeSelectorsMayOverlap(leftScope, rightScope);
|
|
1699
|
+
})
|
|
1700
|
+
);
|
|
1701
|
+
});
|
|
1702
|
+
if (scopesMayOverlap)
|
|
1703
|
+
push(
|
|
1704
|
+
AssuranceProgramSpecificationIssueKind.AMBIGUOUS_SHARED_RESPONSIBILITY_RULE,
|
|
1705
|
+
"sharedResponsibilityRules",
|
|
1706
|
+
`shared-responsibility rules ${versionedSharedResponsibilityRuleKey(left)} and ${versionedSharedResponsibilityRuleKey(right)} govern the same actor set over potentially overlapping scopes`,
|
|
1707
|
+
);
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
for (let leftIndex = 0; leftIndex < entries.length; leftIndex += 1) {
|
|
1712
|
+
const left = entries[leftIndex]!;
|
|
1713
|
+
for (let rightIndex = leftIndex + 1; rightIndex < entries.length; rightIndex += 1) {
|
|
1714
|
+
const right = entries[rightIndex]!;
|
|
1715
|
+
if (versionedObjectiveKey(left.objective) !== versionedObjectiveKey(right.objective)) continue;
|
|
1716
|
+
const scopesMayOverlap = left.scopeSelectorRefs.some((leftRef) => {
|
|
1717
|
+
const leftScope = scopeByRef.get(leftRef);
|
|
1718
|
+
return (
|
|
1719
|
+
leftScope !== undefined &&
|
|
1720
|
+
right.scopeSelectorRefs.some((rightRef) => {
|
|
1721
|
+
const rightScope = scopeByRef.get(rightRef);
|
|
1722
|
+
return rightScope !== undefined && assuranceProgramScopeSelectorsMayOverlap(leftScope, rightScope);
|
|
1723
|
+
})
|
|
1724
|
+
);
|
|
1725
|
+
});
|
|
1726
|
+
if (scopesMayOverlap)
|
|
1727
|
+
push(
|
|
1728
|
+
AssuranceProgramSpecificationIssueKind.AMBIGUOUS_OBLIGATION_BINDING,
|
|
1729
|
+
"obligationRegister.entries",
|
|
1730
|
+
`obligations ${versionedObligationKey(left)} and ${versionedObligationKey(right)} govern the same objective over potentially overlapping scopes`,
|
|
1731
|
+
);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
const visiting = new Set<string>();
|
|
1736
|
+
const visited = new Set<string>();
|
|
1737
|
+
const visitDependency = (entryKey: string): void => {
|
|
1738
|
+
if (visited.has(entryKey)) return;
|
|
1739
|
+
if (visiting.has(entryKey)) {
|
|
1740
|
+
push(
|
|
1741
|
+
AssuranceProgramSpecificationIssueKind.OBLIGATION_DEPENDENCY_CYCLE,
|
|
1742
|
+
"obligationRegister.entries",
|
|
1743
|
+
`obligation dependency graph contains a cycle through ${entryKey}`,
|
|
1744
|
+
);
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
const entry = entryByKey.get(entryKey);
|
|
1748
|
+
if (!entry) return;
|
|
1749
|
+
visiting.add(entryKey);
|
|
1750
|
+
entry.dependencyObligationRefs.forEach((dependency) => visitDependency(versionedObligationKey(dependency)));
|
|
1751
|
+
visiting.delete(entryKey);
|
|
1752
|
+
visited.add(entryKey);
|
|
1753
|
+
};
|
|
1754
|
+
entryByKey.forEach((_entry, entryKey) => visitDependency(entryKey));
|
|
1755
|
+
}
|
|
1756
|
+
requiredApplicabilitySubjects.forEach((subject) => {
|
|
1757
|
+
if (!applicabilityBySubject.has(subject))
|
|
1758
|
+
push(
|
|
1759
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_APPLICABILITY,
|
|
1760
|
+
"applicabilityDecisions",
|
|
1761
|
+
`used source/scope subject ${subject} requires an explicit APPLICABLE, NOT_APPLICABLE or UNDETERMINED decision`,
|
|
1762
|
+
);
|
|
1763
|
+
});
|
|
1764
|
+
program.sourceReferences.forEach((source) => {
|
|
1765
|
+
const hasDecision = [...applicabilityBySubject.keys()].some((subject) => subject.startsWith(`${versionedSourceKey(source.identity)}::`));
|
|
1766
|
+
if (!hasDecision)
|
|
1767
|
+
push(
|
|
1768
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_APPLICABILITY,
|
|
1769
|
+
"applicabilityDecisions",
|
|
1770
|
+
`declared source ${versionedSourceKey(source.identity)} has no explicit applicability decision`,
|
|
1771
|
+
);
|
|
1772
|
+
});
|
|
1773
|
+
|
|
1774
|
+
program.implementationDecisions.forEach((decision, index) => {
|
|
1775
|
+
const objectiveKey = versionedObjectiveKey(decision.objective);
|
|
1776
|
+
if (!objectiveKeys.has(objectiveKey))
|
|
1777
|
+
push(
|
|
1778
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBJECTIVE,
|
|
1779
|
+
`implementationDecisions.${index}.objective`,
|
|
1780
|
+
"implementation decision references an unbound Wildo objective version",
|
|
1781
|
+
);
|
|
1782
|
+
decision.scopeSelectorRefs.forEach((scopeRef) => {
|
|
1783
|
+
if (!scopeByRef.has(scopeRef))
|
|
1784
|
+
push(
|
|
1785
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1786
|
+
`implementationDecisions.${index}.scopeSelectorRefs`,
|
|
1787
|
+
`implementation decision references undeclared scope selector ${scopeRef}`,
|
|
1788
|
+
);
|
|
1789
|
+
const hasScopedBinding = objectiveBindings.some(
|
|
1790
|
+
(binding) => versionedObjectiveKey(binding.objective) === objectiveKey && binding.scopeSelectorRefs.includes(scopeRef),
|
|
1791
|
+
);
|
|
1792
|
+
if (!hasScopedBinding)
|
|
1793
|
+
push(
|
|
1794
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1795
|
+
`implementationDecisions.${index}.scopeSelectorRefs`,
|
|
1796
|
+
`objective ${objectiveKey} is not bound to scope ${scopeRef}`,
|
|
1797
|
+
);
|
|
1798
|
+
const subject = `${objectiveKey}::${scopeRef}`;
|
|
1799
|
+
implementationDecisionCountBySubject.set(subject, (implementationDecisionCountBySubject.get(subject) ?? 0) + 1);
|
|
1800
|
+
});
|
|
1801
|
+
decision.capabilitySelections.forEach((selection) => {
|
|
1802
|
+
const authority = capabilityAuthorityByKey.get(versionedCapabilityKey(selection));
|
|
1803
|
+
if (!authority)
|
|
1804
|
+
push(
|
|
1805
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
1806
|
+
`implementationDecisions.${index}.capabilitySelections`,
|
|
1807
|
+
`selected capability ${versionedCapabilityKey(selection)} has no declared authority`,
|
|
1808
|
+
);
|
|
1809
|
+
else if (authority.capabilityKind !== selection.capabilityKind)
|
|
1810
|
+
push(
|
|
1811
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1812
|
+
`implementationDecisions.${index}.capabilitySelections`,
|
|
1813
|
+
`selected capability ${versionedCapabilityKey(selection)} kind does not match its authority`,
|
|
1814
|
+
);
|
|
1815
|
+
});
|
|
1816
|
+
decision.gapRefs.forEach((findingIdentity) => {
|
|
1817
|
+
const findingKey = `${findingIdentity.findingRef}@${findingIdentity.findingVersion}`;
|
|
1818
|
+
const finding = findingByKey.get(findingKey);
|
|
1819
|
+
if (!finding)
|
|
1820
|
+
push(
|
|
1821
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_FINDING,
|
|
1822
|
+
`implementationDecisions.${index}.gapRefs`,
|
|
1823
|
+
`implementation decision references undeclared finding ${findingKey}`,
|
|
1824
|
+
);
|
|
1825
|
+
else if (
|
|
1826
|
+
!finding.objective ||
|
|
1827
|
+
versionedObjectiveKey(finding.objective) !== objectiveKey ||
|
|
1828
|
+
!decision.scopeSelectorRefs.includes(finding.scopeSelectorRef) ||
|
|
1829
|
+
finding.disposition !== decision.gapDisposition
|
|
1830
|
+
)
|
|
1831
|
+
push(
|
|
1832
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1833
|
+
`implementationDecisions.${index}.gapRefs`,
|
|
1834
|
+
`finding ${findingKey} does not match the decision objective, scope and disposition`,
|
|
1835
|
+
);
|
|
1836
|
+
});
|
|
1837
|
+
if (decision.gapRefs.length > 0)
|
|
1838
|
+
decision.scopeSelectorRefs.forEach((scopeRef) => {
|
|
1839
|
+
const scope = scopeByRef.get(scopeRef);
|
|
1840
|
+
const matchingFinding = decision.gapRefs.some((identity) => {
|
|
1841
|
+
const finding = findingByKey.get(`${identity.findingRef}@${identity.findingVersion}`);
|
|
1842
|
+
if (!finding || !scope) return false;
|
|
1843
|
+
return (
|
|
1844
|
+
finding.scopeSelectorRef === scopeRef &&
|
|
1845
|
+
finding.scopeSelectorVersion === scope.scopeSelectorVersion &&
|
|
1846
|
+
finding.objective !== undefined &&
|
|
1847
|
+
versionedObjectiveKey(finding.objective) === objectiveKey &&
|
|
1848
|
+
finding.disposition === decision.gapDisposition
|
|
1849
|
+
);
|
|
1850
|
+
});
|
|
1851
|
+
if (!matchingFinding)
|
|
1852
|
+
push(
|
|
1853
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1854
|
+
`implementationDecisions.${index}.gapRefs`,
|
|
1855
|
+
`objective/scope subject ${objectiveKey}::${scopeRef} requires its own exact versioned finding`,
|
|
1856
|
+
);
|
|
1857
|
+
});
|
|
1858
|
+
});
|
|
1859
|
+
controlBindingCountBySubject.forEach((_count, subject) => {
|
|
1860
|
+
const decisionCount = implementationDecisionCountBySubject.get(subject) ?? 0;
|
|
1861
|
+
if (decisionCount === 0)
|
|
1862
|
+
push(
|
|
1863
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_IMPLEMENTATION_DECISION,
|
|
1864
|
+
"implementationDecisions",
|
|
1865
|
+
`objective/scope subject ${subject} has no explicit implementation decision`,
|
|
1866
|
+
);
|
|
1867
|
+
else if (decisionCount > 1)
|
|
1868
|
+
push(
|
|
1869
|
+
AssuranceProgramSpecificationIssueKind.AMBIGUOUS_IMPLEMENTATION_DECISION,
|
|
1870
|
+
"implementationDecisions",
|
|
1871
|
+
`objective/scope subject ${subject} has ${decisionCount} implementation decisions; exactly one is required`,
|
|
1872
|
+
);
|
|
1873
|
+
});
|
|
1874
|
+
|
|
1875
|
+
program.responsibilityAssignments.forEach((assignment, index) => {
|
|
1876
|
+
if (!scopeByRef.has(assignment.scopeSelectorRef))
|
|
1877
|
+
push(
|
|
1878
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1879
|
+
`responsibilityAssignments.${index}.scopeSelectorRef`,
|
|
1880
|
+
"responsibility assignment references an undeclared scope selector",
|
|
1881
|
+
);
|
|
1882
|
+
for (const roleRef of [
|
|
1883
|
+
...assignment.responsibleRoleRefs,
|
|
1884
|
+
...assignment.operatingRoleRefs,
|
|
1885
|
+
...assignment.evidenceProviderRoleRefs,
|
|
1886
|
+
...assignment.approvingRoleRefs,
|
|
1887
|
+
...assignment.escalationRoleRefs,
|
|
1888
|
+
])
|
|
1889
|
+
requireRole(roleRef, `responsibilityAssignments.${index}`);
|
|
1890
|
+
});
|
|
1891
|
+
const assignedScopeRefs = new Set(program.responsibilityAssignments.map((assignment) => assignment.scopeSelectorRef));
|
|
1892
|
+
scopeByRef.forEach((_scope, scopeRef) => {
|
|
1893
|
+
if (!assignedScopeRefs.has(scopeRef))
|
|
1894
|
+
push(
|
|
1895
|
+
AssuranceProgramSpecificationIssueKind.INCOMPLETE_RESPONSIBILITY_ASSIGNMENT,
|
|
1896
|
+
"responsibilityAssignments",
|
|
1897
|
+
`scope ${scopeRef} has no responsibility assignment`,
|
|
1898
|
+
);
|
|
1899
|
+
});
|
|
1900
|
+
|
|
1901
|
+
program.gapsAndExceptions.forEach((finding, index) => {
|
|
1902
|
+
const scope = scopeByRef.get(finding.scopeSelectorRef);
|
|
1903
|
+
if (!scope || scope.scopeSelectorVersion !== finding.scopeSelectorVersion)
|
|
1904
|
+
push(
|
|
1905
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1906
|
+
`gapsAndExceptions.${index}.scopeSelectorVersion`,
|
|
1907
|
+
"finding references an undeclared scope selector version",
|
|
1908
|
+
);
|
|
1909
|
+
if (finding.source && !sourceKeys.has(versionedSourceKey(finding.source)))
|
|
1910
|
+
push(
|
|
1911
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_BINDING_SOURCE,
|
|
1912
|
+
`gapsAndExceptions.${index}.source`,
|
|
1913
|
+
"finding references an undeclared source version",
|
|
1914
|
+
);
|
|
1915
|
+
if (finding.objective && !objectiveKeys.has(versionedObjectiveKey(finding.objective)))
|
|
1916
|
+
push(
|
|
1917
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBJECTIVE,
|
|
1918
|
+
`gapsAndExceptions.${index}.objective`,
|
|
1919
|
+
"finding references an unbound Wildo objective version",
|
|
1920
|
+
);
|
|
1921
|
+
if (program.schemaVersion === 3 && finding.objective) {
|
|
1922
|
+
const matchingObligations = program.obligationRegister.entries.filter(
|
|
1923
|
+
(entry) =>
|
|
1924
|
+
versionedObjectiveKey(entry.objective) === versionedObjectiveKey(finding.objective!) &&
|
|
1925
|
+
entry.scopeSelectorRefs.includes(finding.scopeSelectorRef) &&
|
|
1926
|
+
entry.gapRefs.some((identity) => identity.findingRef === finding.findingRef && identity.findingVersion === finding.findingVersion),
|
|
1927
|
+
);
|
|
1928
|
+
if (matchingObligations.length !== 1)
|
|
1929
|
+
push(
|
|
1930
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1931
|
+
`gapsAndExceptions.${index}.objective`,
|
|
1932
|
+
`objective-bearing finding ${finding.findingRef}@${finding.findingVersion} must resolve exactly one obligation over scope ${finding.scopeSelectorRef}; found ${matchingObligations.length}`,
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1935
|
+
if (finding.objective && finding.source) {
|
|
1936
|
+
const objectiveKey = versionedObjectiveKey(finding.objective);
|
|
1937
|
+
const sourceKey = versionedSourceKey(finding.source);
|
|
1938
|
+
const sourceMatchesBinding = objectiveBindings.some(
|
|
1939
|
+
(binding) =>
|
|
1940
|
+
versionedObjectiveKey(binding.objective) === objectiveKey &&
|
|
1941
|
+
binding.scopeSelectorRefs.includes(finding.scopeSelectorRef) &&
|
|
1942
|
+
binding.sourceRequirementRefs.some((reference) => versionedSourceKey(reference.source) === sourceKey),
|
|
1943
|
+
);
|
|
1944
|
+
if (!sourceMatchesBinding)
|
|
1945
|
+
push(
|
|
1946
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1947
|
+
`gapsAndExceptions.${index}.source`,
|
|
1948
|
+
`finding source ${sourceKey} is not bound to ${objectiveKey} in scope ${finding.scopeSelectorRef}`,
|
|
1949
|
+
);
|
|
1950
|
+
}
|
|
1951
|
+
requireRole(finding.ownerRoleRef, `gapsAndExceptions.${index}.ownerRoleRef`);
|
|
1952
|
+
});
|
|
1953
|
+
|
|
1954
|
+
program.documentationRequirements.forEach((requirement, index) => {
|
|
1955
|
+
requirement.sourceRefs.forEach((source) => {
|
|
1956
|
+
if (!sourceKeys.has(versionedSourceKey(source)))
|
|
1957
|
+
push(
|
|
1958
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_DOCUMENT_SOURCE,
|
|
1959
|
+
`documentationRequirements.${index}.sourceRefs`,
|
|
1960
|
+
"documentation requirement references an undeclared source version",
|
|
1961
|
+
);
|
|
1962
|
+
});
|
|
1963
|
+
requirement.approvingRoleRefs.forEach((roleRef) => requireRole(roleRef, `documentationRequirements.${index}.approvingRoleRefs`));
|
|
1964
|
+
});
|
|
1965
|
+
|
|
1966
|
+
program.implementationStatements.forEach((statement, index) => {
|
|
1967
|
+
const objectiveKey = versionedObjectiveKey(statement.objective);
|
|
1968
|
+
if (!objectiveKeys.has(objectiveKey))
|
|
1969
|
+
push(
|
|
1970
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_OBJECTIVE,
|
|
1971
|
+
`implementationStatements.${index}.objective`,
|
|
1972
|
+
"implementation statement references an unbound Wildo objective version",
|
|
1973
|
+
);
|
|
1974
|
+
const scope = scopeByRef.get(statement.governanceScope.scopeRef);
|
|
1975
|
+
if (!scope || scope.scopeSelectorVersion !== statement.governanceScope.scopeVersion)
|
|
1976
|
+
push(
|
|
1977
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_SCOPE_SELECTOR,
|
|
1978
|
+
`implementationStatements.${index}.governanceScope`,
|
|
1979
|
+
"implementation statement references an undeclared scope selector version",
|
|
1980
|
+
);
|
|
1981
|
+
const matchingDecisions = program.implementationDecisions.filter(
|
|
1982
|
+
(decision) => versionedObjectiveKey(decision.objective) === objectiveKey && decision.scopeSelectorRefs.includes(statement.governanceScope.scopeRef),
|
|
1983
|
+
);
|
|
1984
|
+
statement.capabilityBindingRefs.forEach((capability) => {
|
|
1985
|
+
const key = versionedCapabilityKey(capability);
|
|
1986
|
+
const selectedForStatement = matchingDecisions.some((decision) =>
|
|
1987
|
+
decision.capabilitySelections.some((selection) => versionedCapabilityKey(selection) === key),
|
|
1988
|
+
);
|
|
1989
|
+
if (!selectedForStatement)
|
|
1990
|
+
push(
|
|
1991
|
+
AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
1992
|
+
`implementationStatements.${index}.capabilityBindingRefs`,
|
|
1993
|
+
`capability ${key} is not selected for this exact objective and scope`,
|
|
1994
|
+
);
|
|
1995
|
+
});
|
|
1996
|
+
statement.documentDependencies.forEach((dependency) => {
|
|
1997
|
+
if (!documentKeys.has(versionedDocumentKey(dependency)))
|
|
1998
|
+
push(
|
|
1999
|
+
AssuranceProgramSpecificationIssueKind.UNKNOWN_DOCUMENT,
|
|
2000
|
+
`implementationStatements.${index}.documentDependencies`,
|
|
2001
|
+
`implementation statement references undeclared document ${versionedDocumentKey(dependency)}`,
|
|
2002
|
+
);
|
|
2003
|
+
});
|
|
2004
|
+
if (program.schemaVersion === 1) requireRevision(statement, `implementationStatements.${index}.sourceRevisionRef`);
|
|
2005
|
+
else requireBasis(statement, `implementationStatements.${index}.basisRef`);
|
|
2006
|
+
});
|
|
2007
|
+
return issues;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
const sourceReferenceMatchesRecord = (reference: AssuranceProgramSourceReference, record: AssuranceSourceRecord): boolean =>
|
|
2011
|
+
reference.edition === record.edition &&
|
|
2012
|
+
reference.authorityKind === record.authorityKind &&
|
|
2013
|
+
reference.authorityName === record.authorityName &&
|
|
2014
|
+
reference.lifecycleStatus === record.lifecycleStatus &&
|
|
2015
|
+
reference.rightsRef === record.rights.rightsRef &&
|
|
2016
|
+
reference.rightsVersion === record.rights.rightsVersion;
|
|
2017
|
+
|
|
2018
|
+
/**
|
|
2019
|
+
* Deterministic semantic validation consumed by the application-specification family authority.
|
|
2020
|
+
*
|
|
2021
|
+
* `authorities` is OPTIONAL. Without it, only the program's own structural and coherence issues are
|
|
2022
|
+
* collected — the content-validation half, which is a pure function of the authored bytes. The
|
|
2023
|
+
* authority-snapshot cross-checks run only when a host supplies a resolved snapshot (the
|
|
2024
|
+
* framework-knowledge generation pipeline does; the application-creation landing gate does not, and
|
|
2025
|
+
* refusing to validate at all in that case made the compliance-program family unlandable).
|
|
2026
|
+
*/
|
|
2027
|
+
export const validateAssuranceProgramSpecification = (
|
|
2028
|
+
program: AssuranceProgramSpecification,
|
|
2029
|
+
authorities?: AssuranceProgramValidationAuthorities,
|
|
2030
|
+
): { ok: boolean; issues: AssuranceProgramSpecificationIssue[] } => {
|
|
2031
|
+
const issues = collectAssuranceProgramSpecificationIssues(program);
|
|
2032
|
+
if (!authorities) {
|
|
2033
|
+
return { ok: issues.length === 0, issues };
|
|
2034
|
+
}
|
|
2035
|
+
const objectiveBindings = resolveAssuranceProgramObjectiveBindings(program);
|
|
2036
|
+
const objectiveBindingCollectionPath = assuranceProgramObjectiveBindingCollectionPath(program);
|
|
2037
|
+
const parsedSnapshot = AssuranceProgramValidationAuthoritySnapshotSchema.safeParse(authorities.snapshot);
|
|
2038
|
+
if (!parsedSnapshot.success) {
|
|
2039
|
+
issues.push({
|
|
2040
|
+
kind: AssuranceProgramSpecificationIssueKind.AUTHORITY_SNAPSHOT_INVALID,
|
|
2041
|
+
path: "validationAuthorities.snapshot",
|
|
2042
|
+
// Unbounded on purpose: this message is the author-facing account of WHY the
|
|
2043
|
+
// authority snapshot is invalid, so eliding issues would hide fixable faults.
|
|
2044
|
+
// Rendering delegates to the canonical formatter in `@wildo-ai/saas-models`.
|
|
2045
|
+
message: summarizeZodIssues(parsedSnapshot.error.issues, { limit: ALL_ZOD_ISSUES }),
|
|
2046
|
+
});
|
|
2047
|
+
return { ok: false, issues };
|
|
2048
|
+
}
|
|
2049
|
+
const snapshot = parsedSnapshot.data;
|
|
2050
|
+
if (snapshot.documentAuthorityCatalog) {
|
|
2051
|
+
collectAssuranceDocumentAuthorityCatalogIssues({
|
|
2052
|
+
catalog: snapshot.documentAuthorityCatalog,
|
|
2053
|
+
sourceRegistry: snapshot.sourceRegistry,
|
|
2054
|
+
evaluatedAt: snapshot.evaluatedAt,
|
|
2055
|
+
}).forEach((message) =>
|
|
2056
|
+
issues.push({
|
|
2057
|
+
kind: AssuranceProgramSpecificationIssueKind.DOCUMENT_AUTHORITY_CATALOG_INVALID,
|
|
2058
|
+
path: "validationAuthorities.snapshot.documentAuthorityCatalog",
|
|
2059
|
+
message,
|
|
2060
|
+
}),
|
|
2061
|
+
);
|
|
2062
|
+
}
|
|
2063
|
+
/*
|
|
2064
|
+
* HOST AUTHORITY BASIS DRIFT — the one cross-boundary check in this block, and the only one that
|
|
2065
|
+
* ever meant anything: does the basis the PROGRAM accepted match the basis the HOST is offering?
|
|
2066
|
+
* It is keyed on `basisRef@basisVersion`, the declared compatibility generation, so it fires when
|
|
2067
|
+
* the framework's interpretation contract moves and stays quiet for byte movement that does not.
|
|
2068
|
+
* (Five sibling checks here hashed the snapshot against its own material and were deleted
|
|
2069
|
+
* 2026-08-27 — see `.claude/rules/one-source-of-truth.md`.)
|
|
2070
|
+
*/
|
|
2071
|
+
if (program.schemaVersion !== 1) {
|
|
2072
|
+
const snapshotBasis = { basisRef: snapshot.snapshotRef, basisVersion: snapshot.snapshotVersion };
|
|
2073
|
+
program.authorityBases.forEach((basis, basisIndex) => {
|
|
2074
|
+
if (authorityBasisIdentityKey(basis) === authorityBasisIdentityKey(snapshotBasis)) return;
|
|
2075
|
+
issues.push({
|
|
2076
|
+
kind: AssuranceProgramSpecificationIssueKind.HOST_AUTHORITY_BASIS_DRIFT,
|
|
2077
|
+
path: `authorityBases.${basisIndex}`,
|
|
2078
|
+
subjectRef: `${basis.basisRef}@${basis.basisVersion}`,
|
|
2079
|
+
message: `authority basis ${basis.basisRef}@${basis.basisVersion} is not the host basis ${snapshotBasis.basisRef}@${snapshotBasis.basisVersion}`,
|
|
2080
|
+
});
|
|
2081
|
+
});
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
// Policy dates use UTC. Deriving from the authored timestamp text would let two offset spellings
|
|
2085
|
+
// of the same instant select different applicability, review and expiry decisions.
|
|
2086
|
+
const evaluatedOn = utcIsoDateFromInstant(snapshot.evaluatedAt);
|
|
2087
|
+
const sourceRecords = new Map(snapshot.sourceRegistry.sources.map((source) => [versionedSourceKey(source.identity), source]));
|
|
2088
|
+
const objectiveRecords = new Map(snapshot.objectiveCatalog.objectives.map((objective) => [versionedObjectiveKey(objective.identity), objective]));
|
|
2089
|
+
const applicationRoleRefs = new Set<string>(snapshot.applicationRoleRefs);
|
|
2090
|
+
const hostCapabilities = new Map(snapshot.capabilityAuthorities.map((authority) => [versionedCapabilityKey(authority.identity), authority]));
|
|
2091
|
+
const hostArtifacts = new Set(snapshot.implementationArtifacts.map((artifact) => artifact.artifactRef));
|
|
2092
|
+
const hostImplementationArtifactsByKind = new Map(snapshot.hostImplementationArtifacts.map((artifact) => [artifact.artifactKindRef, artifact]));
|
|
2093
|
+
const sourceRequirementAuthorities = new Map(snapshot.sourceRequirementAuthorities.map((authority) => [versionedSourceRequirementKey(authority), authority]));
|
|
2094
|
+
const implementationExpectationAuthorities = new Map(
|
|
2095
|
+
snapshot.implementationExpectationAuthorities.map((authority) => [versionedExpectationKey(authority.identity), authority]),
|
|
2096
|
+
);
|
|
2097
|
+
const evidenceExpectationAuthorities = new Map(
|
|
2098
|
+
snapshot.evidenceExpectationAuthorities.map((authority) => [versionedExpectationKey(authority.identity), authority]),
|
|
2099
|
+
);
|
|
2100
|
+
const verificationExpectationAuthorities = new Map(
|
|
2101
|
+
snapshot.verificationExpectationAuthorities.map((authority) => [versionedExpectationKey(authority.identity), authority]),
|
|
2102
|
+
);
|
|
2103
|
+
|
|
2104
|
+
program.documentationRequirements.forEach((requirement, requirementIndex) => {
|
|
2105
|
+
if (!("schemaVersion" in requirement) || requirement.schemaVersion !== 2) return;
|
|
2106
|
+
const catalog = snapshot.documentAuthorityCatalog;
|
|
2107
|
+
if (!catalog) {
|
|
2108
|
+
issues.push({
|
|
2109
|
+
kind: AssuranceProgramSpecificationIssueKind.DOCUMENT_AUTHORITY_CATALOG_INVALID,
|
|
2110
|
+
path: `documentationRequirements.${requirementIndex}.definition`,
|
|
2111
|
+
message: "a v2 documentation requirement requires a validation snapshot carrying the engine-owned document authority catalog",
|
|
2112
|
+
});
|
|
2113
|
+
return;
|
|
2114
|
+
}
|
|
2115
|
+
const definition = catalog.definitions.find(
|
|
2116
|
+
(candidate) =>
|
|
2117
|
+
candidate.identity.definitionRef === requirement.definition.definitionRef &&
|
|
2118
|
+
candidate.identity.definitionVersion === requirement.definition.definitionVersion,
|
|
2119
|
+
);
|
|
2120
|
+
if (!definition) {
|
|
2121
|
+
issues.push({
|
|
2122
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_DOCUMENT,
|
|
2123
|
+
path: `documentationRequirements.${requirementIndex}.definition`,
|
|
2124
|
+
message: `document definition ${requirement.definition.definitionRef}@${requirement.definition.definitionVersion} is absent from the engine authority catalog`,
|
|
2125
|
+
});
|
|
2126
|
+
return;
|
|
2127
|
+
}
|
|
2128
|
+
const relationshipProblems: string[] = [];
|
|
2129
|
+
if (requirement.documentKindRef !== definition.stableKindRef) relationshipProblems.push("document kind");
|
|
2130
|
+
if (!definition.governanceSubjectKinds.includes(requirement.governanceScope.subjectKind)) relationshipProblems.push("governance subject");
|
|
2131
|
+
if (requirement.audienceKinds.some((audience) => !definition.audienceKinds.includes(audience))) relationshipProblems.push("audience");
|
|
2132
|
+
if (requirement.allowedInteractionKinds.some((kind) => !definition.allowedInteractionKinds.includes(kind)))
|
|
2133
|
+
relationshipProblems.push("interaction meaning");
|
|
2134
|
+
if (requirement.publicationChannelKinds.some((channel) => !definition.publicationChannelKinds.includes(channel)))
|
|
2135
|
+
relationshipProblems.push("publication channel");
|
|
2136
|
+
if (definition.requiredFactRefs.some((factRef) => !requirement.requiredAcceptedFactRefs.includes(factRef))) relationshipProblems.push("required facts");
|
|
2137
|
+
|
|
2138
|
+
const requiredReviewKinds = new Set(
|
|
2139
|
+
catalog.qualifiedReviewPolicies
|
|
2140
|
+
.filter((policy) => definition.qualifiedReviewPolicyRefs.includes(policy.policyRef))
|
|
2141
|
+
.flatMap((policy) => assuranceDocumentQualifiedReviewRequirements(policy).map((reviewRequirement) => reviewRequirement.reviewKind)),
|
|
2142
|
+
);
|
|
2143
|
+
if ([...requiredReviewKinds].some((reviewKind) => !requirement.requiredReviewKinds.includes(reviewKind))) relationshipProblems.push("qualified reviews");
|
|
2144
|
+
|
|
2145
|
+
const requiredSourceKeys = new Set(
|
|
2146
|
+
catalog.sourceMonitoringPolicies
|
|
2147
|
+
.filter((policy) => definition.sourcePolicyRefs.includes(policy.policyRef))
|
|
2148
|
+
.map((policy) => versionedSourceKey(policy.source)),
|
|
2149
|
+
);
|
|
2150
|
+
const authoredSourceKeys = new Set(requirement.sourceRefs.map(versionedSourceKey));
|
|
2151
|
+
if ([...requiredSourceKeys].some((sourceKey) => !authoredSourceKeys.has(sourceKey))) relationshipProblems.push("authoritative sources");
|
|
2152
|
+
const declaredScope = program.scopeSelectors.find((scope) => String(scope.scopeSelectorRef) === String(requirement.governanceScope.scopeRef));
|
|
2153
|
+
if (!declaredScope || declaredScope.scopeSelectorVersion !== requirement.governanceScope.scopeVersion) relationshipProblems.push("governance scope");
|
|
2154
|
+
if (timestampIsAfter(requirement.applicabilityDecidedAt, snapshot.evaluatedAt)) relationshipProblems.push("applicability decision time");
|
|
2155
|
+
|
|
2156
|
+
if (relationshipProblems.length > 0) {
|
|
2157
|
+
issues.push({
|
|
2158
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2159
|
+
path: `documentationRequirements.${requirementIndex}`,
|
|
2160
|
+
message: `documentation requirement does not satisfy its exact engine-owned definition: ${relationshipProblems.join(", ")}`,
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
});
|
|
2164
|
+
|
|
2165
|
+
if (program.schemaVersion === 3) {
|
|
2166
|
+
program.obligationCoverageDecisions.forEach((decision, decisionIndex) => {
|
|
2167
|
+
if (timestampIsAfter(decision.reviewedAt, snapshot.evaluatedAt))
|
|
2168
|
+
issues.push({
|
|
2169
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2170
|
+
path: `obligationCoverageDecisions.${decisionIndex}.reviewedAt`,
|
|
2171
|
+
message: "coverage review cannot be later than the authority evaluation time",
|
|
2172
|
+
});
|
|
2173
|
+
decision.sourceRequirementRefs.forEach((reference, referenceIndex) => {
|
|
2174
|
+
const requirementAuthority = sourceRequirementAuthorities.get(versionedSourceRequirementKey(reference));
|
|
2175
|
+
const sourceAuthority = sourceRecords.get(versionedSourceKey(reference.source));
|
|
2176
|
+
const authorityFacts = [
|
|
2177
|
+
requirementAuthority && { label: "source-requirement review", observedAt: requirementAuthority.reviewedAt },
|
|
2178
|
+
sourceAuthority && { label: "source-rights review", observedAt: sourceAuthority.rights.reviewedAt },
|
|
2179
|
+
sourceAuthority?.retrievedArtifact && { label: "source-artifact retrieval", observedAt: sourceAuthority.retrievedArtifact.retrievedAt },
|
|
2180
|
+
].filter((fact): fact is { label: string; observedAt: string } => fact !== undefined);
|
|
2181
|
+
authorityFacts.forEach((fact) => {
|
|
2182
|
+
if (timestampIsAfter(fact.observedAt, decision.reviewedAt))
|
|
2183
|
+
issues.push({
|
|
2184
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2185
|
+
path: `obligationCoverageDecisions.${decisionIndex}.sourceRequirementRefs.${referenceIndex}`,
|
|
2186
|
+
message: `coverage review cannot predate the cited ${fact.label} at ${fact.observedAt}`,
|
|
2187
|
+
});
|
|
2188
|
+
});
|
|
2189
|
+
});
|
|
2190
|
+
});
|
|
2191
|
+
program.sharedResponsibilityRules.forEach((rule, ruleIndex) => {
|
|
2192
|
+
if (timestampIsAfter(rule.reviewedAt, snapshot.evaluatedAt))
|
|
2193
|
+
issues.push({
|
|
2194
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2195
|
+
path: `sharedResponsibilityRules.${ruleIndex}.reviewedAt`,
|
|
2196
|
+
message: "shared-responsibility review cannot be later than the authority evaluation time",
|
|
2197
|
+
});
|
|
2198
|
+
});
|
|
2199
|
+
program.obligationRegister.entries.forEach((entry, entryIndex) => {
|
|
2200
|
+
if (timestampIsAfter(entry.applicability.decidedAt, snapshot.evaluatedAt))
|
|
2201
|
+
issues.push({
|
|
2202
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2203
|
+
path: `obligationRegister.entries.${entryIndex}.applicability.decidedAt`,
|
|
2204
|
+
message: "obligation applicability decision cannot be later than the authority evaluation time",
|
|
2205
|
+
});
|
|
2206
|
+
const coverageDecision = program.obligationCoverageDecisions.find(
|
|
2207
|
+
(decision) => versionedCoverageDecisionKey(decision) === versionedCoverageDecisionKey(entry.coverageDecision),
|
|
2208
|
+
);
|
|
2209
|
+
if (coverageDecision && timestampIsAfter(coverageDecision.reviewedAt, entry.applicability.decidedAt))
|
|
2210
|
+
issues.push({
|
|
2211
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2212
|
+
path: `obligationRegister.entries.${entryIndex}.applicability.decidedAt`,
|
|
2213
|
+
message: `obligation applicability decision cannot predate its approved coverage review at ${coverageDecision.reviewedAt}`,
|
|
2214
|
+
});
|
|
2215
|
+
if (entry.reviewOn < evaluatedOn)
|
|
2216
|
+
issues.push({
|
|
2217
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2218
|
+
path: `obligationRegister.entries.${entryIndex}.reviewOn`,
|
|
2219
|
+
message: `obligation review was due before authority evaluation date ${evaluatedOn}`,
|
|
2220
|
+
});
|
|
2221
|
+
});
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
objectiveBindings.forEach((binding, index) => {
|
|
2225
|
+
const objectiveKey = versionedObjectiveKey(binding.objective);
|
|
2226
|
+
const objective = objectiveRecords.get(objectiveKey);
|
|
2227
|
+
if (!objective)
|
|
2228
|
+
issues.push({
|
|
2229
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_OBJECTIVE,
|
|
2230
|
+
path: `${objectiveBindingCollectionPath}.${index}.objective`,
|
|
2231
|
+
message: `objective ${objectiveKey} is absent from the supplied Wildo objective catalog`,
|
|
2232
|
+
});
|
|
2233
|
+
else if (objective.lifecycleStatus !== AssuranceObjectiveLifecycleStatus.ACTIVE)
|
|
2234
|
+
issues.push({
|
|
2235
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_OBJECTIVE,
|
|
2236
|
+
path: `${objectiveBindingCollectionPath}.${index}.objective`,
|
|
2237
|
+
message: `objective ${objectiveKey} is ${objective.lifecycleStatus.toLowerCase()} and cannot authorize current application policy`,
|
|
2238
|
+
});
|
|
2239
|
+
binding.sourceRequirementRefs.forEach((reference) => {
|
|
2240
|
+
const authority = sourceRequirementAuthorities.get(versionedSourceRequirementKey(reference));
|
|
2241
|
+
if (!authority || versionedObjectiveKey(authority.objective) !== objectiveKey)
|
|
2242
|
+
issues.push({
|
|
2243
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_SOURCE_REQUIREMENT,
|
|
2244
|
+
path: `${objectiveBindingCollectionPath}.${index}.sourceRequirementRefs`,
|
|
2245
|
+
message: `source requirement ${versionedSourceRequirementKey(reference)} is not reviewed for objective ${objectiveKey}`,
|
|
2246
|
+
});
|
|
2247
|
+
});
|
|
2248
|
+
for (const [field, refs, authorityMap] of [
|
|
2249
|
+
["implementationExpectationRefs", binding.implementationExpectationRefs, implementationExpectationAuthorities],
|
|
2250
|
+
["evidenceExpectationRefs", binding.evidenceExpectationRefs, evidenceExpectationAuthorities],
|
|
2251
|
+
["verificationExpectationRefs", binding.verificationExpectationRefs, verificationExpectationAuthorities],
|
|
2252
|
+
] as const)
|
|
2253
|
+
refs.forEach((identity) => {
|
|
2254
|
+
const key = versionedExpectationKey(identity);
|
|
2255
|
+
const authority = authorityMap.get(key);
|
|
2256
|
+
if (!authority || versionedObjectiveKey(authority.objective) !== objectiveKey)
|
|
2257
|
+
issues.push({
|
|
2258
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_VALIDATION_AUTHORITY,
|
|
2259
|
+
path: `${objectiveBindingCollectionPath}.${index}.${field}`,
|
|
2260
|
+
message: `${key} is not an exact reviewed authority for objective ${objectiveKey}`,
|
|
2261
|
+
});
|
|
2262
|
+
});
|
|
2263
|
+
});
|
|
2264
|
+
|
|
2265
|
+
program.roleAuthorities.forEach((authority, index) => {
|
|
2266
|
+
if (!applicationRoleRefs.has(authority.applicationRoleRef))
|
|
2267
|
+
issues.push({
|
|
2268
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_ROLE,
|
|
2269
|
+
path: `roleAuthorities.${index}.applicationRoleRef`,
|
|
2270
|
+
message: `application role ${authority.applicationRoleRef} is absent from the host application-role catalog`,
|
|
2271
|
+
});
|
|
2272
|
+
});
|
|
2273
|
+
|
|
2274
|
+
program.capabilityAuthorities.forEach((authority, index) => {
|
|
2275
|
+
const key = versionedCapabilityKey(authority.identity);
|
|
2276
|
+
const host = hostCapabilities.get(key);
|
|
2277
|
+
/*
|
|
2278
|
+
* Two different verdicts hide behind "does not match the host catalog", and collapsing them costs an operator
|
|
2279
|
+
* the ability to tell "this host cannot implement the control I accepted" from "the control is intact, its
|
|
2280
|
+
* bytes moved". The first can never be resolved by re-accepting; the second is resolved by exactly that.
|
|
2281
|
+
* Identity, kind and implementation refs are checked first because a capability that fails any of them is not
|
|
2282
|
+
* the accepted control at all — its revision is then irrelevant.
|
|
2283
|
+
*/
|
|
2284
|
+
if (!host || host.capabilityKind !== authority.capabilityKind || JSON.stringify(host.implementationRefs) !== JSON.stringify(authority.implementationRefs)) {
|
|
2285
|
+
issues.push({
|
|
2286
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
2287
|
+
path: `capabilityAuthorities.${index}`,
|
|
2288
|
+
message: `capability authority ${key} is absent from the enabled host capability catalog or resolves to a different capability kind or implementation`,
|
|
2289
|
+
});
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
const implementationIdentityMatches =
|
|
2293
|
+
program.schemaVersion === 1
|
|
2294
|
+
? sourceRevisionKey(host.implementationRevision) === sourceRevisionKey(authority.implementationRevision)
|
|
2295
|
+
: authorityBasisIdentityKey(authority.implementationAuthority) ===
|
|
2296
|
+
authorityBasisIdentityKey({ basisRef: snapshot.snapshotRef, basisVersion: snapshot.snapshotVersion });
|
|
2297
|
+
if (!implementationIdentityMatches)
|
|
2298
|
+
issues.push({
|
|
2299
|
+
kind: AssuranceProgramSpecificationIssueKind.HOST_CAPABILITY_IMPLEMENTATION_DRIFT,
|
|
2300
|
+
path: `capabilityAuthorities.${index}`,
|
|
2301
|
+
subjectRef: key,
|
|
2302
|
+
message: `capability authority ${key} is offered by the host under a different implementation authority than the one it was accepted against`,
|
|
2303
|
+
});
|
|
2304
|
+
});
|
|
2305
|
+
|
|
2306
|
+
program.implementationDecisions.forEach((decision, decisionIndex) => {
|
|
2307
|
+
decision.capabilitySelections.forEach((selection, selectionIndex) => {
|
|
2308
|
+
const host = hostCapabilities.get(versionedCapabilityKey(selection));
|
|
2309
|
+
if (!host) return;
|
|
2310
|
+
host.requiredHostArtifactKindRefs.forEach((artifactKindRef) => {
|
|
2311
|
+
if (!hostImplementationArtifactsByKind.has(artifactKindRef))
|
|
2312
|
+
issues.push({
|
|
2313
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
2314
|
+
path: `implementationDecisions.${decisionIndex}.capabilitySelections.${selectionIndex}`,
|
|
2315
|
+
message: `capability selection requires host implementation artifact kind ${artifactKindRef}`,
|
|
2316
|
+
});
|
|
2317
|
+
});
|
|
2318
|
+
const profile = selection.profileRef ? host.profiles.find((candidate) => candidate.profileRef === selection.profileRef) : undefined;
|
|
2319
|
+
if ((selection.profileRef && !profile) || (!selection.profileRef && host.profiles.length > 0))
|
|
2320
|
+
issues.push({
|
|
2321
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
2322
|
+
path: `implementationDecisions.${decisionIndex}.capabilitySelections.${selectionIndex}.profileRef`,
|
|
2323
|
+
message: `capability selection must resolve one exact host-authorized profile`,
|
|
2324
|
+
});
|
|
2325
|
+
if (profile) {
|
|
2326
|
+
const selectedByParameter = new Map(selection.selectedOptions.map((option) => [option.parameterRef, option.selectedOptionRef]));
|
|
2327
|
+
profile.parameters.forEach((parameter) => {
|
|
2328
|
+
const selected = selectedByParameter.get(parameter.parameterRef);
|
|
2329
|
+
if (!selected || !parameter.allowedOptionRefs.includes(selected))
|
|
2330
|
+
issues.push({
|
|
2331
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
2332
|
+
path: `implementationDecisions.${decisionIndex}.capabilitySelections.${selectionIndex}.selectedOptions`,
|
|
2333
|
+
message: `profile ${profile.profileRef} requires one allowed option for ${parameter.parameterRef}`,
|
|
2334
|
+
});
|
|
2335
|
+
});
|
|
2336
|
+
selection.selectedOptions.forEach((option) => {
|
|
2337
|
+
if (!profile.parameters.some((parameter) => parameter.parameterRef === option.parameterRef))
|
|
2338
|
+
issues.push({
|
|
2339
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
2340
|
+
path: `implementationDecisions.${decisionIndex}.capabilitySelections.${selectionIndex}.selectedOptions`,
|
|
2341
|
+
message: `parameter ${option.parameterRef} is absent from profile ${profile.profileRef}`,
|
|
2342
|
+
});
|
|
2343
|
+
});
|
|
2344
|
+
} else if (selection.selectedOptions.length > 0)
|
|
2345
|
+
issues.push({
|
|
2346
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_CAPABILITY,
|
|
2347
|
+
path: `implementationDecisions.${decisionIndex}.capabilitySelections.${selectionIndex}.selectedOptions`,
|
|
2348
|
+
message: "selected options require an exact host-authorized profile",
|
|
2349
|
+
});
|
|
2350
|
+
});
|
|
2351
|
+
});
|
|
2352
|
+
|
|
2353
|
+
program.sourceReferences.forEach((reference, index) => {
|
|
2354
|
+
const key = versionedSourceKey(reference.identity);
|
|
2355
|
+
const record = sourceRecords.get(key);
|
|
2356
|
+
if (!record) {
|
|
2357
|
+
issues.push({
|
|
2358
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_SOURCE_AUTHORITY,
|
|
2359
|
+
path: `sourceReferences.${index}`,
|
|
2360
|
+
message: `source ${key} is absent from the supplied authoritative registry`,
|
|
2361
|
+
});
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2364
|
+
if (!sourceReferenceMatchesRecord(reference, record))
|
|
2365
|
+
issues.push({
|
|
2366
|
+
kind: AssuranceProgramSpecificationIssueKind.SOURCE_AUTHORITY_MISMATCH,
|
|
2367
|
+
path: `sourceReferences.${index}`,
|
|
2368
|
+
message: `source ${key} does not exactly match its registry metadata, lifecycle and rights identity`,
|
|
2369
|
+
});
|
|
2370
|
+
const rightsAuthorization = deriveAssuranceRightsAuthorization(record.rights, snapshot.requestedSourceUses, snapshot.evaluatedAt);
|
|
2371
|
+
if (!rightsAuthorization.authorized)
|
|
2372
|
+
issues.push({
|
|
2373
|
+
kind: AssuranceProgramSpecificationIssueKind.SOURCE_RIGHTS_UNAUTHORIZED,
|
|
2374
|
+
path: `sourceReferences.${index}.rightsRef`,
|
|
2375
|
+
message: `source ${key} is not authorized for ${rightsAuthorization.requestedUses.join(", ")}: ${rightsAuthorization.reasons.join(", ")}`,
|
|
2376
|
+
});
|
|
2377
|
+
const currentApplicability = program.applicabilityDecisions.filter(
|
|
2378
|
+
(decision) =>
|
|
2379
|
+
versionedSourceKey(decision.source) === key &&
|
|
2380
|
+
decision.effectiveFrom <= evaluatedOn &&
|
|
2381
|
+
(!decision.effectiveUntil || evaluatedOn <= decision.effectiveUntil),
|
|
2382
|
+
);
|
|
2383
|
+
if (
|
|
2384
|
+
record.lifecycleStatus !== AssuranceSourceLifecycleStatus.ACTIVE &&
|
|
2385
|
+
currentApplicability.some((decision) => decision.status !== AssuranceProgramApplicabilityStatus.NOT_APPLICABLE)
|
|
2386
|
+
)
|
|
2387
|
+
issues.push({
|
|
2388
|
+
kind: AssuranceProgramSpecificationIssueKind.SOURCE_LIFECYCLE_CONFLICT,
|
|
2389
|
+
path: "applicabilityDecisions",
|
|
2390
|
+
message: `${record.lifecycleStatus.toLowerCase()} source ${key} cannot authorize a current applicable or undetermined period`,
|
|
2391
|
+
});
|
|
2392
|
+
if (
|
|
2393
|
+
currentApplicability.some((decision) => decision.status !== AssuranceProgramApplicabilityStatus.NOT_APPLICABLE) &&
|
|
2394
|
+
(record.publishedOn > evaluatedOn || (record.effectiveOn !== undefined && record.effectiveOn > evaluatedOn))
|
|
2395
|
+
)
|
|
2396
|
+
issues.push({
|
|
2397
|
+
kind: AssuranceProgramSpecificationIssueKind.SOURCE_LIFECYCLE_CONFLICT,
|
|
2398
|
+
path: "applicabilityDecisions",
|
|
2399
|
+
message: `source ${key} cannot authorize current applicability before its publication and effective dates`,
|
|
2400
|
+
});
|
|
2401
|
+
});
|
|
2402
|
+
|
|
2403
|
+
if (program.schemaVersion === 3) {
|
|
2404
|
+
const applicabilityDecisionByKey = new Map(
|
|
2405
|
+
program.applicabilityDecisions.map((decision) => [versionedApplicabilityDecisionKey(decision), decision] as const),
|
|
2406
|
+
);
|
|
2407
|
+
program.obligationRegister.entries.forEach((entry, entryIndex) => {
|
|
2408
|
+
const citedCurrentDecisions: AssuranceProgramApplicabilityDecision[] = [];
|
|
2409
|
+
entry.sourceApplicabilityDecisionRefs.forEach((identity, identityIndex) => {
|
|
2410
|
+
const decision = applicabilityDecisionByKey.get(versionedApplicabilityDecisionKey(identity));
|
|
2411
|
+
if (decision && (decision.effectiveFrom > evaluatedOn || (decision.effectiveUntil !== undefined && evaluatedOn > decision.effectiveUntil)))
|
|
2412
|
+
issues.push({
|
|
2413
|
+
kind: AssuranceProgramSpecificationIssueKind.INCOMPLETE_APPLICABILITY,
|
|
2414
|
+
path: `obligationRegister.entries.${entryIndex}.sourceApplicabilityDecisionRefs.${identityIndex}`,
|
|
2415
|
+
message: `cited source applicability decision ${versionedApplicabilityDecisionKey(identity)} is not current on ${evaluatedOn}`,
|
|
2416
|
+
});
|
|
2417
|
+
else if (decision) citedCurrentDecisions.push(decision);
|
|
2418
|
+
});
|
|
2419
|
+
if (
|
|
2420
|
+
entry.applicability.status === AssuranceProgramObligationApplicabilityStatus.APPLICABLE &&
|
|
2421
|
+
!citedCurrentDecisions.some((decision) => decision.status === AssuranceProgramApplicabilityStatus.APPLICABLE)
|
|
2422
|
+
)
|
|
2423
|
+
issues.push({
|
|
2424
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2425
|
+
path: `obligationRegister.entries.${entryIndex}.applicability.status`,
|
|
2426
|
+
message: "an applicable obligation requires at least one cited source applicability decision that is currently APPLICABLE",
|
|
2427
|
+
});
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
const requiredApplicabilitySubjects = new Set<string>();
|
|
2432
|
+
objectiveBindings.forEach((binding) =>
|
|
2433
|
+
binding.sourceRequirementRefs.forEach((reference) =>
|
|
2434
|
+
binding.scopeSelectorRefs.forEach((scopeRef) => requiredApplicabilitySubjects.add(applicabilitySubjectKey(reference.source, scopeRef))),
|
|
2435
|
+
),
|
|
2436
|
+
);
|
|
2437
|
+
program.sourceReferences.forEach((source) => {
|
|
2438
|
+
const matchingScopes = program.applicabilityDecisions
|
|
2439
|
+
.filter((decision) => versionedSourceKey(decision.source) === versionedSourceKey(source.identity))
|
|
2440
|
+
.map((decision) => decision.scopeSelectorRef);
|
|
2441
|
+
matchingScopes.forEach((scopeRef) => requiredApplicabilitySubjects.add(applicabilitySubjectKey(source.identity, scopeRef)));
|
|
2442
|
+
});
|
|
2443
|
+
requiredApplicabilitySubjects.forEach((subject) => {
|
|
2444
|
+
const decisions = program.applicabilityDecisions
|
|
2445
|
+
.filter((decision) => applicabilitySubjectKey(decision.source, decision.scopeSelectorRef) === subject)
|
|
2446
|
+
.sort((left, right) => compareCanonicalText(left.effectiveFrom, right.effectiveFrom));
|
|
2447
|
+
const current = decisions.filter(
|
|
2448
|
+
(decision) => decision.effectiveFrom <= evaluatedOn && (!decision.effectiveUntil || evaluatedOn <= decision.effectiveUntil),
|
|
2449
|
+
);
|
|
2450
|
+
if (current.length !== 1)
|
|
2451
|
+
issues.push({
|
|
2452
|
+
kind: AssuranceProgramSpecificationIssueKind.INCOMPLETE_APPLICABILITY,
|
|
2453
|
+
path: "applicabilityDecisions",
|
|
2454
|
+
message: `source/scope subject ${subject} requires exactly one decision current on ${evaluatedOn}; found ${current.length}`,
|
|
2455
|
+
});
|
|
2456
|
+
decisions.forEach((decision, index) => {
|
|
2457
|
+
const next = decisions[index + 1];
|
|
2458
|
+
if (!next) return;
|
|
2459
|
+
if (!decision.effectiveUntil)
|
|
2460
|
+
issues.push({
|
|
2461
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2462
|
+
path: "applicabilityDecisions",
|
|
2463
|
+
message: `open applicability period for ${subject} cannot have a successor`,
|
|
2464
|
+
});
|
|
2465
|
+
else {
|
|
2466
|
+
const nextCalendarDay = new Date(`${decision.effectiveUntil}T00:00:00.000Z`);
|
|
2467
|
+
nextCalendarDay.setUTCDate(nextCalendarDay.getUTCDate() + 1);
|
|
2468
|
+
if (next.effectiveFrom !== nextCalendarDay.toISOString().slice(0, 10))
|
|
2469
|
+
issues.push({
|
|
2470
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2471
|
+
path: "applicabilityDecisions",
|
|
2472
|
+
message: `declared applicability history for ${subject} contains a temporal gap`,
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
});
|
|
2476
|
+
});
|
|
2477
|
+
|
|
2478
|
+
program.gapsAndExceptions.forEach((finding, index) => {
|
|
2479
|
+
if (
|
|
2480
|
+
(finding.kind === AssuranceProgramFindingKind.EXCEPTION || finding.disposition === AssuranceGapDisposition.RISK_ACCEPTED) &&
|
|
2481
|
+
finding.expiresOn &&
|
|
2482
|
+
finding.expiresOn < evaluatedOn
|
|
2483
|
+
)
|
|
2484
|
+
issues.push({
|
|
2485
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2486
|
+
path: `gapsAndExceptions.${index}.expiresOn`,
|
|
2487
|
+
message: `exception or risk acceptance expired before authority evaluation date ${evaluatedOn}`,
|
|
2488
|
+
});
|
|
2489
|
+
if (finding.disposition !== AssuranceGapDisposition.RESOLVED && finding.reviewOn < evaluatedOn)
|
|
2490
|
+
issues.push({
|
|
2491
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2492
|
+
path: `gapsAndExceptions.${index}.reviewOn`,
|
|
2493
|
+
message: `open finding review was due before authority evaluation date ${evaluatedOn}`,
|
|
2494
|
+
});
|
|
2495
|
+
});
|
|
2496
|
+
|
|
2497
|
+
if (program.schemaVersion === 1) {
|
|
2498
|
+
program.sourceRevisions.forEach((revision, index) => {
|
|
2499
|
+
revision.artifacts.forEach((artifact) => {
|
|
2500
|
+
if (!hostArtifacts.has(artifact.artifactRef))
|
|
2501
|
+
issues.push({
|
|
2502
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_IMPLEMENTATION_ARTIFACT,
|
|
2503
|
+
path: `sourceRevisions.${index}.artifacts`,
|
|
2504
|
+
subjectRef: sourceRevisionArtifactSubjectRef(revision.sourceRevisionRef, artifact.artifactRef),
|
|
2505
|
+
message: `artifact ${artifact.artifactRef} is absent from the host authority inventory`,
|
|
2506
|
+
});
|
|
2507
|
+
});
|
|
2508
|
+
});
|
|
2509
|
+
} else {
|
|
2510
|
+
program.authorityBases.forEach((basis, basisIndex) => {
|
|
2511
|
+
basis.attestedArtifactRefs.forEach((artifactRef) => {
|
|
2512
|
+
if (!hostArtifacts.has(artifactRef))
|
|
2513
|
+
issues.push({
|
|
2514
|
+
kind: AssuranceProgramSpecificationIssueKind.UNKNOWN_IMPLEMENTATION_ARTIFACT,
|
|
2515
|
+
path: `authorityBases.${basisIndex}.attestedArtifactRefs`,
|
|
2516
|
+
message: `artifact ${artifactRef} is not attested by the host authority-basis inventory`,
|
|
2517
|
+
});
|
|
2518
|
+
});
|
|
2519
|
+
});
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
program.implementationStatements.forEach((statement, statementIndex) => {
|
|
2523
|
+
if (statement.acceptedAt && timestampIsAfter(statement.acceptedAt, snapshot.evaluatedAt))
|
|
2524
|
+
issues.push({
|
|
2525
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2526
|
+
path: `implementationStatements.${statementIndex}.acceptedAt`,
|
|
2527
|
+
message: "implementation-statement acceptance cannot be later than the authority evaluation time",
|
|
2528
|
+
});
|
|
2529
|
+
if (statement.invalidatedAt && timestampIsAfter(statement.invalidatedAt, snapshot.evaluatedAt))
|
|
2530
|
+
issues.push({
|
|
2531
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2532
|
+
path: `implementationStatements.${statementIndex}.invalidatedAt`,
|
|
2533
|
+
message: "implementation-statement invalidation cannot be later than the authority evaluation time",
|
|
2534
|
+
});
|
|
2535
|
+
if (statement.lifecycleStatus !== AssuranceImplementationStatementLifecycleStatus.ACCEPTED) return;
|
|
2536
|
+
const objectiveKey = versionedObjectiveKey(statement.objective);
|
|
2537
|
+
const binding = objectiveBindings.find(
|
|
2538
|
+
(candidate) => versionedObjectiveKey(candidate.objective) === objectiveKey && candidate.scopeSelectorRefs.includes(statement.governanceScope.scopeRef),
|
|
2539
|
+
);
|
|
2540
|
+
if (!binding) return;
|
|
2541
|
+
if (statement.acceptedAt) {
|
|
2542
|
+
const causallyCheckedSources = new Set<string>();
|
|
2543
|
+
binding.sourceRequirementRefs.forEach((reference) => {
|
|
2544
|
+
const authority = sourceRequirementAuthorities.get(versionedSourceRequirementKey(reference));
|
|
2545
|
+
if (authority && timestampIsAfter(authority.reviewedAt, statement.acceptedAt))
|
|
2546
|
+
issues.push({
|
|
2547
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2548
|
+
path: `implementationStatements.${statementIndex}.acceptedAt`,
|
|
2549
|
+
message: `accepted statement predates the bound source-requirement review ${versionedSourceRequirementKey(reference)}`,
|
|
2550
|
+
});
|
|
2551
|
+
const sourceKey = versionedSourceKey(reference.source);
|
|
2552
|
+
if (causallyCheckedSources.has(sourceKey)) return;
|
|
2553
|
+
causallyCheckedSources.add(sourceKey);
|
|
2554
|
+
const source = sourceRecords.get(sourceKey);
|
|
2555
|
+
if (source && timestampIsAfter(source.rights.reviewedAt, statement.acceptedAt))
|
|
2556
|
+
issues.push({
|
|
2557
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2558
|
+
path: `implementationStatements.${statementIndex}.acceptedAt`,
|
|
2559
|
+
message: `accepted statement predates the source-rights review for ${sourceKey}`,
|
|
2560
|
+
});
|
|
2561
|
+
if (source?.retrievedArtifact && timestampIsAfter(source.retrievedArtifact.retrievedAt, statement.acceptedAt))
|
|
2562
|
+
issues.push({
|
|
2563
|
+
kind: AssuranceProgramSpecificationIssueKind.TEMPORAL_POLICY_CONFLICT,
|
|
2564
|
+
path: `implementationStatements.${statementIndex}.acceptedAt`,
|
|
2565
|
+
message: `accepted statement predates the retrieved source artifact for ${sourceKey}`,
|
|
2566
|
+
});
|
|
2567
|
+
});
|
|
2568
|
+
}
|
|
2569
|
+
const statementCapabilities = new Set(statement.capabilityBindingRefs.map((identity) => identity.capabilityRef));
|
|
2570
|
+
const statementEvidence = new Set(statement.expectedEvidence.map((requirement) => requirement.requirementRef));
|
|
2571
|
+
const statementVerification = new Set(statement.verificationExpectations.map((expectation) => expectation.expectationRef));
|
|
2572
|
+
binding.implementationExpectationRefs.forEach((identity) => {
|
|
2573
|
+
const authority = implementationExpectationAuthorities.get(versionedExpectationKey(identity));
|
|
2574
|
+
if (authority?.requiredCapabilityRefs.some((capabilityRef) => !statementCapabilities.has(capabilityRef)))
|
|
2575
|
+
issues.push({
|
|
2576
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2577
|
+
path: `implementationStatements.${statementIndex}.capabilityBindingRefs`,
|
|
2578
|
+
message: `${versionedExpectationKey(identity)} is not satisfied by the accepted statement capabilities`,
|
|
2579
|
+
});
|
|
2580
|
+
});
|
|
2581
|
+
binding.evidenceExpectationRefs.forEach((identity) => {
|
|
2582
|
+
const authority = evidenceExpectationAuthorities.get(versionedExpectationKey(identity));
|
|
2583
|
+
if (authority?.requiredStatementEvidenceRefs.some((requirementRef) => !statementEvidence.has(requirementRef)))
|
|
2584
|
+
issues.push({
|
|
2585
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2586
|
+
path: `implementationStatements.${statementIndex}.expectedEvidence`,
|
|
2587
|
+
message: `${versionedExpectationKey(identity)} is not satisfied by the accepted statement evidence requirements`,
|
|
2588
|
+
});
|
|
2589
|
+
});
|
|
2590
|
+
binding.verificationExpectationRefs.forEach((identity) => {
|
|
2591
|
+
const authority = verificationExpectationAuthorities.get(versionedExpectationKey(identity));
|
|
2592
|
+
if (authority?.requiredStatementVerificationRefs.some((expectationRef) => !statementVerification.has(expectationRef)))
|
|
2593
|
+
issues.push({
|
|
2594
|
+
kind: AssuranceProgramSpecificationIssueKind.RELATIONSHIP_MISMATCH,
|
|
2595
|
+
path: `implementationStatements.${statementIndex}.verificationExpectations`,
|
|
2596
|
+
message: `${versionedExpectationKey(identity)} is not satisfied by the accepted statement verification expectations`,
|
|
2597
|
+
});
|
|
2598
|
+
});
|
|
2599
|
+
});
|
|
2600
|
+
return { ok: issues.length === 0, issues };
|
|
2601
|
+
};
|
|
2602
|
+
```
|