@wildo-ai/framework-knowledge 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/framework-knowledge.definitions.d.ts +51 -0
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.definitions.js +1571 -0
- package/dist/esm/framework-knowledge.definitions.js.map +1 -0
- package/dist/esm/framework-knowledge.loader.d.ts +72 -0
- package/dist/esm/framework-knowledge.loader.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.loader.js +258 -0
- package/dist/esm/framework-knowledge.loader.js.map +1 -0
- package/dist/esm/framework-knowledge.schemas.d.ts +236 -0
- package/dist/esm/framework-knowledge.schemas.d.ts.map +1 -0
- package/dist/esm/framework-knowledge.schemas.js +23 -0
- package/dist/esm/framework-knowledge.schemas.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +56 -0
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts +200 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js +228 -0
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js +39 -0
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +261 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +412 -0
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +61 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +65 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +54 -0
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts +43 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js +73 -0
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +53 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +114 -0
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +95 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +102 -0
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts +258 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js +241 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts +241 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js +202 -0
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts +82 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js +89 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts +56 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js +76 -0
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts +30 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js +27 -0
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts +31 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js +26 -0
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +254 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +219 -0
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts +180 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +302 -0
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +249 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +286 -0
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts +248 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js +227 -0
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts +45 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js +48 -0
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts +250 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +218 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -0
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -0
- package/dist/knowledge/manifest.json +45 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +407 -0
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +69 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +556 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +47 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/method.md +344 -0
- package/dist/knowledge/playbooks/bottom_up.build-scale/playbook.json +43 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +259 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +83 -0
- package/dist/knowledge/playbooks/bottom_up.domain-plan/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/method.md +321 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +79 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +185 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +66 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +737 -0
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +44 -0
- package/dist/knowledge/playbooks/refinement.document-facts/method.md +261 -0
- package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +57 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/method.md +151 -0
- package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +124 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.business-model/method.md +128 -0
- package/dist/knowledge/playbooks/top_down.business-model/playbook.json +102 -0
- package/dist/knowledge/playbooks/top_down.business-model/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.capability-map/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +73 -0
- package/dist/knowledge/playbooks/top_down.capability-map/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/method.md +177 -0
- package/dist/knowledge/playbooks/top_down.compliance-posture/playbook.json +95 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/method.md +64 -0
- package/dist/knowledge/playbooks/top_down.market-analysis/playbook.json +49 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/method.md +56 -0
- package/dist/knowledge/playbooks/top_down.market-evidence-adequacy/playbook.json +40 -0
- package/dist/knowledge/playbooks/top_down.market-research/method.md +68 -0
- package/dist/knowledge/playbooks/top_down.market-research/playbook.json +42 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +239 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +69 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/method.md +96 -0
- package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +77 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +53 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +61 -0
- package/dist/knowledge/playbooks/top_down.requirements-definition/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/method.md +280 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/playbook.json +87 -0
- package/dist/knowledge/playbooks/top_down.scope-roadmap/structured-artifact-action.json +1 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/method.md +204 -0
- package/dist/knowledge/playbooks/top_down.value-proposition/playbook.json +54 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +146 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +120 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/structured-artifact-action.json +1 -0
- package/dist/knowledge/references/application.database.migration-change-risk.md +28 -0
- package/dist/knowledge/references/assertions.authored-metadata.config.md +90 -0
- package/dist/knowledge/references/assertions.behaviors.wire-contracts.md +223 -0
- package/dist/knowledge/references/assertions.references.conventions.md +92 -0
- package/dist/knowledge/references/assertions.snapshot.validation.md +317 -0
- package/dist/knowledge/references/assertions.specification.config.md +287 -0
- package/dist/knowledge/references/brand.asset.config.md +167 -0
- package/dist/knowledge/references/brand.authored-metadata.config.md +51 -0
- package/dist/knowledge/references/brand.logo-direction.config.md +88 -0
- package/dist/knowledge/references/brand.name.config.md +46 -0
- package/dist/knowledge/references/brand.snapshot.config.md +76 -0
- package/dist/knowledge/references/brand.snapshot.validation.md +446 -0
- package/dist/knowledge/references/brand.visual-tone.config.md +56 -0
- package/dist/knowledge/references/build-plan.task-graph.config.md +198 -0
- package/dist/knowledge/references/business-model.authored-metadata.config.md +65 -0
- package/dist/knowledge/references/business-model.pricing-plan.config.md +122 -0
- package/dist/knowledge/references/business-model.references.conventions.md +99 -0
- package/dist/knowledge/references/business-model.snapshot.config.md +121 -0
- package/dist/knowledge/references/business-model.snapshot.validation.md +325 -0
- package/dist/knowledge/references/cli.market.generate-command.md +230 -0
- package/dist/knowledge/references/cli.market.utils.md +147 -0
- package/dist/knowledge/references/companion.introspection.behaviors.market.md +90 -0
- package/dist/knowledge/references/companion.introspection.handlers.market.md +42 -0
- package/dist/knowledge/references/companion.market.generation-service.md +270 -0
- package/dist/knowledge/references/companion.market.prompt-renderer.md +244 -0
- package/dist/knowledge/references/companion.technical-doc.service.md +809 -0
- package/dist/knowledge/references/engine.client-bundle.allow-list.md +125 -0
- package/dist/knowledge/references/engine.client-bundle.discipline.md +130 -0
- package/dist/knowledge/references/engine.client-bundle.external-connectors-public.discipline.md +55 -0
- package/dist/knowledge/references/engine.saas-technical-doc.config.md +215 -0
- package/dist/knowledge/references/engine.saas-website.config.md +331 -0
- package/dist/knowledge/references/example.authorization.unit-narrowing.declaration.md +24 -0
- package/dist/knowledge/references/example.backend.addon-wiring.module.md +55 -0
- package/dist/knowledge/references/example.backend.custom-operation.create-postfix.md +35 -0
- package/dist/knowledge/references/example.backend.operation.error-throw.md +17 -0
- package/dist/knowledge/references/example.config.app-shell.command-menu-items.md +63 -0
- package/dist/knowledge/references/example.config.app-shell.full.md +147 -0
- package/dist/knowledge/references/example.config.app-shell.hosted-components.md +45 -0
- package/dist/knowledge/references/example.config.app-shell.quick-switcher-fields.md +37 -0
- package/dist/knowledge/references/example.config.backend.billing-enable.md +20 -0
- package/dist/knowledge/references/example.config.backend.required-floors.md +46 -0
- package/dist/knowledge/references/example.config.design-system.full.md +162 -0
- package/dist/knowledge/references/example.config.navigation.full.md +71 -0
- package/dist/knowledge/references/example.config.provider.backend-scope-billing.md +27 -0
- package/dist/knowledge/references/example.data-seeding.minimal.md +114 -0
- package/dist/knowledge/references/example.email.template.minimal.md +54 -0
- package/dist/knowledge/references/example.engine.component-registration.lazy-load.md +16 -0
- package/dist/knowledge/references/example.engine.product-definitions.feature-and-profiles.md +146 -0
- package/dist/knowledge/references/example.flows-actors.chat-assistant.md +196 -0
- package/dist/knowledge/references/example.flows-actors.llm-agent-one-shot.md +174 -0
- package/dist/knowledge/references/example.i18n.label-generation.engine-barrel.md +15 -0
- package/dist/knowledge/references/example.infra.cdn.cloudflare.md +23 -0
- package/dist/knowledge/references/example.infra.cdn.generic.md +17 -0
- package/dist/knowledge/references/example.infra.environment-config.local.md +250 -0
- package/dist/knowledge/references/example.market.alternative.in-house-build.md +49 -0
- package/dist/knowledge/references/example.market.authored-metadata.md +32 -0
- package/dist/knowledge/references/example.market.buying-journey.core-icp.md +140 -0
- package/dist/knowledge/references/example.market.category.config.md +71 -0
- package/dist/knowledge/references/example.market.channel.community.md +39 -0
- package/dist/knowledge/references/example.market.feature-benefit.kano-threshold.md +67 -0
- package/dist/knowledge/references/example.market.feature-benefit.pain-reliever.md +65 -0
- package/dist/knowledge/references/example.market.icp.anti-target.md +47 -0
- package/dist/knowledge/references/example.market.icp.individual.md +82 -0
- package/dist/knowledge/references/example.market.icp.legal-entity-with-geographies.md +95 -0
- package/dist/knowledge/references/example.market.is-benefit-available.composition.md +40 -0
- package/dist/knowledge/references/example.market.job.emotional.md +27 -0
- package/dist/knowledge/references/example.market.job.functional.md +28 -0
- package/dist/knowledge/references/example.market.message-template.seeds.md +106 -0
- package/dist/knowledge/references/example.market.objection.pricing.md +39 -0
- package/dist/knowledge/references/example.market.persona.dmu-with-inheritance.md +62 -0
- package/dist/knowledge/references/example.market.persona.individual-self.md +51 -0
- package/dist/knowledge/references/example.market.positioning.per-icp.md +103 -0
- package/dist/knowledge/references/example.market.proof.metric.md +39 -0
- package/dist/knowledge/references/example.market.scoring.golden-case.md +46 -0
- package/dist/knowledge/references/example.market.scoring.no-coverage-zero.md +40 -0
- package/dist/knowledge/references/example.market.snapshot-validation.duplicate-journey-stage.md +36 -0
- package/dist/knowledge/references/example.market.snapshot-validation.errors-by-kind.md +55 -0
- package/dist/knowledge/references/example.market.snapshot-validation.objection-proof-benefit-mismatch.md +74 -0
- package/dist/knowledge/references/example.market.snapshot-validation.proof-without-support.md +32 -0
- package/dist/knowledge/references/example.market.snapshot-validation.threshold-without-job.md +44 -0
- package/dist/knowledge/references/example.market.snapshot.assembled.md +49 -0
- package/dist/knowledge/references/example.market.tone-of-voice.config.md +41 -0
- package/dist/knowledge/references/example.market.trigger.growth-milestone.md +43 -0
- package/dist/knowledge/references/example.module.companion-exports.full.md +142 -0
- package/dist/knowledge/references/example.module.registration.shared.md +16 -0
- package/dist/knowledge/references/example.module.relationships.actor-edge-back-to-scope-owner.md +47 -0
- package/dist/knowledge/references/example.module.relationships.discriminator.md +25 -0
- package/dist/knowledge/references/example.module.relationships.scope-membership-junction.md +25 -0
- package/dist/knowledge/references/example.provider.backend-module-shape.md +110 -0
- package/dist/knowledge/references/example.provider.contribution.backend-billing.md +12 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.contribution.md +30 -0
- package/dist/knowledge/references/example.provider.frontend-file-picker.module.md +21 -0
- package/dist/knowledge/references/example.rag.source-fields.declaration.md +83 -0
- package/dist/knowledge/references/example.rate-limit.custom-controller-surface.md +25 -0
- package/dist/knowledge/references/example.rate-limit.resource-operation-surface.md +24 -0
- package/dist/knowledge/references/example.resource.add-field.priority-enum.md +19 -0
- package/dist/knowledge/references/example.resource.add-resource.module-factory-map.md +21 -0
- package/dist/knowledge/references/example.resource.config-wiring.fk-relationship.md +33 -0
- package/dist/knowledge/references/example.resource.custom-view.read-host.md +28 -0
- package/dist/knowledge/references/example.resource.mcp-exposure.md +65 -0
- package/dist/knowledge/references/example.resource.reference-constraints.role-constrained.md +27 -0
- package/dist/knowledge/references/example.resource.ui-behavior.enum-badge.md +22 -0
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +43 -0
- package/dist/knowledge/references/example.spec.composite-view.workspace.md +72 -0
- package/dist/knowledge/references/example.spec.feature.flag-with-codehandling.md +64 -0
- package/dist/knowledge/references/example.spec.frontend-component.prop-vocabulary.md +88 -0
- package/dist/knowledge/references/example.spec.resource.semantic-field.md +23 -0
- package/dist/knowledge/references/example.views.app-level.composite-views-config.md +19 -0
- package/dist/knowledge/references/example.views.chart-view.resource-owned.md +69 -0
- package/dist/knowledge/references/example.views.composite-view.host-embeds.md +31 -0
- package/dist/knowledge/references/example.views.composite-view.workspace.md +65 -0
- package/dist/knowledge/references/example.views.custom-view.execution-host.md +41 -0
- package/dist/knowledge/references/example.views.execution-view.resource-owned.md +25 -0
- package/dist/knowledge/references/external-connectors.app.frontend-provider-module.md +42 -0
- package/dist/knowledge/references/market.alternative.config.md +68 -0
- package/dist/knowledge/references/market.alternative.kind.md +32 -0
- package/dist/knowledge/references/market.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/market.buying-journey.config.md +43 -0
- package/dist/knowledge/references/market.buying-journey.stage.md +33 -0
- package/dist/knowledge/references/market.category.config.md +63 -0
- package/dist/knowledge/references/market.channel.config.md +59 -0
- package/dist/knowledge/references/market.channel.kind.md +49 -0
- package/dist/knowledge/references/market.context-block.builder.md +544 -0
- package/dist/knowledge/references/market.context-block.response.md +57 -0
- package/dist/knowledge/references/market.feature-benefit.config.md +84 -0
- package/dist/knowledge/references/market.feature-benefit.kano.md +41 -0
- package/dist/knowledge/references/market.gain.config.md +50 -0
- package/dist/knowledge/references/market.generation.response.md +108 -0
- package/dist/knowledge/references/market.icp.config.md +162 -0
- package/dist/knowledge/references/market.icp.geographic-targeting.md +57 -0
- package/dist/knowledge/references/market.inherit-from.md +74 -0
- package/dist/knowledge/references/market.is-benefit-available.md +58 -0
- package/dist/knowledge/references/market.job.config.md +48 -0
- package/dist/knowledge/references/market.message-template.config.md +86 -0
- package/dist/knowledge/references/market.objection.config.md +56 -0
- package/dist/knowledge/references/market.objection.kind.md +34 -0
- package/dist/knowledge/references/market.pain.config.md +50 -0
- package/dist/knowledge/references/market.persona.config.md +64 -0
- package/dist/knowledge/references/market.positioning.config.md +84 -0
- package/dist/knowledge/references/market.proof.config.md +48 -0
- package/dist/knowledge/references/market.proof.kind.md +34 -0
- package/dist/knowledge/references/market.references.weighted-edges.md +105 -0
- package/dist/knowledge/references/market.scoring.fit.md +215 -0
- package/dist/knowledge/references/market.snapshot.config.md +34 -0
- package/dist/knowledge/references/market.snapshot.validation.md +1171 -0
- package/dist/knowledge/references/market.tone-of-voice.config.md +80 -0
- package/dist/knowledge/references/market.trigger.config.md +45 -0
- package/dist/knowledge/references/market.trigger.kind.md +35 -0
- package/dist/knowledge/references/placement-plan.config.md +330 -0
- package/dist/knowledge/references/platform.config.application-database.md +74 -0
- package/dist/knowledge/references/platform.config.application-modules.md +30 -0
- package/dist/knowledge/references/platform.config.backing-services.md +266 -0
- package/dist/knowledge/references/platform.config.cdn.md +167 -0
- package/dist/knowledge/references/platform.config.environment.deployment.md +263 -0
- package/dist/knowledge/references/platform.config.saas.md +405 -0
- package/dist/knowledge/references/presets.models.design-system.configuration.md +59 -0
- package/dist/knowledge/references/presets.models.design-system.source-config.md +72 -0
- package/dist/knowledge/references/presets.models.labelling.sections.md +64 -0
- package/dist/knowledge/references/presets.models.material.profile-contract.md +192 -0
- package/dist/knowledge/references/presets.models.material.runtime-policy.md +60 -0
- package/dist/knowledge/references/presets.models.surface-policy.defaults.md +613 -0
- package/dist/knowledge/references/presets.models.surface-policy.md +534 -0
- package/dist/knowledge/references/presets.models.surface-variant.md +56 -0
- package/dist/knowledge/references/requirements.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/requirements.functional-requirement.config.md +68 -0
- package/dist/knowledge/references/requirements.non-functional-requirement.config.md +100 -0
- package/dist/knowledge/references/requirements.references.conventions.md +125 -0
- package/dist/knowledge/references/requirements.snapshot.config.md +73 -0
- package/dist/knowledge/references/requirements.snapshot.validation.md +333 -0
- package/dist/knowledge/references/roadmap.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/roadmap.phase.config.md +149 -0
- package/dist/knowledge/references/roadmap.references.conventions.md +89 -0
- package/dist/knowledge/references/roadmap.snapshot.config.md +65 -0
- package/dist/knowledge/references/roadmap.snapshot.validation.md +325 -0
- package/dist/knowledge/references/saas.backend.app-config.backend-authored.md +32 -0
- package/dist/knowledge/references/saas.backend.application-initialization.assembly.md +38 -0
- package/dist/knowledge/references/saas.backend.billing.resolution-failure-reasons.md +45 -0
- package/dist/knowledge/references/saas.backend.custom-operation.authoritative-fields.md +53 -0
- package/dist/knowledge/references/saas.backend.custom-operation.transactional-core.md +120 -0
- package/dist/knowledge/references/saas.backend.domain-module.md +237 -0
- package/dist/knowledge/references/saas.backend.email-template.definition.md +69 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-agent-card.md +89 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-task-surface.md +118 -0
- package/dist/knowledge/references/saas.backend.flows-actors.function-tool.md +82 -0
- package/dist/knowledge/references/saas.backend.flows-actors.invoke-agent.md +48 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-read-tool.md +39 -0
- package/dist/knowledge/references/saas.backend.flows-actors.resource-write-tool.md +67 -0
- package/dist/knowledge/references/saas.backend.pdf-template.bindings.md +52 -0
- package/dist/knowledge/references/saas.backend.pdf-template.definition.md +113 -0
- package/dist/knowledge/references/saas.backend.rate-limit-service.check-policy.md +75 -0
- package/dist/knowledge/references/saas.backend.system-access-service.md +994 -0
- package/dist/knowledge/references/saas.data-seeding.admin-endpoints.md +59 -0
- package/dist/knowledge/references/saas.data-seeding.bootstrap-wiring.md +184 -0
- package/dist/knowledge/references/saas.data-seeding.definition-input.md +95 -0
- package/dist/knowledge/references/saas.data-seeding.modes.md +72 -0
- package/dist/knowledge/references/saas.data-seeding.run-ledger.md +198 -0
- package/dist/knowledge/references/saas.data-seeding.run-status.md +35 -0
- package/dist/knowledge/references/saas.data-seeding.schedule.md +91 -0
- package/dist/knowledge/references/saas.data-seeding.scope-iteration-strategy.md +46 -0
- package/dist/knowledge/references/saas.external-providers.backend-provider-registry.runtime-filter.md +55 -0
- package/dist/knowledge/references/saas.external-providers.document-extraction.applicability.md +26 -0
- package/dist/knowledge/references/saas.external-providers.embeddings.applicability.md +30 -0
- package/dist/knowledge/references/saas.external-providers.llm.model-configuration.md +124 -0
- package/dist/knowledge/references/saas.external-providers.llm.operation-key.md +49 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.configuration.md +265 -0
- package/dist/knowledge/references/saas.frontend.app-level-component.vocabulary.md +148 -0
- package/dist/knowledge/references/saas.frontend.app-shell.hosted-components.md +145 -0
- package/dist/knowledge/references/saas.frontend.chart-view.inserted-declaration.md +80 -0
- package/dist/knowledge/references/saas.frontend.command-menu.omnibox.md +88 -0
- package/dist/knowledge/references/saas.frontend.command-menu.search-resource.md +109 -0
- package/dist/knowledge/references/saas.frontend.component-registration.entry.md +21 -0
- package/dist/knowledge/references/saas.frontend.composite-view.authoring.md +102 -0
- package/dist/knowledge/references/saas.frontend.composite-view.define-helper.md +31 -0
- package/dist/knowledge/references/saas.frontend.domain-module.md +31 -0
- package/dist/knowledge/references/saas.frontend.embedded-resource-descent.md +37 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.action-status-contract.per-action-retry-loop.md +115 -0
- package/dist/knowledge/references/saas.frontend.execution-view.definition.md +172 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.local-pane.md +109 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-bridge-contract.md +55 -0
- package/dist/knowledge/references/saas.frontend.execution-view.dirty-state-contract.md +151 -0
- package/dist/knowledge/references/saas.frontend.execution-view.failure-handling-contract.md +302 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.md +89 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.md +231 -0
- package/dist/knowledge/references/saas.frontend.execution-view.loading-aggregation.participation-prefetch.shell-data-hydrator.md +174 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.md +96 -0
- package/dist/knowledge/references/saas.frontend.execution-view.navigation-handling-and-embedding.resolution.md +45 -0
- package/dist/knowledge/references/saas.frontend.execution-view.outcome-emission-contract.md +71 -0
- package/dist/knowledge/references/saas.frontend.execution-view.participation-and-anchor.md +80 -0
- package/dist/knowledge/references/saas.frontend.execution-view.three-zone-contract.md +147 -0
- package/dist/knowledge/references/saas.frontend.flows-actors-view.md +40 -0
- package/dist/knowledge/references/saas.frontend.form-fields.file-provider-constraints.md +80 -0
- package/dist/knowledge/references/saas.frontend.full-custom-view.definition.md +64 -0
- package/dist/knowledge/references/saas.frontend.inserted-view.identity-bindings-descriptor.md +149 -0
- package/dist/knowledge/references/saas.frontend.operation-key-and-resource-config-like.md +63 -0
- package/dist/knowledge/references/saas.frontend.quick-switcher.scope-field.md +102 -0
- package/dist/knowledge/references/saas.frontend.related-resource-embeds.md +86 -0
- package/dist/knowledge/references/saas.frontend.related-resource-preview.md +23 -0
- package/dist/knowledge/references/saas.frontend.related-resource-sections.md +28 -0
- package/dist/knowledge/references/saas.frontend.resource-header-title.md +43 -0
- package/dist/knowledge/references/saas.frontend.resource-layout-templates.md +215 -0
- package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +531 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +210 -0
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-preset-map.md +39 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.engine-destinations.md +58 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +118 -0
- package/dist/knowledge/references/saas.frontend.view-definition-scope.md +42 -0
- package/dist/knowledge/references/saas.market.generation-agent.md +104 -0
- package/dist/knowledge/references/saas.models.core-resource-operation.md +86 -0
- package/dist/knowledge/references/saas.models.data-mode-read-list.md +395 -0
- package/dist/knowledge/references/saas.models.engine-capabilities.md +114 -0
- package/dist/knowledge/references/saas.models.error-type.md +45 -0
- package/dist/knowledge/references/saas.models.external-data-pipeline.md +162 -0
- package/dist/knowledge/references/saas.models.feature-limit-semantic.md +51 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-configuration.md +127 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-definition.md +115 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-invocation.md +52 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-prompt-spec.md +188 -0
- package/dist/knowledge/references/saas.models.http-api-binding.md +237 -0
- package/dist/knowledge/references/saas.models.navigation.layout.md +149 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-containment.md +22 -0
- package/dist/knowledge/references/saas.models.organization-unit-narrowing-declaration.md +42 -0
- package/dist/knowledge/references/saas.models.polymorphism.optout-business-key.md +62 -0
- package/dist/knowledge/references/saas.models.polymorphism.variant-definition.md +74 -0
- package/dist/knowledge/references/saas.models.provider-capabilities.md +97 -0
- package/dist/knowledge/references/saas.models.rate-limit-configuration.md +67 -0
- package/dist/knowledge/references/saas.models.relationship-handling-contract.md +30 -0
- package/dist/knowledge/references/saas.models.relationship-handling-settings.md +62 -0
- package/dist/knowledge/references/saas.models.relationship-nature-and-models.md +112 -0
- package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +431 -0
- package/dist/knowledge/references/saas.models.resource-config.forwarded-label.md +88 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-api-call.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-base.md +79 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-mcp-exposure.md +49 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-path.md +27 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-union.md +26 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-variant-for-key.md +62 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-configuration.md +124 -0
- package/dist/knowledge/references/saas.models.resource-config.resource-relationships-buckets.md +38 -0
- package/dist/knowledge/references/saas.models.resource-config.resources-registry.md +69 -0
- package/dist/knowledge/references/saas.models.resource-config.searchable-relation.md +89 -0
- package/dist/knowledge/references/saas.models.resource-config.system-access-policy.md +121 -0
- package/dist/knowledge/references/saas.models.resource-config.token-generation.md +145 -0
- package/dist/knowledge/references/saas.models.resource-field-identifier.md +25 -0
- package/dist/knowledge/references/saas.models.resource-operation-display-risk.md +77 -0
- package/dist/knowledge/references/saas.models.resource-operation-variant-runtime.md +58 -0
- package/dist/knowledge/references/saas.models.resource-primary-scope.md +36 -0
- package/dist/knowledge/references/saas.models.resource-relationship-access-scope.md +26 -0
- package/dist/knowledge/references/saas.models.resource-relationship-builder-parameters.md +100 -0
- package/dist/knowledge/references/saas.models.resource-relationship-cardinality.md +57 -0
- package/dist/knowledge/references/saas.models.resource-relationship-declaration.md +69 -0
- package/dist/knowledge/references/saas.models.resource-relationship-resolved-semantics.md +60 -0
- package/dist/knowledge/references/saas.models.resource-relationship-schema.md +172 -0
- package/dist/knowledge/references/saas.models.resource-server-instance.md +109 -0
- package/dist/knowledge/references/saas.models.resource-type.md +24 -0
- package/dist/knowledge/references/saas.models.schema-family-builder.md +242 -0
- package/dist/knowledge/references/saas.models.scope-membership.md +143 -0
- package/dist/knowledge/references/saas.models.shared-domain-module.md +36 -0
- package/dist/knowledge/references/saas.models.shared-saas-module.md +36 -0
- package/dist/knowledge/references/saas.public-runtime.contract.md +229 -0
- package/dist/knowledge/references/saas.rag.retrieval-bounds.md +106 -0
- package/dist/knowledge/references/saas.rag.retrieval-refusals.md +89 -0
- package/dist/knowledge/references/saas.rag.retrieval-request.md +130 -0
- package/dist/knowledge/references/saas.rag.retrieval-result.md +147 -0
- package/dist/knowledge/references/saas.rag.retrieval-scores.md +54 -0
- package/dist/knowledge/references/saas.specifications.application-document-fact-specification.contract.md +59 -0
- package/dist/knowledge/references/saas.specifications.application-document-publication.contract.md +74 -0
- package/dist/knowledge/references/saas.specifications.assurance-document-blueprint.contract.md +1158 -0
- package/dist/knowledge/references/saas.specifications.assurance-program.contract.md +2602 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.catalog-spec-shared.md +180 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.discriminated-union.md +138 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-aggregate-rating.md +47 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-article.md +49 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-blog-posting.md +62 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-breadcrumb-list.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-faq-page.md +51 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-offer.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-organization.md +48 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-product.md +59 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-review.md +46 -0
- package/dist/knowledge/references/saas.specifications.catalogs.schema-org.entity-website.md +46 -0
- package/dist/knowledge/references/saas.specifications.companion-exports.contract.md +530 -0
- package/dist/knowledge/references/saas.specifications.composite-view-specification.md +49 -0
- package/dist/knowledge/references/saas.specifications.error-message-specification.md +92 -0
- package/dist/knowledge/references/saas.specifications.family-specifications.md +109 -0
- package/dist/knowledge/references/saas.specifications.feature-specification.md +93 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-factory.md +113 -0
- package/dist/knowledge/references/saas.specifications.frontend-component-spec-model.md +366 -0
- package/dist/knowledge/references/saas.specifications.resource-frontend-configuration-aspect.md +41 -0
- package/dist/knowledge/references/saas.specifications.resource-operation-spec.md +1978 -0
- package/dist/knowledge/references/saas.specifications.resource-pdf-template-spec.md +58 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-code-handling.md +49 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-config.md +156 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-factory.md +171 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-config-type.md +54 -0
- package/dist/knowledge/references/saas.specifications.resource-spec-frontend-prose.md +171 -0
- package/dist/knowledge/references/saas.website.astro.bridge.md +262 -0
- package/dist/knowledge/references/saas.website.astro.head-renderer.md +271 -0
- package/dist/knowledge/references/saas.website.astro.headers-renderer.md +41 -0
- package/dist/knowledge/references/saas.website.astro.i18n-helper.md +121 -0
- package/dist/knowledge/references/saas.website.astro.label-key-collector.md +117 -0
- package/dist/knowledge/references/saas.website.astro.label-loader.md +377 -0
- package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +46 -0
- package/dist/knowledge/references/saas.website.astro.pick-labels-for-page.md +90 -0
- package/dist/knowledge/references/saas.website.astro.robots-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.astro.runtime-helper.md +187 -0
- package/dist/knowledge/references/saas.website.astro.site-context.md +141 -0
- package/dist/knowledge/references/saas.website.astro.sitemap-coverage.md +188 -0
- package/dist/knowledge/references/saas.website.astro.structured-data-renderer.md +174 -0
- package/dist/knowledge/references/saas.website.blog.bridge.md +396 -0
- package/dist/knowledge/references/saas.website.blog.collection-config.md +180 -0
- package/dist/knowledge/references/saas.website.blog.frontmatter.md +116 -0
- package/dist/knowledge/references/saas.website.blog.head-renderer.md +292 -0
- package/dist/knowledge/references/saas.website.blog.mdx-provider.md +100 -0
- package/dist/knowledge/references/saas.website.blog.post-renderer.md +291 -0
- package/dist/knowledge/references/saas.website.design-tokens.bundle.md +29 -0
- package/dist/knowledge/references/saas.website.design-tokens.colors.md +64 -0
- package/dist/knowledge/references/saas.website.design-tokens.radius.md +38 -0
- package/dist/knowledge/references/saas.website.factories.define-page-manifest.md +98 -0
- package/dist/knowledge/references/saas.website.factories.define-section.md +128 -0
- package/dist/knowledge/references/saas.website.label-keys.compose-helper.md +36 -0
- package/dist/knowledge/references/saas.website.label-keys.format.md +67 -0
- package/dist/knowledge/references/saas.website.label-pack.validator.md +206 -0
- package/dist/knowledge/references/saas.website.page-layout.component.md +217 -0
- package/dist/knowledge/references/saas.website.page-manifest.meta-label-keys.md +47 -0
- package/dist/knowledge/references/saas.website.page-manifest.route-path.md +49 -0
- package/dist/knowledge/references/saas.website.page-manifest.schema.md +186 -0
- package/dist/knowledge/references/saas.website.page-manifest.seo.md +46 -0
- package/dist/knowledge/references/saas.website.page.context.md +57 -0
- package/dist/knowledge/references/saas.website.primitives.button.md +123 -0
- package/dist/knowledge/references/saas.website.primitives.heading.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.image.md +103 -0
- package/dist/knowledge/references/saas.website.primitives.internal-button.md +151 -0
- package/dist/knowledge/references/saas.website.primitives.internal-link.md +193 -0
- package/dist/knowledge/references/saas.website.primitives.link.md +78 -0
- package/dist/knowledge/references/saas.website.primitives.text.md +82 -0
- package/dist/knowledge/references/saas.website.refs.page.md +56 -0
- package/dist/knowledge/references/saas.website.refs.section.md +57 -0
- package/dist/knowledge/references/saas.website.root-config.navigation.md +37 -0
- package/dist/knowledge/references/saas.website.root-config.schema.md +192 -0
- package/dist/knowledge/references/saas.website.root-config.seo.md +98 -0
- package/dist/knowledge/references/saas.website.routing.localized-path.md +84 -0
- package/dist/knowledge/references/saas.website.runtime.context.md +174 -0
- package/dist/knowledge/references/saas.website.section.component.md +138 -0
- package/dist/knowledge/references/saas.website.section.context.md +63 -0
- package/dist/knowledge/references/saas.website.sections.category-enum.md +72 -0
- package/dist/knowledge/references/saas.website.sections.definition-schema.md +121 -0
- package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +37 -0
- package/dist/knowledge/references/saas.website.seo.robots-config.md +106 -0
- package/dist/knowledge/references/saas.website.seo.sitemap-config.md +73 -0
- package/dist/knowledge/references/saas.website.structured-data.payload-shape.md +71 -0
- package/dist/knowledge/references/saas.website.use-label-by-key.hook.md +45 -0
- package/dist/knowledge/references/saas.website.use-label.hook.md +82 -0
- package/dist/knowledge/references/saas.website.use-page.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-runtime.hook.md +36 -0
- package/dist/knowledge/references/saas.website.use-section.hook.md +30 -0
- package/dist/knowledge/references/saas.website.use-tokens.hook.md +32 -0
- package/dist/knowledge/references/vision.authored-metadata.config.md +64 -0
- package/dist/knowledge/references/vision.constraint.config.md +66 -0
- package/dist/knowledge/references/vision.idea.config.md +45 -0
- package/dist/knowledge/references/vision.mission.config.md +46 -0
- package/dist/knowledge/references/vision.problem.config.md +51 -0
- package/dist/knowledge/references/vision.references.conventions.md +115 -0
- package/dist/knowledge/references/vision.snapshot.config.md +85 -0
- package/dist/knowledge/references/vision.snapshot.validation.md +226 -0
- package/dist/knowledge/references/vision.success-criterion.config.md +60 -0
- package/dist/knowledge/references/zod.decorators.chainable-runtime.md +550 -0
- package/dist/knowledge/references/zod.decorators.conditional-visibility.md +104 -0
- package/dist/knowledge/references/zod.decorators.data-categories.md +197 -0
- package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +436 -0
- package/dist/knowledge/references/zod.decorators.display-edit-modes.md +174 -0
- package/dist/knowledge/references/zod.decorators.enums.frontend-handling.md +101 -0
- package/dist/knowledge/references/zod.decorators.field-spec-params.md +317 -0
- package/dist/knowledge/references/zod.decorators.file-generation.md +36 -0
- package/dist/knowledge/references/zod.decorators.file-rag-source.md +56 -0
- package/dist/knowledge/references/zod.decorators.file-schema.md +319 -0
- package/dist/knowledge/references/zod.decorators.foreign-key-display-mode.md +83 -0
- package/dist/knowledge/references/zod.decorators.per-primitive-ui.md +459 -0
- package/dist/knowledge/references/zod.decorators.primitive-ui.md +123 -0
- package/dist/knowledge/references/zod.decorators.rag-source.md +164 -0
- package/dist/knowledge/references/zod.decorators.schema-metadata.md +122 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +152 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-params.md +314 -0
- package/dist/knowledge/references/zod.decorators.structural-lifecycle-params.md +529 -0
- package/dist/knowledge/references/zod.factories.bigdecimal.md +155 -0
- package/dist/knowledge/references/zod.factories.code.md +127 -0
- package/dist/knowledge/references/zod.factories.duration.md +246 -0
- package/dist/knowledge/references/zod.factories.money.md +166 -0
- package/dist/knowledge/references/zod.factories.phone.md +88 -0
- package/dist/knowledge/references/zod.factories.range.md +174 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +15 -0
- package/dist/knowledge/registries/framework-topics.json +5212 -0
- package/dist/knowledge/registries/playbooks.json +488 -0
- package/dist/knowledge/registries/source-tags.json +7664 -0
- package/dist/knowledge/rules/resource-schema-awareness.md +77 -0
- package/dist/knowledge/skills/INDEX.md +349 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/examples/domain-use-case-and-admin-task.example.md +49 -0
- package/dist/knowledge/skills/application-consumer-documentation-authoring/references/source-and-ownership-routing.md +52 -0
- package/dist/knowledge/skills/application-database-migrations/SKILL.md +218 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-application-database-api.md +84 -0
- package/dist/knowledge/skills/application-database-migrations/references/framework-migration-change-risk-api.md +37 -0
- package/dist/knowledge/skills/application-database-migrations/references/migration-refusals.md +64 -0
- package/dist/knowledge/skills/application-database-migrations/references/postgresql-vs-mongodb-obligations.md +34 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +323 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/references/framework-unit-narrowing-declaration-api.md +84 -0
- package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +324 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/backend-di-routing.md +7 -0
- package/dist/knowledge/skills/backend-addon-wiring/references/framework-backend-bootstrap-api.md +276 -0
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +374 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-error-handling-api.md +118 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-operation-base-and-path-api.md +107 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-transactional-core-api.md +134 -0
- package/dist/knowledge/skills/backend-custom-operation/references/operation-file-conventions.md +10 -0
- package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +192 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/brand-authoring-decisions.md +55 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-asset-api.md +184 -0
- package/dist/knowledge/skills/brand-logo-authoring/references/framework-brand-snapshot-api.md +279 -0
- package/dist/knowledge/skills/compliance-document-authoring/SKILL.md +346 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-governance.md +160 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +518 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-service-terms.md +158 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-fact-specification-contract.md +95 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-application-document-publication-contract.md +100 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-assurance-document-blueprint-contract.md +1210 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-governed-document-after-drafting.md +40 -0
- package/dist/knowledge/skills/config-app-shell/SKILL.md +698 -0
- package/dist/knowledge/skills/config-app-shell/references/app-shell-surfaces.md +5 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-api.md +415 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-app-shell-hosted-components-api.md +170 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-command-menu-omnibox-api.md +212 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-quick-switcher-scope-field-api.md +178 -0
- package/dist/knowledge/skills/config-design-system/SKILL.md +424 -0
- package/dist/knowledge/skills/config-design-system/references/design-system-file.md +10 -0
- package/dist/knowledge/skills/config-design-system/references/framework-design-system-configuration-api.md +77 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-profile-api.md +200 -0
- package/dist/knowledge/skills/config-design-system/references/framework-material-runtime-policy-api.md +68 -0
- package/dist/knowledge/skills/config-design-system/references/framework-surface-policy-api.md +1212 -0
- package/dist/knowledge/skills/config-design-system/references/surface-policy-authoring.md +92 -0
- package/dist/knowledge/skills/config-navigation/SKILL.md +249 -0
- package/dist/knowledge/skills/config-navigation/references/framework-navigation-layout-api.md +152 -0
- package/dist/knowledge/skills/config-navigation/references/navigation-zones.md +5 -0
- package/dist/knowledge/skills/config-saas/SKILL.md +209 -0
- package/dist/knowledge/skills/config-saas/references/framework-provider-capabilities-api.md +221 -0
- package/dist/knowledge/skills/config-saas/references/framework-wildo-saas-config-api.md +408 -0
- package/dist/knowledge/skills/config-saas/references/saas-config-scope.md +9 -0
- package/dist/knowledge/skills/config-saas-backend/SKILL.md +183 -0
- package/dist/knowledge/skills/config-saas-backend/references/framework-backend-authored-config-api.md +40 -0
- package/dist/knowledge/skills/configure-billing/SKILL.md +261 -0
- package/dist/knowledge/skills/configure-billing/references/config-chain-and-failure-map.md +90 -0
- package/dist/knowledge/skills/configure-billing/references/example-backend-provider-module-shape.md +122 -0
- package/dist/knowledge/skills/configure-billing/references/example-provider-contribution-and-backend-config.md +48 -0
- package/dist/knowledge/skills/configure-billing/references/framework-backend-provider-reachability-api.md +69 -0
- package/dist/knowledge/skills/configure-billing/references/framework-billing-resolution-failure-api.md +57 -0
- package/dist/knowledge/skills/email-add-template/SKILL.md +439 -0
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +9 -0
- package/dist/knowledge/skills/email-add-template/references/framework-email-template-api.md +72 -0
- package/dist/knowledge/skills/email-definition-wiring/SKILL.md +62 -0
- package/dist/knowledge/skills/email-labels-authoring/SKILL.md +64 -0
- package/dist/knowledge/skills/email-template-authoring/SKILL.md +62 -0
- package/dist/knowledge/skills/engine-component-registration/SKILL.md +257 -0
- package/dist/knowledge/skills/engine-component-registration/references/component-registration-file.md +7 -0
- package/dist/knowledge/skills/engine-component-registration/references/framework-component-registration-api.md +24 -0
- package/dist/knowledge/skills/engine-product-definitions/SKILL.md +429 -0
- package/dist/knowledge/skills/engine-product-definitions/references/framework-engine-product-definitions-api.md +287 -0
- package/dist/knowledge/skills/engine-product-definitions/references/product-registry-scope.md +5 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/SKILL.md +491 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-flows-actors-a2a-contract.md +227 -0
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-named-a2a-agents-contract.md +143 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +368 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/examples/todo-assistant.example.md +226 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-tool-api.md +208 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-view-api.md +286 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +376 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-definition-api.md +262 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-invocation-api.md +130 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-prompt-spec-api.md +214 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-operation-and-model-api.md +195 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/operation-key-selection.md +60 -0
- package/dist/knowledge/skills/frontend-cdn-publish/SKILL.md +237 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/cloudflare-and-operator-setup.md +56 -0
- package/dist/knowledge/skills/frontend-cdn-publish/references/framework-cdn-config-api.md +176 -0
- package/dist/knowledge/skills/i18n-label-generation/SKILL.md +261 -0
- package/dist/knowledge/skills/i18n-label-generation/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-label-generation/references/label-placement.md +7 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +269 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/references/i18n-routing.md +9 -0
- package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +245 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/framework-labelling-sections-api.md +67 -0
- package/dist/knowledge/skills/i18n-translation-rerun/references/translation-workflow.md +17 -0
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +646 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-application-database-api.md +77 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-backing-services-api.md +282 -0
- package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +265 -0
- package/dist/knowledge/skills/infra-environment-config/references/infra-config-files.md +7 -0
- package/dist/knowledge/skills/journey-approve/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-bootstrap-scope/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-next/SKILL.md +42 -0
- package/dist/knowledge/skills/journey-report/SKILL.md +43 -0
- package/dist/knowledge/skills/journey-run/SKILL.md +55 -0
- package/dist/knowledge/skills/journey-status/SKILL.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +370 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/initialization-recovery-recipe.md +50 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/local-environment-troubleshooting.md +409 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +247 -0
- package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +474 -0
- package/dist/knowledge/skills/market-add-feature-benefit/references/framework-feature-benefit-api.md +139 -0
- package/dist/knowledge/skills/market-alternatives/SKILL.md +543 -0
- package/dist/knowledge/skills/market-authoring-overview/SKILL.md +354 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-references-api.md +138 -0
- package/dist/knowledge/skills/market-authoring-overview/references/framework-market-snapshot-api.md +129 -0
- package/dist/knowledge/skills/market-category/SKILL.md +290 -0
- package/dist/knowledge/skills/market-channels/SKILL.md +361 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +2752 -0
- package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +2443 -0
- package/dist/knowledge/skills/market-generation-cli/SKILL.md +1484 -0
- package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +1230 -0
- package/dist/knowledge/skills/market-icp/SKILL.md +625 -0
- package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +352 -0
- package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +415 -0
- package/dist/knowledge/skills/market-message-templates-authoring/references/framework-message-template-api.md +1439 -0
- package/dist/knowledge/skills/market-persona/SKILL.md +407 -0
- package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +392 -0
- package/dist/knowledge/skills/market-positioning-authoring/references/framework-positioning-api.md +97 -0
- package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +665 -0
- package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +620 -0
- package/dist/knowledge/skills/market-scoring-interpretation/references/framework-scoring-api.md +291 -0
- package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +1706 -0
- package/dist/knowledge/skills/market-snapshot-validation/references/framework-snapshot-validation-api.md +1228 -0
- package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +260 -0
- package/dist/knowledge/skills/market-triggers-and-journey/SKILL.md +579 -0
- package/dist/knowledge/skills/module-companion-exports/SKILL.md +318 -0
- package/dist/knowledge/skills/module-companion-exports/references/companion-exports-by-package.md +544 -0
- package/dist/knowledge/skills/module-registration/SKILL.md +212 -0
- package/dist/knowledge/skills/module-registration/references/framework-domain-modules-api.md +366 -0
- package/dist/knowledge/skills/module-registration/references/registry-files.md +9 -0
- package/dist/knowledge/skills/module-relationships/SKILL.md +523 -0
- package/dist/knowledge/skills/module-relationships/references/cross-resource-fk-checklist.md +7 -0
- package/dist/knowledge/skills/module-relationships/references/framework-resource-relationship-authoring-api.md +738 -0
- package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +174 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-api.md +203 -0
- package/dist/knowledge/skills/pdf-template-authoring/references/framework-pdf-template-spec-api.md +62 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +239 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-file-provider-constraints-api.md +90 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-provider-module-api.md +50 -0
- package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +652 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/framework-rate-limit-policy-api.md +182 -0
- package/dist/knowledge/skills/rate-limit-authoring/references/scope-key-and-bucket-conventions.md +137 -0
- package/dist/knowledge/skills/resource-add-field/SKILL.md +272 -0
- package/dist/knowledge/skills/resource-add-field/examples/add-priority-field-to-todos.example.md +153 -0
- package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +845 -0
- package/dist/knowledge/skills/resource-add-module/SKILL.md +322 -0
- package/dist/knowledge/skills/resource-add-module/references/framework-new-module-wiring-api.md +67 -0
- package/dist/knowledge/skills/resource-add-module/references/module-scaffold-layout.md +15 -0
- package/dist/knowledge/skills/resource-add-resource/SKILL.md +222 -0
- package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +540 -0
- package/dist/knowledge/skills/resource-add-resource/references/scaffold-surfaces-checklist.md +25 -0
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +370 -0
- package/dist/knowledge/skills/resource-config-wiring/references/config-change-routing.md +11 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +622 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-operation-scope-enums-api.md +248 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +1769 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +1209 -0
- package/dist/knowledge/skills/resource-custom-view/SKILL.md +228 -0
- package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +693 -0
- package/dist/knowledge/skills/resource-external-data/SKILL.md +349 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-external-data-pipeline-api.md +187 -0
- package/dist/knowledge/skills/resource-external-data/references/framework-http-api-binding-api.md +261 -0
- package/dist/knowledge/skills/resource-external-data/references/lane-selection.md +49 -0
- package/dist/knowledge/skills/resource-external-data/references/pipeline-destination-schema.md +43 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/SKILL.md +308 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-named-mcp-servers-contract.md +166 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/framework-resource-mcp-exposure-contract.md +63 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-catalogue-withdrawal-and-verification.md +77 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-client-registration-postures.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/SKILL.md +424 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/corpus-field-selection.md +90 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-embeddings-capability-api.md +261 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-file-rag-source-api.md +117 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-retrieval-api.md +597 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-source-decorator-api.md +181 -0
- package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +318 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/add-enum-field-with-ui.example.md +132 -0
- package/dist/knowledge/skills/resource-schema-authoring/examples/basic-resource-schema.example.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/decorator-layer-map.md +63 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/field-type-selection.md +70 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +559 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-personal-data-category-api.md +245 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-polymorphic-resources-api.md +147 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-schema-family-api.md +247 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +164 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-structural-params-api.md +327 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +1286 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +1080 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/polymorphic-per-scope-resources.md +75 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/schema-variants-and-discriminators.md +62 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/shared-layer-decorator-checklist.md +69 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/special-factories.md +45 -0
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +389 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-conditional-visibility-api.md +106 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-display-edit-modes-api.md +176 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-enum-frontend-handling-api.md +103 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-foreign-key-ui-api.md +97 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +839 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-per-primitive-ui-api.md +461 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-primitive-ui-api.md +125 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-related-resource-embeds-api.md +245 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-resource-layout-templates-api.md +302 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/ui-layer-boundaries.md +13 -0
- package/dist/knowledge/skills/seeding-authoring/SKILL.md +569 -0
- package/dist/knowledge/skills/seeding-authoring/references/data-seeding-mode-picker.md +154 -0
- package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +176 -0
- package/dist/knowledge/skills/seeding-operations/SKILL.md +505 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-admin-runbook.md +337 -0
- package/dist/knowledge/skills/seeding-operations/references/data-seeding-cron-scheduler.md +171 -0
- package/dist/knowledge/skills/seeding-operations/references/framework-data-seeding-operations-api.md +662 -0
- package/dist/knowledge/skills/settings-placement-authoring/SKILL.md +134 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +65 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +127 -0
- package/dist/knowledge/skills/spec-catalog-authoring/SKILL.md +726 -0
- package/dist/knowledge/skills/spec-catalog-authoring/references/catalog-spec-pattern-overview.md +242 -0
- package/dist/knowledge/skills/spec-companion-exports/SKILL.md +362 -0
- package/dist/knowledge/skills/spec-companion-exports/references/companion-export-checklist.md +8 -0
- package/dist/knowledge/skills/spec-companion-exports/references/framework-companion-exports-contract-api.md +533 -0
- package/dist/knowledge/skills/spec-component-update/SKILL.md +315 -0
- package/dist/knowledge/skills/spec-component-update/references/component-spec-props.md +8 -0
- package/dist/knowledge/skills/spec-component-update/references/framework-frontend-component-spec-api.md +481 -0
- package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +283 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/composite-spec-sections.md +5 -0
- package/dist/knowledge/skills/spec-composite-view-update/references/framework-composite-view-specification-api.md +51 -0
- package/dist/knowledge/skills/spec-family-update/SKILL.md +300 -0
- package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +13 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-error-message-specifications-api.md +108 -0
- package/dist/knowledge/skills/spec-family-update/references/framework-family-specifications-api.md +111 -0
- package/dist/knowledge/skills/spec-feature-update/SKILL.md +306 -0
- package/dist/knowledge/skills/spec-feature-update/references/feature-spec-scope.md +5 -0
- package/dist/knowledge/skills/spec-feature-update/references/framework-feature-specification-api.md +95 -0
- package/dist/knowledge/skills/spec-resource-update/SKILL.md +220 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-field-spec-params-api.md +319 -0
- package/dist/knowledge/skills/spec-resource-update/references/framework-spec-resource-contracts-api.md +2610 -0
- package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +12 -0
- package/dist/knowledge/skills/spec-update-after-change/SKILL.md +195 -0
- package/dist/knowledge/skills/spec-update-after-change/references/framework-spec-factory-api.md +173 -0
- package/dist/knowledge/skills/spec-update-after-change/references/spec-maintenance-by-surface.md +33 -0
- package/dist/knowledge/skills/spec-update-after-change/references/surface-to-spec-routing.md +14 -0
- package/dist/knowledge/skills/views-add-composite-view/SKILL.md +259 -0
- package/dist/knowledge/skills/views-add-composite-view/references/composite-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-composite-view/references/framework-inserted-view-identity-api.md +151 -0
- package/dist/knowledge/skills/views-add-custom-view/SKILL.md +225 -0
- package/dist/knowledge/skills/views-add-custom-view/references/custom-view-routing.md +10 -0
- package/dist/knowledge/skills/views-add-custom-view/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-app-level/SKILL.md +201 -0
- package/dist/knowledge/skills/views-app-level/references/app-level-views-routing.md +9 -0
- package/dist/knowledge/skills/views-app-level/references/framework-view-scope-and-full-custom-api.md +107 -0
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +264 -0
- package/dist/knowledge/skills/views-chart-authoring/references/chart-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-chart-view-contracts-api.md +82 -0
- package/dist/knowledge/skills/views-chart-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-composite-authoring/SKILL.md +302 -0
- package/dist/knowledge/skills/views-composite-authoring/references/composite-embedding-checklist.md +23 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-composite-view-contracts-api.md +133 -0
- package/dist/knowledge/skills/views-composite-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/views-execution-authoring/SKILL.md +209 -0
- package/dist/knowledge/skills/views-execution-authoring/references/execution-view-checklist.md +7 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-execution-view-contracts-api.md +389 -0
- package/dist/knowledge/skills/views-execution-authoring/references/framework-inserted-view-identity-api.md +152 -0
- package/dist/knowledge/skills/website-anonymous-session/SKILL.md +444 -0
- package/dist/knowledge/skills/website-blog-authoring/SKILL.md +587 -0
- package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +1426 -0
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +553 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/example-website-button-override.md +52 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +357 -0
- package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +511 -0
- package/dist/knowledge/skills/website-factory-advanced/SKILL.md +376 -0
- package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +304 -0
- package/dist/knowledge/skills/website-label-pack/SKILL.md +390 -0
- package/dist/knowledge/skills/website-layout-overrides/SKILL.md +461 -0
- package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +264 -0
- package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +414 -0
- package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +366 -0
- package/dist/knowledge/skills/website-page-authoring/SKILL.md +420 -0
- package/dist/knowledge/skills/website-page-variants/SKILL.md +256 -0
- package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +302 -0
- package/dist/knowledge/skills/website-section-contact/SKILL.md +950 -0
- package/dist/knowledge/skills/website-section-contact/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-cta/SKILL.md +822 -0
- package/dist/knowledge/skills/website-section-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-faq/SKILL.md +917 -0
- package/dist/knowledge/skills/website-section-faq/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +878 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +895 -0
- package/dist/knowledge/skills/website-section-feature-detail/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-footer-cta/SKILL.md +814 -0
- package/dist/knowledge/skills/website-section-footer-cta/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-hero/SKILL.md +944 -0
- package/dist/knowledge/skills/website-section-hero/references/define-website-section-api.md +583 -0
- package/dist/knowledge/skills/website-section-pricing/SKILL.md +934 -0
- package/dist/knowledge/skills/website-section-pricing/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-section-social-proof/SKILL.md +912 -0
- package/dist/knowledge/skills/website-section-social-proof/references/define-website-section-api.md +579 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +624 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/aeo-api.md +633 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +193 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +790 -0
- package/dist/knowledge/topic-index.json +17510 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,1439 @@
|
|
|
1
|
+
# Market Message Template (source)
|
|
2
|
+
|
|
3
|
+
`MarketMessageTemplateConfig` is the **reusable, English-authored
|
|
4
|
+
prompt template** the market-generation CLI consumes to produce one
|
|
5
|
+
piece of marketing output. Templates ship inline on the assembled
|
|
6
|
+
`MarketSnapshot` (`messageTemplates[]`) and are policed by the
|
|
7
|
+
validator's 18th issue kind (`MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH`).
|
|
8
|
+
|
|
9
|
+
## Schema, output kinds, required-input enum (source)
|
|
10
|
+
|
|
11
|
+
## Import Origins
|
|
12
|
+
|
|
13
|
+
- `@wildo-ai/saas-specifications`
|
|
14
|
+
|
|
15
|
+
## Source Excerpts
|
|
16
|
+
|
|
17
|
+
### Origin Package: `@wildo-ai/saas-specifications`
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
*
|
|
21
|
+
* Reusable prompt template for market generation outputs (landing
|
|
22
|
+
* page, email, in-app banner, comparison page, objection response).
|
|
23
|
+
*
|
|
24
|
+
* Phase 2 ships the **schema + snapshot slot reservation only**;
|
|
25
|
+
* authoring of templates and the market generation CLI consumer land
|
|
26
|
+
* in Phase 4 (§10.2 / §10.4 of the plan). The lock-now / fill-later
|
|
27
|
+
* pattern keeps the snapshot shape stable so Phase-4 work doesn't
|
|
28
|
+
* churn the contract.
|
|
29
|
+
*
|
|
30
|
+
* Templates are mustache-style, English-only prose. The template MAY
|
|
31
|
+
* include the `{{output_language}}` placeholder; the market generation
|
|
32
|
+
* CLI substitutes the BCP-47 tag passed via `--output-language` and
|
|
33
|
+
* the LLM produces the final output in that language. **The template
|
|
34
|
+
* itself is never translated** — translation happens at LLM output
|
|
35
|
+
* time (D15, §12).
|
|
36
|
+
*
|
|
37
|
+
* `requiredInputs` declares which refs the caller must provide
|
|
38
|
+
* before the template can be rendered (e.g. `['icpRef', 'benefitRef']`
|
|
39
|
+
* for a benefit-spotlight email). Phase-4 agents use this list to
|
|
40
|
+
* fail loudly when an input is missing instead of producing
|
|
41
|
+
* "[object Object]" copy.
|
|
42
|
+
*/
|
|
43
|
+
export enum MarketMessageOutputKind {
|
|
44
|
+
LANDING_PAGE = 'LANDING_PAGE',
|
|
45
|
+
EMAIL = 'EMAIL',
|
|
46
|
+
IN_APP_BANNER = 'IN_APP_BANNER',
|
|
47
|
+
COMPARISON_PAGE = 'COMPARISON_PAGE',
|
|
48
|
+
OBJECTION_RESPONSE = 'OBJECTION_RESPONSE',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Required-input placeholder tokens that a `MarketMessageTemplate`
|
|
53
|
+
* declares it needs at render time.
|
|
54
|
+
*
|
|
55
|
+
* **Naming exception:** the **enum keys** follow the framework's
|
|
56
|
+
* SCREAMING_SNAKE convention (`ICP_REF`, `BENEFIT_REF`, …), but the
|
|
57
|
+
* **enum values** intentionally use camelCase (`'icpRef'`,
|
|
58
|
+
* `'benefitRef'`, …). The values are the literal Mustache placeholder
|
|
59
|
+
* shapes used inside `promptTemplate` (e.g. `{{icp.name}}` requires
|
|
60
|
+
* the `'icpRef'` input — not `'ICP_REF'`). Renderers compare values
|
|
61
|
+
* against placeholder names, so the camelCase form is load-bearing.
|
|
62
|
+
*
|
|
63
|
+
* Authors should always reference the enum keys
|
|
64
|
+
* (`MarketMessageRequiredInput.ICP_REF`) rather than the raw camelCase
|
|
65
|
+
* strings — this preserves refactor safety and autocomplete despite
|
|
66
|
+
* the value-shape exception.
|
|
67
|
+
*/
|
|
68
|
+
export enum MarketMessageRequiredInput {
|
|
69
|
+
ICP_REF = 'icpRef',
|
|
70
|
+
BENEFIT_REF = 'benefitRef',
|
|
71
|
+
CHANNEL_REF = 'channelRef',
|
|
72
|
+
OBJECTION_REF = 'objectionRef',
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const MarketMessageTemplateConfigSchema = z.object({
|
|
76
|
+
/** Stable kebab-case ref (e.g. `'tmpl-landing-icp-hero'`). */
|
|
77
|
+
ref: NonEmptyStringSchema,
|
|
78
|
+
name: NonEmptyStringSchema,
|
|
79
|
+
description: NonEmptyStringSchema,
|
|
80
|
+
outputKind: z.enum(MarketMessageOutputKind),
|
|
81
|
+
/**
|
|
82
|
+
* Mustache-style prompt body in English. Recognized placeholders
|
|
83
|
+
* include `{{icp.name}}`, `{{benefit.claim}}`, `{{output_language}}`,
|
|
84
|
+
* etc. The set of recognized placeholders is finalised in Phase 4
|
|
85
|
+
* together with the agent implementation.
|
|
86
|
+
*/
|
|
87
|
+
promptTemplate: NonEmptyStringSchema,
|
|
88
|
+
requiredInputs: z.array(z.enum(MarketMessageRequiredInput)).default([]),
|
|
89
|
+
/** Optional `ToneOfVoiceRef` to bias the rendered output. */
|
|
90
|
+
preferredVoiceRef: NonEmptyStringSchema.optional(),
|
|
91
|
+
authored: MarketAuthoredMetadataSchema.optional(),
|
|
92
|
+
});
|
|
93
|
+
export type MarketMessageTemplateConfig = z.infer<typeof MarketMessageTemplateConfigSchema>;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Snapshot slot (source)
|
|
97
|
+
|
|
98
|
+
`MarketSnapshot.messageTemplates[]` is the slot consumed by the
|
|
99
|
+
companion behaviors and the market-generation CLI:
|
|
100
|
+
|
|
101
|
+
## Import Origins
|
|
102
|
+
|
|
103
|
+
- `@wildo-ai/saas-specifications`
|
|
104
|
+
|
|
105
|
+
## Source Excerpts
|
|
106
|
+
|
|
107
|
+
### Origin Package: `@wildo-ai/saas-specifications`
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
*
|
|
111
|
+
* Versioning for the market-snapshot payload format itself.
|
|
112
|
+
*
|
|
113
|
+
* - `V0` — bootstrap surface (category + ICPs + personas +
|
|
114
|
+
* jobs/pains/gains + tones of voice). Reserved as the historical
|
|
115
|
+
* marker; no production snapshot should ship as V0.
|
|
116
|
+
* - `V1` — adds `benefits`, `positionings`, and the
|
|
117
|
+
* `messageTemplates` slot reservation.
|
|
118
|
+
* - `V2` — current. Adds the six channel-family arrays
|
|
119
|
+
* (`channels`, `alternatives`, `triggers`, `buyingJourneys`,
|
|
120
|
+
* `proofs`, `objections`) as full configs.
|
|
121
|
+
*
|
|
122
|
+
* The shape grows additively across versions — older callers keep
|
|
123
|
+
* parsing newer payloads via `default([])` semantics on the additive
|
|
124
|
+
* arrays; the `version` field is the explicit marker for consumers
|
|
125
|
+
* that need to branch on era.
|
|
126
|
+
*/
|
|
127
|
+
export enum MarketSnapshotVersion {
|
|
128
|
+
V0 = 'v0',
|
|
129
|
+
V1 = 'v1',
|
|
130
|
+
V2 = 'v2',
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Validator coupling
|
|
135
|
+
|
|
136
|
+
The validator emits `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH` (WARN)
|
|
137
|
+
on either drift direction (declared but unused; used but
|
|
138
|
+
undeclared). The full validator JSDoc + rule table:
|
|
139
|
+
|
|
140
|
+
## Import Origins
|
|
141
|
+
|
|
142
|
+
- `@wildo-ai/saas-specifications`
|
|
143
|
+
|
|
144
|
+
## Source Excerpts
|
|
145
|
+
|
|
146
|
+
### Origin Package: `@wildo-ai/saas-specifications`
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
*
|
|
150
|
+
* Authoring-consistency validator for an assembled `MarketSnapshot`.
|
|
151
|
+
*
|
|
152
|
+
* The function is a **pure**, **typed** graph walker over the
|
|
153
|
+
* snapshot — no Zod introspection, no LocalizedString visitor, no
|
|
154
|
+
* runtime registry access. Each rule is implemented as a tiny
|
|
155
|
+
* standalone detector composed by the top-level
|
|
156
|
+
* `validateMarketSnapshot`.
|
|
157
|
+
*
|
|
158
|
+
* Rule table — currently 18 kinds:
|
|
159
|
+
*
|
|
160
|
+
* | Kind | Severity | Trigger |
|
|
161
|
+
* |--------------------------------------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
|
|
162
|
+
* | `ORPHAN_REF` | ERROR | A `<entity>Ref` does not resolve inside the snapshot. Cross-family refs (`featureRefs`, `productRefs`) are skipped if no set is passed. |
|
|
163
|
+
* | `MULTIPLE_THRESHOLDS_PER_ICP_JOB` | ERROR | An (icpRef, jobRef) cluster has more than one distinct benefit with `kanoCategory: THRESHOLD`. Deduped by benefit `ref`. |
|
|
164
|
+
* | `THRESHOLD_BENEFIT_WITHOUT_JOB` | ERROR | A benefit declares any `kanoCategory: THRESHOLD` entry but `advances[]` is empty (no job to anchor the THRESHOLD claim against). |
|
|
165
|
+
* | `EMPTY_BENEFIT_DELIVERED_BY` | ERROR | A `FeatureBenefit.deliveredByFeatureRefs[]` is empty (defence in depth — Zod also rejects). |
|
|
166
|
+
* | `ICP_WITHOUT_PERSONA` | ERROR (LEGAL_ENTITY) / WARN (INDIVIDUAL) | A non-`ANTI_TARGET` ICP has no persona pointing at its `ref` via `belongsToIcpRefs`. |
|
|
167
|
+
* | `INFLUENCE_CYCLE` | ERROR (self-loop) / WARN (multi-node) | Cycle in the ICP→ICP influence graph. Self-loops are always ERROR; non-trivial cycles are WARN (real GTM dynamics may include them). |
|
|
168
|
+
* | `MISSING_POSITIONING_FOR_ICP` | ERROR | An ICP of priority `CORE` or `EXPANSION` has no `MarketPositioning`. Other priorities exempt. |
|
|
169
|
+
* | `STALE_AUTHORED` | WARN | `lastAuthoredAt + reviewCadence < now`. No check when `reviewCadence` is undefined or `AS_NEEDED`. |
|
|
170
|
+
* | `DUPLICATE_EDGE_PER_ENTITY` | WARN | Same target ref appears twice in the same edge list. Covers ICP/persona `pains/gains/jobs` (by edge ref) and benefit `importanceByICP` (by `icpRef`). |
|
|
171
|
+
* | `INVALID_ANTI_TARGET_PURPOSE_MIX` | ERROR | `priority === ANTI_TARGET` and `purposeMix !== { adoption: 0, revenue: 0 }`. |
|
|
172
|
+
* | `BUYING_GROUP_PERSONA_MISSING_DMU_ROLE` | ERROR | `personaScope === BUYING_GROUP_MEMBER` and `dmuRole` is undefined. |
|
|
173
|
+
* | `BUYING_GROUP_BACKLINK_MISSING` | ERROR | An ICP's `buyingGroup[].personaRef` resolves to a persona whose `belongsToIcpRefs[]` does NOT include the ICP (asymmetric link). |
|
|
174
|
+
* | `PROOF_WITHOUT_SUPPORT` | WARN | A `MarketProof` carries empty `supportsBenefitRefs[]` AND empty `supportsIcpRefs[]`. |
|
|
175
|
+
* | `PROOF_KIND_PAYLOAD_MISMATCH` | WARN | A `MarketProof` carries a payload incoherent with its `proofKind` (`METRIC` without `metric`, `LOGO` with `metric`). |
|
|
176
|
+
* | `DUPLICATE_JOURNEY_STAGE` | ERROR | A `MarketBuyingJourney` lists the same `BuyingJourneyStage` enum value more than once. |
|
|
177
|
+
* | `DUPLICATE_BUYING_JOURNEY_FOR_ICP` | ERROR | Two `MarketBuyingJourney` entries point at the same `icpRef`. The model is "one journey per ICP". |
|
|
178
|
+
* | `OBJECTION_PROOF_BENEFIT_MISMATCH` | WARN | An objection cites `proofRefs[]` whose union of `supportsBenefitRefs[]` ∪ `supportsIcpRefs[]` does not intersect `relatedBenefitRefs[]` ∪ `raisedByIcpRefs[]`. |
|
|
179
|
+
* | `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH` | WARN | A `MarketMessageTemplate` declares a `requiredInputs[]` entry that no `{{<entity>.*}}` / `{{<entity>Ref}}` placeholder consumes — or vice-versa. `{{output_language}}` is exempt (CLI-injected at render time). |
|
|
180
|
+
*
|
|
181
|
+
* Issue ordering inside `result.issues[]` is detector-order, then
|
|
182
|
+
* snapshot-walk order. It is **not** a stable contract — callers
|
|
183
|
+
* must group/sort by `kind` + `severity` themselves.
|
|
184
|
+
*
|
|
185
|
+
* Loaded by application registries at boot. Callers should:
|
|
186
|
+
* - throw a `BusinessConfigError` (re-exported from
|
|
187
|
+
* `@wildo-ai/saas-backend-lib`) when `result.ok === false`,
|
|
188
|
+
* listing every ERROR-severity issue;
|
|
189
|
+
* - log WARN-severity issues through the standard backend logger.
|
|
190
|
+
*
|
|
191
|
+
* The validator never mutates the snapshot.
|
|
192
|
+
*/
|
|
193
|
+
export enum MarketSnapshotIssueKind {
|
|
194
|
+
ORPHAN_REF = 'ORPHAN_REF',
|
|
195
|
+
MULTIPLE_THRESHOLDS_PER_ICP_JOB = 'MULTIPLE_THRESHOLDS_PER_ICP_JOB',
|
|
196
|
+
/**
|
|
197
|
+
* A benefit declares any `kanoCategory: THRESHOLD` entry on
|
|
198
|
+
* `importanceByICP[]` but its `advances[]` is empty. THRESHOLD is
|
|
199
|
+
* defined as "table-stakes for a specific (icp, job)" — without a
|
|
200
|
+
* job to anchor against, the THRESHOLD claim has no semantic
|
|
201
|
+
* cluster and the `MULTIPLE_THRESHOLDS_PER_ICP_JOB` invariant is
|
|
202
|
+
* structurally bypassed (ERROR).
|
|
203
|
+
*/
|
|
204
|
+
THRESHOLD_BENEFIT_WITHOUT_JOB = 'THRESHOLD_BENEFIT_WITHOUT_JOB',
|
|
205
|
+
EMPTY_BENEFIT_DELIVERED_BY = 'EMPTY_BENEFIT_DELIVERED_BY',
|
|
206
|
+
ICP_WITHOUT_PERSONA = 'ICP_WITHOUT_PERSONA',
|
|
207
|
+
INFLUENCE_CYCLE = 'INFLUENCE_CYCLE',
|
|
208
|
+
MISSING_POSITIONING_FOR_ICP = 'MISSING_POSITIONING_FOR_ICP',
|
|
209
|
+
STALE_AUTHORED = 'STALE_AUTHORED',
|
|
210
|
+
/**
|
|
211
|
+
* Same target ref appears more than once in the same per-entity
|
|
212
|
+
* edge list. Currently covers:
|
|
213
|
+
* - ICP and persona `pains[].painRef`, `gains[].gainRef`,
|
|
214
|
+
* `jobs[].jobRef` — typically the result of an `inheritFrom()`
|
|
215
|
+
* spread followed by a forgotten `.filter()` step;
|
|
216
|
+
* - benefit `importanceByICP[].icpRef` — duplicate (benefit, icp)
|
|
217
|
+
* pairs make per-ICP scoring non-deterministic.
|
|
218
|
+
*
|
|
219
|
+
* Severity is WARN — the snapshot still parses, but the duplicate
|
|
220
|
+
* edge silently double-counts in downstream FIT scoring.
|
|
221
|
+
*/
|
|
222
|
+
DUPLICATE_EDGE_PER_ENTITY = 'DUPLICATE_EDGE_PER_ENTITY',
|
|
223
|
+
INVALID_ANTI_TARGET_PURPOSE_MIX = 'INVALID_ANTI_TARGET_PURPOSE_MIX',
|
|
224
|
+
BUYING_GROUP_PERSONA_MISSING_DMU_ROLE = 'BUYING_GROUP_PERSONA_MISSING_DMU_ROLE',
|
|
225
|
+
/**
|
|
226
|
+
* An ICP's `buyingGroup[].personaRef` resolves to a persona, but
|
|
227
|
+
* the persona's `belongsToIcpRefs[]` does not contain the ICP. The
|
|
228
|
+
* link is asymmetric and downstream consumers (DMU rendering,
|
|
229
|
+
* persona-by-ICP indexing) silently drop the persona. ERROR.
|
|
230
|
+
*/
|
|
231
|
+
BUYING_GROUP_BACKLINK_MISSING = 'BUYING_GROUP_BACKLINK_MISSING',
|
|
232
|
+
/** A proof entity that supports neither a benefit nor an ICP — has no place to land in copy (WARN). */
|
|
233
|
+
PROOF_WITHOUT_SUPPORT = 'PROOF_WITHOUT_SUPPORT',
|
|
234
|
+
/**
|
|
235
|
+
* A `MarketProof` carries a payload incoherent with its
|
|
236
|
+
* `proofKind`. The schema is permissive (both `attribution` and
|
|
237
|
+
* `metric` are optional on every kind). This detector catches the
|
|
238
|
+
* strongest mismatches as authoring drift (WARN — the spec parses,
|
|
239
|
+
* but the proof renders badly):
|
|
240
|
+
* - `METRIC` without a `metric` block;
|
|
241
|
+
* - `LOGO` with a `metric` block.
|
|
242
|
+
*/
|
|
243
|
+
PROOF_KIND_PAYLOAD_MISMATCH = 'PROOF_KIND_PAYLOAD_MISMATCH',
|
|
244
|
+
/** Same `BuyingJourneyStage` enum value listed twice on a single journey (ERROR). */
|
|
245
|
+
DUPLICATE_JOURNEY_STAGE = 'DUPLICATE_JOURNEY_STAGE',
|
|
246
|
+
/** Two `MarketBuyingJourney` entries point at the same `icpRef`. The model is one journey per ICP (ERROR). */
|
|
247
|
+
DUPLICATE_BUYING_JOURNEY_FOR_ICP = 'DUPLICATE_BUYING_JOURNEY_FOR_ICP',
|
|
248
|
+
/** Objection's cited proofs do not back any of its `relatedBenefitRefs` or `raisedByIcpRefs` (WARN). */
|
|
249
|
+
OBJECTION_PROOF_BENEFIT_MISMATCH = 'OBJECTION_PROOF_BENEFIT_MISMATCH',
|
|
250
|
+
/**
|
|
251
|
+
* A `MarketMessageTemplate` has a mismatch between its declared
|
|
252
|
+
* `requiredInputs[]` and the `{{<entity>.*}}` / `{{<entity>Ref}}`
|
|
253
|
+
* placeholders that actually appear inside `promptTemplate`.
|
|
254
|
+
*
|
|
255
|
+
* Two symmetric cases:
|
|
256
|
+
* 1. Declared but unused — `requiredInputs` lists `icpRef` but the
|
|
257
|
+
* body has no `{{icp.*}}` / `{{icpRef}}` reference. The CLI will
|
|
258
|
+
* require the caller to pass the input but never substitute it.
|
|
259
|
+
* 2. Used but undeclared — the body references `{{benefit.claim}}`
|
|
260
|
+
* but `requiredInputs` does not include `benefitRef`. The CLI
|
|
261
|
+
* will not enforce the input and the placeholder will render
|
|
262
|
+
* literally (e.g. `{{benefit.claim}}`).
|
|
263
|
+
*
|
|
264
|
+
* The `{{output_language}}` placeholder is **exempt** from this
|
|
265
|
+
* check: it is injected by the market generation CLI from the
|
|
266
|
+
* `--output-language` flag, not from `requiredInputs[]`.
|
|
267
|
+
*
|
|
268
|
+
* WARN severity — the snapshot still parses and the template still
|
|
269
|
+
* renders, but the output will be off-spec at runtime. Authors
|
|
270
|
+
* should either prune the unused entry from `requiredInputs[]` or
|
|
271
|
+
* add the missing placeholder / entry.
|
|
272
|
+
*/
|
|
273
|
+
MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH = 'MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH',
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export type MarketSnapshotIssueSeverity = 'ERROR' | 'WARN';
|
|
277
|
+
|
|
278
|
+
export interface MarketSnapshotIssue {
|
|
279
|
+
kind: MarketSnapshotIssueKind;
|
|
280
|
+
/** Dotted path inside the snapshot (e.g. `'icps[0].pains[2].painRef'`). */
|
|
281
|
+
path: string;
|
|
282
|
+
message: string;
|
|
283
|
+
severity: MarketSnapshotIssueSeverity;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface MarketSnapshotValidationResult {
|
|
287
|
+
/** `true` iff no issue has severity `ERROR`. */
|
|
288
|
+
ok: boolean;
|
|
289
|
+
issues: MarketSnapshotIssue[];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface ValidateMarketSnapshotOptions {
|
|
293
|
+
/**
|
|
294
|
+
* Cross-family ref check for `FeatureBenefit.deliveredByFeatureRefs`.
|
|
295
|
+
* Pass the application's full feature-spec key set; orphans are
|
|
296
|
+
* reported as `ORPHAN_REF`. When omitted, the cross-family check is
|
|
297
|
+
* SKIPPED (intra-snapshot orphans are still detected).
|
|
298
|
+
*/
|
|
299
|
+
availableFeatureRefs?: ReadonlySet<string>;
|
|
300
|
+
/**
|
|
301
|
+
* Cross-family ref check for `MarketICP.recommendedProductRefs` /
|
|
302
|
+
* `upsellPathProductRefs`. Same skip-when-omitted semantics.
|
|
303
|
+
*/
|
|
304
|
+
availableProductRefs?: ReadonlySet<string>;
|
|
305
|
+
/** Override "now" for `STALE_AUTHORED` checks (test affordance). Defaults to `new Date()`. */
|
|
306
|
+
now?: Date;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export function validateMarketSnapshot(
|
|
310
|
+
snapshot: MarketSnapshot,
|
|
311
|
+
options?: ValidateMarketSnapshotOptions,
|
|
312
|
+
): MarketSnapshotValidationResult {
|
|
313
|
+
const issues: MarketSnapshotIssue[] = [];
|
|
314
|
+
|
|
315
|
+
detectOrphanRefs(snapshot, options, issues);
|
|
316
|
+
detectThresholdBenefitsWithoutJob(snapshot, issues);
|
|
317
|
+
detectMultipleThresholdsPerIcpJob(snapshot, issues);
|
|
318
|
+
detectEmptyBenefitDeliveredBy(snapshot, issues);
|
|
319
|
+
detectIcpWithoutPersona(snapshot, issues);
|
|
320
|
+
detectInfluenceCycles(snapshot, issues);
|
|
321
|
+
detectMissingPositioningForIcp(snapshot, issues);
|
|
322
|
+
detectStaleAuthored(snapshot, options?.now ?? new Date(), issues);
|
|
323
|
+
detectDuplicateEdgesPerEntity(snapshot, issues);
|
|
324
|
+
detectInvalidAntiTargetPurposeMix(snapshot, issues);
|
|
325
|
+
detectBuyingGroupPersonasMissingDmuRole(snapshot, issues);
|
|
326
|
+
detectBuyingGroupBacklinkMissing(snapshot, issues);
|
|
327
|
+
detectProofsWithoutSupport(snapshot, issues);
|
|
328
|
+
detectProofKindPayloadMismatch(snapshot, issues);
|
|
329
|
+
detectDuplicateJourneyStages(snapshot, issues);
|
|
330
|
+
detectDuplicateBuyingJourneyForIcp(snapshot, issues);
|
|
331
|
+
detectObjectionProofBenefitMismatch(snapshot, issues);
|
|
332
|
+
detectMessageTemplatePlaceholderMismatch(snapshot, issues);
|
|
333
|
+
|
|
334
|
+
const ok = issues.every(i => i.severity !== 'ERROR');
|
|
335
|
+
return { ok, issues };
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// ────────────────────────────────────────────────────────────────────
|
|
339
|
+
// Detectors — one per rule, kept small and independently testable.
|
|
340
|
+
// ────────────────────────────────────────────────────────────────────
|
|
341
|
+
|
|
342
|
+
function detectOrphanRefs(
|
|
343
|
+
snapshot: MarketSnapshot,
|
|
344
|
+
options: ValidateMarketSnapshotOptions | undefined,
|
|
345
|
+
issues: MarketSnapshotIssue[],
|
|
346
|
+
): void {
|
|
347
|
+
const icpRefs = new Set(snapshot.icps.map(i => i.ref));
|
|
348
|
+
const personaRefs = new Set(snapshot.personas.map(p => p.ref));
|
|
349
|
+
const jobRefs = new Set(snapshot.jobs.map(j => j.ref));
|
|
350
|
+
const painRefs = new Set(snapshot.pains.map(p => p.ref));
|
|
351
|
+
const gainRefs = new Set(snapshot.gains.map(g => g.ref));
|
|
352
|
+
const voiceRefs = new Set(snapshot.tonesOfVoice.map(v => v.ref));
|
|
353
|
+
const benefitRefs = new Set(snapshot.benefits.map(b => b.ref));
|
|
354
|
+
const channelRefs = new Set(snapshot.channels.map(c => c.ref));
|
|
355
|
+
const alternativeRefs = new Set(snapshot.alternatives.map(a => a.ref));
|
|
356
|
+
const triggerRefs = new Set(snapshot.triggers.map(t => t.ref));
|
|
357
|
+
const proofRefs = new Set(snapshot.proofs.map(p => p.ref));
|
|
358
|
+
const objectionRefs = new Set(snapshot.objections.map(o => o.ref));
|
|
359
|
+
|
|
360
|
+
const reportOrphan = (path: string, ref: string, kind: string): void => {
|
|
361
|
+
issues.push({
|
|
362
|
+
kind: MarketSnapshotIssueKind.ORPHAN_REF,
|
|
363
|
+
path,
|
|
364
|
+
message: `${kind} ref "${ref}" at ${path} does not resolve inside the snapshot.`,
|
|
365
|
+
severity: 'ERROR',
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
// ICP edges + cross-family + influences + voices + Phase-3 ref arrays.
|
|
370
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
371
|
+
const basePath = `icps[${iIdx}]`;
|
|
372
|
+
|
|
373
|
+
icp.buyingGroup.forEach((entry, idx) => {
|
|
374
|
+
if (!personaRefs.has(entry.personaRef)) {
|
|
375
|
+
reportOrphan(`${basePath}.buyingGroup[${idx}].personaRef`, entry.personaRef, 'persona');
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
icp.jobs.forEach((edge, idx) => {
|
|
379
|
+
if (!jobRefs.has(edge.jobRef)) reportOrphan(`${basePath}.jobs[${idx}].jobRef`, edge.jobRef, 'job');
|
|
380
|
+
});
|
|
381
|
+
icp.pains.forEach((edge, idx) => {
|
|
382
|
+
if (!painRefs.has(edge.painRef)) reportOrphan(`${basePath}.pains[${idx}].painRef`, edge.painRef, 'pain');
|
|
383
|
+
});
|
|
384
|
+
icp.gains.forEach((edge, idx) => {
|
|
385
|
+
if (!gainRefs.has(edge.gainRef)) reportOrphan(`${basePath}.gains[${idx}].gainRef`, edge.gainRef, 'gain');
|
|
386
|
+
});
|
|
387
|
+
icp.influences.forEach((edge, idx) => {
|
|
388
|
+
if (!icpRefs.has(edge.icpRef)) reportOrphan(`${basePath}.influences[${idx}].icpRef`, edge.icpRef, 'icp');
|
|
389
|
+
});
|
|
390
|
+
if (icp.preferredVoiceRef !== undefined && !voiceRefs.has(icp.preferredVoiceRef)) {
|
|
391
|
+
reportOrphan(`${basePath}.preferredVoiceRef`, icp.preferredVoiceRef, 'voice');
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Phase-3 ICP ref arrays (channels / triggers / alternatives /
|
|
395
|
+
// proofs / objections). All are intra-snapshot — no caller-supplied
|
|
396
|
+
// set required. Orphans here silently waste downstream targeting
|
|
397
|
+
// (channel never reached, trigger never observed) so ERROR is the
|
|
398
|
+
// right severity (D16).
|
|
399
|
+
icp.channelRefs.forEach((ref, idx) => {
|
|
400
|
+
if (!channelRefs.has(ref)) reportOrphan(`${basePath}.channelRefs[${idx}]`, ref, 'channel');
|
|
401
|
+
});
|
|
402
|
+
icp.triggerRefs.forEach((ref, idx) => {
|
|
403
|
+
if (!triggerRefs.has(ref)) reportOrphan(`${basePath}.triggerRefs[${idx}]`, ref, 'trigger');
|
|
404
|
+
});
|
|
405
|
+
icp.alternativeRefs.forEach((ref, idx) => {
|
|
406
|
+
if (!alternativeRefs.has(ref)) reportOrphan(`${basePath}.alternativeRefs[${idx}]`, ref, 'alternative');
|
|
407
|
+
});
|
|
408
|
+
icp.proofRefs.forEach((ref, idx) => {
|
|
409
|
+
if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');
|
|
410
|
+
});
|
|
411
|
+
icp.objectionRefs.forEach((ref, idx) => {
|
|
412
|
+
if (!objectionRefs.has(ref)) reportOrphan(`${basePath}.objectionRefs[${idx}]`, ref, 'objection');
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
if (options?.availableProductRefs !== undefined) {
|
|
416
|
+
icp.recommendedProductRefs.forEach((ref, idx) => {
|
|
417
|
+
if (!options.availableProductRefs!.has(ref)) {
|
|
418
|
+
reportOrphan(`${basePath}.recommendedProductRefs[${idx}]`, ref, 'product');
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
icp.upsellPathProductRefs.forEach((ref, idx) => {
|
|
422
|
+
if (!options.availableProductRefs!.has(ref)) {
|
|
423
|
+
reportOrphan(`${basePath}.upsellPathProductRefs[${idx}]`, ref, 'product');
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Persona edges + cross-family voice ref + parent ICP refs + Phase-3
|
|
430
|
+
// channel refs.
|
|
431
|
+
for (const [pIdx, persona] of snapshot.personas.entries()) {
|
|
432
|
+
const basePath = `personas[${pIdx}]`;
|
|
433
|
+
|
|
434
|
+
persona.belongsToIcpRefs.forEach((ref, idx) => {
|
|
435
|
+
if (!icpRefs.has(ref)) reportOrphan(`${basePath}.belongsToIcpRefs[${idx}]`, ref, 'icp');
|
|
436
|
+
});
|
|
437
|
+
persona.jobs.forEach((edge, idx) => {
|
|
438
|
+
if (!jobRefs.has(edge.jobRef)) reportOrphan(`${basePath}.jobs[${idx}].jobRef`, edge.jobRef, 'job');
|
|
439
|
+
});
|
|
440
|
+
persona.pains.forEach((edge, idx) => {
|
|
441
|
+
if (!painRefs.has(edge.painRef)) reportOrphan(`${basePath}.pains[${idx}].painRef`, edge.painRef, 'pain');
|
|
442
|
+
});
|
|
443
|
+
persona.gains.forEach((edge, idx) => {
|
|
444
|
+
if (!gainRefs.has(edge.gainRef)) reportOrphan(`${basePath}.gains[${idx}].gainRef`, edge.gainRef, 'gain');
|
|
445
|
+
});
|
|
446
|
+
persona.channelRefs.forEach((ref, idx) => {
|
|
447
|
+
if (!channelRefs.has(ref)) reportOrphan(`${basePath}.channelRefs[${idx}]`, ref, 'channel');
|
|
448
|
+
});
|
|
449
|
+
if (persona.preferredVoiceRef !== undefined && !voiceRefs.has(persona.preferredVoiceRef)) {
|
|
450
|
+
reportOrphan(`${basePath}.preferredVoiceRef`, persona.preferredVoiceRef, 'voice');
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Benefits — pain/gain/job + ICP refs + cross-family feature refs +
|
|
455
|
+
// Phase-3 proof / objection back-refs.
|
|
456
|
+
for (const [bIdx, benefit] of snapshot.benefits.entries()) {
|
|
457
|
+
const basePath = `benefits[${bIdx}]`;
|
|
458
|
+
|
|
459
|
+
benefit.relieves.forEach((edge, idx) => {
|
|
460
|
+
if (!painRefs.has(edge.painRef)) {
|
|
461
|
+
reportOrphan(`${basePath}.relieves[${idx}].painRef`, edge.painRef, 'pain');
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
benefit.creates.forEach((edge, idx) => {
|
|
465
|
+
if (!gainRefs.has(edge.gainRef)) {
|
|
466
|
+
reportOrphan(`${basePath}.creates[${idx}].gainRef`, edge.gainRef, 'gain');
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
benefit.advances.forEach((edge, idx) => {
|
|
470
|
+
if (!jobRefs.has(edge.jobRef)) {
|
|
471
|
+
reportOrphan(`${basePath}.advances[${idx}].jobRef`, edge.jobRef, 'job');
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
benefit.importanceByICP.forEach((edge, idx) => {
|
|
475
|
+
if (!icpRefs.has(edge.icpRef)) {
|
|
476
|
+
reportOrphan(`${basePath}.importanceByICP[${idx}].icpRef`, edge.icpRef, 'icp');
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
benefit.proofRefs.forEach((ref, idx) => {
|
|
480
|
+
if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');
|
|
481
|
+
});
|
|
482
|
+
benefit.addressesObjectionRefs.forEach((ref, idx) => {
|
|
483
|
+
if (!objectionRefs.has(ref)) {
|
|
484
|
+
reportOrphan(`${basePath}.addressesObjectionRefs[${idx}]`, ref, 'objection');
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
if (options?.availableFeatureRefs !== undefined) {
|
|
489
|
+
benefit.deliveredByFeatureRefs.forEach((ref, idx) => {
|
|
490
|
+
if (!options.availableFeatureRefs!.has(ref)) {
|
|
491
|
+
reportOrphan(`${basePath}.deliveredByFeatureRefs[${idx}]`, ref, 'feature');
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// Positionings — back to ICP + benefits + alternatives.
|
|
498
|
+
for (const [pIdx, positioning] of snapshot.positionings.entries()) {
|
|
499
|
+
const basePath = `positionings[${pIdx}]`;
|
|
500
|
+
|
|
501
|
+
if (!icpRefs.has(positioning.icpRef)) {
|
|
502
|
+
reportOrphan(`${basePath}.icpRef`, positioning.icpRef, 'icp');
|
|
503
|
+
}
|
|
504
|
+
if (positioning.preferredVoiceRef !== undefined && !voiceRefs.has(positioning.preferredVoiceRef)) {
|
|
505
|
+
reportOrphan(`${basePath}.preferredVoiceRef`, positioning.preferredVoiceRef, 'voice');
|
|
506
|
+
}
|
|
507
|
+
positioning.valuePillars.forEach((pillar, idx) => {
|
|
508
|
+
pillar.backedByBenefitRefs.forEach((ref, j) => {
|
|
509
|
+
if (!benefitRefs.has(ref)) {
|
|
510
|
+
reportOrphan(`${basePath}.valuePillars[${idx}].backedByBenefitRefs[${j}]`, ref, 'benefit');
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
positioning.alternativesContrasted.forEach((entry, idx) => {
|
|
515
|
+
if (!alternativeRefs.has(entry.alternativeRef)) {
|
|
516
|
+
reportOrphan(
|
|
517
|
+
`${basePath}.alternativesContrasted[${idx}].alternativeRef`,
|
|
518
|
+
entry.alternativeRef,
|
|
519
|
+
'alternative',
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// Triggers — affected ICPs + recommended channels.
|
|
526
|
+
for (const [tIdx, trigger] of snapshot.triggers.entries()) {
|
|
527
|
+
const basePath = `triggers[${tIdx}]`;
|
|
528
|
+
trigger.affectedIcpRefs.forEach((ref, idx) => {
|
|
529
|
+
if (!icpRefs.has(ref)) reportOrphan(`${basePath}.affectedIcpRefs[${idx}]`, ref, 'icp');
|
|
530
|
+
});
|
|
531
|
+
trigger.recommendedChannelRefs.forEach((ref, idx) => {
|
|
532
|
+
if (!channelRefs.has(ref)) reportOrphan(`${basePath}.recommendedChannelRefs[${idx}]`, ref, 'channel');
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Buying journeys — back to ICP.
|
|
537
|
+
for (const [jIdx, journey] of snapshot.buyingJourneys.entries()) {
|
|
538
|
+
const basePath = `buyingJourneys[${jIdx}]`;
|
|
539
|
+
if (!icpRefs.has(journey.icpRef)) {
|
|
540
|
+
reportOrphan(`${basePath}.icpRef`, journey.icpRef, 'icp');
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// Proofs — supports benefits + ICPs.
|
|
545
|
+
for (const [pIdx, proof] of snapshot.proofs.entries()) {
|
|
546
|
+
const basePath = `proofs[${pIdx}]`;
|
|
547
|
+
proof.supportsBenefitRefs.forEach((ref, idx) => {
|
|
548
|
+
if (!benefitRefs.has(ref)) reportOrphan(`${basePath}.supportsBenefitRefs[${idx}]`, ref, 'benefit');
|
|
549
|
+
});
|
|
550
|
+
proof.supportsIcpRefs.forEach((ref, idx) => {
|
|
551
|
+
if (!icpRefs.has(ref)) reportOrphan(`${basePath}.supportsIcpRefs[${idx}]`, ref, 'icp');
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// Objections — raised by ICPs + personas, cite proofs + related benefits.
|
|
556
|
+
for (const [oIdx, objection] of snapshot.objections.entries()) {
|
|
557
|
+
const basePath = `objections[${oIdx}]`;
|
|
558
|
+
objection.raisedByIcpRefs.forEach((ref, idx) => {
|
|
559
|
+
if (!icpRefs.has(ref)) reportOrphan(`${basePath}.raisedByIcpRefs[${idx}]`, ref, 'icp');
|
|
560
|
+
});
|
|
561
|
+
objection.raisedByPersonaRefs.forEach((ref, idx) => {
|
|
562
|
+
if (!personaRefs.has(ref)) reportOrphan(`${basePath}.raisedByPersonaRefs[${idx}]`, ref, 'persona');
|
|
563
|
+
});
|
|
564
|
+
objection.proofRefs.forEach((ref, idx) => {
|
|
565
|
+
if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');
|
|
566
|
+
});
|
|
567
|
+
objection.relatedBenefitRefs.forEach((ref, idx) => {
|
|
568
|
+
if (!benefitRefs.has(ref)) reportOrphan(`${basePath}.relatedBenefitRefs[${idx}]`, ref, 'benefit');
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// Message templates — Phase-2 slot, Phase-4 fill. The preferred-voice
|
|
573
|
+
// ref MUST resolve when authored, otherwise the market generation CLI
|
|
574
|
+
// silently falls back to the default voice and produces off-brand
|
|
575
|
+
// copy.
|
|
576
|
+
for (const [tIdx, template] of snapshot.messageTemplates.entries()) {
|
|
577
|
+
const basePath = `messageTemplates[${tIdx}]`;
|
|
578
|
+
if (template.preferredVoiceRef !== undefined && !voiceRefs.has(template.preferredVoiceRef)) {
|
|
579
|
+
reportOrphan(`${basePath}.preferredVoiceRef`, template.preferredVoiceRef, 'voice');
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* D4 invariant: at most ONE THRESHOLD-classified benefit per
|
|
586
|
+
* `(icpRef, jobRef)` cluster. THRESHOLD means "table-stakes — without
|
|
587
|
+
* it the offer is rejected", so two competing THRESHOLDs against the
|
|
588
|
+
* same (icp, job) means we have two unrelated table-stakes claims for
|
|
589
|
+
* the same outcome which is structurally undefined for the FIT scorer
|
|
590
|
+
* (`market-scoring.ts`).
|
|
591
|
+
*
|
|
592
|
+
* The detector dedupes per benefit by tracking the SET of benefit
|
|
593
|
+
* `ref`s per (icp, job) — repeated `advances[]` entries on the SAME
|
|
594
|
+
* benefit (which is itself a `DUPLICATE_EDGE_PER_ENTITY` WARN) do not
|
|
595
|
+
* double-count and therefore do not trigger a false-positive ERROR
|
|
596
|
+
* here. Benefits with empty `advances[]` are caught by
|
|
597
|
+
* `THRESHOLD_BENEFIT_WITHOUT_JOB` (ERROR) — they would otherwise
|
|
598
|
+
* structurally bypass this rule by having no (icp, job) cluster to
|
|
599
|
+
* be counted in.
|
|
600
|
+
*/
|
|
601
|
+
function detectMultipleThresholdsPerIcpJob(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
602
|
+
const benefitRefsByJobByIcp = new Map<string, Map<string, Set<string>>>();
|
|
603
|
+
|
|
604
|
+
for (const benefit of snapshot.benefits) {
|
|
605
|
+
const icpRefsWithThreshold = new Set(
|
|
606
|
+
benefit.importanceByICP
|
|
607
|
+
.filter(e => e.kanoCategory === BenefitKanoCategory.THRESHOLD)
|
|
608
|
+
.map(e => e.icpRef),
|
|
609
|
+
);
|
|
610
|
+
if (icpRefsWithThreshold.size === 0) continue;
|
|
611
|
+
|
|
612
|
+
const distinctJobRefs = new Set(benefit.advances.map(e => e.jobRef));
|
|
613
|
+
if (distinctJobRefs.size === 0) continue; // caught by THRESHOLD_BENEFIT_WITHOUT_JOB
|
|
614
|
+
|
|
615
|
+
for (const icpRef of icpRefsWithThreshold) {
|
|
616
|
+
const byJob = benefitRefsByJobByIcp.get(icpRef) ?? new Map<string, Set<string>>();
|
|
617
|
+
for (const jobRef of distinctJobRefs) {
|
|
618
|
+
const set = byJob.get(jobRef) ?? new Set<string>();
|
|
619
|
+
set.add(benefit.ref);
|
|
620
|
+
byJob.set(jobRef, set);
|
|
621
|
+
}
|
|
622
|
+
benefitRefsByJobByIcp.set(icpRef, byJob);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
for (const [icpRef, byJob] of benefitRefsByJobByIcp.entries()) {
|
|
627
|
+
for (const [jobRef, refsSet] of byJob.entries()) {
|
|
628
|
+
if (refsSet.size > 1) {
|
|
629
|
+
const refs = [...refsSet].join(', ');
|
|
630
|
+
issues.push({
|
|
631
|
+
kind: MarketSnapshotIssueKind.MULTIPLE_THRESHOLDS_PER_ICP_JOB,
|
|
632
|
+
path: `benefits.importanceByICP[icp=${icpRef}].advances[job=${jobRef}]`,
|
|
633
|
+
message: `ICP "${icpRef}" job "${jobRef}" has multiple THRESHOLD benefits (${refs}). Only one THRESHOLD per (icp, job) cluster is allowed.`,
|
|
634
|
+
severity: 'ERROR',
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Companion to `MULTIPLE_THRESHOLDS_PER_ICP_JOB`. THRESHOLD is defined
|
|
643
|
+
* as a per-(ICP, job) classification — a benefit that declares any
|
|
644
|
+
* `kanoCategory: THRESHOLD` entry on `importanceByICP[]` MUST also
|
|
645
|
+
* advance at least one job, otherwise the invariant has no anchor and
|
|
646
|
+
* the FIT scorer cannot place the table-stakes claim. ERROR.
|
|
647
|
+
*/
|
|
648
|
+
function detectThresholdBenefitsWithoutJob(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
649
|
+
for (const [bIdx, benefit] of snapshot.benefits.entries()) {
|
|
650
|
+
const hasThreshold = benefit.importanceByICP.some(
|
|
651
|
+
e => e.kanoCategory === BenefitKanoCategory.THRESHOLD,
|
|
652
|
+
);
|
|
653
|
+
if (!hasThreshold) continue;
|
|
654
|
+
if (benefit.advances.length > 0) continue;
|
|
655
|
+
|
|
656
|
+
const thresholdIcpRefs = benefit.importanceByICP
|
|
657
|
+
.filter(e => e.kanoCategory === BenefitKanoCategory.THRESHOLD)
|
|
658
|
+
.map(e => e.icpRef)
|
|
659
|
+
.join(', ');
|
|
660
|
+
issues.push({
|
|
661
|
+
kind: MarketSnapshotIssueKind.THRESHOLD_BENEFIT_WITHOUT_JOB,
|
|
662
|
+
path: `benefits[${bIdx}].advances`,
|
|
663
|
+
message: `Benefit "${benefit.ref}" is THRESHOLD for ICP(s) [${thresholdIcpRefs}] but advances[] is empty. THRESHOLD is a per-(icp, job) claim — add at least one BenefitAdvancesJob entry, or downgrade kanoCategory to PERFORMANCE/DELIGHTER.`,
|
|
664
|
+
severity: 'ERROR',
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
function detectEmptyBenefitDeliveredBy(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
670
|
+
// The schema enforces `.min(1)`; this detector remains as a defence
|
|
671
|
+
// in depth for callers that bypass parsing (legitimate scenario:
|
|
672
|
+
// tests building snapshots with type-asserted fixtures).
|
|
673
|
+
for (const [bIdx, benefit] of snapshot.benefits.entries()) {
|
|
674
|
+
if (benefit.deliveredByFeatureRefs.length === 0) {
|
|
675
|
+
issues.push({
|
|
676
|
+
kind: MarketSnapshotIssueKind.EMPTY_BENEFIT_DELIVERED_BY,
|
|
677
|
+
path: `benefits[${bIdx}].deliveredByFeatureRefs`,
|
|
678
|
+
message: `Benefit "${benefit.ref}" has empty deliveredByFeatureRefs[]. A benefit must be delivered by at least one feature.`,
|
|
679
|
+
severity: 'ERROR',
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function detectIcpWithoutPersona(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
686
|
+
const personaParents = new Set<string>();
|
|
687
|
+
for (const persona of snapshot.personas) {
|
|
688
|
+
for (const ref of persona.belongsToIcpRefs) personaParents.add(ref);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
692
|
+
if (icp.priority === ICPPriority.ANTI_TARGET) continue;
|
|
693
|
+
if (personaParents.has(icp.ref)) continue;
|
|
694
|
+
|
|
695
|
+
const severity: MarketSnapshotIssueSeverity =
|
|
696
|
+
icp.archetype === ICPArchetype.LEGAL_ENTITY ? 'ERROR' : 'WARN';
|
|
697
|
+
issues.push({
|
|
698
|
+
kind: MarketSnapshotIssueKind.ICP_WITHOUT_PERSONA,
|
|
699
|
+
path: `icps[${iIdx}].ref`,
|
|
700
|
+
message: `ICP "${icp.ref}" (archetype ${icp.archetype}) has no persona pointing at it. ${severity === 'ERROR' ? 'Required' : 'Recommended'} for ${icp.archetype}.`,
|
|
701
|
+
severity,
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
function detectInfluenceCycles(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
707
|
+
// Self-loops first — always ERROR.
|
|
708
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
709
|
+
icp.influences.forEach((edge, idx) => {
|
|
710
|
+
if (edge.icpRef === icp.ref) {
|
|
711
|
+
issues.push({
|
|
712
|
+
kind: MarketSnapshotIssueKind.INFLUENCE_CYCLE,
|
|
713
|
+
path: `icps[${iIdx}].influences[${idx}].icpRef`,
|
|
714
|
+
message: `ICP "${icp.ref}" has a self-loop in influences[]. Self-loops are not allowed.`,
|
|
715
|
+
severity: 'ERROR',
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// Multi-node cycles — Tarjan-style SCC scan, report each cycle once.
|
|
722
|
+
const adjacency = new Map<string, string[]>();
|
|
723
|
+
for (const icp of snapshot.icps) {
|
|
724
|
+
adjacency.set(
|
|
725
|
+
icp.ref,
|
|
726
|
+
icp.influences.filter(e => e.icpRef !== icp.ref).map(e => e.icpRef),
|
|
727
|
+
);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
const seenCycles = new Set<string>();
|
|
731
|
+
const visited = new Set<string>();
|
|
732
|
+
|
|
733
|
+
for (const startRef of adjacency.keys()) {
|
|
734
|
+
if (visited.has(startRef)) continue;
|
|
735
|
+
const stack: string[] = [];
|
|
736
|
+
const onStack = new Set<string>();
|
|
737
|
+
|
|
738
|
+
const dfs = (node: string): void => {
|
|
739
|
+
visited.add(node);
|
|
740
|
+
stack.push(node);
|
|
741
|
+
onStack.add(node);
|
|
742
|
+
|
|
743
|
+
for (const next of adjacency.get(node) ?? []) {
|
|
744
|
+
if (!adjacency.has(next)) continue;
|
|
745
|
+
if (!visited.has(next)) {
|
|
746
|
+
dfs(next);
|
|
747
|
+
} else if (onStack.has(next)) {
|
|
748
|
+
const cycleStart = stack.indexOf(next);
|
|
749
|
+
if (cycleStart >= 0) {
|
|
750
|
+
const cycle = stack.slice(cycleStart);
|
|
751
|
+
const key = [...cycle].sort().join('|');
|
|
752
|
+
if (!seenCycles.has(key)) {
|
|
753
|
+
seenCycles.add(key);
|
|
754
|
+
issues.push({
|
|
755
|
+
kind: MarketSnapshotIssueKind.INFLUENCE_CYCLE,
|
|
756
|
+
path: `icps[*].influences`,
|
|
757
|
+
message: `Influence cycle detected: ${cycle.join(' → ')} → ${next}. Cycles are accepted but emit a WARN.`,
|
|
758
|
+
severity: 'WARN',
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
stack.pop();
|
|
766
|
+
onStack.delete(node);
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
dfs(startRef);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
function detectMissingPositioningForIcp(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
774
|
+
const positionedIcpRefs = new Set(snapshot.positionings.map(p => p.icpRef));
|
|
775
|
+
|
|
776
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
777
|
+
if (icp.priority !== ICPPriority.CORE && icp.priority !== ICPPriority.EXPANSION) continue;
|
|
778
|
+
if (positionedIcpRefs.has(icp.ref)) continue;
|
|
779
|
+
|
|
780
|
+
issues.push({
|
|
781
|
+
kind: MarketSnapshotIssueKind.MISSING_POSITIONING_FOR_ICP,
|
|
782
|
+
path: `icps[${iIdx}].ref`,
|
|
783
|
+
message: `ICP "${icp.ref}" has priority ${icp.priority} but no MarketPositioning entry. CORE and EXPANSION ICPs must be positioned.`,
|
|
784
|
+
severity: 'ERROR',
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const REVIEW_CADENCE_TO_DAYS: Record<ReviewCadence, number> = {
|
|
790
|
+
[ReviewCadence.WEEKLY]: 7,
|
|
791
|
+
[ReviewCadence.MONTHLY]: 31,
|
|
792
|
+
[ReviewCadence.QUARTERLY]: 92,
|
|
793
|
+
[ReviewCadence.YEARLY]: 366,
|
|
794
|
+
[ReviewCadence.AS_NEEDED]: Number.POSITIVE_INFINITY,
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
function detectStaleAuthored(
|
|
798
|
+
snapshot: MarketSnapshot,
|
|
799
|
+
now: Date,
|
|
800
|
+
issues: MarketSnapshotIssue[],
|
|
801
|
+
): void {
|
|
802
|
+
const checkAuthored = (authored: MarketAuthoredMetadata | undefined, path: string, ref: string): void => {
|
|
803
|
+
if (authored?.reviewCadence === undefined) return;
|
|
804
|
+
const days = REVIEW_CADENCE_TO_DAYS[authored.reviewCadence];
|
|
805
|
+
if (!Number.isFinite(days)) return;
|
|
806
|
+
const lastAuthored = new Date(authored.lastAuthoredAt).getTime();
|
|
807
|
+
if (Number.isNaN(lastAuthored)) return;
|
|
808
|
+
const ageMs = now.getTime() - lastAuthored;
|
|
809
|
+
const ageDays = ageMs / (24 * 60 * 60 * 1000);
|
|
810
|
+
if (ageDays > days) {
|
|
811
|
+
issues.push({
|
|
812
|
+
kind: MarketSnapshotIssueKind.STALE_AUTHORED,
|
|
813
|
+
path,
|
|
814
|
+
message: `Authored content for "${ref}" is ${Math.floor(ageDays)} days old (cadence ${authored.reviewCadence} ⇒ ${days}d). Re-author or remove the cadence.`,
|
|
815
|
+
severity: 'WARN',
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
snapshot.icps.forEach((icp, idx) => checkAuthored(icp.authored, `icps[${idx}].authored`, icp.ref));
|
|
821
|
+
snapshot.personas.forEach((p, idx) => checkAuthored(p.authored, `personas[${idx}].authored`, p.ref));
|
|
822
|
+
snapshot.jobs.forEach((j, idx) => checkAuthored(j.authored, `jobs[${idx}].authored`, j.ref));
|
|
823
|
+
snapshot.pains.forEach((p, idx) => checkAuthored(p.authored, `pains[${idx}].authored`, p.ref));
|
|
824
|
+
snapshot.gains.forEach((g, idx) => checkAuthored(g.authored, `gains[${idx}].authored`, g.ref));
|
|
825
|
+
snapshot.tonesOfVoice.forEach((v, idx) => checkAuthored(v.authored, `tonesOfVoice[${idx}].authored`, v.ref));
|
|
826
|
+
snapshot.benefits.forEach((b, idx) => checkAuthored(b.authored, `benefits[${idx}].authored`, b.ref));
|
|
827
|
+
snapshot.positionings.forEach((p, idx) => checkAuthored(p.authored, `positionings[${idx}].authored`, p.ref));
|
|
828
|
+
snapshot.messageTemplates.forEach((t, idx) => checkAuthored(t.authored, `messageTemplates[${idx}].authored`, t.ref));
|
|
829
|
+
snapshot.channels.forEach((c, idx) => checkAuthored(c.authored, `channels[${idx}].authored`, c.ref));
|
|
830
|
+
snapshot.alternatives.forEach((a, idx) => checkAuthored(a.authored, `alternatives[${idx}].authored`, a.ref));
|
|
831
|
+
snapshot.triggers.forEach((t, idx) => checkAuthored(t.authored, `triggers[${idx}].authored`, t.ref));
|
|
832
|
+
snapshot.buyingJourneys.forEach((j, idx) => checkAuthored(j.authored, `buyingJourneys[${idx}].authored`, j.ref));
|
|
833
|
+
snapshot.proofs.forEach((p, idx) => checkAuthored(p.authored, `proofs[${idx}].authored`, p.ref));
|
|
834
|
+
snapshot.objections.forEach((o, idx) => checkAuthored(o.authored, `objections[${idx}].authored`, o.ref));
|
|
835
|
+
checkAuthored(snapshot.category.authored, 'category.authored', snapshot.category.ref);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Per-entity duplicate-edge detection.
|
|
840
|
+
*
|
|
841
|
+
* Scope (intentionally bounded — see `DUPLICATE_EDGE_PER_ENTITY` JSDoc
|
|
842
|
+
* on the enum for the canonical list):
|
|
843
|
+
* - ICP and persona `pains[].painRef` / `gains[].gainRef` /
|
|
844
|
+
* `jobs[].jobRef`. Duplicates here are typically the result of an
|
|
845
|
+
* `inheritFrom(parentIcp)` spread followed by a forgotten
|
|
846
|
+
* `.filter()` step on the persona.
|
|
847
|
+
* - Benefit `importanceByICP[].icpRef`. Duplicates make per-ICP
|
|
848
|
+
* weighting non-deterministic in the FIT scorer (the last one wins
|
|
849
|
+
* silently). We deliberately do NOT collapse the duplicates — we
|
|
850
|
+
* surface them so authors fix the source instead of relying on
|
|
851
|
+
* detector-side normalization.
|
|
852
|
+
*
|
|
853
|
+
* NOT covered (other detectors / schema constraints handle these):
|
|
854
|
+
* - benefit `relieves` / `creates` / `advances` weighted edges — the
|
|
855
|
+
* degree might legitimately differ across entries; future work.
|
|
856
|
+
* - ICP `buyingGroup[].personaRef` — deduplication is enforced by
|
|
857
|
+
* intent (a persona is in the group exactly once); future work.
|
|
858
|
+
*/
|
|
859
|
+
function detectDuplicateEdgesPerEntity(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
860
|
+
const reportDuplicates = (
|
|
861
|
+
refs: string[],
|
|
862
|
+
basePath: string,
|
|
863
|
+
field: string,
|
|
864
|
+
ownerRef: string,
|
|
865
|
+
refSubpath: string = '',
|
|
866
|
+
hint: string = 'Likely an inheritFrom() spread that wasn\'t deduplicated.',
|
|
867
|
+
): void => {
|
|
868
|
+
const seen = new Set<string>();
|
|
869
|
+
refs.forEach((ref, idx) => {
|
|
870
|
+
if (seen.has(ref)) {
|
|
871
|
+
issues.push({
|
|
872
|
+
kind: MarketSnapshotIssueKind.DUPLICATE_EDGE_PER_ENTITY,
|
|
873
|
+
path: `${basePath}.${field}[${idx}]${refSubpath}`,
|
|
874
|
+
message: `${field} ref "${ref}" appears more than once on "${ownerRef}". ${hint}`,
|
|
875
|
+
severity: 'WARN',
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
seen.add(ref);
|
|
879
|
+
});
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
883
|
+
const basePath = `icps[${iIdx}]`;
|
|
884
|
+
reportDuplicates(icp.pains.map(e => e.painRef), basePath, 'pains', icp.ref, '.painRef');
|
|
885
|
+
reportDuplicates(icp.gains.map(e => e.gainRef), basePath, 'gains', icp.ref, '.gainRef');
|
|
886
|
+
reportDuplicates(icp.jobs.map(e => e.jobRef), basePath, 'jobs', icp.ref, '.jobRef');
|
|
887
|
+
}
|
|
888
|
+
for (const [pIdx, persona] of snapshot.personas.entries()) {
|
|
889
|
+
const basePath = `personas[${pIdx}]`;
|
|
890
|
+
reportDuplicates(persona.pains.map(e => e.painRef), basePath, 'pains', persona.ref, '.painRef');
|
|
891
|
+
reportDuplicates(persona.gains.map(e => e.gainRef), basePath, 'gains', persona.ref, '.gainRef');
|
|
892
|
+
reportDuplicates(persona.jobs.map(e => e.jobRef), basePath, 'jobs', persona.ref, '.jobRef');
|
|
893
|
+
}
|
|
894
|
+
for (const [bIdx, benefit] of snapshot.benefits.entries()) {
|
|
895
|
+
const basePath = `benefits[${bIdx}]`;
|
|
896
|
+
reportDuplicates(
|
|
897
|
+
benefit.importanceByICP.map(e => e.icpRef),
|
|
898
|
+
basePath,
|
|
899
|
+
'importanceByICP',
|
|
900
|
+
benefit.ref,
|
|
901
|
+
'.icpRef',
|
|
902
|
+
'Each (benefit, icp) pair must appear at most once — duplicates make per-ICP weighting non-deterministic.',
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
function detectInvalidAntiTargetPurposeMix(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
908
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
909
|
+
if (icp.priority !== ICPPriority.ANTI_TARGET) continue;
|
|
910
|
+
const isZero = icp.purposeMix.adoption === 0 && icp.purposeMix.revenue === 0;
|
|
911
|
+
if (isZero) continue;
|
|
912
|
+
issues.push({
|
|
913
|
+
kind: MarketSnapshotIssueKind.INVALID_ANTI_TARGET_PURPOSE_MIX,
|
|
914
|
+
path: `icps[${iIdx}].purposeMix`,
|
|
915
|
+
message: `ICP "${icp.ref}" has priority ANTI_TARGET but purposeMix=${JSON.stringify(icp.purposeMix)}. ANTI_TARGET ICPs MUST carry { adoption: 0, revenue: 0 }.`,
|
|
916
|
+
severity: 'ERROR',
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
function detectBuyingGroupPersonasMissingDmuRole(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
922
|
+
for (const [pIdx, persona] of snapshot.personas.entries()) {
|
|
923
|
+
if (persona.personaScope !== PersonaScope.BUYING_GROUP_MEMBER) continue;
|
|
924
|
+
if (persona.dmuRole !== undefined) continue;
|
|
925
|
+
issues.push({
|
|
926
|
+
kind: MarketSnapshotIssueKind.BUYING_GROUP_PERSONA_MISSING_DMU_ROLE,
|
|
927
|
+
path: `personas[${pIdx}].dmuRole`,
|
|
928
|
+
message: `Persona "${persona.ref}" has personaScope BUYING_GROUP_MEMBER but no dmuRole. DMU role is required for buying-group members.`,
|
|
929
|
+
severity: 'ERROR',
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* The ICP→persona buying-group link MUST be symmetric: when an ICP
|
|
936
|
+
* lists a persona in `buyingGroup[].personaRef`, the persona's
|
|
937
|
+
* `belongsToIcpRefs[]` MUST contain the ICP. Asymmetric links cause
|
|
938
|
+
* downstream consumers (DMU rendering, persona-by-ICP indexing,
|
|
939
|
+
* market generation targeting) to silently drop the persona because
|
|
940
|
+
* the `belongsToIcpRefs[]` index is the canonical traversal path.
|
|
941
|
+
*
|
|
942
|
+
* ERROR severity — this is a structural integrity bug, not authoring
|
|
943
|
+
* polish: the snapshot will pass parse + intent but will silently
|
|
944
|
+
* misbehave at runtime.
|
|
945
|
+
*
|
|
946
|
+
* Reverse direction (persona declares an ICP that does NOT list the
|
|
947
|
+
* persona in its `buyingGroup[]`) is intentionally NOT reported here:
|
|
948
|
+
* personas of `INDIVIDUAL_SELF` / `INDIVIDUAL_INFLUENCER` scope are
|
|
949
|
+
* legitimately attached to ICPs that have no formal buying group.
|
|
950
|
+
* The detector only runs the ICP→persona direction.
|
|
951
|
+
*/
|
|
952
|
+
function detectBuyingGroupBacklinkMissing(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
953
|
+
const personasByRef = new Map(snapshot.personas.map(p => [p.ref, p] as const));
|
|
954
|
+
|
|
955
|
+
for (const [iIdx, icp] of snapshot.icps.entries()) {
|
|
956
|
+
icp.buyingGroup.forEach((entry, idx) => {
|
|
957
|
+
const persona = personasByRef.get(entry.personaRef);
|
|
958
|
+
if (persona === undefined) return; // orphan caught elsewhere
|
|
959
|
+
if (persona.belongsToIcpRefs.includes(icp.ref)) return;
|
|
960
|
+
issues.push({
|
|
961
|
+
kind: MarketSnapshotIssueKind.BUYING_GROUP_BACKLINK_MISSING,
|
|
962
|
+
path: `icps[${iIdx}].buyingGroup[${idx}].personaRef`,
|
|
963
|
+
message: `ICP "${icp.ref}" lists persona "${persona.ref}" in buyingGroup[], but the persona's belongsToIcpRefs[] is ${JSON.stringify(persona.belongsToIcpRefs)} (does not include "${icp.ref}"). The link must be symmetric.`,
|
|
964
|
+
severity: 'ERROR',
|
|
965
|
+
});
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Phase 3 — a `MarketProof` that supports neither a benefit nor an ICP
|
|
972
|
+
* has no place to land in generated copy. WARN, not ERROR — the proof
|
|
973
|
+
* may be in flight ("about to wire it up next") and should not block
|
|
974
|
+
* boot.
|
|
975
|
+
*/
|
|
976
|
+
function detectProofsWithoutSupport(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
977
|
+
for (const [pIdx, proof] of snapshot.proofs.entries()) {
|
|
978
|
+
if (proof.supportsBenefitRefs.length > 0 || proof.supportsIcpRefs.length > 0) continue;
|
|
979
|
+
issues.push({
|
|
980
|
+
kind: MarketSnapshotIssueKind.PROOF_WITHOUT_SUPPORT,
|
|
981
|
+
path: `proofs[${pIdx}]`,
|
|
982
|
+
message: `Proof "${proof.ref}" supports neither a benefit nor an ICP. Add at least one supportsBenefitRefs[] or supportsIcpRefs[] entry, or remove the proof.`,
|
|
983
|
+
severity: 'WARN',
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Phase 3 — proofKind/payload coherence (WARN). The schema is
|
|
990
|
+
* intentionally permissive (both `attribution` and `metric` are
|
|
991
|
+
* optional on every kind) so that authors can mix proof shapes
|
|
992
|
+
* without fighting the type system. This detector flags the two
|
|
993
|
+
* mismatches that are unambiguously authoring drift:
|
|
994
|
+
*
|
|
995
|
+
* 1. `METRIC` proof without a `metric` block — the structured
|
|
996
|
+
* `value + unit + period` payload is what distinguishes a
|
|
997
|
+
* `METRIC` proof from a `QUOTE` that happens to carry a number.
|
|
998
|
+
* Without it the rendering layer cannot format the proof as a
|
|
999
|
+
* metric (no value to surface, no unit to localize). Authors
|
|
1000
|
+
* should either add the `metric` block or downgrade the kind to
|
|
1001
|
+
* `QUOTE` / `CASE_STUDY`.
|
|
1002
|
+
* 2. `LOGO` proof with a `metric` block — a logo carries no
|
|
1003
|
+
* quantitative payload by definition, so a `metric` block on a
|
|
1004
|
+
* `LOGO` is a category error. Either move the metric to a
|
|
1005
|
+
* sibling `METRIC` proof or change the kind.
|
|
1006
|
+
*
|
|
1007
|
+
* All other kind/payload combinations are deliberately accepted:
|
|
1008
|
+
* a `QUOTE` may carry a `metric` (a quote that quantifies an
|
|
1009
|
+
* outcome), an `AWARD` may carry an `attribution` (the awarding
|
|
1010
|
+
* body), etc. Adding more rules here trades flexibility for
|
|
1011
|
+
* marginal signal — keep this conservative.
|
|
1012
|
+
*/
|
|
1013
|
+
function detectProofKindPayloadMismatch(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
1014
|
+
for (const [pIdx, proof] of snapshot.proofs.entries()) {
|
|
1015
|
+
if (proof.proofKind === ProofKind.METRIC && proof.metric === undefined) {
|
|
1016
|
+
issues.push({
|
|
1017
|
+
kind: MarketSnapshotIssueKind.PROOF_KIND_PAYLOAD_MISMATCH,
|
|
1018
|
+
path: `proofs[${pIdx}].metric`,
|
|
1019
|
+
message: `Proof "${proof.ref}" is METRIC but carries no structured \`metric\` block (value + unit). Add the metric block or downgrade proofKind to QUOTE/CASE_STUDY.`,
|
|
1020
|
+
severity: 'WARN',
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
if (proof.proofKind === ProofKind.LOGO && proof.metric !== undefined) {
|
|
1024
|
+
issues.push({
|
|
1025
|
+
kind: MarketSnapshotIssueKind.PROOF_KIND_PAYLOAD_MISMATCH,
|
|
1026
|
+
path: `proofs[${pIdx}].metric`,
|
|
1027
|
+
message: `Proof "${proof.ref}" is LOGO but carries a \`metric\` block. A logo has no quantitative payload — move the metric to a sibling METRIC proof or change the proofKind.`,
|
|
1028
|
+
severity: 'WARN',
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* A `MarketBuyingJourney` listing the same `BuyingJourneyStage` enum
|
|
1036
|
+
* value more than once is a structural authoring bug (which entry
|
|
1037
|
+
* wins for prompt enrichment? non-deterministic). ERROR.
|
|
1038
|
+
*/
|
|
1039
|
+
function detectDuplicateJourneyStages(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
1040
|
+
for (const [jIdx, journey] of snapshot.buyingJourneys.entries()) {
|
|
1041
|
+
const seenStages = new Set<string>();
|
|
1042
|
+
journey.stages.forEach((entry, idx) => {
|
|
1043
|
+
if (seenStages.has(entry.stage)) {
|
|
1044
|
+
issues.push({
|
|
1045
|
+
kind: MarketSnapshotIssueKind.DUPLICATE_JOURNEY_STAGE,
|
|
1046
|
+
path: `buyingJourneys[${jIdx}].stages[${idx}].stage`,
|
|
1047
|
+
message: `Buying journey "${journey.ref}" lists stage ${entry.stage} more than once. Each BuyingJourneyStage may appear at most once per journey.`,
|
|
1048
|
+
severity: 'ERROR',
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
seenStages.add(entry.stage);
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* Two `MarketBuyingJourney` entries pointing at the same `icpRef` is
|
|
1058
|
+
* a structural authoring bug — the model is "one journey per ICP" and
|
|
1059
|
+
* downstream consumers (prompt enrichment, journey-by-ICP indexing)
|
|
1060
|
+
* will silently pick the first match. ERROR.
|
|
1061
|
+
*/
|
|
1062
|
+
function detectDuplicateBuyingJourneyForIcp(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
1063
|
+
const seenIcpRefs = new Map<string, number>();
|
|
1064
|
+
snapshot.buyingJourneys.forEach((journey, idx) => {
|
|
1065
|
+
const previousIdx = seenIcpRefs.get(journey.icpRef);
|
|
1066
|
+
if (previousIdx !== undefined) {
|
|
1067
|
+
issues.push({
|
|
1068
|
+
kind: MarketSnapshotIssueKind.DUPLICATE_BUYING_JOURNEY_FOR_ICP,
|
|
1069
|
+
path: `buyingJourneys[${idx}].icpRef`,
|
|
1070
|
+
message: `Buying journey "${journey.ref}" targets ICP "${journey.icpRef}" but buyingJourneys[${previousIdx}] already targets the same ICP. The model is one journey per ICP — merge or remove one.`,
|
|
1071
|
+
severity: 'ERROR',
|
|
1072
|
+
});
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
seenIcpRefs.set(journey.icpRef, idx);
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Semantic check: an objection citing `proofRefs[]` should point at
|
|
1081
|
+
* proofs whose support set actually intersects the objection's claim.
|
|
1082
|
+
*
|
|
1083
|
+
* Both sides of the intersection are unioned to be permissive without
|
|
1084
|
+
* being toothless:
|
|
1085
|
+
* - Proof support side: `proof.supportsBenefitRefs[]` ∪
|
|
1086
|
+
* `proof.supportsIcpRefs[]`. A proof that supports the ICP raising
|
|
1087
|
+
* the objection (e.g. a `LOGO` proof for that ICP) is considered
|
|
1088
|
+
* to back the objection even if it doesn't directly back a specific
|
|
1089
|
+
* benefit — logos and case studies are rarely benefit-scoped.
|
|
1090
|
+
* - Objection target side: `objection.relatedBenefitRefs[]` ∪
|
|
1091
|
+
* `objection.raisedByIcpRefs[]`.
|
|
1092
|
+
*
|
|
1093
|
+
* WARN (authoring drift, not catastrophic — the spec parses, but the
|
|
1094
|
+
* cited proofs will not render as supporting evidence in any of the
|
|
1095
|
+
* downstream prompt blocks). Orphan refs are caught separately by
|
|
1096
|
+
* `detectOrphanRefs`.
|
|
1097
|
+
*
|
|
1098
|
+
* Skipped for objections where either side of the intersection is
|
|
1099
|
+
* empty (no proofs cited OR neither related benefits nor raising ICPs
|
|
1100
|
+
* authored — the check has no signal then).
|
|
1101
|
+
*/
|
|
1102
|
+
function detectObjectionProofBenefitMismatch(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {
|
|
1103
|
+
const proofsByRef = new Map(snapshot.proofs.map(p => [p.ref, p] as const));
|
|
1104
|
+
|
|
1105
|
+
for (const [oIdx, objection] of snapshot.objections.entries()) {
|
|
1106
|
+
if (objection.proofRefs.length === 0) continue;
|
|
1107
|
+
const objectionTargets = new Set<string>([
|
|
1108
|
+
...objection.relatedBenefitRefs,
|
|
1109
|
+
...objection.raisedByIcpRefs,
|
|
1110
|
+
]);
|
|
1111
|
+
if (objectionTargets.size === 0) continue;
|
|
1112
|
+
|
|
1113
|
+
const supported = new Set<string>();
|
|
1114
|
+
for (const proofRef of objection.proofRefs) {
|
|
1115
|
+
const proof = proofsByRef.get(proofRef);
|
|
1116
|
+
if (proof === undefined) continue; // orphan caught elsewhere
|
|
1117
|
+
for (const benefitRef of proof.supportsBenefitRefs) supported.add(benefitRef);
|
|
1118
|
+
for (const icpRef of proof.supportsIcpRefs) supported.add(icpRef);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
const intersects = [...objectionTargets].some(ref => supported.has(ref));
|
|
1122
|
+
if (intersects) continue;
|
|
1123
|
+
|
|
1124
|
+
issues.push({
|
|
1125
|
+
kind: MarketSnapshotIssueKind.OBJECTION_PROOF_BENEFIT_MISMATCH,
|
|
1126
|
+
path: `objections[${oIdx}].proofRefs`,
|
|
1127
|
+
message: `Objection "${objection.ref}" cites proofRefs ${JSON.stringify(objection.proofRefs)} but none of them supports any benefit in relatedBenefitRefs ${JSON.stringify(objection.relatedBenefitRefs)} nor any ICP in raisedByIcpRefs ${JSON.stringify(objection.raisedByIcpRefs)}. The cited proofs do not back the objection.`,
|
|
1128
|
+
severity: 'WARN',
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Maps a `MarketMessageRequiredInput` enum value to the placeholder
|
|
1135
|
+
* shapes inside `promptTemplate` that consume it. Each input matches
|
|
1136
|
+
* either the bare `{{<value>}}` token or any dotted-property descent
|
|
1137
|
+
* `{{<entityName>.path}}` (e.g. `icpRef` is consumed by `{{icpRef}}`,
|
|
1138
|
+
* `{{icp.name}}`, `{{icp.profile.geographies}}`).
|
|
1139
|
+
*
|
|
1140
|
+
* The `entityName` form is the camelCase root WITHOUT the trailing
|
|
1141
|
+
* `Ref` suffix — i.e. `icpRef` → entity name `icp`, `benefitRef` →
|
|
1142
|
+
* `benefit`. This matches the conventional Mustache shape authors use
|
|
1143
|
+
* in templates ("ICP context surfaces under `icp.*`").
|
|
1144
|
+
*/
|
|
1145
|
+
const REQUIRED_INPUT_PLACEHOLDER_PATTERNS: Record<MarketMessageRequiredInput, RegExp> = {
|
|
1146
|
+
[MarketMessageRequiredInput.ICP_REF]: /\{\{\s*(?:icpRef|icp(?:\.[A-Za-z0-9_]+)+)\s*\}\}/,
|
|
1147
|
+
[MarketMessageRequiredInput.BENEFIT_REF]: /\{\{\s*(?:benefitRef|benefit(?:\.[A-Za-z0-9_]+)+)\s*\}\}/,
|
|
1148
|
+
[MarketMessageRequiredInput.CHANNEL_REF]: /\{\{\s*(?:channelRef|channel(?:\.[A-Za-z0-9_]+)+)\s*\}\}/,
|
|
1149
|
+
[MarketMessageRequiredInput.OBJECTION_REF]: /\{\{\s*(?:objectionRef|objection(?:\.[A-Za-z0-9_]+)+)\s*\}\}/,
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Inverse of `REQUIRED_INPUT_PLACEHOLDER_PATTERNS` — given a Mustache
|
|
1154
|
+
* placeholder name extracted from a template body, return the
|
|
1155
|
+
* `MarketMessageRequiredInput` it consumes (or `undefined` if the
|
|
1156
|
+
* leading token is the exempt `{{output_language}}` / an unknown
|
|
1157
|
+
* camelCase root).
|
|
1158
|
+
*
|
|
1159
|
+
* Keyed on the **leading entity name** in two distinct shapes:
|
|
1160
|
+
* - the dotted-root entity (`icp` → consumed by `{{icp.name}}`,
|
|
1161
|
+
* `{{icp.profile.…}}`);
|
|
1162
|
+
* - the explicit `<entity>Ref` token (`icpRef` → consumed by
|
|
1163
|
+
* `{{icpRef}}`).
|
|
1164
|
+
*
|
|
1165
|
+
* The bare-entity token `{{icp}}` (no dot, no `Ref` suffix) is
|
|
1166
|
+
* intentionally NOT a recognized form here: Direction-1 of the
|
|
1167
|
+
* validator (declared → used) rejects it (the regex requires
|
|
1168
|
+
* `\{\{icpRef\}\}` OR `\{\{icp\.<segment>\}\}`), so accepting it in
|
|
1169
|
+
* Direction-2 would create an asymmetric false-positive WARN. The
|
|
1170
|
+
* detector enforces this in `isRecognizedPlaceholderToken(...)`
|
|
1171
|
+
* before consulting the map.
|
|
1172
|
+
*/
|
|
1173
|
+
const PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT: Record<string, MarketMessageRequiredInput> = {
|
|
1174
|
+
icp: MarketMessageRequiredInput.ICP_REF,
|
|
1175
|
+
icpRef: MarketMessageRequiredInput.ICP_REF,
|
|
1176
|
+
benefit: MarketMessageRequiredInput.BENEFIT_REF,
|
|
1177
|
+
benefitRef: MarketMessageRequiredInput.BENEFIT_REF,
|
|
1178
|
+
channel: MarketMessageRequiredInput.CHANNEL_REF,
|
|
1179
|
+
channelRef: MarketMessageRequiredInput.CHANNEL_REF,
|
|
1180
|
+
objection: MarketMessageRequiredInput.OBJECTION_REF,
|
|
1181
|
+
objectionRef: MarketMessageRequiredInput.OBJECTION_REF,
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Returns the `MarketMessageRequiredInput` consumed by a Mustache
|
|
1186
|
+
* placeholder body (everything between `{{` and `}}` with whitespace
|
|
1187
|
+
* stripped), or `undefined` when the token does not consume any
|
|
1188
|
+
* required input.
|
|
1189
|
+
*
|
|
1190
|
+
* Symmetric with `REQUIRED_INPUT_PLACEHOLDER_PATTERNS`:
|
|
1191
|
+
* - dotted access (`icp.name`, `icp.profile.geographies`) → consumes
|
|
1192
|
+
* the dotted root's required input;
|
|
1193
|
+
* - explicit `<entity>Ref` (`icpRef`) → consumes the matching
|
|
1194
|
+
* required input;
|
|
1195
|
+
* - bare entity (`icp`) → DOES NOT consume — same as Direction-1.
|
|
1196
|
+
*/
|
|
1197
|
+
function lookupConsumedRequiredInput(
|
|
1198
|
+
innerExpression: string,
|
|
1199
|
+
): MarketMessageRequiredInput | undefined {
|
|
1200
|
+
const dotIndex = innerExpression.indexOf('.');
|
|
1201
|
+
if (dotIndex >= 0) {
|
|
1202
|
+
const dottedRoot = innerExpression.slice(0, dotIndex).trim();
|
|
1203
|
+
return PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT[dottedRoot];
|
|
1204
|
+
}
|
|
1205
|
+
// No dot — only the explicit `<entity>Ref` form is recognized.
|
|
1206
|
+
if (!innerExpression.endsWith('Ref')) return undefined;
|
|
1207
|
+
return PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT[innerExpression];
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Mustache token names that are CLI-injected at render time and are
|
|
1212
|
+
* therefore NOT expected to appear in `requiredInputs[]`. Today only
|
|
1213
|
+
* `output_language` is in this set (substituted from the
|
|
1214
|
+
* `--output-language` flag), but the set
|
|
1215
|
+
* is structured to grow with future CLI-side affordances.
|
|
1216
|
+
*/
|
|
1217
|
+
const PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS: ReadonlySet<string> = new Set([
|
|
1218
|
+
'output_language',
|
|
1219
|
+
]);
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* Match every Mustache placeholder inside a template body. Captures
|
|
1223
|
+
* the inner expression with surrounding whitespace stripped so callers
|
|
1224
|
+
* can split on `.` to extract the leading entity name.
|
|
1225
|
+
*
|
|
1226
|
+
* Permissive on identifier shape — accepts kebab-free dot paths
|
|
1227
|
+
* (`icp.name`, `icp.profile.geographies`) and bare identifiers
|
|
1228
|
+
* (`icpRef`, `output_language`). Mustache section tokens
|
|
1229
|
+
* (`{{#...}}` / `{{^...}}` / `{{/...}}` / `{{!...}}`) are filtered
|
|
1230
|
+
* via the leading sigil check below.
|
|
1231
|
+
*/
|
|
1232
|
+
const MUSTACHE_PLACEHOLDER_REGEX = /\{\{\s*([^}]+?)\s*\}\}/g;
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* Phase-4 (§10.3 of the plan) — declared/used coherence check on
|
|
1236
|
+
* `MarketMessageTemplate.promptTemplate` ↔ `requiredInputs[]`.
|
|
1237
|
+
*
|
|
1238
|
+
* The detector is symmetric: it surfaces both directions of drift
|
|
1239
|
+
* (declared but never substituted; used in the body but never
|
|
1240
|
+
* declared) under the same `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH`
|
|
1241
|
+
* kind. The message text disambiguates the direction so authors can
|
|
1242
|
+
* fix it from the report alone.
|
|
1243
|
+
*
|
|
1244
|
+
* The exempt token set ({{output_language}} today) is filtered before
|
|
1245
|
+
* the "used but not declared" pass — see
|
|
1246
|
+
* `PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS`. Unknown camelCase
|
|
1247
|
+
* roots (e.g. `{{persona.name}}` if persona ever becomes a placeholder
|
|
1248
|
+
* shape) are silently ignored — this detector covers ONLY the inputs
|
|
1249
|
+
* declared in `MarketMessageRequiredInput`. Adding a new required-input
|
|
1250
|
+
* shape requires extending both `PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT`
|
|
1251
|
+
* and `REQUIRED_INPUT_PLACEHOLDER_PATTERNS` together.
|
|
1252
|
+
*/
|
|
1253
|
+
function detectMessageTemplatePlaceholderMismatch(
|
|
1254
|
+
snapshot: MarketSnapshot,
|
|
1255
|
+
issues: MarketSnapshotIssue[],
|
|
1256
|
+
): void {
|
|
1257
|
+
for (const [tIdx, template] of snapshot.messageTemplates.entries()) {
|
|
1258
|
+
const declaredInputs = new Set<MarketMessageRequiredInput>(template.requiredInputs ?? []);
|
|
1259
|
+
|
|
1260
|
+
// Direction 1: declared but the body has no consuming placeholder.
|
|
1261
|
+
for (const declared of declaredInputs) {
|
|
1262
|
+
const pattern = REQUIRED_INPUT_PLACEHOLDER_PATTERNS[declared];
|
|
1263
|
+
if (pattern.test(template.promptTemplate)) continue;
|
|
1264
|
+
issues.push({
|
|
1265
|
+
kind: MarketSnapshotIssueKind.MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH,
|
|
1266
|
+
path: `messageTemplates[${tIdx}].requiredInputs`,
|
|
1267
|
+
message:
|
|
1268
|
+
`Message template "${template.ref}" declares requiredInput "${declared}" but no `
|
|
1269
|
+
+ `\`{{${declared.replace(/Ref$/, '')}.*}}\` / \`{{${declared}}}\` placeholder exists in promptTemplate. `
|
|
1270
|
+
+ `Add the placeholder or prune the requiredInput entry.`,
|
|
1271
|
+
severity: 'WARN',
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
// Direction 2: body references a known input shape that is not declared.
|
|
1276
|
+
const referencedInputs = new Set<MarketMessageRequiredInput>();
|
|
1277
|
+
MUSTACHE_PLACEHOLDER_REGEX.lastIndex = 0;
|
|
1278
|
+
let match: RegExpExecArray | null;
|
|
1279
|
+
while ((match = MUSTACHE_PLACEHOLDER_REGEX.exec(template.promptTemplate)) !== null) {
|
|
1280
|
+
const inner = match[1] ?? '';
|
|
1281
|
+
// Skip Mustache section / inverted / closing / comment tokens.
|
|
1282
|
+
const firstChar = inner[0];
|
|
1283
|
+
if (firstChar === '#' || firstChar === '^' || firstChar === '/' || firstChar === '!') continue;
|
|
1284
|
+
|
|
1285
|
+
const leadingEntity = inner.split('.')[0]?.trim() ?? '';
|
|
1286
|
+
if (leadingEntity.length === 0) continue;
|
|
1287
|
+
if (PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS.has(leadingEntity)) continue;
|
|
1288
|
+
|
|
1289
|
+
const consumedInput = lookupConsumedRequiredInput(inner);
|
|
1290
|
+
if (consumedInput === undefined) continue; // unknown entity root — out of scope for this detector
|
|
1291
|
+
referencedInputs.add(consumedInput);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
for (const referenced of referencedInputs) {
|
|
1295
|
+
if (declaredInputs.has(referenced)) continue;
|
|
1296
|
+
issues.push({
|
|
1297
|
+
kind: MarketSnapshotIssueKind.MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH,
|
|
1298
|
+
path: `messageTemplates[${tIdx}].promptTemplate`,
|
|
1299
|
+
message:
|
|
1300
|
+
`Message template "${template.ref}" references \`{{${referenced.replace(/Ref$/, '')}.*}}\` / `
|
|
1301
|
+
+ `\`{{${referenced}}}\` placeholders but does not declare "${referenced}" in requiredInputs[]. `
|
|
1302
|
+
+ `Add the requiredInput entry or remove the placeholder.`,
|
|
1303
|
+
severity: 'WARN',
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
```
|
|
1309
|
+
|
|
1310
|
+
## Placeholder ↔ requiredInput mapping
|
|
1311
|
+
|
|
1312
|
+
| `MarketMessageRequiredInput` value | Placeholder shapes that consume it |
|
|
1313
|
+
|------------------------------------|-------------------------------------------------------------|
|
|
1314
|
+
| `ICP_REF` (`'icpRef'`) | `{{icp.<path>}}`, `{{icpRef}}` |
|
|
1315
|
+
| `BENEFIT_REF` (`'benefitRef'`) | `{{benefit.<path>}}`, `{{benefitRef}}` |
|
|
1316
|
+
| `CHANNEL_REF` (`'channelRef'`) | `{{channel.<path>}}`, `{{channelRef}}` |
|
|
1317
|
+
| `OBJECTION_REF` (`'objectionRef'`) | `{{objection.<path>}}`, `{{objectionRef}}` |
|
|
1318
|
+
|
|
1319
|
+
The `{{output_language}}` token is **CLI-injected** (substituted from
|
|
1320
|
+
the market-generation `--output-language` flag) and is **exempt** from
|
|
1321
|
+
the placeholder-mismatch rule. It must never appear in
|
|
1322
|
+
`requiredInputs[]`.
|
|
1323
|
+
|
|
1324
|
+
Mustache section / inverted / closing / comment tokens
|
|
1325
|
+
(`{{#...}}`, `{{^...}}`, `{{/...}}`, `{{!...}}`) are skipped by
|
|
1326
|
+
the validator scan.
|
|
1327
|
+
|
|
1328
|
+
## Worked seed pair (Tier A)
|
|
1329
|
+
|
|
1330
|
+
Two minimal mechanism-only seeds: one `LANDING_PAGE`
|
|
1331
|
+
(`tmpl-landing-icp-hero`, declares `ICP_REF + BENEFIT_REF`) and one
|
|
1332
|
+
`OBJECTION_RESPONSE` (`tmpl-objection-response-email`, declares
|
|
1333
|
+
`ICP_REF + BENEFIT_REF + OBJECTION_REF`). Both demonstrate the
|
|
1334
|
+
`{{output_language}}` exemption inline.
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
## Usage Example
|
|
1338
|
+
|
|
1339
|
+
```typescript
|
|
1340
|
+
*
|
|
1341
|
+
* Minimal application-owned message-template examples. They demonstrate how
|
|
1342
|
+
* a structured market fact set constrains an LLM request without pretending
|
|
1343
|
+
* that generated copy is already approved for publication. The examples:
|
|
1344
|
+
*
|
|
1345
|
+
* 1. Exercise the `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH` validation rule.
|
|
1346
|
+
* 2. Provide one ICP-scoped landing-page template and one objection-response
|
|
1347
|
+
* email template for an application-managed generation workflow.
|
|
1348
|
+
* 3. Demonstrate the `{{output_language}}` runtime input: it is supplied by
|
|
1349
|
+
* the invocation context, not duplicated in `requiredInputs`.
|
|
1350
|
+
*
|
|
1351
|
+
* Recognised placeholder shapes (kept in sync with
|
|
1352
|
+
* `MarketMessageRequiredInput` ↔ `PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT`
|
|
1353
|
+
* in the validated market snapshot):
|
|
1354
|
+
*
|
|
1355
|
+
* - `{{icp.name}}`, `{{icp.profile.geographies}}`, `{{icpRef}}`
|
|
1356
|
+
* → declares `MarketMessageRequiredInput.ICP_REF`.
|
|
1357
|
+
* - `{{benefit.claim}}`, `{{benefitRef}}`
|
|
1358
|
+
* → declares `MarketMessageRequiredInput.BENEFIT_REF`.
|
|
1359
|
+
* - `{{objection.claim}}`, `{{objectionRef}}`
|
|
1360
|
+
* → declares `MarketMessageRequiredInput.OBJECTION_REF`.
|
|
1361
|
+
* - `{{output_language}}` is invocation-supplied — never declared.
|
|
1362
|
+
*/
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* ICP-scoped landing-page hero. Consumed by the market-generation workflow to
|
|
1366
|
+
* render a per-ICP landing-page hero:
|
|
1367
|
+
* the LLM receives the `icp` and one in-scope `benefit`, plus the
|
|
1368
|
+
* ICP's `preferredVoiceRef`-resolved tone of voice context block.
|
|
1369
|
+
*/
|
|
1370
|
+
export const tmplLandingIcpHero: MarketMessageTemplateConfig = {
|
|
1371
|
+
ref: 'tmpl-landing-icp-hero',
|
|
1372
|
+
name: 'Landing — ICP hero block',
|
|
1373
|
+
description:
|
|
1374
|
+
'Single-paragraph hero for an ICP-scoped landing page, anchored on one '
|
|
1375
|
+
+ 'in-scope benefit. Output is rendered in {{output_language}} by the '
|
|
1376
|
+
+ 'market-generation CLI (--output-language flag).',
|
|
1377
|
+
outputKind: MarketMessageOutputKind.LANDING_PAGE,
|
|
1378
|
+
promptTemplate:
|
|
1379
|
+
'Write a single hero paragraph (maximum 60 words) for the '
|
|
1380
|
+
+ '{{icp.name}} landing page. Anchor the paragraph on the benefit '
|
|
1381
|
+
+ '"{{benefit.claim}}" and lead with the outcome the ICP recognises '
|
|
1382
|
+
+ 'from their own week, not from a feature list. Address the reader '
|
|
1383
|
+
+ 'directly. Produce the output in {{output_language}}.',
|
|
1384
|
+
requiredInputs: [
|
|
1385
|
+
MarketMessageRequiredInput.ICP_REF,
|
|
1386
|
+
MarketMessageRequiredInput.BENEFIT_REF,
|
|
1387
|
+
],
|
|
1388
|
+
preferredVoiceRef: 'voice-trusted-engineer',
|
|
1389
|
+
authored: {
|
|
1390
|
+
lastAuthoredAt: '2026-04-17T00:00:00Z',
|
|
1391
|
+
confidence: AuthoredConfidence.MEDIUM,
|
|
1392
|
+
reviewer: 'your-app@wildo.ai',
|
|
1393
|
+
notes:
|
|
1394
|
+
'Phase-4.1 mechanism seed. Realistic per-ICP variants (indie-maker, '
|
|
1395
|
+
+ 'small-team) land in Phase 4.2 once the CLI is wired.',
|
|
1396
|
+
},
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* Objection-response email. Consumed by the market-generation workflow to
|
|
1401
|
+
* draft a 1:1 sales / customer-success reply when a known objection is raised
|
|
1402
|
+
* — pairs the `objection` with the strongest related `benefit` and
|
|
1403
|
+
* the `icp` of the contact.
|
|
1404
|
+
*/
|
|
1405
|
+
export const tmplObjectionResponseEmail: MarketMessageTemplateConfig = {
|
|
1406
|
+
ref: 'tmpl-objection-response-email',
|
|
1407
|
+
name: 'Email — objection response',
|
|
1408
|
+
description:
|
|
1409
|
+
'Short reply email (≤120 words) addressing one named objection for an '
|
|
1410
|
+
+ 'ICP, citing one related benefit. Output is rendered in '
|
|
1411
|
+
+ '{{output_language}}.',
|
|
1412
|
+
outputKind: MarketMessageOutputKind.OBJECTION_RESPONSE,
|
|
1413
|
+
promptTemplate:
|
|
1414
|
+
'Draft a reply email (≤120 words) for a {{icp.name}} contact who raised '
|
|
1415
|
+
+ 'the objection "{{objection.claim}}". Acknowledge the concern in one '
|
|
1416
|
+
+ 'sentence, then ground the response in the benefit '
|
|
1417
|
+
+ '"{{benefit.claim}}". Close with one specific next action that does '
|
|
1418
|
+
+ 'not require a demo. Produce the output in {{output_language}}.',
|
|
1419
|
+
requiredInputs: [
|
|
1420
|
+
MarketMessageRequiredInput.ICP_REF,
|
|
1421
|
+
MarketMessageRequiredInput.BENEFIT_REF,
|
|
1422
|
+
MarketMessageRequiredInput.OBJECTION_REF,
|
|
1423
|
+
],
|
|
1424
|
+
preferredVoiceRef: 'voice-trusted-engineer',
|
|
1425
|
+
authored: {
|
|
1426
|
+
lastAuthoredAt: '2026-04-17T00:00:00Z',
|
|
1427
|
+
confidence: AuthoredConfidence.MEDIUM,
|
|
1428
|
+
reviewer: 'your-app@wildo.ai',
|
|
1429
|
+
notes:
|
|
1430
|
+
'Phase-4.1 mechanism seed. Coverage by objection family expands in '
|
|
1431
|
+
+ 'Phase 4.2 (per-objection variants) once the market-generation CLI ships.',
|
|
1432
|
+
},
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
export const applicationMessageTemplates: MarketMessageTemplateConfig[] = [
|
|
1436
|
+
tmplLandingIcpHero,
|
|
1437
|
+
tmplObjectionResponseEmail,
|
|
1438
|
+
];
|
|
1439
|
+
```
|