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