@wildo-ai/framework-knowledge 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/framework-knowledge.definitions.d.ts +51 -0
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.definitions.js +1571 -0
- package/dist/esm/framework-knowledge.definitions.js.map +1 -0
- package/dist/esm/framework-knowledge.loader.d.ts +72 -0
- package/dist/esm/framework-knowledge.loader.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.loader.js +258 -0
- package/dist/esm/framework-knowledge.loader.js.map +1 -0
- package/dist/esm/framework-knowledge.schemas.d.ts +236 -0
- package/dist/esm/framework-knowledge.schemas.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.schemas.js +23 -0
- package/dist/esm/framework-knowledge.schemas.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +56 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts +200 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js +228 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +261 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +412 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +61 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +65 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +54 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts +43 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js +73 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +114 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +95 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +102 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts +258 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js +241 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts +241 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js +202 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts +82 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js +89 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts +56 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js +76 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts +30 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js +27 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts +31 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js +26 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +254 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +219 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts +180 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +302 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +249 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +286 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts +248 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js +227 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts +45 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js +48 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts +250 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +218 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -0
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -0
- package/dist/knowledge/manifest.json +45 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +407 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +69 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +556 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +47 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/method.md +344 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/playbook.json +43 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +259 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +83 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/method.md +321 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +79 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +185 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +66 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +737 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +44 -0
- package/dist/knowledge/playbooks/refinement.document-facts/method.md +261 -0
- package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +57 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/method.md +151 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +124 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/method.md +128 -0
- package/dist/knowledge/playbooks/top_down.business-model/playbook.json +102 -0
- package/dist/knowledge/playbooks/top_down.business-model/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +73 -0
- package/dist/knowledge/playbooks/top_down.capability-map/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/method.md +177 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/playbook.json +95 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/method.md +64 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/playbook.json +49 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/method.md +56 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/playbook.json +40 -0
- package/dist/knowledge/playbooks/top_down.market-research/method.md +68 -0
- package/dist/knowledge/playbooks/top_down.market-research/playbook.json +42 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +69 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/method.md +96 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +77 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +53 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +61 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/method.md +280 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/playbook.json +87 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/method.md +204 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/playbook.json +54 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +146 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +120 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/structured-artifact-action.json +1 -0
- package/dist/knowledge/references/application.database.migration-change-risk.md +28 -0
- package/dist/knowledge/references/assertions.authored-metadata.config.md +90 -0
- package/dist/knowledge/references/assertions.behaviors.wire-contracts.md +223 -0
- package/dist/knowledge/references/assertions.references.conventions.md +92 -0
- package/dist/knowledge/references/assertions.snapshot.validation.md +317 -0
- package/dist/knowledge/references/assertions.specification.config.md +287 -0
- package/dist/knowledge/references/brand.asset.config.md +167 -0
- package/dist/knowledge/references/brand.authored-metadata.config.md +51 -0
- package/dist/knowledge/references/brand.logo-direction.config.md +88 -0
- package/dist/knowledge/references/brand.name.config.md +46 -0
- package/dist/knowledge/references/brand.snapshot.config.md +76 -0
- package/dist/knowledge/references/brand.snapshot.validation.md +446 -0
- package/dist/knowledge/references/brand.visual-tone.config.md +56 -0
- package/dist/knowledge/references/build-plan.task-graph.config.md +198 -0
- package/dist/knowledge/references/business-model.authored-metadata.config.md +65 -0
- package/dist/knowledge/references/business-model.pricing-plan.config.md +122 -0
- package/dist/knowledge/references/business-model.references.conventions.md +99 -0
- package/dist/knowledge/references/business-model.snapshot.config.md +121 -0
- package/dist/knowledge/references/business-model.snapshot.validation.md +325 -0
- package/dist/knowledge/references/cli.market.generate-command.md +230 -0
- package/dist/knowledge/references/cli.market.utils.md +147 -0
- package/dist/knowledge/references/companion.introspection.behaviors.market.md +90 -0
- package/dist/knowledge/references/companion.introspection.handlers.market.md +42 -0
- package/dist/knowledge/references/companion.market.generation-service.md +270 -0
- package/dist/knowledge/references/companion.market.prompt-renderer.md +244 -0
- package/dist/knowledge/references/companion.technical-doc.service.md +809 -0
- package/dist/knowledge/references/engine.client-bundle.allow-list.md +125 -0
- package/dist/knowledge/references/engine.client-bundle.discipline.md +130 -0
- package/dist/knowledge/references/engine.client-bundle.external-connectors-public.discipline.md +55 -0
- package/dist/knowledge/references/engine.saas-technical-doc.config.md +215 -0
- package/dist/knowledge/references/engine.saas-website.config.md +331 -0
- package/dist/knowledge/references/example.authorization.unit-narrowing.declaration.md +24 -0
- package/dist/knowledge/references/example.backend.addon-wiring.module.md +55 -0
- package/dist/knowledge/references/example.backend.custom-operation.create-postfix.md +35 -0
- package/dist/knowledge/references/example.backend.operation.error-throw.md +17 -0
- package/dist/knowledge/references/example.config.app-shell.command-menu-items.md +63 -0
- package/dist/knowledge/references/example.config.app-shell.full.md +147 -0
- package/dist/knowledge/references/example.config.app-shell.hosted-components.md +45 -0
- package/dist/knowledge/references/example.config.app-shell.quick-switcher-fields.md +37 -0
- package/dist/knowledge/references/example.config.backend.billing-enable.md +20 -0
- package/dist/knowledge/references/example.config.backend.required-floors.md +46 -0
- package/dist/knowledge/references/example.config.design-system.full.md +162 -0
- package/dist/knowledge/references/example.config.navigation.full.md +71 -0
- package/dist/knowledge/references/example.config.provider.backend-scope-billing.md +27 -0
- package/dist/knowledge/references/example.data-seeding.minimal.md +114 -0
- package/dist/knowledge/references/example.email.template.minimal.md +54 -0
- package/dist/knowledge/references/example.engine.component-registration.lazy-load.md +16 -0
- package/dist/knowledge/references/example.engine.product-definitions.feature-and-profiles.md +146 -0
- package/dist/knowledge/references/example.flows-actors.chat-assistant.md +196 -0
- package/dist/knowledge/references/example.flows-actors.llm-agent-one-shot.md +174 -0
- package/dist/knowledge/references/example.i18n.label-generation.engine-barrel.md +15 -0
- package/dist/knowledge/references/example.infra.cdn.cloudflare.md +23 -0
- package/dist/knowledge/references/example.infra.cdn.generic.md +17 -0
- package/dist/knowledge/references/example.infra.environment-config.local.md +250 -0
- package/dist/knowledge/references/example.market.alternative.in-house-build.md +49 -0
- package/dist/knowledge/references/example.market.authored-metadata.md +32 -0
- package/dist/knowledge/references/example.market.buying-journey.core-icp.md +140 -0
- package/dist/knowledge/references/example.market.category.config.md +71 -0
- package/dist/knowledge/references/example.market.channel.community.md +39 -0
- package/dist/knowledge/references/example.market.feature-benefit.kano-threshold.md +67 -0
- package/dist/knowledge/references/example.market.feature-benefit.pain-reliever.md +65 -0
- package/dist/knowledge/references/example.market.icp.anti-target.md +47 -0
- package/dist/knowledge/references/example.market.icp.individual.md +82 -0
- package/dist/knowledge/references/example.market.icp.legal-entity-with-geographies.md +95 -0
- package/dist/knowledge/references/example.market.is-benefit-available.composition.md +40 -0
- package/dist/knowledge/references/example.market.job.emotional.md +27 -0
- package/dist/knowledge/references/example.market.job.functional.md +28 -0
- package/dist/knowledge/references/example.market.message-template.seeds.md +106 -0
- package/dist/knowledge/references/example.market.objection.pricing.md +39 -0
- package/dist/knowledge/references/example.market.persona.dmu-with-inheritance.md +62 -0
- package/dist/knowledge/references/example.market.persona.individual-self.md +51 -0
- package/dist/knowledge/references/example.market.positioning.per-icp.md +103 -0
- package/dist/knowledge/references/example.market.proof.metric.md +39 -0
- package/dist/knowledge/references/example.market.scoring.golden-case.md +46 -0
- package/dist/knowledge/references/example.market.scoring.no-coverage-zero.md +40 -0
- package/dist/knowledge/references/example.market.snapshot-validation.duplicate-journey-stage.md +36 -0
- package/dist/knowledge/references/example.market.snapshot-validation.errors-by-kind.md +55 -0
- package/dist/knowledge/references/example.market.snapshot-validation.objection-proof-benefit-mismatch.md +74 -0
- package/dist/knowledge/references/example.market.snapshot-validation.proof-without-support.md +32 -0
- package/dist/knowledge/references/example.market.snapshot-validation.threshold-without-job.md +44 -0
- package/dist/knowledge/references/example.market.snapshot.assembled.md +49 -0
- package/dist/knowledge/references/example.market.tone-of-voice.config.md +41 -0
- package/dist/knowledge/references/example.market.trigger.growth-milestone.md +43 -0
- package/dist/knowledge/references/example.module.companion-exports.full.md +142 -0
- package/dist/knowledge/references/example.module.registration.shared.md +16 -0
- package/dist/knowledge/references/example.module.relationships.actor-edge-back-to-scope-owner.md +47 -0
- package/dist/knowledge/references/example.module.relationships.discriminator.md +25 -0
- package/dist/knowledge/references/example.module.relationships.scope-membership-junction.md +25 -0
- package/dist/knowledge/references/example.provider.backend-module-shape.md +110 -0
- package/dist/knowledge/references/example.provider.contribution.backend-billing.md +12 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.contribution.md +30 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.module.md +21 -0
- package/dist/knowledge/references/example.rag.source-fields.declaration.md +83 -0
- package/dist/knowledge/references/example.rate-limit.custom-controller-surface.md +25 -0
- package/dist/knowledge/references/example.rate-limit.resource-operation-surface.md +24 -0
- package/dist/knowledge/references/example.resource.add-field.priority-enum.md +19 -0
- package/dist/knowledge/references/example.resource.add-resource.module-factory-map.md +21 -0
- package/dist/knowledge/references/example.resource.config-wiring.fk-relationship.md +33 -0
- package/dist/knowledge/references/example.resource.custom-view.read-host.md +28 -0
- package/dist/knowledge/references/example.resource.mcp-exposure.md +65 -0
- package/dist/knowledge/references/example.resource.reference-constraints.role-constrained.md +27 -0
- package/dist/knowledge/references/example.resource.ui-behavior.enum-badge.md +22 -0
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +43 -0
- package/dist/knowledge/references/example.spec.composite-view.workspace.md +72 -0
- package/dist/knowledge/references/example.spec.feature.flag-with-codehandling.md +64 -0
- package/dist/knowledge/references/example.spec.frontend-component.prop-vocabulary.md +88 -0
- package/dist/knowledge/references/example.spec.resource.semantic-field.md +23 -0
- package/dist/knowledge/references/example.views.app-level.composite-views-config.md +19 -0
- package/dist/knowledge/references/example.views.chart-view.resource-owned.md +69 -0
- package/dist/knowledge/references/example.views.composite-view.host-embeds.md +31 -0
- package/dist/knowledge/references/example.views.composite-view.workspace.md +65 -0
- package/dist/knowledge/references/example.views.custom-view.execution-host.md +41 -0
- package/dist/knowledge/references/example.views.execution-view.resource-owned.md +25 -0
- package/dist/knowledge/references/external-connectors.app.frontend-provider-module.md +42 -0
- package/dist/knowledge/references/market.alternative.config.md +68 -0
- package/dist/knowledge/references/market.alternative.kind.md +32 -0
- package/dist/knowledge/references/market.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/market.buying-journey.config.md +43 -0
- package/dist/knowledge/references/market.buying-journey.stage.md +33 -0
- package/dist/knowledge/references/market.category.config.md +63 -0
- package/dist/knowledge/references/market.channel.config.md +59 -0
- package/dist/knowledge/references/market.channel.kind.md +49 -0
- package/dist/knowledge/references/market.context-block.builder.md +544 -0
- package/dist/knowledge/references/market.context-block.response.md +57 -0
- package/dist/knowledge/references/market.feature-benefit.config.md +84 -0
- package/dist/knowledge/references/market.feature-benefit.kano.md +41 -0
- package/dist/knowledge/references/market.gain.config.md +50 -0
- package/dist/knowledge/references/market.generation.response.md +108 -0
- package/dist/knowledge/references/market.icp.config.md +162 -0
- package/dist/knowledge/references/market.icp.geographic-targeting.md +57 -0
- package/dist/knowledge/references/market.inherit-from.md +74 -0
- package/dist/knowledge/references/market.is-benefit-available.md +58 -0
- package/dist/knowledge/references/market.job.config.md +48 -0
- package/dist/knowledge/references/market.message-template.config.md +86 -0
- package/dist/knowledge/references/market.objection.config.md +56 -0
- package/dist/knowledge/references/market.objection.kind.md +34 -0
- package/dist/knowledge/references/market.pain.config.md +50 -0
- package/dist/knowledge/references/market.persona.config.md +64 -0
- package/dist/knowledge/references/market.positioning.config.md +84 -0
- package/dist/knowledge/references/market.proof.config.md +48 -0
- package/dist/knowledge/references/market.proof.kind.md +34 -0
- package/dist/knowledge/references/market.references.weighted-edges.md +105 -0
- package/dist/knowledge/references/market.scoring.fit.md +215 -0
- package/dist/knowledge/references/market.snapshot.config.md +34 -0
- package/dist/knowledge/references/market.snapshot.validation.md +1171 -0
- package/dist/knowledge/references/market.tone-of-voice.config.md +80 -0
- package/dist/knowledge/references/market.trigger.config.md +45 -0
- package/dist/knowledge/references/market.trigger.kind.md +35 -0
- package/dist/knowledge/references/placement-plan.config.md +330 -0
- package/dist/knowledge/references/platform.config.application-database.md +74 -0
- package/dist/knowledge/references/platform.config.application-modules.md +30 -0
- package/dist/knowledge/references/platform.config.backing-services.md +266 -0
- package/dist/knowledge/references/platform.config.cdn.md +167 -0
- package/dist/knowledge/references/platform.config.environment.deployment.md +263 -0
- package/dist/knowledge/references/platform.config.saas.md +405 -0
- package/dist/knowledge/references/presets.models.design-system.configuration.md +59 -0
- package/dist/knowledge/references/presets.models.design-system.source-config.md +72 -0
- package/dist/knowledge/references/presets.models.labelling.sections.md +64 -0
- package/dist/knowledge/references/presets.models.material.profile-contract.md +192 -0
- package/dist/knowledge/references/presets.models.material.runtime-policy.md +60 -0
- package/dist/knowledge/references/presets.models.surface-policy.defaults.md +613 -0
- package/dist/knowledge/references/presets.models.surface-policy.md +534 -0
- package/dist/knowledge/references/presets.models.surface-variant.md +56 -0
- package/dist/knowledge/references/requirements.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/requirements.functional-requirement.config.md +68 -0
- package/dist/knowledge/references/requirements.non-functional-requirement.config.md +100 -0
- package/dist/knowledge/references/requirements.references.conventions.md +125 -0
- package/dist/knowledge/references/requirements.snapshot.config.md +73 -0
- package/dist/knowledge/references/requirements.snapshot.validation.md +333 -0
- package/dist/knowledge/references/roadmap.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/roadmap.phase.config.md +149 -0
- package/dist/knowledge/references/roadmap.references.conventions.md +89 -0
- package/dist/knowledge/references/roadmap.snapshot.config.md +65 -0
- package/dist/knowledge/references/roadmap.snapshot.validation.md +325 -0
- package/dist/knowledge/references/saas.backend.app-config.backend-authored.md +32 -0
- package/dist/knowledge/references/saas.backend.application-initialization.assembly.md +38 -0
- package/dist/knowledge/references/saas.backend.billing.resolution-failure-reasons.md +45 -0
- package/dist/knowledge/references/saas.backend.custom-operation.authoritative-fields.md +53 -0
- package/dist/knowledge/references/saas.backend.custom-operation.transactional-core.md +120 -0
- package/dist/knowledge/references/saas.backend.domain-module.md +237 -0
- package/dist/knowledge/references/saas.backend.email-template.definition.md +69 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-agent-card.md +89 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-task-surface.md +118 -0
- package/dist/knowledge/references/saas.backend.flows-actors.function-tool.md +82 -0
- package/dist/knowledge/references/saas.backend.flows-actors.invoke-agent.md +48 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-read-tool.md +39 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-write-tool.md +67 -0
- package/dist/knowledge/references/saas.backend.pdf-template.bindings.md +52 -0
- package/dist/knowledge/references/saas.backend.pdf-template.definition.md +113 -0
- package/dist/knowledge/references/saas.backend.rate-limit-service.check-policy.md +75 -0
- package/dist/knowledge/references/saas.backend.system-access-service.md +994 -0
- package/dist/knowledge/references/saas.data-seeding.admin-endpoints.md +59 -0
- package/dist/knowledge/references/saas.data-seeding.bootstrap-wiring.md +184 -0
- package/dist/knowledge/references/saas.data-seeding.definition-input.md +95 -0
- package/dist/knowledge/references/saas.data-seeding.modes.md +72 -0
- package/dist/knowledge/references/saas.data-seeding.run-ledger.md +198 -0
- package/dist/knowledge/references/saas.data-seeding.run-status.md +35 -0
- package/dist/knowledge/references/saas.data-seeding.schedule.md +91 -0
- package/dist/knowledge/references/saas.data-seeding.scope-iteration-strategy.md +46 -0
- package/dist/knowledge/references/saas.external-providers.backend-provider-registry.runtime-filter.md +55 -0
- package/dist/knowledge/references/saas.external-providers.document-extraction.applicability.md +26 -0
- package/dist/knowledge/references/saas.external-providers.embeddings.applicability.md +30 -0
- package/dist/knowledge/references/saas.external-providers.llm.model-configuration.md +124 -0
- package/dist/knowledge/references/saas.external-providers.llm.operation-key.md +49 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.configuration.md +265 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.vocabulary.md +148 -0
- package/dist/knowledge/references/saas.frontend.app-shell.hosted-components.md +145 -0
- package/dist/knowledge/references/saas.frontend.chart-view.inserted-declaration.md +80 -0
- package/dist/knowledge/references/saas.frontend.command-menu.omnibox.md +88 -0
- package/dist/knowledge/references/saas.frontend.command-menu.search-resource.md +109 -0
- package/dist/knowledge/references/saas.frontend.component-registration.entry.md +21 -0
- package/dist/knowledge/references/saas.frontend.composite-view.authoring.md +102 -0
- package/dist/knowledge/references/saas.frontend.composite-view.define-helper.md +31 -0
- package/dist/knowledge/references/saas.frontend.domain-module.md +31 -0
- package/dist/knowledge/references/saas.frontend.embedded-resource-descent.md +37 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.per-action-retry-loop.md +115 -0
- package/dist/knowledge/references/saas.frontend.execution-view.definition.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.local-pane.md +109 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.md +55 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-state-contract.md +151 -0
- package/dist/knowledge/references/saas.frontend.execution-view.failure-handling-contract.md +302 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.md +89 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.md +231 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.shell-data-hydrator.md +174 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.md +96 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.resolution.md +45 -0
- package/dist/knowledge/references/saas.frontend.execution-view.outcome-emission-contract.md +71 -0
- package/dist/knowledge/references/saas.frontend.execution-view.participation-and-anchor.md +80 -0
- package/dist/knowledge/references/saas.frontend.execution-view.three-zone-contract.md +147 -0
- package/dist/knowledge/references/saas.frontend.flows-actors-view.md +40 -0
- package/dist/knowledge/references/saas.frontend.form-fields.file-provider-constraints.md +80 -0
- package/dist/knowledge/references/saas.frontend.full-custom-view.definition.md +64 -0
- package/dist/knowledge/references/saas.frontend.inserted-view.identity-bindings-descriptor.md +149 -0
- package/dist/knowledge/references/saas.frontend.operation-key-and-resource-config-like.md +63 -0
- package/dist/knowledge/references/saas.frontend.quick-switcher.scope-field.md +102 -0
- package/dist/knowledge/references/saas.frontend.related-resource-embeds.md +86 -0
- package/dist/knowledge/references/saas.frontend.related-resource-preview.md +23 -0
- package/dist/knowledge/references/saas.frontend.related-resource-sections.md +28 -0
- package/dist/knowledge/references/saas.frontend.resource-header-title.md +43 -0
- package/dist/knowledge/references/saas.frontend.resource-layout-templates.md +215 -0
- package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +531 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +210 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-preset-map.md +39 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.engine-destinations.md +58 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +118 -0
- package/dist/knowledge/references/saas.frontend.view-definition-scope.md +42 -0
- package/dist/knowledge/references/saas.market.generation-agent.md +104 -0
- package/dist/knowledge/references/saas.models.core-resource-operation.md +86 -0
- package/dist/knowledge/references/saas.models.data-mode-read-list.md +395 -0
- package/dist/knowledge/references/saas.models.engine-capabilities.md +114 -0
- package/dist/knowledge/references/saas.models.error-type.md +45 -0
- package/dist/knowledge/references/saas.models.external-data-pipeline.md +162 -0
- package/dist/knowledge/references/saas.models.feature-limit-semantic.md +51 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-configuration.md +127 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-definition.md +115 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-invocation.md +52 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-prompt-spec.md +188 -0
- package/dist/knowledge/references/saas.models.http-api-binding.md +237 -0
- package/dist/knowledge/references/saas.models.navigation.layout.md +149 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-containment.md +22 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-declaration.md +42 -0
- package/dist/knowledge/references/saas.models.polymorphism.optout-business-key.md +62 -0
- package/dist/knowledge/references/saas.models.polymorphism.variant-definition.md +74 -0
- package/dist/knowledge/references/saas.models.provider-capabilities.md +97 -0
- package/dist/knowledge/references/saas.models.rate-limit-configuration.md +67 -0
- package/dist/knowledge/references/saas.models.relationship-handling-contract.md +30 -0
- package/dist/knowledge/references/saas.models.relationship-handling-settings.md +62 -0
- package/dist/knowledge/references/saas.models.relationship-nature-and-models.md +112 -0
- package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +431 -0
- package/dist/knowledge/references/saas.models.resource-config.forwarded-label.md +88 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-api-call.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-base.md +79 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-mcp-exposure.md +49 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-path.md +27 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-union.md +26 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-variant-for-key.md +62 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-configuration.md +124 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-relationships-buckets.md +38 -0
- package/dist/knowledge/references/saas.models.resource-config.resources-registry.md +69 -0
- package/dist/knowledge/references/saas.models.resource-config.searchable-relation.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.system-access-policy.md +121 -0
- package/dist/knowledge/references/saas.models.resource-config.token-generation.md +145 -0
- package/dist/knowledge/references/saas.models.resource-field-identifier.md +25 -0
- package/dist/knowledge/references/saas.models.resource-operation-display-risk.md +77 -0
- package/dist/knowledge/references/saas.models.resource-operation-variant-runtime.md +58 -0
- package/dist/knowledge/references/saas.models.resource-primary-scope.md +36 -0
- package/dist/knowledge/references/saas.models.resource-relationship-access-scope.md +26 -0
- package/dist/knowledge/references/saas.models.resource-relationship-builder-parameters.md +100 -0
- package/dist/knowledge/references/saas.models.resource-relationship-cardinality.md +57 -0
- package/dist/knowledge/references/saas.models.resource-relationship-declaration.md +69 -0
- package/dist/knowledge/references/saas.models.resource-relationship-resolved-semantics.md +60 -0
- package/dist/knowledge/references/saas.models.resource-relationship-schema.md +172 -0
- package/dist/knowledge/references/saas.models.resource-server-instance.md +109 -0
- package/dist/knowledge/references/saas.models.resource-type.md +24 -0
- package/dist/knowledge/references/saas.models.schema-family-builder.md +242 -0
- package/dist/knowledge/references/saas.models.scope-membership.md +143 -0
- package/dist/knowledge/references/saas.models.shared-domain-module.md +36 -0
- package/dist/knowledge/references/saas.models.shared-saas-module.md +36 -0
- package/dist/knowledge/references/saas.public-runtime.contract.md +229 -0
- package/dist/knowledge/references/saas.rag.retrieval-bounds.md +106 -0
- package/dist/knowledge/references/saas.rag.retrieval-refusals.md +89 -0
- package/dist/knowledge/references/saas.rag.retrieval-request.md +130 -0
- package/dist/knowledge/references/saas.rag.retrieval-result.md +147 -0
- package/dist/knowledge/references/saas.rag.retrieval-scores.md +54 -0
- package/dist/knowledge/references/saas.specifications.application-document-fact-specification.contract.md +59 -0
- package/dist/knowledge/references/saas.specifications.application-document-publication.contract.md +74 -0
- package/dist/knowledge/references/saas.specifications.assurance-document-blueprint.contract.md +1158 -0
- package/dist/knowledge/references/saas.specifications.assurance-program.contract.md +2602 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.catalog-spec-shared.md +180 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.discriminated-union.md +138 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-rating.md +47 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-article.md +49 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-blog-posting.md +62 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-breadcrumb-list.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-faq-page.md +51 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-organization.md +48 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-product.md +59 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-review.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-website.md +46 -0
- package/dist/knowledge/references/saas.specifications.companion-exports.contract.md +530 -0
- package/dist/knowledge/references/saas.specifications.composite-view-specification.md +49 -0
- package/dist/knowledge/references/saas.specifications.error-message-specification.md +92 -0
- package/dist/knowledge/references/saas.specifications.family-specifications.md +109 -0
- package/dist/knowledge/references/saas.specifications.feature-specification.md +93 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-factory.md +113 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-model.md +366 -0
- package/dist/knowledge/references/saas.specifications.resource-frontend-configuration-aspect.md +41 -0
- package/dist/knowledge/references/saas.specifications.resource-operation-spec.md +1978 -0
- package/dist/knowledge/references/saas.specifications.resource-pdf-template-spec.md +58 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-code-handling.md +49 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-config.md +156 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-factory.md +171 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-config-type.md +54 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-prose.md +171 -0
- package/dist/knowledge/references/saas.website.astro.bridge.md +262 -0
- package/dist/knowledge/references/saas.website.astro.head-renderer.md +271 -0
- package/dist/knowledge/references/saas.website.astro.headers-renderer.md +41 -0
- package/dist/knowledge/references/saas.website.astro.i18n-helper.md +121 -0
- package/dist/knowledge/references/saas.website.astro.label-key-collector.md +117 -0
- package/dist/knowledge/references/saas.website.astro.label-loader.md +377 -0
- package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +46 -0
- package/dist/knowledge/references/saas.website.astro.pick-labels-for-page.md +90 -0
- package/dist/knowledge/references/saas.website.astro.robots-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.astro.runtime-helper.md +187 -0
- package/dist/knowledge/references/saas.website.astro.site-context.md +141 -0
- package/dist/knowledge/references/saas.website.astro.sitemap-coverage.md +188 -0
- package/dist/knowledge/references/saas.website.astro.structured-data-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.blog.bridge.md +396 -0
- package/dist/knowledge/references/saas.website.blog.collection-config.md +180 -0
- package/dist/knowledge/references/saas.website.blog.frontmatter.md +116 -0
- package/dist/knowledge/references/saas.website.blog.head-renderer.md +292 -0
- package/dist/knowledge/references/saas.website.blog.mdx-provider.md +100 -0
- package/dist/knowledge/references/saas.website.blog.post-renderer.md +291 -0
- package/dist/knowledge/references/saas.website.design-tokens.bundle.md +29 -0
- package/dist/knowledge/references/saas.website.design-tokens.colors.md +64 -0
- package/dist/knowledge/references/saas.website.design-tokens.radius.md +38 -0
- package/dist/knowledge/references/saas.website.factories.define-page-manifest.md +98 -0
- package/dist/knowledge/references/saas.website.factories.define-section.md +128 -0
- package/dist/knowledge/references/saas.website.label-keys.compose-helper.md +36 -0
- package/dist/knowledge/references/saas.website.label-keys.format.md +67 -0
- package/dist/knowledge/references/saas.website.label-pack.validator.md +206 -0
- package/dist/knowledge/references/saas.website.page-layout.component.md +217 -0
- package/dist/knowledge/references/saas.website.page-manifest.meta-label-keys.md +47 -0
- package/dist/knowledge/references/saas.website.page-manifest.route-path.md +49 -0
- package/dist/knowledge/references/saas.website.page-manifest.schema.md +186 -0
- package/dist/knowledge/references/saas.website.page-manifest.seo.md +46 -0
- package/dist/knowledge/references/saas.website.page.context.md +57 -0
- package/dist/knowledge/references/saas.website.primitives.button.md +123 -0
- package/dist/knowledge/references/saas.website.primitives.heading.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.image.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.internal-button.md +151 -0
- package/dist/knowledge/references/saas.website.primitives.internal-link.md +193 -0
- package/dist/knowledge/references/saas.website.primitives.link.md +78 -0
- package/dist/knowledge/references/saas.website.primitives.text.md +82 -0
- package/dist/knowledge/references/saas.website.refs.page.md +56 -0
- package/dist/knowledge/references/saas.website.refs.section.md +57 -0
- package/dist/knowledge/references/saas.website.root-config.navigation.md +37 -0
- package/dist/knowledge/references/saas.website.root-config.schema.md +192 -0
- package/dist/knowledge/references/saas.website.root-config.seo.md +98 -0
- package/dist/knowledge/references/saas.website.routing.localized-path.md +84 -0
- package/dist/knowledge/references/saas.website.runtime.context.md +174 -0
- package/dist/knowledge/references/saas.website.section.component.md +138 -0
- package/dist/knowledge/references/saas.website.section.context.md +63 -0
- package/dist/knowledge/references/saas.website.sections.category-enum.md +72 -0
- package/dist/knowledge/references/saas.website.sections.definition-schema.md +121 -0
- package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +37 -0
- package/dist/knowledge/references/saas.website.seo.robots-config.md +106 -0
- package/dist/knowledge/references/saas.website.seo.sitemap-config.md +73 -0
- package/dist/knowledge/references/saas.website.structured-data.payload-shape.md +71 -0
- package/dist/knowledge/references/saas.website.use-label-by-key.hook.md +45 -0
- package/dist/knowledge/references/saas.website.use-label.hook.md +82 -0
- package/dist/knowledge/references/saas.website.use-page.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-runtime.hook.md +36 -0
- package/dist/knowledge/references/saas.website.use-section.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-tokens.hook.md +32 -0
- package/dist/knowledge/references/vision.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/vision.constraint.config.md +66 -0
- package/dist/knowledge/references/vision.idea.config.md +45 -0
- package/dist/knowledge/references/vision.mission.config.md +46 -0
- package/dist/knowledge/references/vision.problem.config.md +51 -0
- package/dist/knowledge/references/vision.references.conventions.md +115 -0
- package/dist/knowledge/references/vision.snapshot.config.md +85 -0
- package/dist/knowledge/references/vision.snapshot.validation.md +226 -0
- package/dist/knowledge/references/vision.success-criterion.config.md +60 -0
- package/dist/knowledge/references/zod.decorators.chainable-runtime.md +550 -0
- package/dist/knowledge/references/zod.decorators.conditional-visibility.md +104 -0
- package/dist/knowledge/references/zod.decorators.data-categories.md +197 -0
- package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +436 -0
- package/dist/knowledge/references/zod.decorators.display-edit-modes.md +174 -0
- package/dist/knowledge/references/zod.decorators.enums.frontend-handling.md +101 -0
- package/dist/knowledge/references/zod.decorators.field-spec-params.md +317 -0
- package/dist/knowledge/references/zod.decorators.file-generation.md +36 -0
- package/dist/knowledge/references/zod.decorators.file-rag-source.md +56 -0
- package/dist/knowledge/references/zod.decorators.file-schema.md +319 -0
- package/dist/knowledge/references/zod.decorators.foreign-key-display-mode.md +83 -0
- package/dist/knowledge/references/zod.decorators.per-primitive-ui.md +459 -0
- package/dist/knowledge/references/zod.decorators.primitive-ui.md +123 -0
- package/dist/knowledge/references/zod.decorators.rag-source.md +164 -0
- package/dist/knowledge/references/zod.decorators.schema-metadata.md +122 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +152 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-params.md +314 -0
- package/dist/knowledge/references/zod.decorators.structural-lifecycle-params.md +529 -0
- package/dist/knowledge/references/zod.factories.bigdecimal.md +155 -0
- package/dist/knowledge/references/zod.factories.code.md +127 -0
- package/dist/knowledge/references/zod.factories.duration.md +246 -0
- package/dist/knowledge/references/zod.factories.money.md +166 -0
- package/dist/knowledge/references/zod.factories.phone.md +88 -0
- package/dist/knowledge/references/zod.factories.range.md +174 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +15 -0
- package/dist/knowledge/registries/framework-topics.json +5212 -0
- package/dist/knowledge/registries/playbooks.json +488 -0
- package/dist/knowledge/registries/source-tags.json +7664 -0
- package/dist/knowledge/rules/resource-schema-awareness.md +77 -0
- package/dist/knowledge/skills/INDEX.md +349 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/examples/domain-use-case-and-admin-task.example.md +49 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/references/source-and-ownership-routing.md +52 -0
- package/dist/knowledge/skills/application-database-migrations/SKILL.md +218 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-application-database-api.md +84 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-migration-change-risk-api.md +37 -0
- package/dist/knowledge/skills/application-database-migrations/references/migration-refusals.md +64 -0
- package/dist/knowledge/skills/application-database-migrations/references/postgresql-vs-mongodb-obligations.md +34 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +323 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/references/framework-unit-narrowing-declaration-api.md +84 -0
- package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +324 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/backend-di-routing.md +7 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/framework-backend-bootstrap-api.md +276 -0
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +374 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-error-handling-api.md +118 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-operation-base-and-path-api.md +107 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-transactional-core-api.md +134 -0
- package/dist/knowledge/skills/backend-custom-operation/references/operation-file-conventions.md +10 -0
- package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +192 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/brand-authoring-decisions.md +55 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-asset-api.md +184 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-snapshot-api.md +279 -0
- package/dist/knowledge/skills/compliance-document-authoring/SKILL.md +346 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-governance.md +160 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +518 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-service-terms.md +158 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-fact-specification-contract.md +95 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-publication-contract.md +100 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-assurance-document-blueprint-contract.md +1210 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-governed-document-after-drafting.md +40 -0
- package/dist/knowledge/skills/config-app-shell/SKILL.md +698 -0
- package/dist/knowledge/skills/config-app-shell/references/app-shell-surfaces.md +5 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-api.md +415 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-hosted-components-api.md +170 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-command-menu-omnibox-api.md +212 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-quick-switcher-scope-field-api.md +178 -0
- package/dist/knowledge/skills/config-design-system/SKILL.md +424 -0
- package/dist/knowledge/skills/config-design-system/references/design-system-file.md +10 -0
- package/dist/knowledge/skills/config-design-system/references/framework-design-system-configuration-api.md +77 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-profile-api.md +200 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-runtime-policy-api.md +68 -0
- package/dist/knowledge/skills/config-design-system/references/framework-surface-policy-api.md +1212 -0
- package/dist/knowledge/skills/config-design-system/references/surface-policy-authoring.md +92 -0
- package/dist/knowledge/skills/config-navigation/SKILL.md +249 -0
- package/dist/knowledge/skills/config-navigation/references/framework-navigation-layout-api.md +152 -0
- package/dist/knowledge/skills/config-navigation/references/navigation-zones.md +5 -0
- package/dist/knowledge/skills/config-saas/SKILL.md +209 -0
- package/dist/knowledge/skills/config-saas/references/framework-provider-capabilities-api.md +221 -0
- package/dist/knowledge/skills/config-saas/references/framework-wildo-saas-config-api.md +408 -0
- package/dist/knowledge/skills/config-saas/references/saas-config-scope.md +9 -0
- package/dist/knowledge/skills/config-saas-backend/SKILL.md +183 -0
- package/dist/knowledge/skills/config-saas-backend/references/framework-backend-authored-config-api.md +40 -0
- package/dist/knowledge/skills/configure-billing/SKILL.md +261 -0
- package/dist/knowledge/skills/configure-billing/references/config-chain-and-failure-map.md +90 -0
- package/dist/knowledge/skills/configure-billing/references/example-backend-provider-module-shape.md +122 -0
- package/dist/knowledge/skills/configure-billing/references/example-provider-contribution-and-backend-config.md +48 -0
- package/dist/knowledge/skills/configure-billing/references/framework-backend-provider-reachability-api.md +69 -0
- package/dist/knowledge/skills/configure-billing/references/framework-billing-resolution-failure-api.md +57 -0
- package/dist/knowledge/skills/email-add-template/SKILL.md +439 -0
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +9 -0
- package/dist/knowledge/skills/email-add-template/references/framework-email-template-api.md +72 -0
- package/dist/knowledge/skills/email-definition-wiring/SKILL.md +62 -0
- package/dist/knowledge/skills/email-labels-authoring/SKILL.md +64 -0
- package/dist/knowledge/skills/email-template-authoring/SKILL.md +62 -0
- package/dist/knowledge/skills/engine-component-registration/SKILL.md +257 -0
- package/dist/knowledge/skills/engine-component-registration/references/component-registration-file.md +7 -0
- package/dist/knowledge/skills/engine-component-registration/references/framework-component-registration-api.md +24 -0
- package/dist/knowledge/skills/engine-product-definitions/SKILL.md +429 -0
- package/dist/knowledge/skills/engine-product-definitions/references/framework-engine-product-definitions-api.md +287 -0
- package/dist/knowledge/skills/engine-product-definitions/references/product-registry-scope.md +5 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/SKILL.md +491 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-flows-actors-a2a-contract.md +227 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-named-a2a-agents-contract.md +143 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +368 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/examples/todo-assistant.example.md +226 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-tool-api.md +208 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-view-api.md +286 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +376 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-definition-api.md +262 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-invocation-api.md +130 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-prompt-spec-api.md +214 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-operation-and-model-api.md +195 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/operation-key-selection.md +60 -0
- package/dist/knowledge/skills/frontend-cdn-publish/SKILL.md +237 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/cloudflare-and-operator-setup.md +56 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/framework-cdn-config-api.md +176 -0
- package/dist/knowledge/skills/i18n-label-generation/SKILL.md +261 -0
- package/dist/knowledge/skills/i18n-label-generation/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-label-generation/references/label-placement.md +7 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +269 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/i18n-routing.md +9 -0
- package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +245 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/translation-workflow.md +17 -0
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +646 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-application-database-api.md +77 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-backing-services-api.md +282 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +265 -0
- package/dist/knowledge/skills/infra-environment-config/references/infra-config-files.md +7 -0
- package/dist/knowledge/skills/journey-approve/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-bootstrap-scope/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-next/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-report/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-run/SKILL.md +55 -0
- package/dist/knowledge/skills/journey-status/SKILL.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +370 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/initialization-recovery-recipe.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/local-environment-troubleshooting.md +409 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +247 -0
- package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +474 -0
- package/dist/knowledge/skills/market-add-feature-benefit/references/framework-feature-benefit-api.md +139 -0
- package/dist/knowledge/skills/market-alternatives/SKILL.md +543 -0
- package/dist/knowledge/skills/market-authoring-overview/SKILL.md +354 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-references-api.md +138 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-snapshot-api.md +129 -0
- package/dist/knowledge/skills/market-category/SKILL.md +290 -0
- package/dist/knowledge/skills/market-channels/SKILL.md +361 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +2752 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +2443 -0
- package/dist/knowledge/skills/market-generation-cli/SKILL.md +1484 -0
- package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +1230 -0
- package/dist/knowledge/skills/market-icp/SKILL.md +625 -0
- package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +352 -0
- package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/market-message-templates-authoring/references/framework-message-template-api.md +1439 -0
- package/dist/knowledge/skills/market-persona/SKILL.md +407 -0
- package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +392 -0
- package/dist/knowledge/skills/market-positioning-authoring/references/framework-positioning-api.md +97 -0
- package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +665 -0
- package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +620 -0
- package/dist/knowledge/skills/market-scoring-interpretation/references/framework-scoring-api.md +291 -0
- package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +1706 -0
- package/dist/knowledge/skills/market-snapshot-validation/references/framework-snapshot-validation-api.md +1228 -0
- package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +260 -0
- package/dist/knowledge/skills/market-triggers-and-journey/SKILL.md +579 -0
- package/dist/knowledge/skills/module-companion-exports/SKILL.md +318 -0
- package/dist/knowledge/skills/module-companion-exports/references/companion-exports-by-package.md +544 -0
- package/dist/knowledge/skills/module-registration/SKILL.md +212 -0
- package/dist/knowledge/skills/module-registration/references/framework-domain-modules-api.md +366 -0
- package/dist/knowledge/skills/module-registration/references/registry-files.md +9 -0
- package/dist/knowledge/skills/module-relationships/SKILL.md +523 -0
- package/dist/knowledge/skills/module-relationships/references/cross-resource-fk-checklist.md +7 -0
- package/dist/knowledge/skills/module-relationships/references/framework-resource-relationship-authoring-api.md +738 -0
- package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +174 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-api.md +203 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-spec-api.md +62 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +239 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-file-provider-constraints-api.md +90 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-provider-module-api.md +50 -0
- package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +652 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/framework-rate-limit-policy-api.md +182 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/scope-key-and-bucket-conventions.md +137 -0
- package/dist/knowledge/skills/resource-add-field/SKILL.md +272 -0
- package/dist/knowledge/skills/resource-add-field/examples/add-priority-field-to-todos.example.md +153 -0
- package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +845 -0
- package/dist/knowledge/skills/resource-add-module/SKILL.md +322 -0
- package/dist/knowledge/skills/resource-add-module/references/framework-new-module-wiring-api.md +67 -0
- package/dist/knowledge/skills/resource-add-module/references/module-scaffold-layout.md +15 -0
- package/dist/knowledge/skills/resource-add-resource/SKILL.md +222 -0
- package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +540 -0
- package/dist/knowledge/skills/resource-add-resource/references/scaffold-surfaces-checklist.md +25 -0
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +370 -0
- package/dist/knowledge/skills/resource-config-wiring/references/config-change-routing.md +11 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +622 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-operation-scope-enums-api.md +248 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +1769 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +1209 -0
- package/dist/knowledge/skills/resource-custom-view/SKILL.md +228 -0
- package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +693 -0
- package/dist/knowledge/skills/resource-external-data/SKILL.md +349 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-external-data-pipeline-api.md +187 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-http-api-binding-api.md +261 -0
- package/dist/knowledge/skills/resource-external-data/references/lane-selection.md +49 -0
- package/dist/knowledge/skills/resource-external-data/references/pipeline-destination-schema.md +43 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/SKILL.md +308 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-named-mcp-servers-contract.md +166 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-resource-mcp-exposure-contract.md +63 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-catalogue-withdrawal-and-verification.md +77 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-client-registration-postures.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/SKILL.md +424 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/corpus-field-selection.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-embeddings-capability-api.md +261 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-file-rag-source-api.md +117 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-retrieval-api.md +597 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-source-decorator-api.md +181 -0
- package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +318 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/add-enum-field-with-ui.example.md +132 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/basic-resource-schema.example.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/decorator-layer-map.md +63 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/field-type-selection.md +70 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +559 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-personal-data-category-api.md +245 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-polymorphic-resources-api.md +147 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-schema-family-api.md +247 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +164 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-structural-params-api.md +327 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +1286 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +1080 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/polymorphic-per-scope-resources.md +75 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/schema-variants-and-discriminators.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/shared-layer-decorator-checklist.md +69 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/special-factories.md +45 -0
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +389 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-conditional-visibility-api.md +106 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-display-edit-modes-api.md +176 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-enum-frontend-handling-api.md +103 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-foreign-key-ui-api.md +97 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +839 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-per-primitive-ui-api.md +461 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-primitive-ui-api.md +125 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-related-resource-embeds-api.md +245 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-resource-layout-templates-api.md +302 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/ui-layer-boundaries.md +13 -0
- package/dist/knowledge/skills/seeding-authoring/SKILL.md +569 -0
- package/dist/knowledge/skills/seeding-authoring/references/data-seeding-mode-picker.md +154 -0
- package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +176 -0
- package/dist/knowledge/skills/seeding-operations/SKILL.md +505 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-admin-runbook.md +337 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-cron-scheduler.md +171 -0
- package/dist/knowledge/skills/seeding-operations/references/framework-data-seeding-operations-api.md +662 -0
- package/dist/knowledge/skills/settings-placement-authoring/SKILL.md +134 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +65 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +127 -0
- package/dist/knowledge/skills/spec-catalog-authoring/SKILL.md +726 -0
- package/dist/knowledge/skills/spec-catalog-authoring/references/catalog-spec-pattern-overview.md +242 -0
- package/dist/knowledge/skills/spec-companion-exports/SKILL.md +362 -0
- package/dist/knowledge/skills/spec-companion-exports/references/companion-export-checklist.md +8 -0
- package/dist/knowledge/skills/spec-companion-exports/references/framework-companion-exports-contract-api.md +533 -0
- package/dist/knowledge/skills/spec-component-update/SKILL.md +315 -0
- package/dist/knowledge/skills/spec-component-update/references/component-spec-props.md +8 -0
- package/dist/knowledge/skills/spec-component-update/references/framework-frontend-component-spec-api.md +481 -0
- package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +283 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/composite-spec-sections.md +5 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/framework-composite-view-specification-api.md +51 -0
- package/dist/knowledge/skills/spec-family-update/SKILL.md +300 -0
- package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +13 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-error-message-specifications-api.md +108 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-family-specifications-api.md +111 -0
- package/dist/knowledge/skills/spec-feature-update/SKILL.md +306 -0
- package/dist/knowledge/skills/spec-feature-update/references/feature-spec-scope.md +5 -0
- package/dist/knowledge/skills/spec-feature-update/references/framework-feature-specification-api.md +95 -0
- package/dist/knowledge/skills/spec-resource-update/SKILL.md +220 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-field-spec-params-api.md +319 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-spec-resource-contracts-api.md +2610 -0
- package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +12 -0
- package/dist/knowledge/skills/spec-update-after-change/SKILL.md +195 -0
- package/dist/knowledge/skills/spec-update-after-change/references/framework-spec-factory-api.md +173 -0
- package/dist/knowledge/skills/spec-update-after-change/references/spec-maintenance-by-surface.md +33 -0
- package/dist/knowledge/skills/spec-update-after-change/references/surface-to-spec-routing.md +14 -0
- package/dist/knowledge/skills/views-add-composite-view/SKILL.md +259 -0
- package/dist/knowledge/skills/views-add-composite-view/references/composite-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-composite-view/references/framework-inserted-view-identity-api.md +151 -0
- package/dist/knowledge/skills/views-add-custom-view/SKILL.md +225 -0
- package/dist/knowledge/skills/views-add-custom-view/references/custom-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-custom-view/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-app-level/SKILL.md +201 -0
- package/dist/knowledge/skills/views-app-level/references/app-level-views-routing.md +9 -0
- package/dist/knowledge/skills/views-app-level/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +264 -0
- package/dist/knowledge/skills/views-chart-authoring/references/chart-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-chart-view-contracts-api.md +82 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-composite-authoring/SKILL.md +302 -0
- package/dist/knowledge/skills/views-composite-authoring/references/composite-embedding-checklist.md +23 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-composite-view-contracts-api.md +133 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-execution-authoring/SKILL.md +209 -0
- package/dist/knowledge/skills/views-execution-authoring/references/execution-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-execution-view-contracts-api.md +389 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/website-anonymous-session/SKILL.md +444 -0
- package/dist/knowledge/skills/website-blog-authoring/SKILL.md +587 -0
- package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +1426 -0
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +553 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/example-website-button-override.md +52 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +357 -0
- package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +511 -0
- package/dist/knowledge/skills/website-factory-advanced/SKILL.md +376 -0
- package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +304 -0
- package/dist/knowledge/skills/website-label-pack/SKILL.md +390 -0
- package/dist/knowledge/skills/website-layout-overrides/SKILL.md +461 -0
- package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +264 -0
- package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +414 -0
- package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +366 -0
- package/dist/knowledge/skills/website-page-authoring/SKILL.md +420 -0
- package/dist/knowledge/skills/website-page-variants/SKILL.md +256 -0
- package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +302 -0
- package/dist/knowledge/skills/website-section-contact/SKILL.md +950 -0
- package/dist/knowledge/skills/website-section-contact/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-cta/SKILL.md +822 -0
- package/dist/knowledge/skills/website-section-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-faq/SKILL.md +917 -0
- package/dist/knowledge/skills/website-section-faq/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +878 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +895 -0
- package/dist/knowledge/skills/website-section-feature-detail/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-footer-cta/SKILL.md +814 -0
- package/dist/knowledge/skills/website-section-footer-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-hero/SKILL.md +944 -0
- package/dist/knowledge/skills/website-section-hero/references/define-website-section-api.md +583 -0
- package/dist/knowledge/skills/website-section-pricing/SKILL.md +934 -0
- package/dist/knowledge/skills/website-section-pricing/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-social-proof/SKILL.md +912 -0
- package/dist/knowledge/skills/website-section-social-proof/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +624 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/aeo-api.md +633 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +193 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +790 -0
- package/dist/knowledge/topic-index.json +17510 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -0
package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md
ADDED
|
@@ -0,0 +1,1209 @@
|
|
|
1
|
+
# System-context reads & writes and the `systemAccessPolicy` opt-in (source)
|
|
2
|
+
|
|
3
|
+
Read this when:
|
|
4
|
+
|
|
5
|
+
- you hit an `ErrorType.CONFIGURATION` error (`system_context_access_not_permitted`)
|
|
6
|
+
on a resource your backend — or the framework — reads with `readAsSystem` /
|
|
7
|
+
`listAsSystem`, or writes with `createAsSystem` / `updateAsSystem` /
|
|
8
|
+
`updateManyAsSystem`;
|
|
9
|
+
- you are writing backend code that must read a resource **outside the caller's
|
|
10
|
+
scope** (a config load, a cross-organization lookup) and a normal scoped read
|
|
11
|
+
returns nothing because the caller isn't a member of that scope;
|
|
12
|
+
- you are writing an in-process backend flow that must **persist a system resource
|
|
13
|
+
whose backend-only or context-FK fields the client-shaped request DTO strips**
|
|
14
|
+
(e.g. registration writing `USER_CREDENTIALS` `{ userId, passwordHash }`, where
|
|
15
|
+
there is no request context to seed `userId` and `passwordHash` is
|
|
16
|
+
`.isBackendOnly()`), and a plain `servicesRegistryHandler.create/update` drops
|
|
17
|
+
those fields (a required-path save crash, or silent data loss);
|
|
18
|
+
- you are deciding whether a new resource should be accessible system-context at all.
|
|
19
|
+
|
|
20
|
+
## What a "system read" is
|
|
21
|
+
|
|
22
|
+
`readAsSystem` / `listAsSystem` (on `SystemAccessBackendService`, from
|
|
23
|
+
`@wildo-ai/saas-backend-lib`) read with a synthesised super-admin execution context.
|
|
24
|
+
They **bypass the caller's scope + role ACL** — reach for them only when the
|
|
25
|
+
originating request genuinely cannot satisfy the resource's ACL yet the read is
|
|
26
|
+
legitimate (e.g. loading an org's webhook/SSO config during a request the config
|
|
27
|
+
owner didn't make, or finding a user's pending invitations across every
|
|
28
|
+
organization).
|
|
29
|
+
|
|
30
|
+
A system read does not REMOVE authorization — it RELOCATES it onto your code. You
|
|
31
|
+
MUST enforce an explicit alternative check (consumable-token validity,
|
|
32
|
+
email-ownership match, or "this is a userless internal config load") and project
|
|
33
|
+
only the fields safe to surface — the result is the FULL record, not the caller's
|
|
34
|
+
filtered view.
|
|
35
|
+
|
|
36
|
+
## What a "system write" is
|
|
37
|
+
|
|
38
|
+
`createAsSystem` / `updateAsSystem` / `updateManyAsSystem` are the MUTATION
|
|
39
|
+
siblings. Beyond the same ACL-bypass, they solve a specific problem: the repository
|
|
40
|
+
strict-parses every write against a **client-shaped** request DTO that drops
|
|
41
|
+
`.isBackendOnly()` fields and the context-auto-populated FKs (`userId`,
|
|
42
|
+
`organizationId`, …). On the HTTP path those are re-supplied afterwards (from the
|
|
43
|
+
URL context / initiator identity). An in-process caller has neither, so a plain
|
|
44
|
+
write silently loses them. The trusted-write primitives re-attach EXACTLY those
|
|
45
|
+
DTO-stripped fields (derived from the resource schema — never caller-supplied)
|
|
46
|
+
after the strict parse, so the payload persists faithfully. Use them for trusted
|
|
47
|
+
engine flows that write system resources directly (registration, provisioning);
|
|
48
|
+
they run the normal service pipeline (feature gates, hooks, events), just under a
|
|
49
|
+
system context. Same discipline as reads: only trusted engine code can reach them,
|
|
50
|
+
and the calling flow owns the real authorization decision.
|
|
51
|
+
|
|
52
|
+
## Two halves: opt the resource in, then call
|
|
53
|
+
|
|
54
|
+
### 1. Opt-in — resource config (`shared-lib`), fail-closed
|
|
55
|
+
|
|
56
|
+
A resource is NOT readable system-context unless its `*.resources-config.ts`
|
|
57
|
+
declares `systemAccessPolicy` with the verb set to `ALLOWED`. Omit it (the default)
|
|
58
|
+
and the call throws `ErrorType.CONFIGURATION`. Declare ONLY the verb you need, and
|
|
59
|
+
comment the alternative authorization the caller enforces.
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// inside createResourceConfiguration_Initialization({ ... })
|
|
63
|
+
isSystemResource: true,
|
|
64
|
+
// Declare ONLY the verb(s) you call. Read verbs: read / list. Write verbs:
|
|
65
|
+
// create / update / updateMany. Everything omitted defaults to FORBIDDEN.
|
|
66
|
+
systemAccessPolicy: { read: ResourceSystemAccessMode.ALLOWED }, // + list / create / update / updateMany as needed
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The enum + policy type contract (source):
|
|
70
|
+
|
|
71
|
+
## Import Origins
|
|
72
|
+
|
|
73
|
+
- `@wildo-ai/saas-models`
|
|
74
|
+
|
|
75
|
+
## Source Excerpts
|
|
76
|
+
|
|
77
|
+
### Origin Package: `@wildo-ai/saas-models`
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
*
|
|
81
|
+
* Access mode for the ACL-bypassing system-context reads
|
|
82
|
+
* (`SystemAccessBackendService.readAsSystem` / `listAsSystem`, from
|
|
83
|
+
* `@wildo-ai/saas-backend-lib`).
|
|
84
|
+
*
|
|
85
|
+
* Those primitives run with a synthesised super-admin execution context and
|
|
86
|
+
* therefore SKIP the caller's scope and role checks entirely. A resource is
|
|
87
|
+
* readable that way ONLY if its resource configuration opts the verb in. Any
|
|
88
|
+
* verb left undeclared defaults to `FORBIDDEN`: a system read of a resource
|
|
89
|
+
* that has not opted in throws `ErrorType.CONFIGURATION` — the framework is
|
|
90
|
+
* fail-closed here by construction.
|
|
91
|
+
*/
|
|
92
|
+
export enum ResourceSystemAccessMode {
|
|
93
|
+
/** The verb's system-context primitive is rejected for this resource (default). */
|
|
94
|
+
FORBIDDEN = 'FORBIDDEN',
|
|
95
|
+
/** The verb's system-context primitive is permitted for this resource. */
|
|
96
|
+
ALLOWED = 'ALLOWED',
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Per-resource opt-in policy for the ACL-bypassing system-context primitives
|
|
101
|
+
* on `SystemAccessBackendService`: the reads (`readAsSystem` / `listAsSystem`)
|
|
102
|
+
* and the trusted writes (`createAsSystem` / `updateAsSystem` /
|
|
103
|
+
* `updateManyAsSystem`).
|
|
104
|
+
*
|
|
105
|
+
* A system-context call does not REMOVE the authorization decision — it
|
|
106
|
+
* RELOCATES it from the resource ACL onto the calling service, which MUST
|
|
107
|
+
* enforce an explicit alternative check (e.g. consumable-token or
|
|
108
|
+
* email-ownership matching). Declaring this policy is the data owner's
|
|
109
|
+
* statement that such a bypass is permissible at all, and for which verb. An
|
|
110
|
+
* absent policy — or a verb set to (or left defaulting to) `FORBIDDEN` — makes
|
|
111
|
+
* the primitive throw.
|
|
112
|
+
*
|
|
113
|
+
* The WRITE verbs additionally let a trusted in-process caller persist the
|
|
114
|
+
* fields the client-shaped request DTO strips — `.isBackendOnly()` material
|
|
115
|
+
* (e.g. a credential `passwordHash`) and the context-auto-populated FKs (e.g.
|
|
116
|
+
* `userId` on a system resource that has no HTTP surface to seed it) — by
|
|
117
|
+
* re-attaching exactly those fields after the strict parse. They are the
|
|
118
|
+
* sanctioned path for engine flows like registration that must write system
|
|
119
|
+
* resources directly; opting a verb in is the data owner's acknowledgement that
|
|
120
|
+
* a super-admin-context mutation of this resource is legitimate.
|
|
121
|
+
*
|
|
122
|
+
* Caveats a system-context call inherits (it runs as super-admin), to weigh
|
|
123
|
+
* before opting in:
|
|
124
|
+
* - a READ returns the FULL record — every field, including ones a normal
|
|
125
|
+
* caller's role / field-visibility would hide — so never forward the result
|
|
126
|
+
* verbatim to an under-privileged caller; project only what is safe.
|
|
127
|
+
* - a WRITE bypasses the caller's scope + role ACL, so the calling service
|
|
128
|
+
* owns the authorization decision (only trusted engine code can reach the
|
|
129
|
+
* primitive — it is never exposed to an HTTP payload).
|
|
130
|
+
* - feature flags do not gate it (it is an internal request).
|
|
131
|
+
* - the policy is RESOURCE-LEVEL: for a polymorphic resource it is shared by
|
|
132
|
+
* every scope variant (declare it once on the shared config).
|
|
133
|
+
*
|
|
134
|
+
* Intentionally DISTINCT from `isSystemResource`: marking a resource as
|
|
135
|
+
* framework infrastructure does NOT imply that an ACL bypass is acceptable
|
|
136
|
+
* for its data. Keep the two concepts separate.
|
|
137
|
+
*/
|
|
138
|
+
export type ResourceSystemAccessPolicy = {
|
|
139
|
+
/** Governs `readAsSystem`. Omitted ⇒ FORBIDDEN. */
|
|
140
|
+
read?: ResourceSystemAccessMode,
|
|
141
|
+
/** Governs `listAsSystem`. Omitted ⇒ FORBIDDEN. */
|
|
142
|
+
list?: ResourceSystemAccessMode,
|
|
143
|
+
/** Governs `createAsSystem`. Omitted ⇒ FORBIDDEN. */
|
|
144
|
+
create?: ResourceSystemAccessMode,
|
|
145
|
+
/** Governs `updateAsSystem`. Omitted ⇒ FORBIDDEN. */
|
|
146
|
+
update?: ResourceSystemAccessMode,
|
|
147
|
+
/** Governs `updateManyAsSystem`. Omitted ⇒ FORBIDDEN. */
|
|
148
|
+
updateMany?: ResourceSystemAccessMode,
|
|
149
|
+
// NOTE: there is deliberately NO `delete` verb here — there is no `deleteAsSystem` primitive. A row is
|
|
150
|
+
// removed either through its own DELETE operation ACL (e.g. an owner-facing `API_CALL` DELETE under the
|
|
151
|
+
// USER_SELF owner filter) or by the `onParentDelete` composition cascade (which deletes at the raw
|
|
152
|
+
// repository layer, variant-agnostic — see `deleteChildrenImmediate`). If you find yourself reaching
|
|
153
|
+
// for `systemAccessPolicy.delete`, model the removal as one of those two instead.
|
|
154
|
+
/**
|
|
155
|
+
* Governs the impersonalization see-through reads (`readRetainedAsSystem` /
|
|
156
|
+
* `listRetainedAsSystem`) — the privileged, audited path that reveals
|
|
157
|
+
* `retentionStatus = RETAINED` rows hidden-by-default. Omitted ⇒ FORBIDDEN.
|
|
158
|
+
* Auto-derived to `ALLOWED` by the factory when a resource opts into
|
|
159
|
+
* `retentionPolicy`; never authored by hand in the common case.
|
|
160
|
+
*
|
|
161
|
+
* **LIVE.** `readRetainedAsSystem` / `listRetainedAsSystem` exist and are enforced: the verb is
|
|
162
|
+
* asserted fail-closed, a privileged human role is required, and every reveal emits a
|
|
163
|
+
* human-attributed `RETAINED_DATA_ACCESS` audit event. (This block previously said the primitives
|
|
164
|
+
* were "wired in a later phase" — false since the M5b work landed.)
|
|
165
|
+
*/
|
|
166
|
+
seeRetained?: ResourceSystemAccessMode,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* May this resource's rows be swept into a SUBJECT EXPORT bundle (GDPR Art. 15 / Art. 20)?
|
|
170
|
+
*
|
|
171
|
+
* Fail-closed by omission, like every other verb here. A subject export reads across the whole
|
|
172
|
+
* child-direction graph of its subject, so without an explicit opt-in a resource could be
|
|
173
|
+
* disclosed to a data subject because it merely sits on an edge — nobody having decided that its
|
|
174
|
+
* contents are appropriate to hand over.
|
|
175
|
+
*
|
|
176
|
+
* **The refusal is LOUD, not a silent skip.** When an edge the classifier marked for inclusion
|
|
177
|
+
* belongs to a resource that has not opted in, the export REFUSES and names it. Silently dropping
|
|
178
|
+
* it would produce an access bundle that is incomplete without saying so — a disclosure failure
|
|
179
|
+
* wearing the appearance of a successful response, which is the same class of lie as the routed
|
|
180
|
+
* export operations this capability replaced. Refusing is a one-line fix per resource; a silent
|
|
181
|
+
* omission is undetectable.
|
|
182
|
+
*
|
|
183
|
+
* NOT derived from `portabilityPolicy`: declaring where fields came from (Art. 20 scoping) and
|
|
184
|
+
* consenting to be disclosed at all are different decisions, and a resource may legitimately want
|
|
185
|
+
* the first without the second.
|
|
186
|
+
*/
|
|
187
|
+
exportSubject?: ResourceSystemAccessMode,
|
|
188
|
+
};
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### 2. Call — backend code
|
|
192
|
+
|
|
193
|
+
Resolve `SystemAccessBackendService` (DI symbol `SAAS_SERVICE_TYPES.SystemAccessService`)
|
|
194
|
+
— NOT the services-registry handler, which deliberately does not expose these methods.
|
|
195
|
+
Services that already inject the Inversify `Container` resolve it lazily
|
|
196
|
+
(`container.get(SAAS_SERVICE_TYPES.SystemAccessService)`, to avoid startup re-entry);
|
|
197
|
+
others inject it directly in the constructor. The write primitives take the payload
|
|
198
|
+
directly (no execution context — they synthesise the system one) and, unlike the
|
|
199
|
+
handler, need no `ec` argument.
|
|
200
|
+
|
|
201
|
+
## Import Origins
|
|
202
|
+
|
|
203
|
+
- `@wildo-ai/saas-backend-lib`
|
|
204
|
+
|
|
205
|
+
## Source Excerpts
|
|
206
|
+
|
|
207
|
+
### Origin Package: `@wildo-ai/saas-backend-lib`
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
*
|
|
211
|
+
* Read a resource using a synthesised INTERNALLY_INITIATED_REQUEST execution
|
|
212
|
+
* context with system-level admin roles, regardless of the originating user's
|
|
213
|
+
* roles. Use this for server-side policy / configuration loads that drive runtime
|
|
214
|
+
* behaviour (webhook config, SSO config, SIEM export config, …) where the
|
|
215
|
+
* originating user is not necessarily the configurer of the policy and therefore
|
|
216
|
+
* cannot satisfy the resource's READ ACL.
|
|
217
|
+
*
|
|
218
|
+
* REQUIRES the target resource to opt in via `systemAccessPolicy.read = ALLOWED`
|
|
219
|
+
* on its resource configuration — otherwise this throws `ErrorType.CONFIGURATION`
|
|
220
|
+
* (fail-closed; a never-registered resource throws `ErrorType.INTERNAL` first).
|
|
221
|
+
* The returned record is the FULL super-admin view (every field, no feature
|
|
222
|
+
* gating), so the caller MUST enforce an explicit alternative authorization and
|
|
223
|
+
* project only what is safe to surface to the originating (often lower-privilege)
|
|
224
|
+
* request.
|
|
225
|
+
*
|
|
226
|
+
* Behaviour notes:
|
|
227
|
+
* - The synthesised EC is `INTERNALLY_INITIATED_REQUEST` — feature resolution
|
|
228
|
+
* returns "all features enabled" for it (the call is server-internal).
|
|
229
|
+
* - `scopeContext` (optional) seeds the EC's `contextResourcesFieldIdentifier`
|
|
230
|
+
* (the WHICH-resources-in-scope channel) so `buildContextualFilter` scopes
|
|
231
|
+
* the read to the right tenant FK (e.g. `organizationId`). It must NOT go on
|
|
232
|
+
* `initiatorIds` — the internal EC fail-closed rejects identity fields there
|
|
233
|
+
* (see {@link buildSystemScopeContextMap}). When omitted, the caller scopes
|
|
234
|
+
* via the filter argument.
|
|
235
|
+
* - Role injection is APPLICATION-scoped `APP_ADMIN_SUPER_ADMIN` — the broadest
|
|
236
|
+
* system role, accepted by every variant's READ ACL.
|
|
237
|
+
*/
|
|
238
|
+
public async readAsSystem<T = any>(
|
|
239
|
+
resourceType: ResourceType,
|
|
240
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
241
|
+
options?: ServiceOptions & {
|
|
242
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
243
|
+
/**
|
|
244
|
+
* Skip the `SYSTEM_CONTEXT_READ` privileged-access audit for THIS call. For SELF-REFERENTIAL
|
|
245
|
+
* internal reads that are framework plumbing rather than tenant-actionable access — e.g. the
|
|
246
|
+
* audit pipeline resolving a user's memberships / an org's SIEM config to ROUTE an audit event
|
|
247
|
+
* — where auditing the read would only amplify (and can recurse into) the audit trail. Genuine
|
|
248
|
+
* privileged reads leave this unset so they still audit.
|
|
249
|
+
*/
|
|
250
|
+
suppressSystemAudit?: boolean;
|
|
251
|
+
},
|
|
252
|
+
): Promise<T | null> {
|
|
253
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system READ.
|
|
254
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.READ);
|
|
255
|
+
|
|
256
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> = options?.variantKey
|
|
257
|
+
? this.resourcesRegistry.getServiceOperationPath(resourceType, CoreResourceOperation.READ, options.variantKey)
|
|
258
|
+
: this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.READ);
|
|
259
|
+
|
|
260
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
261
|
+
operation: operationPath,
|
|
262
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
263
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
264
|
+
initiatorRoles: [
|
|
265
|
+
{
|
|
266
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
267
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
const result = await this.getServicesRegistryHandler().read<T>(resourceType, systemContext, id_or_ids_or_filter, options);
|
|
273
|
+
// Guard 4: emit a best-effort privileged-access audit event. Never blocks or
|
|
274
|
+
// fails the read — `?.` short-circuits when audit is unbound and errors are
|
|
275
|
+
// swallowed (`logEvent` is already fire-and-forget internally).
|
|
276
|
+
if (!options?.suppressSystemAudit) {
|
|
277
|
+
await this.emitPrivilegedReadAudit({
|
|
278
|
+
resourceType: resourceType as string,
|
|
279
|
+
operation: CoreResourceOperation.READ,
|
|
280
|
+
resultCount: result == null ? 0 : 1,
|
|
281
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
282
|
+
scopeContext: options?.scopeContext,
|
|
283
|
+
performedByRuntime: this.describeRuntimeForAudit(),
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
return result;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* List resources using a synthesised INTERNALLY_INITIATED_REQUEST execution
|
|
291
|
+
* context with system-level admin roles. The cross-scope sibling of
|
|
292
|
+
* {@link readAsSystem}: use it for server-side LISTs that must span scopes the
|
|
293
|
+
* originating user is not a member of (e.g. "all pending invitations for this
|
|
294
|
+
* email across every organization"), where a normal scoped LIST would filter the
|
|
295
|
+
* rows out by the caller's scope. Same role/scope semantics as `readAsSystem`;
|
|
296
|
+
* with no `pagination` the return is a plain `T[]`.
|
|
297
|
+
*/
|
|
298
|
+
public async listAsSystem<T = any>(
|
|
299
|
+
resourceType: ResourceType,
|
|
300
|
+
filter?: FilterQuery<any>,
|
|
301
|
+
pagination?: Partial<Resources_PaginationRequest>,
|
|
302
|
+
options?: ServiceOptions & {
|
|
303
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
304
|
+
/** Skip the `SYSTEM_CONTEXT_READ` audit for a self-referential internal routing read — see {@link readAsSystem}. */
|
|
305
|
+
suppressSystemAudit?: boolean;
|
|
306
|
+
},
|
|
307
|
+
): Promise<T[] | Resources_PaginatedResult<T>> {
|
|
308
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system LIST.
|
|
309
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.LIST);
|
|
310
|
+
|
|
311
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> = options?.variantKey
|
|
312
|
+
? this.resourcesRegistry.getServiceOperationPath(resourceType, CoreResourceOperation.LIST, options.variantKey)
|
|
313
|
+
: this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.LIST);
|
|
314
|
+
|
|
315
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
316
|
+
operation: operationPath,
|
|
317
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
318
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
319
|
+
initiatorRoles: [
|
|
320
|
+
{
|
|
321
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
322
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
const result = await this.getServicesRegistryHandler().list<T>(resourceType, systemContext, filter, pagination, options);
|
|
328
|
+
// Guard 4: best-effort privileged-access audit (never blocks or fails the list).
|
|
329
|
+
if (!options?.suppressSystemAudit) {
|
|
330
|
+
const resultCount = Array.isArray(result) ? result.length : result.data?.length;
|
|
331
|
+
await this.emitPrivilegedReadAudit({
|
|
332
|
+
resourceType: resourceType as string,
|
|
333
|
+
operation: CoreResourceOperation.LIST,
|
|
334
|
+
resultCount,
|
|
335
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
336
|
+
scopeContext: options?.scopeContext,
|
|
337
|
+
performedByRuntime: this.describeRuntimeForAudit(),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
return result;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// ═══════════════════════════════════════════════════════════════════════════════════════════════
|
|
344
|
+
// RETENTION SEE-THROUGH primitives (M5b) — privileged reads that REVEAL retained (impersonalized-and-
|
|
345
|
+
// retained) rows the M5a hide-predicate keeps hidden from normal callers. Distinct from readAsSystem/
|
|
346
|
+
// listAsSystem: they assert the `seeRetained` policy verb (NOT read/list), require a privileged HUMAN
|
|
347
|
+
// role, SET the EC see-through flag, and emit the HUMAN-attributed `RETAINED_DATA_ACCESS` audit
|
|
348
|
+
// (accessingUserId + reason threaded in — this layer has no ambient user). Strictly read-only.
|
|
349
|
+
// ═══════════════════════════════════════════════════════════════════════════════════════════════
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Fail-closed gate for the retention see-through verb. Unlike {@link assertSystemAccessAllowed}
|
|
353
|
+
* (whose op→verb map is 1:1), the see-through reads run over the resource's READ / LIST core op yet
|
|
354
|
+
* must assert the SEPARATE `seeRetained` verb — so this is a dedicated check, not a map entry.
|
|
355
|
+
*/
|
|
356
|
+
private assertSeeRetainedAllowed(resourceType: ResourceType): void {
|
|
357
|
+
const config = this.resourcesRegistry.getResourceConfiguration(resourceType);
|
|
358
|
+
if (config.systemAccessPolicy?.seeRetained !== ResourceSystemAccessMode.ALLOWED) {
|
|
359
|
+
throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {
|
|
360
|
+
context: {
|
|
361
|
+
reason: 'see_retained_access_not_permitted',
|
|
362
|
+
resourceType,
|
|
363
|
+
message:
|
|
364
|
+
`readRetainedAsSystem / listRetainedAsSystem is not permitted for resource ` +
|
|
365
|
+
`'${String(resourceType)}': its systemAccessPolicy.seeRetained is not ALLOWED (fail-closed). ` +
|
|
366
|
+
`This grant is derived automatically when the resource opts into retentionPolicy.`,
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Privileged-role gate for a see-through read: the HUMAN principal must hold a role authorized to
|
|
374
|
+
* reveal retained (scrubbed) PII. Phase 1 gates on `APP_ADMIN_SUPER_ADMIN` only (super-admin already
|
|
375
|
+
* has full access); a dedicated `COMPLIANCE_AUDITOR` role is a purely-additive follow-up — add it to
|
|
376
|
+
* the `authorized` set once that `_core` role lands. Thrown as AUTHORIZATION (a human 403), unlike the
|
|
377
|
+
* CONFIGURATION error above (a resource-opt-in problem).
|
|
378
|
+
*/
|
|
379
|
+
private assertSeeThroughRole(accessingUserRoles: string[]): void {
|
|
380
|
+
const authorized = accessingUserRoles.some(r => r === CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN);
|
|
381
|
+
if (!authorized) {
|
|
382
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
383
|
+
context: {
|
|
384
|
+
reason: 'see_through_role_required',
|
|
385
|
+
message:
|
|
386
|
+
`A retention see-through read requires a privileged role ` +
|
|
387
|
+
`(${CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN}); the caller's roles do not include one.`,
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Fail-closed attribution guard: a see-through reveal of scrubbed PII is only permitted with a REAL
|
|
395
|
+
* human id AND a real reason. The `RETAINED_DATA_ACCESS` event schema pins both as `.trim().min(1)`,
|
|
396
|
+
* but the audit store persists `eventData` as an unparsed record — so this is the ENFORCEMENT point
|
|
397
|
+
* that stops a blank/whitespace attribution from producing an anonymous, reason-less audited reveal
|
|
398
|
+
* (which would defeat the entire justification for allowing the read). Thrown as VALIDATION.
|
|
399
|
+
*/
|
|
400
|
+
private assertSeeThroughAttribution(accessingUserId: string, reason: string): void {
|
|
401
|
+
if (!accessingUserId?.trim() || !reason?.trim()) {
|
|
402
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
403
|
+
context: {
|
|
404
|
+
reason: 'see_through_attribution_required',
|
|
405
|
+
message:
|
|
406
|
+
`A retention see-through read requires a non-empty accessingUserId AND reason ` +
|
|
407
|
+
`(human attribution + justification for revealing scrubbed PII); neither may be blank.`,
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* SEE-THROUGH single-record read (M5b): reveals a RETAINED (impersonalized-and-retained) record that
|
|
415
|
+
* the M5a hide-predicate hides from normal callers. Fail-closed on the `seeRetained` policy verb + a
|
|
416
|
+
* privileged HUMAN role; sets the EC see-through flag so `buildContextualFilter` suppresses ONLY the
|
|
417
|
+
* retention predicate for THIS read (scope still applies); emits the HUMAN-attributed
|
|
418
|
+
* `RETAINED_DATA_ACCESS` audit. The human's id/roles + a `reason` are REQUIRED — this layer has no
|
|
419
|
+
* ambient user. Strictly read-only.
|
|
420
|
+
*/
|
|
421
|
+
public async readRetainedAsSystem<T = any>(
|
|
422
|
+
resourceType: ResourceType,
|
|
423
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
424
|
+
auth: { accessingUserId: string; accessingUserRoles: string[]; reason: string },
|
|
425
|
+
options?: ServiceOptions & {
|
|
426
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
427
|
+
},
|
|
428
|
+
): Promise<T | null> {
|
|
429
|
+
this.assertSeeRetainedAllowed(resourceType);
|
|
430
|
+
this.assertSeeThroughRole(auth.accessingUserRoles);
|
|
431
|
+
this.assertSeeThroughAttribution(auth.accessingUserId, auth.reason);
|
|
432
|
+
|
|
433
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> = options?.variantKey
|
|
434
|
+
? this.resourcesRegistry.getServiceOperationPath(resourceType, CoreResourceOperation.READ, options.variantKey)
|
|
435
|
+
: this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.READ);
|
|
436
|
+
|
|
437
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
438
|
+
operation: operationPath,
|
|
439
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
440
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
441
|
+
initiatorRoles: [
|
|
442
|
+
{
|
|
443
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
444
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
445
|
+
},
|
|
446
|
+
],
|
|
447
|
+
});
|
|
448
|
+
// M5b: reveal retained rows for THIS read only (suppresses ONLY the retention predicate, not scope).
|
|
449
|
+
systemContext.setSeeRetainedData(true);
|
|
450
|
+
|
|
451
|
+
const result = await this.getServicesRegistryHandler().read<T>(resourceType, systemContext, id_or_ids_or_filter, options);
|
|
452
|
+
|
|
453
|
+
// M6: HUMAN-attributed, reason-bearing, best-effort (never blocks/fails the read).
|
|
454
|
+
this.auditLogsService?.logRetainedDataAccess({
|
|
455
|
+
accessingUserId: auth.accessingUserId,
|
|
456
|
+
roles: auth.accessingUserRoles,
|
|
457
|
+
reason: auth.reason,
|
|
458
|
+
resourceType: resourceType as string,
|
|
459
|
+
operationIdentifier: 'readRetainedAsSystem',
|
|
460
|
+
retainedRecordCount: result == null ? 0 : 1,
|
|
461
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
462
|
+
}).catch(() => { /* audit is best-effort */ });
|
|
463
|
+
|
|
464
|
+
return result;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* SEE-THROUGH collection read (M5b): the list sibling of {@link readRetainedAsSystem}. Same gates
|
|
469
|
+
* (`seeRetained` verb + privileged role), same EC see-through flag, same HUMAN-attributed audit.
|
|
470
|
+
*/
|
|
471
|
+
public async listRetainedAsSystem<T = any>(
|
|
472
|
+
resourceType: ResourceType,
|
|
473
|
+
auth: { accessingUserId: string; accessingUserRoles: string[]; reason: string },
|
|
474
|
+
filter?: FilterQuery<any>,
|
|
475
|
+
pagination?: Partial<Resources_PaginationRequest>,
|
|
476
|
+
options?: ServiceOptions & {
|
|
477
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
478
|
+
},
|
|
479
|
+
): Promise<T[] | Resources_PaginatedResult<T>> {
|
|
480
|
+
this.assertSeeRetainedAllowed(resourceType);
|
|
481
|
+
this.assertSeeThroughRole(auth.accessingUserRoles);
|
|
482
|
+
this.assertSeeThroughAttribution(auth.accessingUserId, auth.reason);
|
|
483
|
+
|
|
484
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> = options?.variantKey
|
|
485
|
+
? this.resourcesRegistry.getServiceOperationPath(resourceType, CoreResourceOperation.LIST, options.variantKey)
|
|
486
|
+
: this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.LIST);
|
|
487
|
+
|
|
488
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
489
|
+
operation: operationPath,
|
|
490
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
491
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
492
|
+
initiatorRoles: [
|
|
493
|
+
{
|
|
494
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
495
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
496
|
+
},
|
|
497
|
+
],
|
|
498
|
+
});
|
|
499
|
+
systemContext.setSeeRetainedData(true);
|
|
500
|
+
|
|
501
|
+
const result = await this.getServicesRegistryHandler().list<T>(resourceType, systemContext, filter, pagination, options);
|
|
502
|
+
const retainedRecordCount = Array.isArray(result) ? result.length : result.data?.length;
|
|
503
|
+
|
|
504
|
+
this.auditLogsService?.logRetainedDataAccess({
|
|
505
|
+
accessingUserId: auth.accessingUserId,
|
|
506
|
+
roles: auth.accessingUserRoles,
|
|
507
|
+
reason: auth.reason,
|
|
508
|
+
resourceType: resourceType as string,
|
|
509
|
+
operationIdentifier: 'listRetainedAsSystem',
|
|
510
|
+
retainedRecordCount,
|
|
511
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
512
|
+
}).catch(() => { /* audit is best-effort */ });
|
|
513
|
+
|
|
514
|
+
return result;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Create a resource using a synthesised super-admin system context, RE-ATTACHING
|
|
519
|
+
* the fields the client-shaped request DTO strips: `.isBackendOnly()` material
|
|
520
|
+
* (e.g. a credential `passwordHash`) and the context-auto-populated FKs (e.g.
|
|
521
|
+
* `userId` on a system resource that has no HTTP surface to seed it). Use this
|
|
522
|
+
* for trusted in-process writes to system resources — e.g. registration
|
|
523
|
+
* persisting `USER_CREDENTIALS` / `USER_PROFILES` — where the payload IS the
|
|
524
|
+
* source of truth and there is no request context to inject the FKs.
|
|
525
|
+
*
|
|
526
|
+
* REQUIRES the target resource to opt in via `systemAccessPolicy.create = ALLOWED`
|
|
527
|
+
* (fail-closed; otherwise throws `ErrorType.CONFIGURATION`). The re-attach
|
|
528
|
+
* allowlist is DERIVED from the resource schema (never caller-supplied), and this
|
|
529
|
+
* primitive is reachable only from trusted engine code — never an HTTP payload —
|
|
530
|
+
* so it cannot be used to smuggle client-forbidden fields.
|
|
531
|
+
*
|
|
532
|
+
* `scopeContext` (optional) seeds the EC's `contextResourcesFieldIdentifier`
|
|
533
|
+
* (the WHICH-resources-in-scope channel — NOT `initiatorIds`, which fail-closed
|
|
534
|
+
* rejects identity fields on the internal EC; see
|
|
535
|
+
* {@link buildSystemScopeContextMap}) so `enrichDataWithContext`'s context-map
|
|
536
|
+
* loop injects the right scope FK. It is NOT required when the scope FKs are
|
|
537
|
+
* already present on `data` (they are preserved by the allowlist).
|
|
538
|
+
*/
|
|
539
|
+
public async createAsSystem<T = any>(
|
|
540
|
+
resourceType: ResourceType,
|
|
541
|
+
data: Record<string, unknown>,
|
|
542
|
+
options?: ServiceOptions & {
|
|
543
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
544
|
+
},
|
|
545
|
+
): Promise<T> {
|
|
546
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system CREATE.
|
|
547
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.CREATE);
|
|
548
|
+
|
|
549
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> =
|
|
550
|
+
this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.CREATE);
|
|
551
|
+
|
|
552
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
553
|
+
operation: operationPath,
|
|
554
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
555
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
556
|
+
initiatorRoles: [
|
|
557
|
+
{
|
|
558
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
559
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
560
|
+
},
|
|
561
|
+
],
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
const preserveServerInjectedFields = [
|
|
565
|
+
...(options?.preserveServerInjectedFields ?? []),
|
|
566
|
+
...this.deriveWritePreserveFields(resourceType, data, CoreResourceOperation.CREATE),
|
|
567
|
+
];
|
|
568
|
+
|
|
569
|
+
const result = await this.getServicesRegistryHandler().create<T>(
|
|
570
|
+
resourceType,
|
|
571
|
+
systemContext,
|
|
572
|
+
data,
|
|
573
|
+
{ ...options, preserveServerInjectedFields },
|
|
574
|
+
);
|
|
575
|
+
// Guard 4: best-effort privileged-write audit (never blocks or fails the write).
|
|
576
|
+
this.scheduleSystemContextWriteAudit(
|
|
577
|
+
resourceType,
|
|
578
|
+
CoreResourceOperation.CREATE,
|
|
579
|
+
options,
|
|
580
|
+
);
|
|
581
|
+
return result;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Update a single resource using a synthesised super-admin system context,
|
|
586
|
+
* re-attaching the DTO-stripped fields (backend-only material like a rotated
|
|
587
|
+
* `passwordHash`, and context-auto-populated FKs). The single-target sibling of
|
|
588
|
+
* {@link createAsSystem}. Requires `systemAccessPolicy.update = ALLOWED`
|
|
589
|
+
* (fail-closed). `id_or_ids_or_filter` selects the target exactly as the normal
|
|
590
|
+
* `update` does (an id or a filter).
|
|
591
|
+
*/
|
|
592
|
+
public async updateAsSystem<T = any>(
|
|
593
|
+
resourceType: ResourceType,
|
|
594
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
595
|
+
data: Record<string, unknown>,
|
|
596
|
+
options?: ServiceOptions & {
|
|
597
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
598
|
+
},
|
|
599
|
+
): Promise<T | null> {
|
|
600
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system UPDATE.
|
|
601
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.UPDATE);
|
|
602
|
+
|
|
603
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> =
|
|
604
|
+
this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.UPDATE);
|
|
605
|
+
|
|
606
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
607
|
+
operation: operationPath,
|
|
608
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
609
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
610
|
+
initiatorRoles: [
|
|
611
|
+
{
|
|
612
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
613
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
614
|
+
},
|
|
615
|
+
],
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
const preserveServerInjectedFields = [
|
|
619
|
+
...(options?.preserveServerInjectedFields ?? []),
|
|
620
|
+
...this.deriveWritePreserveFields(resourceType, data, CoreResourceOperation.UPDATE),
|
|
621
|
+
];
|
|
622
|
+
|
|
623
|
+
const result = await this.getServicesRegistryHandler().update<T>(
|
|
624
|
+
resourceType,
|
|
625
|
+
systemContext,
|
|
626
|
+
id_or_ids_or_filter,
|
|
627
|
+
data,
|
|
628
|
+
{ ...options, preserveServerInjectedFields },
|
|
629
|
+
);
|
|
630
|
+
this.scheduleSystemContextWriteAudit(
|
|
631
|
+
resourceType,
|
|
632
|
+
CoreResourceOperation.UPDATE,
|
|
633
|
+
options,
|
|
634
|
+
);
|
|
635
|
+
return result;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Bulk-update resources matched by `id_or_ids_or_filter` using a synthesised
|
|
640
|
+
* super-admin system context, re-attaching the DTO-stripped fields. The
|
|
641
|
+
* many-target sibling of {@link updateAsSystem}; requires
|
|
642
|
+
* `systemAccessPolicy.updateMany = ALLOWED` (fail-closed). Used e.g. by
|
|
643
|
+
* anonymous→user ownership transposition, where a shared patch (`userId`,
|
|
644
|
+
* `anonymousUserId`) must land on many rows.
|
|
645
|
+
*/
|
|
646
|
+
public async updateManyAsSystem<T = any>(
|
|
647
|
+
resourceType: ResourceType,
|
|
648
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
649
|
+
data: Record<string, unknown>,
|
|
650
|
+
options?: ServiceOptions & {
|
|
651
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
652
|
+
},
|
|
653
|
+
): Promise<T[]> {
|
|
654
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system UPDATE_MANY.
|
|
655
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.UPDATE_MANY);
|
|
656
|
+
|
|
657
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> =
|
|
658
|
+
this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.UPDATE_MANY);
|
|
659
|
+
|
|
660
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
661
|
+
operation: operationPath,
|
|
662
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
663
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
664
|
+
initiatorRoles: [
|
|
665
|
+
{
|
|
666
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
667
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
668
|
+
},
|
|
669
|
+
],
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
const preserveServerInjectedFields = [
|
|
673
|
+
...(options?.preserveServerInjectedFields ?? []),
|
|
674
|
+
...this.deriveWritePreserveFields(resourceType, data, CoreResourceOperation.UPDATE_MANY),
|
|
675
|
+
];
|
|
676
|
+
|
|
677
|
+
const result = await this.getServicesRegistryHandler().updateMany<T>(
|
|
678
|
+
resourceType,
|
|
679
|
+
systemContext,
|
|
680
|
+
id_or_ids_or_filter,
|
|
681
|
+
data,
|
|
682
|
+
{ ...options, preserveServerInjectedFields },
|
|
683
|
+
);
|
|
684
|
+
this.scheduleSystemContextWriteAudit(
|
|
685
|
+
resourceType,
|
|
686
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
687
|
+
options,
|
|
688
|
+
);
|
|
689
|
+
return result;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* DIRECT subject erasure — impersonalize-and-retain the named rows of a retention-governed resource.
|
|
694
|
+
*
|
|
695
|
+
* This is the entry point for "erase this subject": scrub the personal fields in place, keep the row,
|
|
696
|
+
* and mark it `RETAINED` (hidden from normal reads, immutable, reachable only through the audited
|
|
697
|
+
* see-through path).
|
|
698
|
+
*
|
|
699
|
+
* WHY IT EXISTS: until now the ONLY way to reach impersonalization was the `onParentDelete` cascade —
|
|
700
|
+
* i.e. a PARENT being deleted. That structurally excludes every SCOPE ROOT, and `USERS` is a scope
|
|
701
|
+
* root, so the resource that actually holds the personal data could never be erased. A
|
|
702
|
+
* parent-delete-only trigger can only ever reach CHILD resources, which are precisely the ones
|
|
703
|
+
* holding no PII (a billing row points at a person; the name and address live on the user). This
|
|
704
|
+
* closes that gap: erasure can now be initiated on the subject itself.
|
|
705
|
+
*
|
|
706
|
+
* Shares ONE definition of "impersonalize these rows" with the cascade
|
|
707
|
+
* (`impersonalizeRowsInPlace`) — the asserts, the scrub patch, the marker write and the
|
|
708
|
+
* treatment-driven file erasure are not duplicated here, so the two entry points cannot drift on
|
|
709
|
+
* what counts as erased.
|
|
710
|
+
*
|
|
711
|
+
* Fail-closed twice over: the resource must grant system `updateMany` (Guard 1, as for every trusted
|
|
712
|
+
* write) AND must be retention-governed (asserted by the shared core — otherwise there is no
|
|
713
|
+
* `retentionStatus` marker to flip and no derived grant to flip it with).
|
|
714
|
+
*
|
|
715
|
+
* Takes EXPLICIT ids rather than a filter: an erasure is not a query, and resolving a filter here
|
|
716
|
+
* would need a system LIST grant plus a silent decision about what to do when it matches more (or
|
|
717
|
+
* fewer) rows than the caller expected. The caller knows the subject.
|
|
718
|
+
*/
|
|
719
|
+
public async impersonalizeSubjectAsSystem(
|
|
720
|
+
resourceType: ResourceType,
|
|
721
|
+
id_or_ids: string | string[],
|
|
722
|
+
options?: ServiceOptions & {
|
|
723
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
724
|
+
},
|
|
725
|
+
): Promise<void> {
|
|
726
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system UPDATE_MANY — the verb the
|
|
727
|
+
// scrub write uses.
|
|
728
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.UPDATE_MANY);
|
|
729
|
+
|
|
730
|
+
const rowIds = typeof id_or_ids === 'string' ? [id_or_ids] : id_or_ids;
|
|
731
|
+
if (rowIds.length === 0) {
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> =
|
|
736
|
+
this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.UPDATE_MANY);
|
|
737
|
+
|
|
738
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
739
|
+
operation: operationPath,
|
|
740
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
741
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
742
|
+
initiatorRoles: [
|
|
743
|
+
{
|
|
744
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
745
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
746
|
+
},
|
|
747
|
+
],
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
await this.getServicesRegistryHandler()
|
|
751
|
+
.getService(resourceType)
|
|
752
|
+
.impersonalizeRowsInPlace(resourceType, rowIds, systemContext, options);
|
|
753
|
+
|
|
754
|
+
// Best-effort privileged-write audit (never blocks or fails the erasure) — mirrors the other
|
|
755
|
+
// trusted writes. The per-row RETAINED_DATA_ACCESS audit covers later READS of the retained rows;
|
|
756
|
+
// this records the erasure itself.
|
|
757
|
+
this.auditLogsService?.logSystemContextWrite({
|
|
758
|
+
resourceType: resourceType as string,
|
|
759
|
+
operation: CoreResourceOperation.UPDATE_MANY,
|
|
760
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
761
|
+
scopeContext: options?.scopeContext,
|
|
762
|
+
performedByRuntime: this.describeRuntimeForAudit(),
|
|
763
|
+
}).catch(() => { /* audit is best-effort */ });
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* SUBJECT ERASURE — the entry point a "delete my account" request calls.
|
|
768
|
+
*
|
|
769
|
+
* The whole erasure, not just its last step: tear down the subject's dependents according to what
|
|
770
|
+
* each edge declared, THEN scrub the subject row and flip it to `RETAINED`. Prefer this over
|
|
771
|
+
* {@link impersonalizeSubjectAsSystem} for any real erasure request — that method scrubs the
|
|
772
|
+
* subject row ALONE, which for a user leaves the profile holding the name, the bio and the avatar
|
|
773
|
+
* completely intact (the `USERS → USER_PROFILES` cascade is delete-driven, and an erasure does not
|
|
774
|
+
* delete the user). `impersonalizeSubjectAsSystem` remains the right call only when the caller has
|
|
775
|
+
* already dealt with the dependents, or when the subject genuinely has none.
|
|
776
|
+
*
|
|
777
|
+
* The delete-vs-retain decision per dependent is DERIVED FROM CONFIGURATION — each edge's
|
|
778
|
+
* `onParentDelete` declaration, read through the same authority the delete cascade uses — never
|
|
779
|
+
* from a hardcoded list of resource types. Edges the author never classified abort the erasure
|
|
780
|
+
* instead of being guessed at. See `classifySubjectErasureDisposition` for the full table.
|
|
781
|
+
*
|
|
782
|
+
* Fail-closed three times over: the resource must grant system `updateMany` (Guard 1, as for every
|
|
783
|
+
* trusted write), must be retention-governed (the subject is kept, so there must be a
|
|
784
|
+
* `retentionStatus` marker to flip), and must have an executable disposition for every dependent
|
|
785
|
+
* edge.
|
|
786
|
+
*
|
|
787
|
+
* Takes EXPLICIT ids for the same reason {@link impersonalizeSubjectAsSystem} does: an erasure is
|
|
788
|
+
* not a query, and resolving a filter here would silently decide what to do when it matches more
|
|
789
|
+
* (or fewer) subjects than the caller expected.
|
|
790
|
+
*
|
|
791
|
+
* @returns the `SubjectErasureReport` — every edge with the disposition applied and the
|
|
792
|
+
* configuration that justified it. Returned rather than only logged so the flow fronting the
|
|
793
|
+
* request can record or surface it as the evidence of what was erased.
|
|
794
|
+
*/
|
|
795
|
+
/**
|
|
796
|
+
* Assemble a data subject's export bundle under a synthesised system context — the disclosure
|
|
797
|
+
* counterpart of {@link eraseSubjectAsSystem}, and the ONLY public door to a subject export.
|
|
798
|
+
*
|
|
799
|
+
* ## No route, deliberately
|
|
800
|
+
*
|
|
801
|
+
* There is no resource operation and no HTTP endpoint for this, exactly as there is none for
|
|
802
|
+
* erasure. GDPR Art. 15 and Art. 20 bind the data **controller** — the application built with this
|
|
803
|
+
* framework, not the framework — so WHO may request an export, what identity proof is required
|
|
804
|
+
* first, and how the result is delivered are the application's decisions. The framework's job is
|
|
805
|
+
* to make the bundle assemblable and to refuse to assemble a misleading one.
|
|
806
|
+
*
|
|
807
|
+
* Four routed export operations that claimed to do this were removed on 2026-08-01 for exactly
|
|
808
|
+
* this reason: each answered HTTP 200 with an unfiltered row while ignoring its whole request
|
|
809
|
+
* contract. This is the honest replacement, at the layer the decision actually belongs to.
|
|
810
|
+
*
|
|
811
|
+
* ## Two-key gate
|
|
812
|
+
*
|
|
813
|
+
* The caller's invocation is the first key — reaching this method at all is a deliberate act by
|
|
814
|
+
* the controller. The per-resource `systemAccessPolicy.exportSubject` opt-in is the second, and it
|
|
815
|
+
* is enforced inside the orchestrator across EVERY resource that would enter the bundle, not just
|
|
816
|
+
* the subject's own. A resource that never consented to disclosure cannot be swept in because it
|
|
817
|
+
* happens to sit on an edge.
|
|
818
|
+
*
|
|
819
|
+
* `// assurance-control: WILDO.PRIVACY.SUBJECT_DATA_EXPORT`
|
|
820
|
+
*
|
|
821
|
+
* ## Interaction with erasure RETENTION (checked 2026-08-09 — deliberate, not an oversight)
|
|
822
|
+
*
|
|
823
|
+
* This path does NOT set the see-through flag; only `readRetainedAsSystem` / `listRetainedAsSystem` do.
|
|
824
|
+
* So exporting a subject who has ALREADY been erased-and-retained reads through the ordinary chokepoint,
|
|
825
|
+
* finds the row hidden, and discloses nothing — which is the correct answer twice over: the row's
|
|
826
|
+
* personal fields are already scrubbed, and an export is a disclosure door, so it must not be the one
|
|
827
|
+
* that reveals what erasure withdrew.
|
|
828
|
+
*
|
|
829
|
+
* Do not "fix" a thin bundle for an erased subject by granting see-through here. The audited reveal has
|
|
830
|
+
* its own two primitives precisely so that a compliance auditor's read is separable, attributed and
|
|
831
|
+
* logged; routing it through export would make every export a potential retained-data disclosure.
|
|
832
|
+
*
|
|
833
|
+
* @param resourceType the subject's resource type.
|
|
834
|
+
* @param id_or_ids the explicit subject rows. An export is not a query.
|
|
835
|
+
* @param purpose WHICH right is being answered — the two produce genuinely different bundles.
|
|
836
|
+
* @returns the {@link SubjectExportBundle}. Only `bundle.report` is safe to log; `bundle.slices`
|
|
837
|
+
* carry the personal data itself.
|
|
838
|
+
*/
|
|
839
|
+
public async exportSubjectAsSystem(
|
|
840
|
+
resourceType: ResourceType,
|
|
841
|
+
id_or_ids: string | string[],
|
|
842
|
+
purpose: SubjectExportPurpose,
|
|
843
|
+
options?: ServiceOptions & {
|
|
844
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
845
|
+
},
|
|
846
|
+
): Promise<SubjectExportBundle> {
|
|
847
|
+
// Guard 1 (fail-closed): the subject's own resource must permit system READ — the verb every
|
|
848
|
+
// row of the bundle is gathered with. The narrower `exportSubject` opt-in is asserted per
|
|
849
|
+
// participating resource inside the orchestrator.
|
|
850
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.READ);
|
|
851
|
+
|
|
852
|
+
const subjectIds = typeof id_or_ids === 'string' ? [id_or_ids] : id_or_ids;
|
|
853
|
+
if (subjectIds.length === 0) {
|
|
854
|
+
return {
|
|
855
|
+
report: {
|
|
856
|
+
purpose,
|
|
857
|
+
subjectResourceType: resourceType,
|
|
858
|
+
subjectIds: [],
|
|
859
|
+
edges: [],
|
|
860
|
+
fieldsExcludedAsDerived: [],
|
|
861
|
+
fieldsWithheldAsNonDisclosable: [],
|
|
862
|
+
totalRecordCount: 0,
|
|
863
|
+
},
|
|
864
|
+
slices: [],
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> =
|
|
869
|
+
this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.READ);
|
|
870
|
+
|
|
871
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
872
|
+
operation: operationPath,
|
|
873
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
874
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
875
|
+
initiatorRoles: [
|
|
876
|
+
{
|
|
877
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
878
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
879
|
+
},
|
|
880
|
+
],
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
const bundle = await this.getServicesRegistryHandler()
|
|
884
|
+
.getService(resourceType)
|
|
885
|
+
.exportSubjectInPlace(resourceType, subjectIds, purpose, systemContext, options);
|
|
886
|
+
|
|
887
|
+
// ── The audit event ──
|
|
888
|
+
//
|
|
889
|
+
// A subject export is arguably the most audit-worthy READ the framework performs: it assembles
|
|
890
|
+
// everything held about one person and hands it out. No framework mechanism would emit for it:
|
|
891
|
+
// `FIELD_ACCESS` fires only on first exposure of a backend-only secret at CREATE, and the
|
|
892
|
+
// risk-tiered `RESOURCE_OPERATION_PERFORMED` emission deliberately excludes read-shaped
|
|
893
|
+
// operations. The removed export operations produced no trail whatsoever — which is why this
|
|
894
|
+
// event is emitted explicitly here rather than inherited.
|
|
895
|
+
//
|
|
896
|
+
// The report is logged, never the slices: the report is designed to carry dispositions and
|
|
897
|
+
// counts and NO personal data, so it is safe to persist in an audit store. Logging the bundle
|
|
898
|
+
// would put the exported personal data into the audit trail — turning the record of a
|
|
899
|
+
// disclosure into a second copy of it.
|
|
900
|
+
await this.auditLogsService?.logSubjectDataExport({
|
|
901
|
+
purpose,
|
|
902
|
+
subjectResourceType: resourceType as string,
|
|
903
|
+
subjectIds,
|
|
904
|
+
includedResourceTypes: bundle.report.edges
|
|
905
|
+
.filter((edge) => edge.collected)
|
|
906
|
+
.map((edge) => String(edge.relatedResourceType)),
|
|
907
|
+
totalRecordCount: bundle.report.totalRecordCount,
|
|
908
|
+
fieldsExcludedAsDerived: bundle.report.fieldsExcludedAsDerived,
|
|
909
|
+
fieldsWithheldAsNonDisclosable: bundle.report.fieldsWithheldAsNonDisclosable,
|
|
910
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
return bundle;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Guard 4 of {@link eraseSubjectAsSystem}: rows linked to the subject in an HTTP_API-bound
|
|
918
|
+
* external system declaring erasure stance `CONTROLLER_ACKNOWLEDGED_NON_ERASURE` (ETL D6, 6c)
|
|
919
|
+
* refuse the erasure until the CONTROLLER acknowledges the hole — per request, via
|
|
920
|
+
* `acknowledgeHttpApiNonErasure`, never as a standing posture.
|
|
921
|
+
*
|
|
922
|
+
* `CONFLICT` (409), like the floors: the caller is authorized and the payload valid — what
|
|
923
|
+
* refuses is the declared state of the subject's graph, and the refusal names its own remedy.
|
|
924
|
+
* Enumerates the subject's child-direction edges (the erasure's own discovery boundary — linkage
|
|
925
|
+
* no relationship declares is outside every part of the erasure, not only this guard). The
|
|
926
|
+
* acknowledged path's RECORD (the CRITICAL audit event + the report entry) is emitted by the
|
|
927
|
+
* per-resource external effect post-commit, where the outcome it records actually exists.
|
|
928
|
+
*/
|
|
929
|
+
private assertHttpApiNonErasureAcknowledged(
|
|
930
|
+
subjectResourceType: ResourceType,
|
|
931
|
+
acknowledged: boolean | undefined,
|
|
932
|
+
executionContext: ExecutionContext<any>,
|
|
933
|
+
): void {
|
|
934
|
+
const subjectConfiguration = this.resourcesRegistry.getResourceConfiguration(subjectResourceType) as {
|
|
935
|
+
resourceRelationships?: Parameters<typeof getChildDirectionRelationships>[0];
|
|
936
|
+
};
|
|
937
|
+
const childRelationships = subjectConfiguration?.resourceRelationships
|
|
938
|
+
? getChildDirectionRelationships(subjectConfiguration.resourceRelationships)
|
|
939
|
+
: [];
|
|
940
|
+
|
|
941
|
+
const affected: Array<{ resourceType: string; providerRef: string; remoteEntityRef: string }> = [];
|
|
942
|
+
const seenChildResourceTypes = new Set<string>();
|
|
943
|
+
for (const relationship of childRelationships) {
|
|
944
|
+
if ((relationship as { isDisabled?: boolean }).isDisabled === true) continue;
|
|
945
|
+
const childResourceType = String((relationship as { resourceType2?: unknown }).resourceType2 ?? '');
|
|
946
|
+
if (!childResourceType || seenChildResourceTypes.has(childResourceType)) continue;
|
|
947
|
+
seenChildResourceTypes.add(childResourceType);
|
|
948
|
+
|
|
949
|
+
let childConfiguration: { httpApiBinding?: { providerRef: string; entityRef: string; erasure?: { stance?: string } } } | undefined;
|
|
950
|
+
try {
|
|
951
|
+
childConfiguration = this.resourcesRegistry.getResourceConfiguration(childResourceType as ResourceType);
|
|
952
|
+
} catch {
|
|
953
|
+
// An unregistered child is the erasure orchestrator's problem to name, not this guard's.
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
const binding = childConfiguration?.httpApiBinding;
|
|
957
|
+
if (!binding || binding.erasure?.stance !== HttpApiErasureStance.CONTROLLER_ACKNOWLEDGED_NON_ERASURE) continue;
|
|
958
|
+
affected.push({
|
|
959
|
+
resourceType: childResourceType,
|
|
960
|
+
providerRef: binding.providerRef,
|
|
961
|
+
remoteEntityRef: binding.entityRef,
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
if (affected.length === 0 || acknowledged === true) return;
|
|
966
|
+
|
|
967
|
+
throw this.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {
|
|
968
|
+
context: {
|
|
969
|
+
reason: 'http_api_non_erasure_unacknowledged',
|
|
970
|
+
message:
|
|
971
|
+
`Subject erasure of "${subjectResourceType}" is REFUSED: ${affected.length} linked HTTP_API-bound resource(s) `
|
|
972
|
+
+ `declare erasure stance CONTROLLER_ACKNOWLEDGED_NON_ERASURE — their remote rows cannot be erased by the platform `
|
|
973
|
+
+ `and would silently survive an erasure that reports itself complete. To proceed, pass `
|
|
974
|
+
+ `'acknowledgeHttpApiNonErasure: true' on THIS request: the erasure will then complete locally, each named resource `
|
|
975
|
+
+ `will be recorded as a CRITICAL audit event, and the report will carry the hole explicitly.`,
|
|
976
|
+
subjectResourceType,
|
|
977
|
+
resources: affected,
|
|
978
|
+
},
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
public async eraseSubjectAsSystem(
|
|
983
|
+
resourceType: ResourceType,
|
|
984
|
+
id_or_ids: string | string[],
|
|
985
|
+
options?: ServiceOptions & {
|
|
986
|
+
scopeContext?: { organizationId?: string; applicationId?: string; userId?: string };
|
|
987
|
+
/**
|
|
988
|
+
* The CONTROLLER's explicit decision to complete an erasure that would leave one or more
|
|
989
|
+
* organizations with no usable owner.
|
|
990
|
+
*
|
|
991
|
+
* Off by default, so stranding a tenant is never accidental. Supplied, the erasure proceeds and
|
|
992
|
+
* each stranded tenant is recorded as a CRITICAL audit event instead of the write being
|
|
993
|
+
* refused. See `assertOrganizationOwnerFloorForSubjectErasure` in the floor authority for why
|
|
994
|
+
* this door is defeasible while every administrative door is not — in short, GDPR Art. 17(3)
|
|
995
|
+
* does not recognise "the tenant would become unadministrable" as a ground to refuse erasure,
|
|
996
|
+
* and the framework must not impose that posture on the application that owes the answer.
|
|
997
|
+
*/
|
|
998
|
+
acknowledgeOrganizationOwnerFloorBreach?: boolean;
|
|
999
|
+
/**
|
|
1000
|
+
* The same controller decision for the APPLICATION-scope floor.
|
|
1001
|
+
*
|
|
1002
|
+
* Separate from its organization sibling on purpose: the two guard different populations with
|
|
1003
|
+
* different remedies, and an erasure that may lawfully strand one tenant is not thereby
|
|
1004
|
+
* licensed to leave the whole application unadministrable. Acknowledging one must never
|
|
1005
|
+
* silently acknowledge the other.
|
|
1006
|
+
*/
|
|
1007
|
+
acknowledgeAdministrativeContinuityFloorBreach?: boolean;
|
|
1008
|
+
/**
|
|
1009
|
+
* The CONTROLLER's explicit decision to complete an erasure although rows linked to the
|
|
1010
|
+
* subject live in HTTP_API-bound EXTERNAL systems declaring erasure stance
|
|
1011
|
+
* `CONTROLLER_ACKNOWLEDGED_NON_ERASURE` (ETL D6 stance 6c).
|
|
1012
|
+
*
|
|
1013
|
+
* Off by default and PER REQUEST, never a standing posture: unacknowledged, guard 4 refuses
|
|
1014
|
+
* before anything is written, naming every such resource. Acknowledged, the erasure proceeds
|
|
1015
|
+
* and each resource is recorded twice — a CRITICAL `HTTP_API_NON_ERASURE_ACKNOWLEDGED` audit
|
|
1016
|
+
* event, and an `ACKNOWLEDGED_NON_ERASURE` entry in the report's `externalEffects` (which
|
|
1017
|
+
* `isIncompleteSubjectErasureExternalEffect` deliberately counts as incomplete: the data is
|
|
1018
|
+
* still live at the third party, however deliberate the decision).
|
|
1019
|
+
*
|
|
1020
|
+
* A THIRD acknowledgement, separate from the two floor acknowledgements on purpose — each
|
|
1021
|
+
* guards a different consequence with a different remedy, and acknowledging one must never
|
|
1022
|
+
* silently acknowledge another.
|
|
1023
|
+
*/
|
|
1024
|
+
acknowledgeHttpApiNonErasure?: boolean;
|
|
1025
|
+
},
|
|
1026
|
+
): Promise<SubjectErasureReport> {
|
|
1027
|
+
// Guard 1 (fail-closed): the resource must explicitly opt into system UPDATE_MANY — the verb the
|
|
1028
|
+
// subject's scrub write uses.
|
|
1029
|
+
this.assertSystemAccessAllowed(resourceType, CoreResourceOperation.UPDATE_MANY);
|
|
1030
|
+
|
|
1031
|
+
const subjectIds = typeof id_or_ids === 'string' ? [id_or_ids] : id_or_ids;
|
|
1032
|
+
if (subjectIds.length === 0) {
|
|
1033
|
+
return {
|
|
1034
|
+
subjectResourceType: resourceType,
|
|
1035
|
+
subjectIds: [],
|
|
1036
|
+
edges: [],
|
|
1037
|
+
subjectImpersonalized: false,
|
|
1038
|
+
// No subject means nothing to erase anywhere, including externally — and the effects below
|
|
1039
|
+
// are deliberately never reached, so no provider is called for an empty request.
|
|
1040
|
+
externalEffects: [],
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
const operationPath: ResourceConfiguration_OperationPath<any, any> =
|
|
1045
|
+
this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.UPDATE_MANY);
|
|
1046
|
+
|
|
1047
|
+
const systemContext = await this.executionContextCreator.createForInternalOperation({
|
|
1048
|
+
operation: operationPath,
|
|
1049
|
+
contextResourcesFieldIdentifier: this.buildSystemScopeContextMap(options?.scopeContext),
|
|
1050
|
+
initiatorIds: this.buildSystemInitiatorIds(options?.scopeContext),
|
|
1051
|
+
initiatorRoles: [
|
|
1052
|
+
{
|
|
1053
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
1054
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
1055
|
+
},
|
|
1056
|
+
],
|
|
1057
|
+
});
|
|
1058
|
+
|
|
1059
|
+
// ── Guard 2: the last-super-administrator floor ──
|
|
1060
|
+
//
|
|
1061
|
+
// An erasure scrubs the subject's row and retention-hides it, so an erased administrator stops
|
|
1062
|
+
// counting as decisively as a deleted or demoted one — and `appRoles` deliberately survives the
|
|
1063
|
+
// scrub (`.isAuditEvidence()`, no `.impersonalizeWith()`), so a naive role query would keep
|
|
1064
|
+
// counting a principal nobody can authenticate as.
|
|
1065
|
+
//
|
|
1066
|
+
// This runs BEFORE `eraseSubjectInPlace`, so a refusal leaves nothing written.
|
|
1067
|
+
//
|
|
1068
|
+
// The floor is NOT bypassed for this system path even though the ceiling gate exempts internal
|
|
1069
|
+
// writes. An erasure that leaves the application unadministrable is not a completed
|
|
1070
|
+
// data-protection request — it is an availability incident wearing one. The remedy the refusal
|
|
1071
|
+
// names (appoint another administrator, then erase) satisfies both obligations; silently
|
|
1072
|
+
// proceeding satisfies neither.
|
|
1073
|
+
await this.assertSuperAdminFloorForSubjectErasure(
|
|
1074
|
+
resourceType,
|
|
1075
|
+
subjectIds,
|
|
1076
|
+
systemContext,
|
|
1077
|
+
options?.acknowledgeAdministrativeContinuityFloorBreach,
|
|
1078
|
+
);
|
|
1079
|
+
|
|
1080
|
+
// ── Guard 3: the last-organization-owner floor ──
|
|
1081
|
+
//
|
|
1082
|
+
// The per-tenant sibling of Guard 2, and the only one of the two that can refuse on behalf of
|
|
1083
|
+
// several populations at once. It runs SECOND because the application floor is the more
|
|
1084
|
+
// fundamental condition: an application with no administrator cannot repair an ownerless tenant
|
|
1085
|
+
// either, so reporting that first gives the operator the outer problem to solve.
|
|
1086
|
+
//
|
|
1087
|
+
// Also BEFORE `eraseSubjectInPlace`, so a refusal from either guard leaves nothing written.
|
|
1088
|
+
await this.assertOrganizationOwnerFloorForSubjectErasure(
|
|
1089
|
+
resourceType,
|
|
1090
|
+
subjectIds,
|
|
1091
|
+
systemContext,
|
|
1092
|
+
options?.acknowledgeOrganizationOwnerFloorBreach,
|
|
1093
|
+
);
|
|
1094
|
+
|
|
1095
|
+
// ── Guard 4: HTTP_API stance-6c resources demand a per-request acknowledgement ──
|
|
1096
|
+
//
|
|
1097
|
+
// Rows linked to the subject that live in an external system the platform CANNOT erase
|
|
1098
|
+
// (D6 stance 6c) must not be silently skipped by an erasure that then reports itself done.
|
|
1099
|
+
// Refusing HERE — before `eraseSubjectInPlace`, like the two floors — leaves nothing written;
|
|
1100
|
+
// the stance's post-commit effect can only RECORD, never refuse. The refusal is escapable per
|
|
1101
|
+
// request (`acknowledgeHttpApiNonErasure`), never by a standing configuration — the same
|
|
1102
|
+
// defeasibility argument as the floors: GDPR Art. 17(3) does not list "a third party holds
|
|
1103
|
+
// copies we cannot delete" as a ground for the FRAMEWORK to refuse indefinitely, so the
|
|
1104
|
+
// controller decides, and the record is the control.
|
|
1105
|
+
this.assertHttpApiNonErasureAcknowledged(
|
|
1106
|
+
resourceType,
|
|
1107
|
+
options?.acknowledgeHttpApiNonErasure,
|
|
1108
|
+
systemContext,
|
|
1109
|
+
);
|
|
1110
|
+
|
|
1111
|
+
const report = await this.getServicesRegistryHandler()
|
|
1112
|
+
.getService(resourceType)
|
|
1113
|
+
.eraseSubjectInPlace(resourceType, subjectIds, systemContext, options);
|
|
1114
|
+
|
|
1115
|
+
// ── External, non-transactional effects — POST-COMMIT by construction ──
|
|
1116
|
+
//
|
|
1117
|
+
// `eraseSubjectInPlace` has returned, so its transaction is closed and the local scrub is
|
|
1118
|
+
// durable. Only now may we call out to systems we do not own (a billing provider anonymizing
|
|
1119
|
+
// its customer, say). Running them inside the transaction would be wrong twice over: it would
|
|
1120
|
+
// hold a database transaction open across third-party network latency, and a later rollback
|
|
1121
|
+
// could not undo a provider-side erasure that had already applied.
|
|
1122
|
+
//
|
|
1123
|
+
// The consequence is deliberate and asymmetric: a failure here does NOT fail the erasure. The
|
|
1124
|
+
// local rows are correctly scrubbed either way, and throwing would invite the caller to retry
|
|
1125
|
+
// an erasure whose local half already succeeded. The incomplete state travels in the report
|
|
1126
|
+
// instead — which is why `SubjectErasureReport.externalEffects` exists rather than a boolean.
|
|
1127
|
+
// No registry bound → no effect ever declared itself for this subject, so an empty list is the
|
|
1128
|
+
// truthful answer (NOT `NOT_REGISTERED`, which means a KNOWN effect had no handler).
|
|
1129
|
+
report.externalEffects = this.subjectErasureExternalEffects
|
|
1130
|
+
? await this.subjectErasureExternalEffects.runAll({
|
|
1131
|
+
subjectResourceType: resourceType,
|
|
1132
|
+
subjectIds,
|
|
1133
|
+
scopeContext: options?.scopeContext,
|
|
1134
|
+
})
|
|
1135
|
+
: [];
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Tolerate a port that answers with nothing — because the LOCAL ERASURE IS ALREADY COMMITTED.
|
|
1139
|
+
*
|
|
1140
|
+
* `runAll` is typed to resolve an array, but this is an injected port: an implementation that
|
|
1141
|
+
* returns `undefined` (or a stub standing in for one) satisfies the binding and violates the
|
|
1142
|
+
* contract. Dereferencing it threw `Cannot read properties of undefined (reading 'filter')` AFTER
|
|
1143
|
+
* the transaction committed — so a completed, correct erasure surfaced to its caller as a failure,
|
|
1144
|
+
* inviting a retry of work already done. Turning a successful data-protection request into an
|
|
1145
|
+
* apparent failure is the worse outcome, so the malformed answer is coerced and reported LOUDLY
|
|
1146
|
+
* rather than thrown: nothing here can undo the erasure, and an operator still has to learn that
|
|
1147
|
+
* external effects were not actually measured.
|
|
1148
|
+
*/
|
|
1149
|
+
if (!Array.isArray(report.externalEffects)) {
|
|
1150
|
+
this.logger?.error(
|
|
1151
|
+
'Subject-erasure external-effects port returned a non-array; treating it as NO effects measured. '
|
|
1152
|
+
+ 'The LOCAL erasure is committed and correct, but whether personal data is still live at a third '
|
|
1153
|
+
+ 'party is now UNKNOWN rather than reported.',
|
|
1154
|
+
{ subjectResourceType: resourceType, subjectCount: subjectIds.length, received: typeof report.externalEffects },
|
|
1155
|
+
);
|
|
1156
|
+
report.externalEffects = [];
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
const incompleteEffects = selectIncompleteExternalEffects(report.externalEffects);
|
|
1160
|
+
if (incompleteEffects.length > 0) {
|
|
1161
|
+
// ERROR, not warn: personal data is potentially still live at a third party after a
|
|
1162
|
+
// completed data-protection request. That is an operator obligation, not a footnote — and the
|
|
1163
|
+
// report is returned to a caller who may only persist it, so the log has to stand alone.
|
|
1164
|
+
this.logger?.error('Subject erasure completed LOCALLY but external effects are incomplete', {
|
|
1165
|
+
subjectResourceType: resourceType,
|
|
1166
|
+
subjectCount: subjectIds.length,
|
|
1167
|
+
incompleteEffects: incompleteEffects.map((effect) => ({
|
|
1168
|
+
effectRef: effect.effectRef,
|
|
1169
|
+
status: effect.status,
|
|
1170
|
+
detail: effect.detail,
|
|
1171
|
+
failedSteps: (effect.steps ?? [])
|
|
1172
|
+
.filter((step) => !step.succeeded)
|
|
1173
|
+
.map((step) => ({ step: step.step, targetRef: step.targetRef, error: step.error })),
|
|
1174
|
+
})),
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
// Best-effort privileged-write audit of the erasure itself (never blocks or fails it) — mirrors
|
|
1179
|
+
// the other trusted writes. The dependent teardowns audit themselves through the writers they
|
|
1180
|
+
// run on; the per-edge dispositions are additionally carried by the returned report and the
|
|
1181
|
+
// structured completion log.
|
|
1182
|
+
this.auditLogsService?.logSystemContextWrite({
|
|
1183
|
+
resourceType: resourceType as string,
|
|
1184
|
+
operation: CoreResourceOperation.UPDATE_MANY,
|
|
1185
|
+
organizationId: options?.scopeContext?.organizationId,
|
|
1186
|
+
scopeContext: options?.scopeContext,
|
|
1187
|
+
performedByRuntime: this.describeRuntimeForAudit(),
|
|
1188
|
+
}).catch(() => { /* audit is best-effort */ });
|
|
1189
|
+
|
|
1190
|
+
return report;
|
|
1191
|
+
}
|
|
1192
|
+
```
|
|
1193
|
+
|
|
1194
|
+
## Checklist
|
|
1195
|
+
|
|
1196
|
+
- [ ] The resource's `*.resources-config.ts` sets `systemAccessPolicy` with the
|
|
1197
|
+
matching verb `= ResourceSystemAccessMode.ALLOWED` for exactly the verb(s) you
|
|
1198
|
+
call — read / list for reads, create / update / updateMany for writes
|
|
1199
|
+
(fail-closed: anything else throws `ErrorType.CONFIGURATION`).
|
|
1200
|
+
- [ ] The calling code resolves `SystemAccessBackendService` — not the handler.
|
|
1201
|
+
- [ ] The caller enforces an explicit alternative authorization (token /
|
|
1202
|
+
email-ownership / userless-internal) — system access bypasses the resource ACL.
|
|
1203
|
+
- [ ] READS: the result is projected, not forwarded verbatim, to the originating
|
|
1204
|
+
(often lower-privilege) request — it is the full super-admin record.
|
|
1205
|
+
- [ ] WRITES: the payload is a complete trusted domain object — the primitive
|
|
1206
|
+
re-attaches the DTO-stripped backend-only + context-FK fields for you, so a
|
|
1207
|
+
caller can't silently under-persist one.
|
|
1208
|
+
- [ ] For a polymorphic resource, the policy is declared once on the shared config
|
|
1209
|
+
(it is shared by every scope variant).
|