@wildo-ai/saas-specifications 1.1.0 → 1.1.2
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/dist/assurance/external-framework-mapping.json +980 -0
- package/dist/esm/_core/brand/brand.family-aspects.d.ts +3 -0
- package/dist/esm/_core/brand/brand.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand.family-aspects.js +51 -0
- package/dist/esm/_core/brand/brand.family-aspects.js.map +1 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts +3 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +28 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts +3 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.js +21 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.js.map +1 -0
- package/dist/esm/_core/chart-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/chart-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/chart-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts +85 -0
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js +41 -0
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +168 -2
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +98 -9
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts +12 -0
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js +47 -0
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js.map +1 -0
- package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js +8 -3
- package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts +21 -0
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js +40 -0
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js.map +1 -0
- package/dist/esm/_core/composite-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/composite-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +32 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -0
- package/dist/esm/_core/execution-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/execution-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/execution-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.registry.d.ts +18 -0
- package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -0
- package/dist/esm/_core/family-aspects.registry.js +60 -0
- package/dist/esm/_core/family-aspects.registry.js.map +1 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts +122 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -0
- package/dist/esm/_core/family-aspects.schemas.js +15 -0
- package/dist/esm/_core/family-aspects.schemas.js.map +1 -0
- package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +11 -11
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts +3 -0
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js +25 -0
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js.map +1 -0
- package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/flows-actors-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/frontend-component-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/frontend-component-specification.schemas.js +19 -1
- package/dist/esm/_core/frontend-component-specification.schemas.js.map +1 -1
- package/dist/esm/_core/full-custom-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/full-custom-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/full-custom-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/guidance-flow-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/guidance-flow-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/guidance-flow-specification.schemas.js +14 -0
- package/dist/esm/_core/guidance-flow-specification.schemas.js.map +1 -1
- package/dist/esm/_core/index.d.ts +2 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +2 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +22 -22
- package/dist/esm/_core/market/market.family-aspects.d.ts +9 -0
- package/dist/esm/_core/market/market.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/market/market.family-aspects.js +227 -0
- package/dist/esm/_core/market/market.family-aspects.js.map +1 -0
- package/dist/esm/_core/onboarding-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/onboarding-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/onboarding-view-specification.schemas.js +14 -0
- package/dist/esm/_core/onboarding-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts +3 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js +31 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js.map +1 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.d.ts +9 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.js +40 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.js.map +1 -0
- package/dist/esm/_core/resource-specification.schemas.d.ts +22 -0
- package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
- package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts +3 -0
- package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/roadmap/roadmap.family-aspects.js +26 -0
- package/dist/esm/_core/roadmap/roadmap.family-aspects.js.map +1 -0
- package/dist/esm/_core/vision/vision.family-aspects.d.ts +11 -0
- package/dist/esm/_core/vision/vision.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/vision/vision.family-aspects.js +63 -0
- package/dist/esm/_core/vision/vision.family-aspects.js.map +1 -0
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +188 -33
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +158 -57
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts +38 -4
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js +37 -3
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/document-facts.family-aspects.d.ts +12 -0
- package/dist/esm/application-creation/document-facts.family-aspects.d.ts.map +1 -0
- package/dist/esm/application-creation/document-facts.family-aspects.js +37 -0
- package/dist/esm/application-creation/document-facts.family-aspects.js.map +1 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts +3 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts.map +1 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.js +23 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.js.map +1 -0
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +93 -62
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +114 -59
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +2 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +2 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +11 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +11 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +976 -2
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +2026 -61
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +1 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.js +18 -3
- package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts +32 -2
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.js +32 -2
- package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-external-framework-mapping.d.ts +90 -0
- package/dist/esm/assurance/assurance-external-framework-mapping.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-external-framework-mapping.js +134 -0
- package/dist/esm/assurance/assurance-external-framework-mapping.js.map +1 -0
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts +71 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +545 -5
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +141 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.js +377 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -0
- package/dist/esm/assurance/assurance-program.family-aspects.d.ts +13 -0
- package/dist/esm/assurance/assurance-program.family-aspects.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-program.family-aspects.js +16 -0
- package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -0
- package/dist/esm/assurance/assurance-program.schemas.d.ts +30 -6
- package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.js +29 -6
- package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts +1 -0
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js +12 -0
- package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-sources.schemas.d.ts +76 -0
- package/dist/esm/assurance/assurance-sources.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-sources.schemas.js +59 -0
- package/dist/esm/assurance/assurance-sources.schemas.js.map +1 -1
- package/dist/esm/assurance/document-publication.family-aspects.d.ts +29 -0
- package/dist/esm/assurance/document-publication.family-aspects.d.ts.map +1 -0
- package/dist/esm/assurance/document-publication.family-aspects.js +48 -0
- package/dist/esm/assurance/document-publication.family-aspects.js.map +1 -0
- package/dist/esm/assurance.exports.d.ts +2 -0
- package/dist/esm/assurance.exports.d.ts.map +1 -1
- package/dist/esm/assurance.exports.js +2 -0
- package/dist/esm/assurance.exports.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +19 -2
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +2 -0
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts +36 -0
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js +193 -0
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js.map +1 -0
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +3 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +6 -4
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts +2 -2
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +8 -8
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts +2 -2
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js +3 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js +3 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js +3 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +6 -6
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts +6 -6
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +2 -0
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +5 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/engine-resource-sub-domain.d.ts +63 -0
- package/dist/esm/engine/engine-resource-sub-domain.d.ts.map +1 -0
- package/dist/esm/engine/engine-resource-sub-domain.js +87 -0
- package/dist/esm/engine/engine-resource-sub-domain.js.map +1 -0
- package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.js +30 -1
- package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.js +2 -0
- package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js +2 -0
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.js +2 -0
- package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.js +2 -0
- package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +12 -0
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +2 -0
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +2 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js +8 -3
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +3 -0
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +3 -0
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +3 -0
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/index.d.ts +1 -0
- package/dist/esm/engine/index.d.ts.map +1 -1
- package/dist/esm/engine/index.js +1 -0
- package/dist/esm/engine/index.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +2 -0
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +3 -0
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +2 -0
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js +3 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts +5 -0
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +385 -9
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
- package/dist/esm/technical-documentation/technical-documentation-units.schemas.js +1 -1
- package/dist/esm/technical-documentation/technical-documentation-units.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +8 -8
- package/dist/esm/.builder.pid +0 -9
- package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts.map +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings-validation.js.map +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts.map +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings.schemas.js.map +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ApplicationDocumentFactDeclarationSet } from "../../application-creation/application-document-fact-specification.application-creation.schemas";
|
|
3
3
|
/**
|
|
4
4
|
* A proposed governed-document draft — a privacy notice or service terms — as CONTENT.
|
|
5
5
|
*
|
|
@@ -94,6 +94,31 @@ export type ComplianceStatementIncompleteness = z.infer<typeof ComplianceStateme
|
|
|
94
94
|
/** One clause of the draft: the prose a reader sees, and what it rests on. */
|
|
95
95
|
export declare const ComplianceDocumentCandidateClauseSchema: z.ZodObject<{
|
|
96
96
|
clauseRef: z.ZodString;
|
|
97
|
+
/**
|
|
98
|
+
* Which of the document blueprint's clauses this clause supplies.
|
|
99
|
+
*
|
|
100
|
+
* The clause-level twin of `satisfiesSectionRefs`, and it exists for the reason that survived
|
|
101
|
+
* every other half of the ref-churn problem: a clause has NO stable anchor. Facts are dictated by
|
|
102
|
+
* the catalog and sections carry a `concernRef` from a closed vocabulary, so both join across two
|
|
103
|
+
* drafts. A clause is named freely and joins to nothing — so a reviewer who approved clause N
|
|
104
|
+
* cannot find it in the next revision, which is what makes a governed document's review
|
|
105
|
+
* un-carryable rather than merely untidy.
|
|
106
|
+
*
|
|
107
|
+
* Stated as a CLAIM rather than adopted as the clause's own `clauseRef`, for the same reason as
|
|
108
|
+
* sections: the candidate's clause set is the drafter's, and telling it to take catalog names
|
|
109
|
+
* asks it to reconcile two structures mid-draft. Several clauses may supply one blueprint clause
|
|
110
|
+
* between them, and one clause may supply several.
|
|
111
|
+
*
|
|
112
|
+
* `.optional()`, deliberately and with a scar behind it: `satisfiesSectionRefs` shipped as
|
|
113
|
+
* `.default([])` and broke every already-landed document at compile time, because a Zod default is
|
|
114
|
+
* required on the inferred OUTPUT type and a landed candidate is TypeScript authored against it.
|
|
115
|
+
* Absent means the clause claims nothing.
|
|
116
|
+
*
|
|
117
|
+
* Only REQUIRED blueprint clauses are ever expected. A CONDITIONAL clause is included when its
|
|
118
|
+
* condition groups hold, so an unclaimed one is not a gap — the coverage check filters on
|
|
119
|
+
* `inclusionKind`, which matters: service terms declares 4 conditional clauses of 15.
|
|
120
|
+
*/
|
|
121
|
+
satisfiesClauseRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
97
122
|
order: z.ZodNumber;
|
|
98
123
|
bodyMarkdown: z.ZodString;
|
|
99
124
|
/**
|
|
@@ -142,8 +167,74 @@ export declare const ComplianceDocumentCandidateSectionSchema: z.ZodObject<{
|
|
|
142
167
|
* knows. Naming it here records a decision it has already made.
|
|
143
168
|
*/
|
|
144
169
|
concernRef: z.ZodOptional<z.ZodString>;
|
|
170
|
+
/**
|
|
171
|
+
* Which of the DOCUMENT DEFINITION's required sections this section satisfies.
|
|
172
|
+
*
|
|
173
|
+
* The join between two vocabularies that are orthogonal rather than competing, and the reason
|
|
174
|
+
* neither could replace the other. A `concernRef` says what compliance TOPIC a section is about —
|
|
175
|
+
* one flat 19-member set spanning privacy notices, service terms and the governance documents,
|
|
176
|
+
* and the spine of the completeness statement that reports gaps ACROSS documents. A catalog
|
|
177
|
+
* section ref says where content belongs in THIS document — 42 distinct refs, defined per
|
|
178
|
+
* definition, because a privacy notice's eleven and a programme handbook's five are different
|
|
179
|
+
* sets by design.
|
|
180
|
+
*
|
|
181
|
+
* Stated per DRAFT rather than mapped once in the framework, deliberately. A global concern →
|
|
182
|
+
* section mapping has to give one answer for all six document types, and `analytics-and-tracking`
|
|
183
|
+
* does not sit under the same heading in a privacy notice and a programme handbook — so such a
|
|
184
|
+
* mapping is wrong somewhere by construction. Per document is the only level at which the
|
|
185
|
+
* question has a stable answer, and the drafter has both in front of it: the brief renders the
|
|
186
|
+
* definition's required sections, and the method walks the concerns.
|
|
187
|
+
*
|
|
188
|
+
* ⚠️ This does NOT make the catalog own the section set. An earlier attempt told the drafter to
|
|
189
|
+
* adopt catalog refs as its own `sectionRef`, which asked it to reconcile two structures mid-draft
|
|
190
|
+
* and was reverted. This adds a claim and changes no structure: the section keeps its own ref and
|
|
191
|
+
* its own ordering.
|
|
192
|
+
*
|
|
193
|
+
* `.optional()`, NOT `.default([])`, and the difference is not stylistic. A Zod default is
|
|
194
|
+
* optional on INPUT and REQUIRED on the inferred OUTPUT type — and a landed document is a
|
|
195
|
+
* TypeScript file typed against that output type. Declaring it with a default therefore broke
|
|
196
|
+
* every already-landed candidate at compile time (`TS2741`), which is a schema change reaching
|
|
197
|
+
* backwards into committed artifacts a human wrote. Absent means the section claims nothing, and
|
|
198
|
+
* every reader treats it that way.
|
|
199
|
+
*
|
|
200
|
+
* Unconstrained here on purpose — a section answering no required part of the definition (a
|
|
201
|
+
* preamble, a contact block) legitimately claims nothing. What the claims are worth
|
|
202
|
+
* is decided by the COVERAGE check over the landed pair, which is where the definition is known;
|
|
203
|
+
* this schema cannot see which document it is drafting.
|
|
204
|
+
*
|
|
205
|
+
* **What this proves and what it does not.** A required section claimed by NOTHING is caught. A
|
|
206
|
+
* section claiming a required part it does not actually address is NOT — nothing reads the prose.
|
|
207
|
+
* That is the same bound the fact-binding check carries (citation, not semantics), and it is
|
|
208
|
+
* stated here so the coverage result is not read as a stronger guarantee than it is.
|
|
209
|
+
*/
|
|
210
|
+
satisfiesSectionRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
211
|
clauses: z.ZodArray<z.ZodObject<{
|
|
146
212
|
clauseRef: z.ZodString;
|
|
213
|
+
/**
|
|
214
|
+
* Which of the document blueprint's clauses this clause supplies.
|
|
215
|
+
*
|
|
216
|
+
* The clause-level twin of `satisfiesSectionRefs`, and it exists for the reason that survived
|
|
217
|
+
* every other half of the ref-churn problem: a clause has NO stable anchor. Facts are dictated by
|
|
218
|
+
* the catalog and sections carry a `concernRef` from a closed vocabulary, so both join across two
|
|
219
|
+
* drafts. A clause is named freely and joins to nothing — so a reviewer who approved clause N
|
|
220
|
+
* cannot find it in the next revision, which is what makes a governed document's review
|
|
221
|
+
* un-carryable rather than merely untidy.
|
|
222
|
+
*
|
|
223
|
+
* Stated as a CLAIM rather than adopted as the clause's own `clauseRef`, for the same reason as
|
|
224
|
+
* sections: the candidate's clause set is the drafter's, and telling it to take catalog names
|
|
225
|
+
* asks it to reconcile two structures mid-draft. Several clauses may supply one blueprint clause
|
|
226
|
+
* between them, and one clause may supply several.
|
|
227
|
+
*
|
|
228
|
+
* `.optional()`, deliberately and with a scar behind it: `satisfiesSectionRefs` shipped as
|
|
229
|
+
* `.default([])` and broke every already-landed document at compile time, because a Zod default is
|
|
230
|
+
* required on the inferred OUTPUT type and a landed candidate is TypeScript authored against it.
|
|
231
|
+
* Absent means the clause claims nothing.
|
|
232
|
+
*
|
|
233
|
+
* Only REQUIRED blueprint clauses are ever expected. A CONDITIONAL clause is included when its
|
|
234
|
+
* condition groups hold, so an unclaimed one is not a gap — the coverage check filters on
|
|
235
|
+
* `inclusionKind`, which matters: service terms declares 4 conditional clauses of 15.
|
|
236
|
+
*/
|
|
237
|
+
satisfiesClauseRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
147
238
|
order: z.ZodNumber;
|
|
148
239
|
bodyMarkdown: z.ZodString;
|
|
149
240
|
/**
|
|
@@ -225,8 +316,74 @@ export declare const ComplianceDocumentCandidateSchema: z.ZodObject<{
|
|
|
225
316
|
* knows. Naming it here records a decision it has already made.
|
|
226
317
|
*/
|
|
227
318
|
concernRef: z.ZodOptional<z.ZodString>;
|
|
319
|
+
/**
|
|
320
|
+
* Which of the DOCUMENT DEFINITION's required sections this section satisfies.
|
|
321
|
+
*
|
|
322
|
+
* The join between two vocabularies that are orthogonal rather than competing, and the reason
|
|
323
|
+
* neither could replace the other. A `concernRef` says what compliance TOPIC a section is about —
|
|
324
|
+
* one flat 19-member set spanning privacy notices, service terms and the governance documents,
|
|
325
|
+
* and the spine of the completeness statement that reports gaps ACROSS documents. A catalog
|
|
326
|
+
* section ref says where content belongs in THIS document — 42 distinct refs, defined per
|
|
327
|
+
* definition, because a privacy notice's eleven and a programme handbook's five are different
|
|
328
|
+
* sets by design.
|
|
329
|
+
*
|
|
330
|
+
* Stated per DRAFT rather than mapped once in the framework, deliberately. A global concern →
|
|
331
|
+
* section mapping has to give one answer for all six document types, and `analytics-and-tracking`
|
|
332
|
+
* does not sit under the same heading in a privacy notice and a programme handbook — so such a
|
|
333
|
+
* mapping is wrong somewhere by construction. Per document is the only level at which the
|
|
334
|
+
* question has a stable answer, and the drafter has both in front of it: the brief renders the
|
|
335
|
+
* definition's required sections, and the method walks the concerns.
|
|
336
|
+
*
|
|
337
|
+
* ⚠️ This does NOT make the catalog own the section set. An earlier attempt told the drafter to
|
|
338
|
+
* adopt catalog refs as its own `sectionRef`, which asked it to reconcile two structures mid-draft
|
|
339
|
+
* and was reverted. This adds a claim and changes no structure: the section keeps its own ref and
|
|
340
|
+
* its own ordering.
|
|
341
|
+
*
|
|
342
|
+
* `.optional()`, NOT `.default([])`, and the difference is not stylistic. A Zod default is
|
|
343
|
+
* optional on INPUT and REQUIRED on the inferred OUTPUT type — and a landed document is a
|
|
344
|
+
* TypeScript file typed against that output type. Declaring it with a default therefore broke
|
|
345
|
+
* every already-landed candidate at compile time (`TS2741`), which is a schema change reaching
|
|
346
|
+
* backwards into committed artifacts a human wrote. Absent means the section claims nothing, and
|
|
347
|
+
* every reader treats it that way.
|
|
348
|
+
*
|
|
349
|
+
* Unconstrained here on purpose — a section answering no required part of the definition (a
|
|
350
|
+
* preamble, a contact block) legitimately claims nothing. What the claims are worth
|
|
351
|
+
* is decided by the COVERAGE check over the landed pair, which is where the definition is known;
|
|
352
|
+
* this schema cannot see which document it is drafting.
|
|
353
|
+
*
|
|
354
|
+
* **What this proves and what it does not.** A required section claimed by NOTHING is caught. A
|
|
355
|
+
* section claiming a required part it does not actually address is NOT — nothing reads the prose.
|
|
356
|
+
* That is the same bound the fact-binding check carries (citation, not semantics), and it is
|
|
357
|
+
* stated here so the coverage result is not read as a stronger guarantee than it is.
|
|
358
|
+
*/
|
|
359
|
+
satisfiesSectionRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
228
360
|
clauses: z.ZodArray<z.ZodObject<{
|
|
229
361
|
clauseRef: z.ZodString;
|
|
362
|
+
/**
|
|
363
|
+
* Which of the document blueprint's clauses this clause supplies.
|
|
364
|
+
*
|
|
365
|
+
* The clause-level twin of `satisfiesSectionRefs`, and it exists for the reason that survived
|
|
366
|
+
* every other half of the ref-churn problem: a clause has NO stable anchor. Facts are dictated by
|
|
367
|
+
* the catalog and sections carry a `concernRef` from a closed vocabulary, so both join across two
|
|
368
|
+
* drafts. A clause is named freely and joins to nothing — so a reviewer who approved clause N
|
|
369
|
+
* cannot find it in the next revision, which is what makes a governed document's review
|
|
370
|
+
* un-carryable rather than merely untidy.
|
|
371
|
+
*
|
|
372
|
+
* Stated as a CLAIM rather than adopted as the clause's own `clauseRef`, for the same reason as
|
|
373
|
+
* sections: the candidate's clause set is the drafter's, and telling it to take catalog names
|
|
374
|
+
* asks it to reconcile two structures mid-draft. Several clauses may supply one blueprint clause
|
|
375
|
+
* between them, and one clause may supply several.
|
|
376
|
+
*
|
|
377
|
+
* `.optional()`, deliberately and with a scar behind it: `satisfiesSectionRefs` shipped as
|
|
378
|
+
* `.default([])` and broke every already-landed document at compile time, because a Zod default is
|
|
379
|
+
* required on the inferred OUTPUT type and a landed candidate is TypeScript authored against it.
|
|
380
|
+
* Absent means the clause claims nothing.
|
|
381
|
+
*
|
|
382
|
+
* Only REQUIRED blueprint clauses are ever expected. A CONDITIONAL clause is included when its
|
|
383
|
+
* condition groups hold, so an unclaimed one is not a gap — the coverage check filters on
|
|
384
|
+
* `inclusionKind`, which matters: service terms declares 4 conditional clauses of 15.
|
|
385
|
+
*/
|
|
386
|
+
satisfiesClauseRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
230
387
|
order: z.ZodNumber;
|
|
231
388
|
bodyMarkdown: z.ZodString;
|
|
232
389
|
/**
|
|
@@ -402,6 +559,15 @@ export declare function validateComplianceDocumentCandidateFactBinding(candidate
|
|
|
402
559
|
* asserts the fact, not one particular scope's declaration of it, and picking a scope here would be this
|
|
403
560
|
* function inventing a precedence rule that belongs to the document's governance scope. `NOT_APPLICABLE`
|
|
404
561
|
* therefore wins only when it is the ONLY answer on record.
|
|
562
|
+
*
|
|
563
|
+
* ## Several specifications, on purpose
|
|
564
|
+
*
|
|
565
|
+
* Since #192 the facts live in TWO families — `document-facts` (what the accepted specification answers,
|
|
566
|
+
* regenerated by a producer) and `document-facts-authored` (what a human established). A document reads
|
|
567
|
+
* both, because it asserts the FACT and does not care who wrote it. That is exactly the precedence rule
|
|
568
|
+
* above applied one level up, so it needed no new policy: variadic, absent-tolerant, same fold.
|
|
569
|
+
*
|
|
570
|
+
* Order between the two is therefore not significant, and a caller must not read it as significant.
|
|
405
571
|
*/
|
|
406
|
-
export declare function collectComplianceDocumentFactAvailability(
|
|
572
|
+
export declare function collectComplianceDocumentFactAvailability(...specifications: readonly (ApplicationDocumentFactDeclarationSet | undefined)[]): ReadonlyMap<string, ComplianceDocumentFactAvailability>;
|
|
407
573
|
//# sourceMappingURL=compliance-document-candidate.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-document-candidate.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/_core/compliance-documents/compliance-document-candidate.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,
|
|
1
|
+
{"version":3,"file":"compliance-document-candidate.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/_core/compliance-documents/compliance-document-candidate.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,qCAAqC,EAC3C,MAAM,iGAAiG,CAAC;AAEzG;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,aAAsH,CAAC;AAMzK;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,+BAA+B;IACzC;;;OAGG;IACH,OAAO,YAAY;IACnB;;;;;;OAMG;IACH,eAAe,oBAAoB;IACnC;;;OAGG;IACH,cAAc,mBAAmB;IACjC;;;;OAIG;IACH,mBAAmB,wBAAwB;CAC5C;AAED,+GAA+G;AAC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,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAgB,8CAA8C,CAC5D,SAAS,EAAE,2BAA2B,EACtC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,kCAAkC,CAAC,GACrE;IAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,2CAA2C,EAAE,CAAA;CAAE,CAqHnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yCAAyC,CACvD,GAAG,cAAc,EAAE,SAAS,CAAC,qCAAqC,GAAG,SAAS,CAAC,EAAE,GAChF,WAAW,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAczD"}
|
|
@@ -98,6 +98,31 @@ export const ComplianceStatementIncompletenessSchema = z.strictObject({
|
|
|
98
98
|
export const ComplianceDocumentCandidateClauseSchema = z
|
|
99
99
|
.strictObject({
|
|
100
100
|
clauseRef: NamespacedRefSchema,
|
|
101
|
+
/**
|
|
102
|
+
* Which of the document blueprint's clauses this clause supplies.
|
|
103
|
+
*
|
|
104
|
+
* The clause-level twin of `satisfiesSectionRefs`, and it exists for the reason that survived
|
|
105
|
+
* every other half of the ref-churn problem: a clause has NO stable anchor. Facts are dictated by
|
|
106
|
+
* the catalog and sections carry a `concernRef` from a closed vocabulary, so both join across two
|
|
107
|
+
* drafts. A clause is named freely and joins to nothing — so a reviewer who approved clause N
|
|
108
|
+
* cannot find it in the next revision, which is what makes a governed document's review
|
|
109
|
+
* un-carryable rather than merely untidy.
|
|
110
|
+
*
|
|
111
|
+
* Stated as a CLAIM rather than adopted as the clause's own `clauseRef`, for the same reason as
|
|
112
|
+
* sections: the candidate's clause set is the drafter's, and telling it to take catalog names
|
|
113
|
+
* asks it to reconcile two structures mid-draft. Several clauses may supply one blueprint clause
|
|
114
|
+
* between them, and one clause may supply several.
|
|
115
|
+
*
|
|
116
|
+
* `.optional()`, deliberately and with a scar behind it: `satisfiesSectionRefs` shipped as
|
|
117
|
+
* `.default([])` and broke every already-landed document at compile time, because a Zod default is
|
|
118
|
+
* required on the inferred OUTPUT type and a landed candidate is TypeScript authored against it.
|
|
119
|
+
* Absent means the clause claims nothing.
|
|
120
|
+
*
|
|
121
|
+
* Only REQUIRED blueprint clauses are ever expected. A CONDITIONAL clause is included when its
|
|
122
|
+
* condition groups hold, so an unclaimed one is not a gap — the coverage check filters on
|
|
123
|
+
* `inclusionKind`, which matters: service terms declares 4 conditional clauses of 15.
|
|
124
|
+
*/
|
|
125
|
+
satisfiesClauseRefs: z.array(NamespacedRefSchema).optional(),
|
|
101
126
|
order: PositiveOrdinalSchema,
|
|
102
127
|
bodyMarkdown: z.string().trim().min(1),
|
|
103
128
|
/**
|
|
@@ -122,6 +147,12 @@ export const ComplianceDocumentCandidateClauseSchema = z
|
|
|
122
147
|
if (!valuesAreUnique(clause.factRefs)) {
|
|
123
148
|
context.addIssue({ code: "custom", message: "fact references must be unique", path: ["factRefs"] });
|
|
124
149
|
}
|
|
150
|
+
// A clause claiming the same blueprint clause twice supplies it once. Refused for the same reason
|
|
151
|
+
// every sibling ref list is: a duplicate misleads a coverage count that reads each claim as
|
|
152
|
+
// evidence.
|
|
153
|
+
if (!valuesAreUnique(clause.satisfiesClauseRefs ?? [])) {
|
|
154
|
+
context.addIssue({ code: "custom", message: "satisfied clause references must be unique", path: ["satisfiesClauseRefs"] });
|
|
155
|
+
}
|
|
125
156
|
/*
|
|
126
157
|
* The pairing is enforced in BOTH directions, and the second direction is the one that matters.
|
|
127
158
|
*
|
|
@@ -165,12 +196,59 @@ export const ComplianceDocumentCandidateSectionSchema = z
|
|
|
165
196
|
* knows. Naming it here records a decision it has already made.
|
|
166
197
|
*/
|
|
167
198
|
concernRef: z.string().trim().min(1).optional(),
|
|
199
|
+
/**
|
|
200
|
+
* Which of the DOCUMENT DEFINITION's required sections this section satisfies.
|
|
201
|
+
*
|
|
202
|
+
* The join between two vocabularies that are orthogonal rather than competing, and the reason
|
|
203
|
+
* neither could replace the other. A `concernRef` says what compliance TOPIC a section is about —
|
|
204
|
+
* one flat 19-member set spanning privacy notices, service terms and the governance documents,
|
|
205
|
+
* and the spine of the completeness statement that reports gaps ACROSS documents. A catalog
|
|
206
|
+
* section ref says where content belongs in THIS document — 42 distinct refs, defined per
|
|
207
|
+
* definition, because a privacy notice's eleven and a programme handbook's five are different
|
|
208
|
+
* sets by design.
|
|
209
|
+
*
|
|
210
|
+
* Stated per DRAFT rather than mapped once in the framework, deliberately. A global concern →
|
|
211
|
+
* section mapping has to give one answer for all six document types, and `analytics-and-tracking`
|
|
212
|
+
* does not sit under the same heading in a privacy notice and a programme handbook — so such a
|
|
213
|
+
* mapping is wrong somewhere by construction. Per document is the only level at which the
|
|
214
|
+
* question has a stable answer, and the drafter has both in front of it: the brief renders the
|
|
215
|
+
* definition's required sections, and the method walks the concerns.
|
|
216
|
+
*
|
|
217
|
+
* ⚠️ This does NOT make the catalog own the section set. An earlier attempt told the drafter to
|
|
218
|
+
* adopt catalog refs as its own `sectionRef`, which asked it to reconcile two structures mid-draft
|
|
219
|
+
* and was reverted. This adds a claim and changes no structure: the section keeps its own ref and
|
|
220
|
+
* its own ordering.
|
|
221
|
+
*
|
|
222
|
+
* `.optional()`, NOT `.default([])`, and the difference is not stylistic. A Zod default is
|
|
223
|
+
* optional on INPUT and REQUIRED on the inferred OUTPUT type — and a landed document is a
|
|
224
|
+
* TypeScript file typed against that output type. Declaring it with a default therefore broke
|
|
225
|
+
* every already-landed candidate at compile time (`TS2741`), which is a schema change reaching
|
|
226
|
+
* backwards into committed artifacts a human wrote. Absent means the section claims nothing, and
|
|
227
|
+
* every reader treats it that way.
|
|
228
|
+
*
|
|
229
|
+
* Unconstrained here on purpose — a section answering no required part of the definition (a
|
|
230
|
+
* preamble, a contact block) legitimately claims nothing. What the claims are worth
|
|
231
|
+
* is decided by the COVERAGE check over the landed pair, which is where the definition is known;
|
|
232
|
+
* this schema cannot see which document it is drafting.
|
|
233
|
+
*
|
|
234
|
+
* **What this proves and what it does not.** A required section claimed by NOTHING is caught. A
|
|
235
|
+
* section claiming a required part it does not actually address is NOT — nothing reads the prose.
|
|
236
|
+
* That is the same bound the fact-binding check carries (citation, not semantics), and it is
|
|
237
|
+
* stated here so the coverage result is not read as a stronger guarantee than it is.
|
|
238
|
+
*/
|
|
239
|
+
satisfiesSectionRefs: z.array(NamespacedRefSchema).optional(),
|
|
168
240
|
clauses: z.array(ComplianceDocumentCandidateClauseSchema).min(1),
|
|
169
241
|
})
|
|
170
242
|
.superRefine((section, context) => {
|
|
171
243
|
if (!valuesAreUnique(section.clauses.map((clause) => clause.clauseRef))) {
|
|
172
244
|
context.addIssue({ code: "custom", message: "clause references must be unique", path: ["clauses"] });
|
|
173
245
|
}
|
|
246
|
+
// A section claiming the same required part twice says nothing twice. Refused for the same reason
|
|
247
|
+
// every other ref list here is: a duplicate is either a mistake or padding, and both mislead a
|
|
248
|
+
// coverage count that treats each claim as evidence.
|
|
249
|
+
if (!valuesAreUnique(section.satisfiesSectionRefs ?? [])) {
|
|
250
|
+
context.addIssue({ code: "custom", message: "satisfied section references must be unique", path: ["satisfiesSectionRefs"] });
|
|
251
|
+
}
|
|
174
252
|
section.clauses.forEach((clause, index) => {
|
|
175
253
|
if (clause.order !== index + 1) {
|
|
176
254
|
context.addIssue({
|
|
@@ -484,17 +562,28 @@ export function validateComplianceDocumentCandidateFactBinding(candidate, declar
|
|
|
484
562
|
* asserts the fact, not one particular scope's declaration of it, and picking a scope here would be this
|
|
485
563
|
* function inventing a precedence rule that belongs to the document's governance scope. `NOT_APPLICABLE`
|
|
486
564
|
* therefore wins only when it is the ONLY answer on record.
|
|
565
|
+
*
|
|
566
|
+
* ## Several specifications, on purpose
|
|
567
|
+
*
|
|
568
|
+
* Since #192 the facts live in TWO families — `document-facts` (what the accepted specification answers,
|
|
569
|
+
* regenerated by a producer) and `document-facts-authored` (what a human established). A document reads
|
|
570
|
+
* both, because it asserts the FACT and does not care who wrote it. That is exactly the precedence rule
|
|
571
|
+
* above applied one level up, so it needed no new policy: variadic, absent-tolerant, same fold.
|
|
572
|
+
*
|
|
573
|
+
* Order between the two is therefore not significant, and a caller must not read it as significant.
|
|
487
574
|
*/
|
|
488
|
-
export function collectComplianceDocumentFactAvailability(
|
|
575
|
+
export function collectComplianceDocumentFactAvailability(...specifications) {
|
|
489
576
|
const availability = new Map();
|
|
490
|
-
for (const
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
577
|
+
for (const specification of specifications) {
|
|
578
|
+
for (const declaration of specification?.declarations ?? []) {
|
|
579
|
+
const resolved = declaration.resolutionKind === ApplicationAssuranceDocumentFactContributionResolutionKind.KNOWN
|
|
580
|
+
? ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE
|
|
581
|
+
: ComplianceDocumentFactAvailability.DECLARED_NOT_APPLICABLE;
|
|
582
|
+
// A value never loses to a later NOT_APPLICABLE — see the JSDoc above.
|
|
583
|
+
if (availability.get(declaration.factRef) === ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE)
|
|
584
|
+
continue;
|
|
585
|
+
availability.set(declaration.factRef, resolved);
|
|
586
|
+
}
|
|
498
587
|
}
|
|
499
588
|
return availability;
|
|
500
589
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-document-candidate.schemas.js","sourceRoot":"","sources":["../../../../../src/_core/compliance-documents/compliance-document-candidate.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0DAA0D,GAE3D,MAAM,iGAAiG,CAAC;AAEzG;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAA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AAC,2BAA2B;oBAClF,CAAC,CAAC,iBAAiB,SAAS,CAAC,OAAO,sBAAsB,OAAO,mDAAmD;oBACpH,CAAC,CAAC,iBAAiB,SAAS,CAAC,OAAO,sBAAsB,OAAO,2DAA2D;aACjI,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yCAAyC,CACvD,aAAmD;IAEnD,MAAM,YAAY,GAAG,IAAI,GAAG,EAA8C,CAAC;IAC3E,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,YAAY,EAAE,CAAC;QACrD,MAAM,QAAQ,GACZ,WAAW,CAAC,cAAc,KAAK,0DAA0D,CAAC,KAAK;YAC7F,CAAC,CAAC,kCAAkC,CAAC,mBAAmB;YACxD,CAAC,CAAC,kCAAkC,CAAC,uBAAuB,CAAC;QACjE,uEAAuE;QACvE,IAAI,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,kCAAkC,CAAC,mBAAmB;YAAE,SAAS;QAC/G,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport {\n ApplicationAssuranceDocumentFactContributionResolutionKind,\n type ApplicationDocumentFactSpecification,\n} from \"../../application-creation/application-document-fact-specification.application-creation.schemas\";\n\n/**\n * A proposed governed-document draft — a privacy notice or service terms — as CONTENT.\n *\n * ## Why this exists again\n *\n * `ApplicationAssuranceDocumentCandidateContentDraftV1` was deleted with the assurance custody lane, which\n * left `refinement.compliance-document-candidate` naming a schema nothing could resolve: the one playbook in\n * the catalog that could not run at all. But the contract governing that deletion is explicit about the\n * split (`.claude/rules/one-source-of-truth.md`, rule 7): *\"What survives: the assurance document CONTENT\n * schemas and their validators. What dissolves: draft custody, reviewer-authority grants,\n * release/reintegration state machines, CAS-bound snapshot appends and provider locks.\"*\n *\n * The old schema was both, in one 433-line file. This is the content half, restored on its own.\n *\n * ## What was deliberately NOT restored\n *\n * The original clause and variant-selection shapes wrapped every fact reference in a binding carrying\n * `valueDigest` and `authorityEvidenceDigests` — a sealed proof that the fact a clause rested on had not\n * moved. That is custody: it exists to make a draft tamper-evident on the way to a reviewer. A fact\n * REFERENCE is content (\"this clause rests on fact X\" is what the document says); the digest of that fact's\n * value is apparatus around it, and Rule 0 keeps nothing that cannot be branched and merged.\n *\n * Nothing is weakened by the removal, because nothing verified those digests any more — the reconciler that\n * did went with the lane. What remains is the shape a model must produce and a human must read.\n */\n\n/**\n * `namespace:local-id` — the ref shape every reference in this family takes.\n *\n * Exported so the family schema and its generation contract share ONE definition. Two copies of a ref\n * regex is two things that can disagree about what a valid ref is, and the disagreement is invisible:\n * a provider answer would pass generation and fail the family parse it is normalized into.\n */\nexport const ComplianceDocumentNamespacedRefSchema = z.string().trim().regex(/^[a-z0-9]+(?:[-.][a-z0-9]+)*:[a-z0-9]+(?:[-/.][a-z0-9]+)*$/u, \"expected a namespaced ref\");\nconst NamespacedRefSchema = ComplianceDocumentNamespacedRefSchema;\nconst PositiveOrdinalSchema = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);\n\nconst valuesAreUnique = (values: readonly string[]): boolean => new Set(values).size === values.length;\n\n/**\n * How completely a single statement is established — and, when it is not, WHO can close it.\n *\n * ## Why a document says what it does not know\n *\n * A compliance document that quietly omits what its author could not establish is worse than one that\n * says so: the reader cannot tell \"this does not apply to us\" from \"nobody knew\". So an application\n * produces its privacy notice TODAY, with each unestablished statement marked, and completes the marks\n * later. Producing is never blocked by a gap — but a gap is never untracked either.\n *\n * ## Why four members and not one \"incomplete\"\n *\n * Because each names a DIFFERENT SUPPLIER, and a register whose rows all say \"incomplete\" is a register\n * nobody can action — which is how real compliance gap lists die. The distinction is the whole value:\n * three of these are somebody's task, and they are three different somebodies.\n *\n * Do not merge them, and do not add a fifth without a document that needs it. A `NOT_APPLICABLE` member\n * was designed and dropped: hand-writing the first real privacy notice resolved every one of its\n * concerns to one of the four below, so the fifth would have shipped with no user and no test that\n * meant anything.\n */\nexport enum ComplianceStatementCompleteness {\n /**\n * Established from what the application IS. The strict state: every fact this statement cites must be\n * declared and carry a value, or the statement is invention and is refused.\n */\n DERIVED = \"DERIVED\",\n /**\n * The framework cannot express the answer yet — nobody can supply it by editing this application.\n *\n * Closed by an ENGINE change (tracked as a GitHub issue), never by a workaround and never by\n * inference. Example: a provider declares no processor identity or region, so \"who else processes\n * your data\" has no citable source in any application.\n */\n NEEDS_FRAMEWORK = \"NEEDS_FRAMEWORK\",\n /**\n * A human decision that has not been taken. Closed by the operator deciding and recording it —\n * legal entity, controller-vs-processor role, governing law, effective date, jurisdiction.\n */\n NEEDS_DECISION = \"NEEDS_DECISION\",\n /**\n * The framework CAN express it and this application has not declared it. Closed by the application's\n * own authors editing their configuration — a retention policy, a data-subject kind, an export\n * declaration. The cheapest of the three to close, and the one most worth naming precisely.\n */\n NEEDS_CONFIGURATION = \"NEEDS_CONFIGURATION\",\n}\n\n/** What is missing from a statement, and who supplies it. Present exactly when completeness is not DERIVED. */\nexport const ComplianceStatementIncompletenessSchema = z.strictObject({\n /** The missing information, in the reader's terms — not \"factRef absent\" but \"how long we keep it\". */\n needs: z.string().trim().min(1),\n /**\n * Who or what closes it, concretely enough to act on: an issue reference, a decision owner, the\n * configuration surface to edit. A row whose remedy is unnamed is a row nobody picks up.\n */\n closedBy: z.string().trim().min(1),\n});\nexport type ComplianceStatementIncompleteness = z.infer<typeof ComplianceStatementIncompletenessSchema>;\n\n/** One clause of the draft: the prose a reader sees, and what it rests on. */\nexport const ComplianceDocumentCandidateClauseSchema = z\n .strictObject({\n clauseRef: NamespacedRefSchema,\n order: PositiveOrdinalSchema,\n bodyMarkdown: z.string().trim().min(1),\n /**\n * How established this clause is. Defaults to the STRICT state, deliberately.\n *\n * A hand-authored clause that omits the key claims to be derived, and is checked accordingly — the\n * safe direction, since the cost of being wrong is a refusal a human can answer. The GENERATION\n * contract must require it explicitly instead: a model permitted to omit the key would silently\n * claim `DERIVED`, which is the one direction that lets invention back in.\n */\n completeness: z.enum(ComplianceStatementCompleteness).default(ComplianceStatementCompleteness.DERIVED),\n /** Required when `completeness` is not `DERIVED`, forbidden when it is — see the superRefine below. */\n incompleteness: ComplianceStatementIncompletenessSchema.optional(),\n /** The document facts this clause asserts. A clause that asserts none cites none — an empty list is valid. */\n factRefs: z.array(NamespacedRefSchema),\n /** The application policies the clause derives from. At least one: prose with no source is invention. */\n sourcePolicyRefs: z.array(NamespacedRefSchema).min(1),\n /** The claim guards a reviewer checks this clause against. */\n claimGuardRefs: z.array(NamespacedRefSchema).min(1),\n })\n .superRefine((clause, context) => {\n if (!valuesAreUnique(clause.factRefs)) {\n context.addIssue({ code: \"custom\", message: \"fact references must be unique\", path: [\"factRefs\"] });\n }\n /*\n * The pairing is enforced in BOTH directions, and the second direction is the one that matters.\n *\n * Missing `incompleteness` on a marked clause produces the register row nobody can action — the\n * failure mode the four states exist to prevent. Present `incompleteness` on a `DERIVED` clause is\n * a statement claiming to be both established and missing something, which no reader can resolve.\n */\n const marked = clause.completeness !== ComplianceStatementCompleteness.DERIVED;\n if (marked && clause.incompleteness === undefined) {\n context.addIssue({\n code: \"custom\",\n message: `a clause marked ${clause.completeness} must state what it needs and who closes it`,\n path: [\"incompleteness\"],\n });\n }\n if (!marked && clause.incompleteness !== undefined) {\n context.addIssue({\n code: \"custom\",\n message: \"a DERIVED clause is established, so it cannot also declare what it is missing\",\n path: [\"incompleteness\"],\n });\n }\n });\nexport type ComplianceDocumentCandidateClause = z.infer<typeof ComplianceDocumentCandidateClauseSchema>;\n\n/** One titled section, whose clauses are contiguously ordered. */\nexport const ComplianceDocumentCandidateSectionSchema = z\n .strictObject({\n sectionRef: NamespacedRefSchema,\n order: PositiveOrdinalSchema,\n title: z.string().trim().min(1),\n /**\n * Which compliance CONCERN this section answers — \"how long do you keep my data\", \"who else sees\n * it\". Optional, because a document may legitimately carry a section that answers none (a\n * preamble, a contact block).\n *\n * This is what lets the completeness statement be projected from the document ALONE. An earlier\n * revision left the concern mapping to be supplied by a caller, on the reasoning that a framework\n * vocabulary should not sit inside content a drafter authors. That reasoning produced a\n * projection with no caller — the exact defect shape this lane is characterised by, unreachable\n * code that reads as capability — and it was wrong on its own terms: the drafter is told to write\n * one section per concern from the composition reference, so the concern is already what it\n * knows. Naming it here records a decision it has already made.\n */\n concernRef: z.string().trim().min(1).optional(),\n clauses: z.array(ComplianceDocumentCandidateClauseSchema).min(1),\n })\n .superRefine((section, context) => {\n if (!valuesAreUnique(section.clauses.map((clause) => clause.clauseRef))) {\n context.addIssue({ code: \"custom\", message: \"clause references must be unique\", path: [\"clauses\"] });\n }\n section.clauses.forEach((clause, index) => {\n if (clause.order !== index + 1) {\n context.addIssue({\n code: \"custom\",\n message: \"clause order must be contiguous and match array order\",\n path: [\"clauses\", index, \"order\"],\n });\n }\n });\n });\nexport type ComplianceDocumentCandidateSection = z.infer<typeof ComplianceDocumentCandidateSectionSchema>;\n\n/** Which option the draft takes on one publication axis, and the facts justifying it. */\nexport const ComplianceDocumentCandidateVariantSelectionSchema = z\n .strictObject({\n axisRef: NamespacedRefSchema,\n optionRefs: z.array(NamespacedRefSchema).min(1),\n supportingFactRefs: z.array(NamespacedRefSchema).min(1),\n })\n .superRefine((selection, context) => {\n if (!valuesAreUnique(selection.optionRefs)) {\n context.addIssue({ code: \"custom\", message: \"option references must be unique\", path: [\"optionRefs\"] });\n }\n if (!valuesAreUnique(selection.supportingFactRefs)) {\n context.addIssue({ code: \"custom\", message: \"supporting fact references must be unique\", path: [\"supportingFactRefs\"] });\n }\n });\nexport type ComplianceDocumentCandidateVariantSelection = z.infer<typeof ComplianceDocumentCandidateVariantSelectionSchema>;\n\nexport enum ComplianceDocumentCandidateVersion {\n V1 = \"v1\",\n}\n\n/** THE draft. Artifact-family id: `compliance-document-candidate`. */\nexport const ComplianceDocumentCandidateSchema = z.strictObject({\n version: z.enum(ComplianceDocumentCandidateVersion).default(ComplianceDocumentCandidateVersion.V1),\n /** Which governed document this drafts, e.g. `document:privacy-notice`. */\n documentRef: NamespacedRefSchema,\n title: z.string().trim().min(1),\n /**\n * BCP-47-ish; the publication family owns the closed set, this only requires a plausible tag.\n *\n * OPTIONAL, with `jurisdictionRefs` below: both are second-step questions and neither may gate\n * producing a draft. An application that has not yet decided which locales it publishes in still has\n * a privacy notice to write, and the decision is a `NEEDS_DECISION` row in the register rather than a\n * refusal at the schema. Requiring them here would have made the deferral impossible to express —\n * the drafter's only way past a required field is to invent a value for it.\n */\n locale: z.string().trim().min(2).optional(),\n /** Optional for the same reason as `locale`; absent means the jurisdiction decision is still open. */\n jurisdictionRefs: z.array(NamespacedRefSchema).min(1).optional(),\n variantSelections: z.array(ComplianceDocumentCandidateVariantSelectionSchema).default([]),\n sections: z.array(ComplianceDocumentCandidateSectionSchema).min(1),\n /** What a reviewer must check before this becomes a published document. */\n reviewChecklistRefs: z.array(NamespacedRefSchema).min(1),\n /** What the draft does NOT cover, stated by the drafter rather than discovered by the reader. */\n limitationRefs: z.array(NamespacedRefSchema).default([]),\n});\nexport type ComplianceDocumentCandidate = z.infer<typeof ComplianceDocumentCandidateSchema>;\n\nexport enum ComplianceDocumentCandidateIssueKind {\n DUPLICATE_SECTION_REF = \"DUPLICATE_SECTION_REF\",\n NON_CONTIGUOUS_SECTION_ORDER = \"NON_CONTIGUOUS_SECTION_ORDER\",\n DUPLICATE_JURISDICTION = \"DUPLICATE_JURISDICTION\",\n DUPLICATE_VARIANT_AXIS = \"DUPLICATE_VARIANT_AXIS\",\n DANGLING_CLAUSE_FACT = \"DANGLING_CLAUSE_FACT\",\n}\n\nexport interface ComplianceDocumentCandidateIssue {\n readonly kind: ComplianceDocumentCandidateIssueKind;\n readonly path: string;\n readonly message: string;\n}\n\n/**\n * Semantic validation the schema alone cannot express.\n *\n * The referential half is why this exists: a model producing a variant selection that cites a fact no clause\n * anywhere uses has written a justification for a decision the document does not make. Same class as the 156\n * dangling references a market snapshot carried for months — a schema-valid artifact whose parts disagree.\n */\nexport function validateComplianceDocumentCandidate(\n candidate: ComplianceDocumentCandidate,\n): { readonly ok: boolean; readonly issues: readonly ComplianceDocumentCandidateIssue[] } {\n const issues: ComplianceDocumentCandidateIssue[] = [];\n const add = (kind: ComplianceDocumentCandidateIssueKind, path: string, message: string): void => {\n issues.push({ kind, path, message });\n };\n\n if (!valuesAreUnique(candidate.sections.map((section) => section.sectionRef))) {\n add(ComplianceDocumentCandidateIssueKind.DUPLICATE_SECTION_REF, \"sections\", \"section references must be unique\");\n }\n candidate.sections.forEach((section, index) => {\n if (section.order !== index + 1) {\n add(\n ComplianceDocumentCandidateIssueKind.NON_CONTIGUOUS_SECTION_ORDER,\n `sections.${index}.order`,\n \"section order must be contiguous and match array order\",\n );\n }\n });\n // Absent is a deferred decision, not a duplicate — only a PRESENT list can contradict itself.\n if (candidate.jurisdictionRefs !== undefined && !valuesAreUnique(candidate.jurisdictionRefs)) {\n add(ComplianceDocumentCandidateIssueKind.DUPLICATE_JURISDICTION, \"jurisdictionRefs\", \"jurisdiction references must be unique\");\n }\n if (!valuesAreUnique(candidate.variantSelections.map((selection) => selection.axisRef))) {\n add(ComplianceDocumentCandidateIssueKind.DUPLICATE_VARIANT_AXIS, \"variantSelections\", \"each publication axis may be selected once\");\n }\n\n const citedFacts = new Set(candidate.sections.flatMap((section) => section.clauses.flatMap((clause) => clause.factRefs)));\n candidate.variantSelections.forEach((selection, index) => {\n for (const factRef of selection.supportingFactRefs) {\n if (!citedFacts.has(factRef)) {\n add(\n ComplianceDocumentCandidateIssueKind.DANGLING_CLAUSE_FACT,\n `variantSelections.${index}.supportingFactRefs`,\n `\"${factRef}\" justifies a variant selection but no clause in the document uses it`,\n );\n }\n }\n });\n\n return { ok: issues.length === 0, issues };\n}\n\n/**\n * What the application's declared facts say about one fact ref, as far as a DRAFT needs to know.\n *\n * Two members rather than one, because they are different answers and a document that confuses them is\n * wrong in different ways. \"We do not transfer data internationally\" is a real, citable fact with a\n * value; \"international transfers are not applicable to us\" is the application declining to answer, and\n * a clause resting on it asserts something nobody established.\n *\n * A ref that is absent from the map is neither — the application has not considered it at all.\n */\nexport enum ComplianceDocumentFactAvailability {\n /** The application declared this fact and it carries a value a clause may rest on. */\n DECLARED_WITH_VALUE = \"DECLARED_WITH_VALUE\",\n /** The application declared this fact NOT APPLICABLE. Citable by nothing; visible to a reviewer. */\n DECLARED_NOT_APPLICABLE = \"DECLARED_NOT_APPLICABLE\",\n}\n\n/**\n * Kinds the CROSS-FAMILY check reports. A separate enum from the intra-document one on purpose: these\n * describe a disagreement between two FILES, and a reader fixing one is not editing the same artifact.\n */\nexport enum ComplianceDocumentCandidateFactBindingIssueKind {\n /** A clause asserts a fact the application never declared. The defect this check exists for. */\n UNDECLARED_CLAUSE_FACT = \"UNDECLARED_CLAUSE_FACT\",\n /** A variant selection is justified by a fact the application never declared. */\n UNDECLARED_VARIANT_FACT = \"UNDECLARED_VARIANT_FACT\",\n /** A variant selection is justified by a fact the application declared NOT APPLICABLE. */\n NOT_APPLICABLE_VARIANT_FACT = \"NOT_APPLICABLE_VARIANT_FACT\",\n}\n\nexport interface ComplianceDocumentCandidateFactBindingIssue {\n readonly kind: ComplianceDocumentCandidateFactBindingIssueKind;\n readonly path: string;\n readonly message: string;\n}\n\n/**\n * Refuse a draft that ASSERTS a fact the application never wrote down — and let it MARK one instead.\n *\n * ## The matrix, because \"error when the fact is missing\" leaves cells undecided\n *\n * | clause completeness | cited fact | verdict |\n * |---|---|---|\n * | `DERIVED` | undeclared | **ERROR** — invention |\n * | `DERIVED` | declared `NOT_APPLICABLE` | **ERROR** — a claim resting on a non-answer |\n * | `NEEDS_*` | undeclared | **OK** — this is precisely the fact it is waiting for |\n * | `NEEDS_*` | declared with a value | **OK** — incomplete for some other reason |\n *\n * The distinction the whole capability turns on is ASSERT versus MARK. A clause may say \"this is not\n * yet established\"; it may not say something untrue. Incompleteness is CONTENT — the reader sees it,\n * the register lists it, a human closes it later — and it never gates producing the document.\n *\n * ## Variant selections stay strict, and that is not an oversight\n *\n * A clause STATES something and may state that it does not know. A variant selection DECIDES something\n * — which option this publication takes on an axis — and a decision justified by a fact nobody declared\n * is not incomplete, it is unfounded. There is no \"I have not decided\" selection to make: a draft that\n * has not decided simply omits the axis (`variantSelections` defaults to empty).\n *\n * ## What this replaces, and why the replacement is not weaker\n *\n * The deleted design handed the drafting agent an `ApplicationAssuranceDocumentFactProjection`: a\n * host-computed record carrying a projector identity, source-head digests, per-contribution authority\n * receipts and a self digest. The drafter could not see an unverified fact, because the host had sealed\n * the set it was permitted to see.\n *\n * None of that is branchable on git (`.claude/rules/one-source-of-truth.md`, Rule 0), and all of it is\n * gone. But what it PROTECTED was never the digest — it was the sentence *\"a published legal document\n * must not assert something about this application that nobody established.\"* That sentence is a\n * relation between two files, and a relation between two files is a pure function.\n *\n * So the drafter may now write anything, and this refuses to let an unbacked claim become a file. The\n * guarantee moves from \"the drafter could not SEE an unverified fact\" to \"an unverified fact cannot be\n * COMMITTED\" — the same protection at the boundary that matters, and it MERGES: two branches may declare\n * different facts and draft different clauses, and each branch's check answers about its own tree.\n *\n * What is genuinely given up is tamper evidence in transit to a reviewer. Under Rule 0 that job belongs\n * to git and the forge — a reviewer reads a diff, not a receipt.\n *\n * ## Why an availability map rather than the fact specification\n *\n * `ApplicationDocumentFactSpecification` lives in the `application-creation` layer and carries authority\n * kinds, governance scopes, sensitivity refs and validity windows — none of which this question needs.\n * Taking only what it needs keeps `_core` free of that dependency and makes the contract exact: this\n * answers *\"is every asserted fact declared, with a value\"*, and nothing else. Whether a declaration's\n * AUTHORITY is adequate for the claim it carries is a reviewer's judgement, and later a judge's — never\n * this function's. Merging the two would rebuild the authority engine that Rule 0 removed.\n *\n * ## Absent is not empty\n *\n * A caller that could not load the fact specification must NOT call this with an empty map — it expresses\n * that case by not calling. Conflating \"I could not read the facts\" with \"there are none\" turns a wiring\n * failure into a content verdict (`.claude/rules/negative-results-require-a-positive-probe.md`).\n *\n * An empty map therefore means \"check against nothing\", and every citation is refused. Note this is the\n * PURE FUNCTION's contract, not a description of a reachable application state: through the companion\n * path an empty map cannot occur, because `ApplicationDocumentFactSpecificationSchema` requires\n * `declarations: min(1)` and `collectComplianceDocumentFactAvailability` emits one entry per declaration.\n * An earlier revision of this comment justified the branch as \"the application declared no facts\", which\n * names a state the schema forbids and would send the next reader looking for it.\n */\nexport function validateComplianceDocumentCandidateFactBinding(\n candidate: ComplianceDocumentCandidate,\n declaredFacts: ReadonlyMap<string, ComplianceDocumentFactAvailability>,\n): { readonly ok: boolean; readonly issues: readonly ComplianceDocumentCandidateFactBindingIssue[] } {\n const issues: ComplianceDocumentCandidateFactBindingIssue[] = [];\n\n /*\n * One classifier for both citation sites. The two sites differ only in their path and their noun, and\n * a second copy of the availability branch is how the clause rule and the variant rule drift apart\n * (`.claude/rules/invariant-call-site-enumeration.md` — prefer one named home over N applications).\n */\n /**\n * Which issue a cited fact raises, if any.\n *\n * `notApplicable` is OPTIONAL: passing `undefined` means a recorded \"does not apply\" is an acceptable\n * citation at that site. A `DERIVED` clause passes `undefined` deliberately — see the correction in\n * the loop below — while any site that still wants to report the mismatch names its own kind.\n */\n const classify = (\n factRef: string,\n undeclared: ComplianceDocumentCandidateFactBindingIssueKind,\n notApplicable: ComplianceDocumentCandidateFactBindingIssueKind | undefined,\n ): ComplianceDocumentCandidateFactBindingIssueKind | undefined => {\n const availability = declaredFacts.get(factRef);\n if (availability === ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE) return undefined;\n return availability === ComplianceDocumentFactAvailability.DECLARED_NOT_APPLICABLE ? notApplicable : undeclared;\n };\n\n candidate.sections.forEach((section, sectionIndex) => {\n section.clauses.forEach((clause, clauseIndex) => {\n /*\n * A clause that says it is NOT established is exempt, and this line is the whole reframe.\n *\n * An earlier revision refused any clause citing an undeclared fact. That refusal was correct\n * about invention and wrong about incompleteness: it made a document unproducible until every\n * fact existed, which for a real application is never. The fix is not to relax the check — it is\n * to notice that a marked clause is making a DIFFERENT KIND of statement. \"We have not yet\n * established how long we keep this\" asserts nothing about the application, so there is nothing\n * for the facts file to back.\n *\n * The exemption is exactly as wide as the marking, and the marking costs something: the schema\n * requires `incompleteness.needs` and `.closedBy`, so a drafter cannot buy silence by marking a\n * clause — it must say what is missing and who supplies it, in the register a human reads.\n *\n * `DERIVED` remains strict about the thing this check exists for: a fact the application never\n * declared is invention, and no marking makes it citable.\n *\n * ## A NOT_APPLICABLE fact IS citable — corrected 2026-08-29, against live evidence\n *\n * This refused a DERIVED clause citing a NOT_APPLICABLE fact, on the reasoning that such a fact is\n * \"a non-answer\". That reasoning is wrong, and it is wrong in the same way the pre-reframe refusal\n * above was: it reads the fact's SHAPE instead of the statement it supports.\n *\n * `NOT_APPLICABLE` is not silence. The family schema REQUIRES a `reason`, so it is a considered,\n * recorded finding that something does not apply — *\"no external analytics provider is\n * configured\"*, *\"no AI capability is declared\"*. A clause resting on it makes the matching\n * NEGATIVE statement, and that fact is precisely its support. Refusing it does not prevent a false\n * claim; it prevents a TRUE one, and pushes the drafter to mark the concern incomplete instead —\n * so the document says \"this has not been established\" about something the application HAS\n * established, which is the under-reporting direction a compliance statement must never fail in.\n *\n * Measured: wonder-crm's notice (2026-08-29) came back with recipients-and-processors,\n * automated-decisions-and-ai and analytics-and-tracking all marked incomplete, and the run before\n * it failed all three attempts on this rule alone. The hand-written comparison the design was\n * validated against derives all three, in as many words — *\"true because none are configured\"*.\n *\n * What is NOT weakened: the check is, and always was, about whether the application DECLARED the\n * fact. Nothing here reads a clause's prose, so a clause misusing a KNOWN fact was never caught\n * either; the guarantee is citation, not semantics, and it is unchanged.\n */\n if (clause.completeness !== ComplianceStatementCompleteness.DERIVED) return;\n for (const factRef of clause.factRefs) {\n /*\n * `undefined` is the correction below, and it makes UNDECLARED_CLAUSE_FACT the ONLY kind a\n * clause can raise — there is deliberately no not-applicable counterpart in the vocabulary.\n *\n * One existed until 2026-08-30, described as \"reported for a MARKED clause only\". Measured,\n * it was unreachable from anywhere: a marked clause returns above, before any classification,\n * and a DERIVED clause passes `undefined` here. A vocabulary member nothing can emit is worse\n * than absent — a consumer branching on it writes code that can never run.\n */\n const kind = classify(\n factRef,\n ComplianceDocumentCandidateFactBindingIssueKind.UNDECLARED_CLAUSE_FACT,\n undefined,\n );\n if (kind === undefined) continue;\n issues.push({\n kind,\n path: `sections.${sectionIndex}.clauses.${clauseIndex}.factRefs`,\n // The message is what goes back to the model on a retry, so it names the FIX rather than the\n // fault: the drafter's options are to cite a declared fact or to drop the claim.\n message:\n `clause \"${clause.clauseRef}\" asserts \"${factRef}\", which the application's document-facts do not declare. `\n + \"Cite a declared fact or remove the claim; a governed document may not state something nobody established.\",\n });\n }\n });\n });\n\n candidate.variantSelections.forEach((selection, index) => {\n for (const factRef of selection.supportingFactRefs) {\n const kind = classify(\n factRef,\n ComplianceDocumentCandidateFactBindingIssueKind.UNDECLARED_VARIANT_FACT,\n ComplianceDocumentCandidateFactBindingIssueKind.NOT_APPLICABLE_VARIANT_FACT,\n );\n if (kind === undefined) continue;\n issues.push({\n kind,\n path: `variantSelections.${index}.supportingFactRefs`,\n message:\n kind === ComplianceDocumentCandidateFactBindingIssueKind.NOT_APPLICABLE_VARIANT_FACT\n ? `variant axis \"${selection.axisRef}\" is justified by \"${factRef}\", which the application declared NOT APPLICABLE.`\n : `variant axis \"${selection.axisRef}\" is justified by \"${factRef}\", which the application's document-facts do not declare.`,\n });\n }\n });\n\n return { ok: issues.length === 0, issues };\n}\n\n/**\n * Derive the availability map from the application's accepted `document-facts` file.\n *\n * The join lives HERE, beside the check that consumes it, rather than at each call site: the generation\n * loop and the landing both need it, and two derivations of the same map are how a retry gets corrected\n * against a different set of facts than the one the write is checked against.\n *\n * ## One ref, several declarations\n *\n * A fact ref may legitimately appear more than once — the family permits one current declaration per\n * `(factRef, factVersion, governanceScope)` triple, so the same fact can be declared for the operator and\n * for a tenant, or at two versions. If ANY of them carries a value, a clause may rest on it: the document\n * asserts the fact, not one particular scope's declaration of it, and picking a scope here would be this\n * function inventing a precedence rule that belongs to the document's governance scope. `NOT_APPLICABLE`\n * therefore wins only when it is the ONLY answer on record.\n */\nexport function collectComplianceDocumentFactAvailability(\n specification: ApplicationDocumentFactSpecification,\n): ReadonlyMap<string, ComplianceDocumentFactAvailability> {\n const availability = new Map<string, ComplianceDocumentFactAvailability>();\n for (const declaration of specification.declarations) {\n const resolved =\n declaration.resolutionKind === ApplicationAssuranceDocumentFactContributionResolutionKind.KNOWN\n ? ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE\n : ComplianceDocumentFactAvailability.DECLARED_NOT_APPLICABLE;\n // A value never loses to a later NOT_APPLICABLE — see the JSDoc above.\n if (availability.get(declaration.factRef) === ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE) continue;\n availability.set(declaration.factRef, resolved);\n }\n return availability;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compliance-document-candidate.schemas.js","sourceRoot":"","sources":["../../../../../src/_core/compliance-documents/compliance-document-candidate.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0DAA0D,GAE3D,MAAM,iGAAiG,CAAC;AAEzG;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,6DAA6D,EAAE,2BAA2B,CAAC,CAAC;AACzK,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,gB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BACxD,CAAC,CAAC,kCAAkC,CAAC,uBAAuB,CAAC;YACjE,uEAAuE;YACvE,IAAI,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,kCAAkC,CAAC,mBAAmB;gBAAE,SAAS;YAC/G,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport {\n ApplicationAssuranceDocumentFactContributionResolutionKind,\n type ApplicationDocumentFactDeclarationSet,\n} from \"../../application-creation/application-document-fact-specification.application-creation.schemas\";\n\n/**\n * A proposed governed-document draft — a privacy notice or service terms — as CONTENT.\n *\n * ## Why this exists again\n *\n * `ApplicationAssuranceDocumentCandidateContentDraftV1` was deleted with the assurance custody lane, which\n * left `refinement.compliance-document-candidate` naming a schema nothing could resolve: the one playbook in\n * the catalog that could not run at all. But the contract governing that deletion is explicit about the\n * split (`.claude/rules/one-source-of-truth.md`, rule 7): *\"What survives: the assurance document CONTENT\n * schemas and their validators. What dissolves: draft custody, reviewer-authority grants,\n * release/reintegration state machines, CAS-bound snapshot appends and provider locks.\"*\n *\n * The old schema was both, in one 433-line file. This is the content half, restored on its own.\n *\n * ## What was deliberately NOT restored\n *\n * The original clause and variant-selection shapes wrapped every fact reference in a binding carrying\n * `valueDigest` and `authorityEvidenceDigests` — a sealed proof that the fact a clause rested on had not\n * moved. That is custody: it exists to make a draft tamper-evident on the way to a reviewer. A fact\n * REFERENCE is content (\"this clause rests on fact X\" is what the document says); the digest of that fact's\n * value is apparatus around it, and Rule 0 keeps nothing that cannot be branched and merged.\n *\n * Nothing is weakened by the removal, because nothing verified those digests any more — the reconciler that\n * did went with the lane. What remains is the shape a model must produce and a human must read.\n */\n\n/**\n * `namespace:local-id` — the ref shape every reference in this family takes.\n *\n * Exported so the family schema and its generation contract share ONE definition. Two copies of a ref\n * regex is two things that can disagree about what a valid ref is, and the disagreement is invisible:\n * a provider answer would pass generation and fail the family parse it is normalized into.\n */\nexport const ComplianceDocumentNamespacedRefSchema = z.string().trim().regex(/^[a-z0-9]+(?:[-.][a-z0-9]+)*:[a-z0-9]+(?:[-/.][a-z0-9]+)*$/u, \"expected a namespaced ref\");\nconst NamespacedRefSchema = ComplianceDocumentNamespacedRefSchema;\nconst PositiveOrdinalSchema = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);\n\nconst valuesAreUnique = (values: readonly string[]): boolean => new Set(values).size === values.length;\n\n/**\n * How completely a single statement is established — and, when it is not, WHO can close it.\n *\n * ## Why a document says what it does not know\n *\n * A compliance document that quietly omits what its author could not establish is worse than one that\n * says so: the reader cannot tell \"this does not apply to us\" from \"nobody knew\". So an application\n * produces its privacy notice TODAY, with each unestablished statement marked, and completes the marks\n * later. Producing is never blocked by a gap — but a gap is never untracked either.\n *\n * ## Why four members and not one \"incomplete\"\n *\n * Because each names a DIFFERENT SUPPLIER, and a register whose rows all say \"incomplete\" is a register\n * nobody can action — which is how real compliance gap lists die. The distinction is the whole value:\n * three of these are somebody's task, and they are three different somebodies.\n *\n * Do not merge them, and do not add a fifth without a document that needs it. A `NOT_APPLICABLE` member\n * was designed and dropped: hand-writing the first real privacy notice resolved every one of its\n * concerns to one of the four below, so the fifth would have shipped with no user and no test that\n * meant anything.\n */\nexport enum ComplianceStatementCompleteness {\n /**\n * Established from what the application IS. The strict state: every fact this statement cites must be\n * declared and carry a value, or the statement is invention and is refused.\n */\n DERIVED = \"DERIVED\",\n /**\n * The framework cannot express the answer yet — nobody can supply it by editing this application.\n *\n * Closed by an ENGINE change (tracked as a GitHub issue), never by a workaround and never by\n * inference. Example: a provider declares no processor identity or region, so \"who else processes\n * your data\" has no citable source in any application.\n */\n NEEDS_FRAMEWORK = \"NEEDS_FRAMEWORK\",\n /**\n * A human decision that has not been taken. Closed by the operator deciding and recording it —\n * legal entity, controller-vs-processor role, governing law, effective date, jurisdiction.\n */\n NEEDS_DECISION = \"NEEDS_DECISION\",\n /**\n * The framework CAN express it and this application has not declared it. Closed by the application's\n * own authors editing their configuration — a retention policy, a data-subject kind, an export\n * declaration. The cheapest of the three to close, and the one most worth naming precisely.\n */\n NEEDS_CONFIGURATION = \"NEEDS_CONFIGURATION\",\n}\n\n/** What is missing from a statement, and who supplies it. Present exactly when completeness is not DERIVED. */\nexport const ComplianceStatementIncompletenessSchema = z.strictObject({\n /** The missing information, in the reader's terms — not \"factRef absent\" but \"how long we keep it\". */\n needs: z.string().trim().min(1),\n /**\n * Who or what closes it, concretely enough to act on: an issue reference, a decision owner, the\n * configuration surface to edit. A row whose remedy is unnamed is a row nobody picks up.\n */\n closedBy: z.string().trim().min(1),\n});\nexport type ComplianceStatementIncompleteness = z.infer<typeof ComplianceStatementIncompletenessSchema>;\n\n/** One clause of the draft: the prose a reader sees, and what it rests on. */\nexport const ComplianceDocumentCandidateClauseSchema = z\n .strictObject({\n clauseRef: NamespacedRefSchema,\n /**\n * Which of the document blueprint's clauses this clause supplies.\n *\n * The clause-level twin of `satisfiesSectionRefs`, and it exists for the reason that survived\n * every other half of the ref-churn problem: a clause has NO stable anchor. Facts are dictated by\n * the catalog and sections carry a `concernRef` from a closed vocabulary, so both join across two\n * drafts. A clause is named freely and joins to nothing — so a reviewer who approved clause N\n * cannot find it in the next revision, which is what makes a governed document's review\n * un-carryable rather than merely untidy.\n *\n * Stated as a CLAIM rather than adopted as the clause's own `clauseRef`, for the same reason as\n * sections: the candidate's clause set is the drafter's, and telling it to take catalog names\n * asks it to reconcile two structures mid-draft. Several clauses may supply one blueprint clause\n * between them, and one clause may supply several.\n *\n * `.optional()`, deliberately and with a scar behind it: `satisfiesSectionRefs` shipped as\n * `.default([])` and broke every already-landed document at compile time, because a Zod default is\n * required on the inferred OUTPUT type and a landed candidate is TypeScript authored against it.\n * Absent means the clause claims nothing.\n *\n * Only REQUIRED blueprint clauses are ever expected. A CONDITIONAL clause is included when its\n * condition groups hold, so an unclaimed one is not a gap — the coverage check filters on\n * `inclusionKind`, which matters: service terms declares 4 conditional clauses of 15.\n */\n satisfiesClauseRefs: z.array(NamespacedRefSchema).optional(),\n order: PositiveOrdinalSchema,\n bodyMarkdown: z.string().trim().min(1),\n /**\n * How established this clause is. Defaults to the STRICT state, deliberately.\n *\n * A hand-authored clause that omits the key claims to be derived, and is checked accordingly — the\n * safe direction, since the cost of being wrong is a refusal a human can answer. The GENERATION\n * contract must require it explicitly instead: a model permitted to omit the key would silently\n * claim `DERIVED`, which is the one direction that lets invention back in.\n */\n completeness: z.enum(ComplianceStatementCompleteness).default(ComplianceStatementCompleteness.DERIVED),\n /** Required when `completeness` is not `DERIVED`, forbidden when it is — see the superRefine below. */\n incompleteness: ComplianceStatementIncompletenessSchema.optional(),\n /** The document facts this clause asserts. A clause that asserts none cites none — an empty list is valid. */\n factRefs: z.array(NamespacedRefSchema),\n /** The application policies the clause derives from. At least one: prose with no source is invention. */\n sourcePolicyRefs: z.array(NamespacedRefSchema).min(1),\n /** The claim guards a reviewer checks this clause against. */\n claimGuardRefs: z.array(NamespacedRefSchema).min(1),\n })\n .superRefine((clause, context) => {\n if (!valuesAreUnique(clause.factRefs)) {\n context.addIssue({ code: \"custom\", message: \"fact references must be unique\", path: [\"factRefs\"] });\n }\n // A clause claiming the same blueprint clause twice supplies it once. Refused for the same reason\n // every sibling ref list is: a duplicate misleads a coverage count that reads each claim as\n // evidence.\n if (!valuesAreUnique(clause.satisfiesClauseRefs ?? [])) {\n context.addIssue({ code: \"custom\", message: \"satisfied clause references must be unique\", path: [\"satisfiesClauseRefs\"] });\n }\n /*\n * The pairing is enforced in BOTH directions, and the second direction is the one that matters.\n *\n * Missing `incompleteness` on a marked clause produces the register row nobody can action — the\n * failure mode the four states exist to prevent. Present `incompleteness` on a `DERIVED` clause is\n * a statement claiming to be both established and missing something, which no reader can resolve.\n */\n const marked = clause.completeness !== ComplianceStatementCompleteness.DERIVED;\n if (marked && clause.incompleteness === undefined) {\n context.addIssue({\n code: \"custom\",\n message: `a clause marked ${clause.completeness} must state what it needs and who closes it`,\n path: [\"incompleteness\"],\n });\n }\n if (!marked && clause.incompleteness !== undefined) {\n context.addIssue({\n code: \"custom\",\n message: \"a DERIVED clause is established, so it cannot also declare what it is missing\",\n path: [\"incompleteness\"],\n });\n }\n });\nexport type ComplianceDocumentCandidateClause = z.infer<typeof ComplianceDocumentCandidateClauseSchema>;\n\n/** One titled section, whose clauses are contiguously ordered. */\nexport const ComplianceDocumentCandidateSectionSchema = z\n .strictObject({\n sectionRef: NamespacedRefSchema,\n order: PositiveOrdinalSchema,\n title: z.string().trim().min(1),\n /**\n * Which compliance CONCERN this section answers — \"how long do you keep my data\", \"who else sees\n * it\". Optional, because a document may legitimately carry a section that answers none (a\n * preamble, a contact block).\n *\n * This is what lets the completeness statement be projected from the document ALONE. An earlier\n * revision left the concern mapping to be supplied by a caller, on the reasoning that a framework\n * vocabulary should not sit inside content a drafter authors. That reasoning produced a\n * projection with no caller — the exact defect shape this lane is characterised by, unreachable\n * code that reads as capability — and it was wrong on its own terms: the drafter is told to write\n * one section per concern from the composition reference, so the concern is already what it\n * knows. Naming it here records a decision it has already made.\n */\n concernRef: z.string().trim().min(1).optional(),\n /**\n * Which of the DOCUMENT DEFINITION's required sections this section satisfies.\n *\n * The join between two vocabularies that are orthogonal rather than competing, and the reason\n * neither could replace the other. A `concernRef` says what compliance TOPIC a section is about —\n * one flat 19-member set spanning privacy notices, service terms and the governance documents,\n * and the spine of the completeness statement that reports gaps ACROSS documents. A catalog\n * section ref says where content belongs in THIS document — 42 distinct refs, defined per\n * definition, because a privacy notice's eleven and a programme handbook's five are different\n * sets by design.\n *\n * Stated per DRAFT rather than mapped once in the framework, deliberately. A global concern →\n * section mapping has to give one answer for all six document types, and `analytics-and-tracking`\n * does not sit under the same heading in a privacy notice and a programme handbook — so such a\n * mapping is wrong somewhere by construction. Per document is the only level at which the\n * question has a stable answer, and the drafter has both in front of it: the brief renders the\n * definition's required sections, and the method walks the concerns.\n *\n * ⚠️ This does NOT make the catalog own the section set. An earlier attempt told the drafter to\n * adopt catalog refs as its own `sectionRef`, which asked it to reconcile two structures mid-draft\n * and was reverted. This adds a claim and changes no structure: the section keeps its own ref and\n * its own ordering.\n *\n * `.optional()`, NOT `.default([])`, and the difference is not stylistic. A Zod default is\n * optional on INPUT and REQUIRED on the inferred OUTPUT type — and a landed document is a\n * TypeScript file typed against that output type. Declaring it with a default therefore broke\n * every already-landed candidate at compile time (`TS2741`), which is a schema change reaching\n * backwards into committed artifacts a human wrote. Absent means the section claims nothing, and\n * every reader treats it that way.\n *\n * Unconstrained here on purpose — a section answering no required part of the definition (a\n * preamble, a contact block) legitimately claims nothing. What the claims are worth\n * is decided by the COVERAGE check over the landed pair, which is where the definition is known;\n * this schema cannot see which document it is drafting.\n *\n * **What this proves and what it does not.** A required section claimed by NOTHING is caught. A\n * section claiming a required part it does not actually address is NOT — nothing reads the prose.\n * That is the same bound the fact-binding check carries (citation, not semantics), and it is\n * stated here so the coverage result is not read as a stronger guarantee than it is.\n */\n satisfiesSectionRefs: z.array(NamespacedRefSchema).optional(),\n clauses: z.array(ComplianceDocumentCandidateClauseSchema).min(1),\n })\n .superRefine((section, context) => {\n if (!valuesAreUnique(section.clauses.map((clause) => clause.clauseRef))) {\n context.addIssue({ code: \"custom\", message: \"clause references must be unique\", path: [\"clauses\"] });\n }\n // A section claiming the same required part twice says nothing twice. Refused for the same reason\n // every other ref list here is: a duplicate is either a mistake or padding, and both mislead a\n // coverage count that treats each claim as evidence.\n if (!valuesAreUnique(section.satisfiesSectionRefs ?? [])) {\n context.addIssue({ code: \"custom\", message: \"satisfied section references must be unique\", path: [\"satisfiesSectionRefs\"] });\n }\n section.clauses.forEach((clause, index) => {\n if (clause.order !== index + 1) {\n context.addIssue({\n code: \"custom\",\n message: \"clause order must be contiguous and match array order\",\n path: [\"clauses\", index, \"order\"],\n });\n }\n });\n });\nexport type ComplianceDocumentCandidateSection = z.infer<typeof ComplianceDocumentCandidateSectionSchema>;\n\n/** Which option the draft takes on one publication axis, and the facts justifying it. */\nexport const ComplianceDocumentCandidateVariantSelectionSchema = z\n .strictObject({\n axisRef: NamespacedRefSchema,\n optionRefs: z.array(NamespacedRefSchema).min(1),\n supportingFactRefs: z.array(NamespacedRefSchema).min(1),\n })\n .superRefine((selection, context) => {\n if (!valuesAreUnique(selection.optionRefs)) {\n context.addIssue({ code: \"custom\", message: \"option references must be unique\", path: [\"optionRefs\"] });\n }\n if (!valuesAreUnique(selection.supportingFactRefs)) {\n context.addIssue({ code: \"custom\", message: \"supporting fact references must be unique\", path: [\"supportingFactRefs\"] });\n }\n });\nexport type ComplianceDocumentCandidateVariantSelection = z.infer<typeof ComplianceDocumentCandidateVariantSelectionSchema>;\n\nexport enum ComplianceDocumentCandidateVersion {\n V1 = \"v1\",\n}\n\n/** THE draft. Artifact-family id: `compliance-document-candidate`. */\nexport const ComplianceDocumentCandidateSchema = z.strictObject({\n version: z.enum(ComplianceDocumentCandidateVersion).default(ComplianceDocumentCandidateVersion.V1),\n /** Which governed document this drafts, e.g. `document:privacy-notice`. */\n documentRef: NamespacedRefSchema,\n title: z.string().trim().min(1),\n /**\n * BCP-47-ish; the publication family owns the closed set, this only requires a plausible tag.\n *\n * OPTIONAL, with `jurisdictionRefs` below: both are second-step questions and neither may gate\n * producing a draft. An application that has not yet decided which locales it publishes in still has\n * a privacy notice to write, and the decision is a `NEEDS_DECISION` row in the register rather than a\n * refusal at the schema. Requiring them here would have made the deferral impossible to express —\n * the drafter's only way past a required field is to invent a value for it.\n */\n locale: z.string().trim().min(2).optional(),\n /** Optional for the same reason as `locale`; absent means the jurisdiction decision is still open. */\n jurisdictionRefs: z.array(NamespacedRefSchema).min(1).optional(),\n variantSelections: z.array(ComplianceDocumentCandidateVariantSelectionSchema).default([]),\n sections: z.array(ComplianceDocumentCandidateSectionSchema).min(1),\n /** What a reviewer must check before this becomes a published document. */\n reviewChecklistRefs: z.array(NamespacedRefSchema).min(1),\n /** What the draft does NOT cover, stated by the drafter rather than discovered by the reader. */\n limitationRefs: z.array(NamespacedRefSchema).default([]),\n});\nexport type ComplianceDocumentCandidate = z.infer<typeof ComplianceDocumentCandidateSchema>;\n\nexport enum ComplianceDocumentCandidateIssueKind {\n DUPLICATE_SECTION_REF = \"DUPLICATE_SECTION_REF\",\n NON_CONTIGUOUS_SECTION_ORDER = \"NON_CONTIGUOUS_SECTION_ORDER\",\n DUPLICATE_JURISDICTION = \"DUPLICATE_JURISDICTION\",\n DUPLICATE_VARIANT_AXIS = \"DUPLICATE_VARIANT_AXIS\",\n DANGLING_CLAUSE_FACT = \"DANGLING_CLAUSE_FACT\",\n}\n\nexport interface ComplianceDocumentCandidateIssue {\n readonly kind: ComplianceDocumentCandidateIssueKind;\n readonly path: string;\n readonly message: string;\n}\n\n/**\n * Semantic validation the schema alone cannot express.\n *\n * The referential half is why this exists: a model producing a variant selection that cites a fact no clause\n * anywhere uses has written a justification for a decision the document does not make. Same class as the 156\n * dangling references a market snapshot carried for months — a schema-valid artifact whose parts disagree.\n */\nexport function validateComplianceDocumentCandidate(\n candidate: ComplianceDocumentCandidate,\n): { readonly ok: boolean; readonly issues: readonly ComplianceDocumentCandidateIssue[] } {\n const issues: ComplianceDocumentCandidateIssue[] = [];\n const add = (kind: ComplianceDocumentCandidateIssueKind, path: string, message: string): void => {\n issues.push({ kind, path, message });\n };\n\n if (!valuesAreUnique(candidate.sections.map((section) => section.sectionRef))) {\n add(ComplianceDocumentCandidateIssueKind.DUPLICATE_SECTION_REF, \"sections\", \"section references must be unique\");\n }\n candidate.sections.forEach((section, index) => {\n if (section.order !== index + 1) {\n add(\n ComplianceDocumentCandidateIssueKind.NON_CONTIGUOUS_SECTION_ORDER,\n `sections.${index}.order`,\n \"section order must be contiguous and match array order\",\n );\n }\n });\n // Absent is a deferred decision, not a duplicate — only a PRESENT list can contradict itself.\n if (candidate.jurisdictionRefs !== undefined && !valuesAreUnique(candidate.jurisdictionRefs)) {\n add(ComplianceDocumentCandidateIssueKind.DUPLICATE_JURISDICTION, \"jurisdictionRefs\", \"jurisdiction references must be unique\");\n }\n if (!valuesAreUnique(candidate.variantSelections.map((selection) => selection.axisRef))) {\n add(ComplianceDocumentCandidateIssueKind.DUPLICATE_VARIANT_AXIS, \"variantSelections\", \"each publication axis may be selected once\");\n }\n\n const citedFacts = new Set(candidate.sections.flatMap((section) => section.clauses.flatMap((clause) => clause.factRefs)));\n candidate.variantSelections.forEach((selection, index) => {\n for (const factRef of selection.supportingFactRefs) {\n if (!citedFacts.has(factRef)) {\n add(\n ComplianceDocumentCandidateIssueKind.DANGLING_CLAUSE_FACT,\n `variantSelections.${index}.supportingFactRefs`,\n `\"${factRef}\" justifies a variant selection but no clause in the document uses it`,\n );\n }\n }\n });\n\n return { ok: issues.length === 0, issues };\n}\n\n/**\n * What the application's declared facts say about one fact ref, as far as a DRAFT needs to know.\n *\n * Two members rather than one, because they are different answers and a document that confuses them is\n * wrong in different ways. \"We do not transfer data internationally\" is a real, citable fact with a\n * value; \"international transfers are not applicable to us\" is the application declining to answer, and\n * a clause resting on it asserts something nobody established.\n *\n * A ref that is absent from the map is neither — the application has not considered it at all.\n */\nexport enum ComplianceDocumentFactAvailability {\n /** The application declared this fact and it carries a value a clause may rest on. */\n DECLARED_WITH_VALUE = \"DECLARED_WITH_VALUE\",\n /** The application declared this fact NOT APPLICABLE. Citable by nothing; visible to a reviewer. */\n DECLARED_NOT_APPLICABLE = \"DECLARED_NOT_APPLICABLE\",\n}\n\n/**\n * Kinds the CROSS-FAMILY check reports. A separate enum from the intra-document one on purpose: these\n * describe a disagreement between two FILES, and a reader fixing one is not editing the same artifact.\n */\nexport enum ComplianceDocumentCandidateFactBindingIssueKind {\n /** A clause asserts a fact the application never declared. The defect this check exists for. */\n UNDECLARED_CLAUSE_FACT = \"UNDECLARED_CLAUSE_FACT\",\n /** A variant selection is justified by a fact the application never declared. */\n UNDECLARED_VARIANT_FACT = \"UNDECLARED_VARIANT_FACT\",\n /** A variant selection is justified by a fact the application declared NOT APPLICABLE. */\n NOT_APPLICABLE_VARIANT_FACT = \"NOT_APPLICABLE_VARIANT_FACT\",\n}\n\nexport interface ComplianceDocumentCandidateFactBindingIssue {\n readonly kind: ComplianceDocumentCandidateFactBindingIssueKind;\n readonly path: string;\n readonly message: string;\n}\n\n/**\n * Refuse a draft that ASSERTS a fact the application never wrote down — and let it MARK one instead.\n *\n * ## The matrix, because \"error when the fact is missing\" leaves cells undecided\n *\n * | clause completeness | cited fact | verdict |\n * |---|---|---|\n * | `DERIVED` | undeclared | **ERROR** — invention |\n * | `DERIVED` | declared `NOT_APPLICABLE` | **ERROR** — a claim resting on a non-answer |\n * | `NEEDS_*` | undeclared | **OK** — this is precisely the fact it is waiting for |\n * | `NEEDS_*` | declared with a value | **OK** — incomplete for some other reason |\n *\n * The distinction the whole capability turns on is ASSERT versus MARK. A clause may say \"this is not\n * yet established\"; it may not say something untrue. Incompleteness is CONTENT — the reader sees it,\n * the register lists it, a human closes it later — and it never gates producing the document.\n *\n * ## Variant selections stay strict, and that is not an oversight\n *\n * A clause STATES something and may state that it does not know. A variant selection DECIDES something\n * — which option this publication takes on an axis — and a decision justified by a fact nobody declared\n * is not incomplete, it is unfounded. There is no \"I have not decided\" selection to make: a draft that\n * has not decided simply omits the axis (`variantSelections` defaults to empty).\n *\n * ## What this replaces, and why the replacement is not weaker\n *\n * The deleted design handed the drafting agent an `ApplicationAssuranceDocumentFactProjection`: a\n * host-computed record carrying a projector identity, source-head digests, per-contribution authority\n * receipts and a self digest. The drafter could not see an unverified fact, because the host had sealed\n * the set it was permitted to see.\n *\n * None of that is branchable on git (`.claude/rules/one-source-of-truth.md`, Rule 0), and all of it is\n * gone. But what it PROTECTED was never the digest — it was the sentence *\"a published legal document\n * must not assert something about this application that nobody established.\"* That sentence is a\n * relation between two files, and a relation between two files is a pure function.\n *\n * So the drafter may now write anything, and this refuses to let an unbacked claim become a file. The\n * guarantee moves from \"the drafter could not SEE an unverified fact\" to \"an unverified fact cannot be\n * COMMITTED\" — the same protection at the boundary that matters, and it MERGES: two branches may declare\n * different facts and draft different clauses, and each branch's check answers about its own tree.\n *\n * What is genuinely given up is tamper evidence in transit to a reviewer. Under Rule 0 that job belongs\n * to git and the forge — a reviewer reads a diff, not a receipt.\n *\n * ## Why an availability map rather than the fact specification\n *\n * `ApplicationDocumentFactSpecification` lives in the `application-creation` layer and carries authority\n * kinds, governance scopes, sensitivity refs and validity windows — none of which this question needs.\n * Taking only what it needs keeps `_core` free of that dependency and makes the contract exact: this\n * answers *\"is every asserted fact declared, with a value\"*, and nothing else. Whether a declaration's\n * AUTHORITY is adequate for the claim it carries is a reviewer's judgement, and later a judge's — never\n * this function's. Merging the two would rebuild the authority engine that Rule 0 removed.\n *\n * ## Absent is not empty\n *\n * A caller that could not load the fact specification must NOT call this with an empty map — it expresses\n * that case by not calling. Conflating \"I could not read the facts\" with \"there are none\" turns a wiring\n * failure into a content verdict (`.claude/rules/negative-results-require-a-positive-probe.md`).\n *\n * An empty map therefore means \"check against nothing\", and every citation is refused. Note this is the\n * PURE FUNCTION's contract, not a description of a reachable application state: through the companion\n * path an empty map cannot occur, because `ApplicationDocumentFactSpecificationSchema` requires\n * `declarations: min(1)` and `collectComplianceDocumentFactAvailability` emits one entry per declaration.\n * An earlier revision of this comment justified the branch as \"the application declared no facts\", which\n * names a state the schema forbids and would send the next reader looking for it.\n */\nexport function validateComplianceDocumentCandidateFactBinding(\n candidate: ComplianceDocumentCandidate,\n declaredFacts: ReadonlyMap<string, ComplianceDocumentFactAvailability>,\n): { readonly ok: boolean; readonly issues: readonly ComplianceDocumentCandidateFactBindingIssue[] } {\n const issues: ComplianceDocumentCandidateFactBindingIssue[] = [];\n\n /*\n * One classifier for both citation sites. The two sites differ only in their path and their noun, and\n * a second copy of the availability branch is how the clause rule and the variant rule drift apart\n * (`.claude/rules/invariant-call-site-enumeration.md` — prefer one named home over N applications).\n */\n /**\n * Which issue a cited fact raises, if any.\n *\n * `notApplicable` is OPTIONAL: passing `undefined` means a recorded \"does not apply\" is an acceptable\n * citation at that site. A `DERIVED` clause passes `undefined` deliberately — see the correction in\n * the loop below — while any site that still wants to report the mismatch names its own kind.\n */\n const classify = (\n factRef: string,\n undeclared: ComplianceDocumentCandidateFactBindingIssueKind,\n notApplicable: ComplianceDocumentCandidateFactBindingIssueKind | undefined,\n ): ComplianceDocumentCandidateFactBindingIssueKind | undefined => {\n const availability = declaredFacts.get(factRef);\n if (availability === ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE) return undefined;\n return availability === ComplianceDocumentFactAvailability.DECLARED_NOT_APPLICABLE ? notApplicable : undeclared;\n };\n\n candidate.sections.forEach((section, sectionIndex) => {\n section.clauses.forEach((clause, clauseIndex) => {\n /*\n * A clause that says it is NOT established is exempt, and this line is the whole reframe.\n *\n * An earlier revision refused any clause citing an undeclared fact. That refusal was correct\n * about invention and wrong about incompleteness: it made a document unproducible until every\n * fact existed, which for a real application is never. The fix is not to relax the check — it is\n * to notice that a marked clause is making a DIFFERENT KIND of statement. \"We have not yet\n * established how long we keep this\" asserts nothing about the application, so there is nothing\n * for the facts file to back.\n *\n * The exemption is exactly as wide as the marking, and the marking costs something: the schema\n * requires `incompleteness.needs` and `.closedBy`, so a drafter cannot buy silence by marking a\n * clause — it must say what is missing and who supplies it, in the register a human reads.\n *\n * `DERIVED` remains strict about the thing this check exists for: a fact the application never\n * declared is invention, and no marking makes it citable.\n *\n * ## A NOT_APPLICABLE fact IS citable — corrected 2026-08-29, against live evidence\n *\n * This refused a DERIVED clause citing a NOT_APPLICABLE fact, on the reasoning that such a fact is\n * \"a non-answer\". That reasoning is wrong, and it is wrong in the same way the pre-reframe refusal\n * above was: it reads the fact's SHAPE instead of the statement it supports.\n *\n * `NOT_APPLICABLE` is not silence. The family schema REQUIRES a `reason`, so it is a considered,\n * recorded finding that something does not apply — *\"no external analytics provider is\n * configured\"*, *\"no AI capability is declared\"*. A clause resting on it makes the matching\n * NEGATIVE statement, and that fact is precisely its support. Refusing it does not prevent a false\n * claim; it prevents a TRUE one, and pushes the drafter to mark the concern incomplete instead —\n * so the document says \"this has not been established\" about something the application HAS\n * established, which is the under-reporting direction a compliance statement must never fail in.\n *\n * Measured: wonder-crm's notice (2026-08-29) came back with recipients-and-processors,\n * automated-decisions-and-ai and analytics-and-tracking all marked incomplete, and the run before\n * it failed all three attempts on this rule alone. The hand-written comparison the design was\n * validated against derives all three, in as many words — *\"true because none are configured\"*.\n *\n * What is NOT weakened: the check is, and always was, about whether the application DECLARED the\n * fact. Nothing here reads a clause's prose, so a clause misusing a KNOWN fact was never caught\n * either; the guarantee is citation, not semantics, and it is unchanged.\n */\n if (clause.completeness !== ComplianceStatementCompleteness.DERIVED) return;\n for (const factRef of clause.factRefs) {\n /*\n * `undefined` is the correction below, and it makes UNDECLARED_CLAUSE_FACT the ONLY kind a\n * clause can raise — there is deliberately no not-applicable counterpart in the vocabulary.\n *\n * One existed until 2026-08-30, described as \"reported for a MARKED clause only\". Measured,\n * it was unreachable from anywhere: a marked clause returns above, before any classification,\n * and a DERIVED clause passes `undefined` here. A vocabulary member nothing can emit is worse\n * than absent — a consumer branching on it writes code that can never run.\n */\n const kind = classify(\n factRef,\n ComplianceDocumentCandidateFactBindingIssueKind.UNDECLARED_CLAUSE_FACT,\n undefined,\n );\n if (kind === undefined) continue;\n issues.push({\n kind,\n path: `sections.${sectionIndex}.clauses.${clauseIndex}.factRefs`,\n // The message is what goes back to the model on a retry, so it names the FIX rather than the\n // fault: the drafter's options are to cite a declared fact or to drop the claim.\n message:\n `clause \"${clause.clauseRef}\" asserts \"${factRef}\", which the application's document-facts do not declare. `\n + \"Cite a declared fact or remove the claim; a governed document may not state something nobody established.\",\n });\n }\n });\n });\n\n candidate.variantSelections.forEach((selection, index) => {\n for (const factRef of selection.supportingFactRefs) {\n const kind = classify(\n factRef,\n ComplianceDocumentCandidateFactBindingIssueKind.UNDECLARED_VARIANT_FACT,\n ComplianceDocumentCandidateFactBindingIssueKind.NOT_APPLICABLE_VARIANT_FACT,\n );\n if (kind === undefined) continue;\n issues.push({\n kind,\n path: `variantSelections.${index}.supportingFactRefs`,\n message:\n kind === ComplianceDocumentCandidateFactBindingIssueKind.NOT_APPLICABLE_VARIANT_FACT\n ? `variant axis \"${selection.axisRef}\" is justified by \"${factRef}\", which the application declared NOT APPLICABLE.`\n : `variant axis \"${selection.axisRef}\" is justified by \"${factRef}\", which the application's document-facts do not declare.`,\n });\n }\n });\n\n return { ok: issues.length === 0, issues };\n}\n\n/**\n * Derive the availability map from the application's accepted `document-facts` file.\n *\n * The join lives HERE, beside the check that consumes it, rather than at each call site: the generation\n * loop and the landing both need it, and two derivations of the same map are how a retry gets corrected\n * against a different set of facts than the one the write is checked against.\n *\n * ## One ref, several declarations\n *\n * A fact ref may legitimately appear more than once — the family permits one current declaration per\n * `(factRef, factVersion, governanceScope)` triple, so the same fact can be declared for the operator and\n * for a tenant, or at two versions. If ANY of them carries a value, a clause may rest on it: the document\n * asserts the fact, not one particular scope's declaration of it, and picking a scope here would be this\n * function inventing a precedence rule that belongs to the document's governance scope. `NOT_APPLICABLE`\n * therefore wins only when it is the ONLY answer on record.\n *\n * ## Several specifications, on purpose\n *\n * Since #192 the facts live in TWO families — `document-facts` (what the accepted specification answers,\n * regenerated by a producer) and `document-facts-authored` (what a human established). A document reads\n * both, because it asserts the FACT and does not care who wrote it. That is exactly the precedence rule\n * above applied one level up, so it needed no new policy: variadic, absent-tolerant, same fold.\n *\n * Order between the two is therefore not significant, and a caller must not read it as significant.\n */\nexport function collectComplianceDocumentFactAvailability(\n ...specifications: readonly (ApplicationDocumentFactDeclarationSet | undefined)[]\n): ReadonlyMap<string, ComplianceDocumentFactAvailability> {\n const availability = new Map<string, ComplianceDocumentFactAvailability>();\n for (const specification of specifications) {\n for (const declaration of specification?.declarations ?? []) {\n const resolved =\n declaration.resolutionKind === ApplicationAssuranceDocumentFactContributionResolutionKind.KNOWN\n ? ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE\n : ComplianceDocumentFactAvailability.DECLARED_NOT_APPLICABLE;\n // A value never loses to a later NOT_APPLICABLE — see the JSDoc above.\n if (availability.get(declaration.factRef) === ComplianceDocumentFactAvailability.DECLARED_WITH_VALUE) continue;\n availability.set(declaration.factRef, resolved);\n }\n }\n return availability;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FamilyAspectsDeclaration } from '../family-aspects.schemas';
|
|
2
|
+
/**
|
|
3
|
+
* The governed-document CANDIDATE family's aspects.
|
|
4
|
+
*
|
|
5
|
+
* `supportingFactRefs` (and the clauses' `factRefs`, third-level and out of aspect scope) hold
|
|
6
|
+
* DOCUMENT-FACT CATALOG keys — which the fact-declaration aspect exposes as its `factRef` FIELD,
|
|
7
|
+
* not as its business key. Becoming an edge needs a lookup-field extension to the contract
|
|
8
|
+
* (resolve by a declared non-key field); recorded as a non-edge until that lands rather than
|
|
9
|
+
* pointing an edge at a key set it can never match.
|
|
10
|
+
*/
|
|
11
|
+
export declare const COMPLIANCE_DOCUMENT_CANDIDATE_FAMILY_ASPECTS: FamilyAspectsDeclaration;
|
|
12
|
+
//# sourceMappingURL=compliance-documents.family-aspects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-documents.family-aspects.d.ts","sourceRoot":"","sources":["../../../../../src/_core/compliance-documents/compliance-documents.family-aspects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAO1E;;;;;;;;GAQG;AACH,eAAO,MAAM,4CAA4C,EAAE,wBAmC1D,CAAC"}
|