@wildo-ai/saas-specifications 1.1.8 → 1.1.9

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 (147) hide show
  1. package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +9 -0
  2. package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
  3. package/dist/esm/_core/application-specification-family-identity.schemas.js +9 -0
  4. package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
  5. package/dist/esm/_core/brand/brand-name-choice.d.ts +136 -0
  6. package/dist/esm/_core/brand/brand-name-choice.d.ts.map +1 -0
  7. package/dist/esm/_core/brand/brand-name-choice.js +193 -0
  8. package/dist/esm/_core/brand/brand-name-choice.js.map +1 -0
  9. package/dist/esm/_core/brand/brand-name-screening-generation.schemas.d.ts +108 -0
  10. package/dist/esm/_core/brand/brand-name-screening-generation.schemas.d.ts.map +1 -0
  11. package/dist/esm/_core/brand/brand-name-screening-generation.schemas.js +59 -0
  12. package/dist/esm/_core/brand/brand-name-screening-generation.schemas.js.map +1 -0
  13. package/dist/esm/_core/brand/brand-name-screening-validation.d.ts +51 -0
  14. package/dist/esm/_core/brand/brand-name-screening-validation.d.ts.map +1 -0
  15. package/dist/esm/_core/brand/brand-name-screening-validation.js +157 -0
  16. package/dist/esm/_core/brand/brand-name-screening-validation.js.map +1 -0
  17. package/dist/esm/_core/brand/brand-name-screening-view.d.ts +120 -0
  18. package/dist/esm/_core/brand/brand-name-screening-view.d.ts.map +1 -0
  19. package/dist/esm/_core/brand/brand-name-screening-view.js +47 -0
  20. package/dist/esm/_core/brand/brand-name-screening-view.js.map +1 -0
  21. package/dist/esm/_core/brand/brand-name-screening.family-aspects.d.ts +3 -0
  22. package/dist/esm/_core/brand/brand-name-screening.family-aspects.d.ts.map +1 -0
  23. package/dist/esm/_core/brand/brand-name-screening.family-aspects.js +42 -0
  24. package/dist/esm/_core/brand/brand-name-screening.family-aspects.js.map +1 -0
  25. package/dist/esm/_core/brand/brand-name-screening.schemas.d.ts +310 -0
  26. package/dist/esm/_core/brand/brand-name-screening.schemas.d.ts.map +1 -0
  27. package/dist/esm/_core/brand/brand-name-screening.schemas.js +272 -0
  28. package/dist/esm/_core/brand/brand-name-screening.schemas.js.map +1 -0
  29. package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts +23 -0
  30. package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts.map +1 -1
  31. package/dist/esm/_core/brand/brand-snapshot.schemas.js +32 -0
  32. package/dist/esm/_core/brand/brand-snapshot.schemas.js.map +1 -1
  33. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +10 -0
  34. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
  35. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +57 -0
  36. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
  37. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +89 -0
  38. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
  39. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +79 -19
  40. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
  41. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +61 -11
  42. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
  43. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
  44. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +18 -2
  45. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
  46. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts +28 -4
  47. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts.map +1 -1
  48. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js +53 -5
  49. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js.map +1 -1
  50. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts +24 -4
  51. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts.map +1 -1
  52. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js +64 -4
  53. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js.map +1 -1
  54. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.d.ts +59 -0
  55. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.d.ts.map +1 -1
  56. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.js +64 -0
  57. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.js.map +1 -1
  58. package/dist/esm/_core/business-model-lite/pricing-plan.schemas.d.ts +3 -0
  59. package/dist/esm/_core/business-model-lite/pricing-plan.schemas.d.ts.map +1 -1
  60. package/dist/esm/_core/business-model-lite/pricing-plan.schemas.js +16 -0
  61. package/dist/esm/_core/business-model-lite/pricing-plan.schemas.js.map +1 -1
  62. package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts +7 -1
  63. package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
  64. package/dist/esm/_core/capability-composition/capability-composition-validation.js +34 -28
  65. package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
  66. package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +75 -4
  67. package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
  68. package/dist/esm/_core/capability-composition/capability-composition.schemas.js +62 -4
  69. package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
  70. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
  71. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +7 -0
  72. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
  73. package/dist/esm/_core/compliance-documents/launch-blockers.schemas.d.ts +153 -0
  74. package/dist/esm/_core/compliance-documents/launch-blockers.schemas.d.ts.map +1 -0
  75. package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js +241 -0
  76. package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js.map +1 -0
  77. package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.d.ts +8 -1
  78. package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.d.ts.map +1 -1
  79. package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.js +19 -1
  80. package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.js.map +1 -1
  81. package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.d.ts +61 -3
  82. package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.d.ts.map +1 -1
  83. package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.js +73 -3
  84. package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.js.map +1 -1
  85. package/dist/esm/_core/experience-plan/experience-plan.family-aspects.js +1 -1
  86. package/dist/esm/_core/experience-plan/experience-plan.family-aspects.js.map +1 -1
  87. package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
  88. package/dist/esm/_core/experience-plan/experience-plan.schemas.js +1 -0
  89. package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
  90. package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -1
  91. package/dist/esm/_core/family-aspects.registry.js +2 -0
  92. package/dist/esm/_core/family-aspects.registry.js.map +1 -1
  93. package/dist/esm/_core/index.d.ts +6 -0
  94. package/dist/esm/_core/index.d.ts.map +1 -1
  95. package/dist/esm/_core/index.js +6 -0
  96. package/dist/esm/_core/index.js.map +1 -1
  97. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
  98. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +5 -1
  99. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
  100. package/dist/esm/_core/market/market-icp.schemas.d.ts +7 -0
  101. package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
  102. package/dist/esm/_core/market/market-icp.schemas.js +7 -0
  103. package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
  104. package/dist/esm/_core/market/market-language-coverage.d.ts +62 -0
  105. package/dist/esm/_core/market/market-language-coverage.d.ts.map +1 -0
  106. package/dist/esm/_core/market/market-language-coverage.js +48 -0
  107. package/dist/esm/_core/market/market-language-coverage.js.map +1 -0
  108. package/dist/esm/_core/market/market-snapshot-validation.js +2 -2
  109. package/dist/esm/_core/market/market-snapshot-validation.js.map +1 -1
  110. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +63 -2
  111. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
  112. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +73 -5
  113. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
  114. package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -1
  115. package/dist/esm/application-creation/application-line.application-creation.schemas.js +2 -0
  116. package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -1
  117. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +28 -0
  118. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  119. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +19 -1
  120. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  121. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +1 -0
  122. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
  123. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +1 -0
  124. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
  125. package/dist/esm/application-creation.exports.d.ts +7 -0
  126. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  127. package/dist/esm/application-creation.exports.js +7 -0
  128. package/dist/esm/application-creation.exports.js.map +1 -1
  129. package/dist/esm/assurance/application-risk-signals.derivations.d.ts +20 -0
  130. package/dist/esm/assurance/application-risk-signals.derivations.d.ts.map +1 -1
  131. package/dist/esm/assurance/application-risk-signals.derivations.js +81 -0
  132. package/dist/esm/assurance/application-risk-signals.derivations.js.map +1 -1
  133. package/dist/esm/assurance/governed-document-release.d.ts +9 -0
  134. package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
  135. package/dist/esm/assurance/governed-document-release.js +9 -0
  136. package/dist/esm/assurance/governed-document-release.js.map +1 -1
  137. package/dist/esm/companion-exports.d.ts +10 -1
  138. package/dist/esm/companion-exports.d.ts.map +1 -1
  139. package/dist/esm/companion-exports.js.map +1 -1
  140. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +1 -0
  141. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
  142. package/package.json +8 -8
  143. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts +0 -24
  144. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts.map +0 -1
  145. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +0 -24
  146. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +0 -1
  147. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"market-snapshot-validation.js","sourceRoot":"","sources":["../../../../../src/_core/market/market-snapshot-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OA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;AAED,wDAAwD","sourcesContent":["import { BenefitKanoCategory } from './feature-benefit.schemas';\nimport type { MarketAuthoredMetadata } from './market-authored-metadata.schemas';\nimport { ReviewCadence } from './market-authored-metadata.schemas';\nimport { ICPArchetype, ICPPriority } from './market-icp.schemas';\nimport { MarketMessageRequiredInput } from './market-message-template.schemas';\nimport { PersonaScope } from './market-persona.schemas';\nimport { ProofKind } from './market-proof.schemas';\nimport type { MarketSnapshot } from './market-snapshot.schemas';\n\n/**\n * @wildo_source:part:start market.snapshot.validation facet:layer:specification facet:family:market\n *\n * Authoring-consistency validator for an assembled `MarketSnapshot`.\n *\n * The function is a **pure**, **typed** graph walker over the\n * snapshot — no Zod introspection, no LocalizedString visitor, no\n * runtime registry access. Each rule is implemented as a tiny\n * standalone detector composed by the top-level\n * `validateMarketSnapshot`.\n *\n * Rule table — currently 18 kinds:\n *\n * | Kind | Severity | Trigger |\n * |--------------------------------------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n * | `ORPHAN_REF` | ERROR | A `<entity>Ref` does not resolve inside the snapshot. Cross-family refs (`featureRefs`, `productRefs`) are skipped if no set is passed. |\n * | `MULTIPLE_THRESHOLDS_PER_ICP_JOB` | ERROR | An (icpRef, jobRef) cluster has more than one distinct benefit with `kanoCategory: THRESHOLD`. Deduped by benefit `ref`. |\n * | `THRESHOLD_BENEFIT_WITHOUT_JOB` | ERROR | A benefit declares any `kanoCategory: THRESHOLD` entry but `advances[]` is empty (no job to anchor the THRESHOLD claim against). |\n * | `EMPTY_BENEFIT_DELIVERED_BY` | ERROR | A `FeatureBenefit.deliveredByFeatureRefs[]` is empty (defence in depth — Zod also rejects). |\n * | `ICP_WITHOUT_PERSONA` | ERROR (LEGAL_ENTITY) / WARN (INDIVIDUAL) | A non-`ANTI_TARGET` ICP has no persona pointing at its `ref` via `belongsToIcpRefs`. |\n * | `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). |\n * | `MISSING_POSITIONING_FOR_ICP` | ERROR | An ICP of priority `CORE` or `EXPANSION` has no `MarketPositioning`. Other priorities exempt. |\n * | `STALE_AUTHORED` | WARN | `lastAuthoredAt + reviewCadence < now`. No check when `reviewCadence` is undefined or `AS_NEEDED`. |\n * | `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`). |\n * | `INVALID_ANTI_TARGET_PURPOSE_MIX` | ERROR | `priority === ANTI_TARGET` and `purposeMix !== { adoption: 0, revenue: 0 }`. |\n * | `BUYING_GROUP_PERSONA_MISSING_DMU_ROLE` | ERROR | `personaScope === BUYING_GROUP_MEMBER` and `dmuRole` is undefined. |\n * | `BUYING_GROUP_BACKLINK_MISSING` | ERROR | An ICP's `buyingGroup[].personaRef` resolves to a persona whose `belongsToIcpRefs[]` does NOT include the ICP (asymmetric link). |\n * | `PROOF_WITHOUT_SUPPORT` | WARN | A `MarketProof` carries empty `supportsBenefitRefs[]` AND empty `supportsIcpRefs[]`. |\n * | `PROOF_KIND_PAYLOAD_MISMATCH` | WARN | A `MarketProof` carries a payload incoherent with its `proofKind` (`METRIC` without `metric`, `LOGO` with `metric`). |\n * | `DUPLICATE_JOURNEY_STAGE` | ERROR | A `MarketBuyingJourney` lists the same `BuyingJourneyStage` enum value more than once. |\n * | `DUPLICATE_BUYING_JOURNEY_FOR_ICP` | ERROR | Two `MarketBuyingJourney` entries point at the same `icpRef`. The model is \"one journey per ICP\". |\n * | `OBJECTION_PROOF_BENEFIT_MISMATCH` | WARN | An objection cites `proofRefs[]` whose union of `supportsBenefitRefs[]` ∪ `supportsIcpRefs[]` does not intersect `relatedBenefitRefs[]` ∪ `raisedByIcpRefs[]`. |\n * | `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). |\n *\n * Issue ordering inside `result.issues[]` is detector-order, then\n * snapshot-walk order. It is **not** a stable contract — callers\n * must group/sort by `kind` + `severity` themselves.\n *\n * Loaded by application registries at boot. Callers should:\n * - throw a `BusinessConfigError` (re-exported from\n * `@wildo-ai/saas-backend-lib`) when `result.ok === false`,\n * listing every ERROR-severity issue;\n * - log WARN-severity issues through the standard backend logger.\n *\n * The validator never mutates the snapshot.\n */\nexport enum MarketSnapshotIssueKind {\n ORPHAN_REF = 'ORPHAN_REF',\n MULTIPLE_THRESHOLDS_PER_ICP_JOB = 'MULTIPLE_THRESHOLDS_PER_ICP_JOB',\n /**\n * A benefit declares any `kanoCategory: THRESHOLD` entry on\n * `importanceByICP[]` but its `advances[]` is empty. THRESHOLD is\n * defined as \"table-stakes for a specific (icp, job)\" — without a\n * job to anchor against, the THRESHOLD claim has no semantic\n * cluster and the `MULTIPLE_THRESHOLDS_PER_ICP_JOB` invariant is\n * structurally bypassed (ERROR).\n */\n THRESHOLD_BENEFIT_WITHOUT_JOB = 'THRESHOLD_BENEFIT_WITHOUT_JOB',\n EMPTY_BENEFIT_DELIVERED_BY = 'EMPTY_BENEFIT_DELIVERED_BY',\n ICP_WITHOUT_PERSONA = 'ICP_WITHOUT_PERSONA',\n INFLUENCE_CYCLE = 'INFLUENCE_CYCLE',\n MISSING_POSITIONING_FOR_ICP = 'MISSING_POSITIONING_FOR_ICP',\n STALE_AUTHORED = 'STALE_AUTHORED',\n /**\n * Same target ref appears more than once in the same per-entity\n * edge list. Currently covers:\n * - ICP and persona `pains[].painRef`, `gains[].gainRef`,\n * `jobs[].jobRef` — typically the result of an `inheritFrom()`\n * spread followed by a forgotten `.filter()` step;\n * - benefit `importanceByICP[].icpRef` — duplicate (benefit, icp)\n * pairs make per-ICP scoring non-deterministic.\n *\n * Severity is WARN — the snapshot still parses, but the duplicate\n * edge silently double-counts in downstream FIT scoring.\n */\n DUPLICATE_EDGE_PER_ENTITY = 'DUPLICATE_EDGE_PER_ENTITY',\n INVALID_ANTI_TARGET_PURPOSE_MIX = 'INVALID_ANTI_TARGET_PURPOSE_MIX',\n BUYING_GROUP_PERSONA_MISSING_DMU_ROLE = 'BUYING_GROUP_PERSONA_MISSING_DMU_ROLE',\n /**\n * An ICP's `buyingGroup[].personaRef` resolves to a persona, but\n * the persona's `belongsToIcpRefs[]` does not contain the ICP. The\n * link is asymmetric and downstream consumers (DMU rendering,\n * persona-by-ICP indexing) silently drop the persona. ERROR.\n */\n BUYING_GROUP_BACKLINK_MISSING = 'BUYING_GROUP_BACKLINK_MISSING',\n /** A proof entity that supports neither a benefit nor an ICP — has no place to land in copy (WARN). */\n PROOF_WITHOUT_SUPPORT = 'PROOF_WITHOUT_SUPPORT',\n /**\n * A `MarketProof` carries a payload incoherent with its\n * `proofKind`. The schema is permissive (both `attribution` and\n * `metric` are optional on every kind). This detector catches the\n * strongest mismatches as authoring drift (WARN — the spec parses,\n * but the proof renders badly):\n * - `METRIC` without a `metric` block;\n * - `LOGO` with a `metric` block.\n */\n PROOF_KIND_PAYLOAD_MISMATCH = 'PROOF_KIND_PAYLOAD_MISMATCH',\n /** Same `BuyingJourneyStage` enum value listed twice on a single journey (ERROR). */\n DUPLICATE_JOURNEY_STAGE = 'DUPLICATE_JOURNEY_STAGE',\n /** Two `MarketBuyingJourney` entries point at the same `icpRef`. The model is one journey per ICP (ERROR). */\n DUPLICATE_BUYING_JOURNEY_FOR_ICP = 'DUPLICATE_BUYING_JOURNEY_FOR_ICP',\n /** Objection's cited proofs do not back any of its `relatedBenefitRefs` or `raisedByIcpRefs` (WARN). */\n OBJECTION_PROOF_BENEFIT_MISMATCH = 'OBJECTION_PROOF_BENEFIT_MISMATCH',\n /**\n * A `MarketMessageTemplate` has a mismatch between its declared\n * `requiredInputs[]` and the `{{<entity>.*}}` / `{{<entity>Ref}}`\n * placeholders that actually appear inside `promptTemplate`.\n *\n * Two symmetric cases:\n * 1. Declared but unused — `requiredInputs` lists `icpRef` but the\n * body has no `{{icp.*}}` / `{{icpRef}}` reference. The CLI will\n * require the caller to pass the input but never substitute it.\n * 2. Used but undeclared — the body references `{{benefit.claim}}`\n * but `requiredInputs` does not include `benefitRef`. The CLI\n * will not enforce the input and the placeholder will render\n * literally (e.g. `{{benefit.claim}}`).\n *\n * The `{{output_language}}` placeholder is **exempt** from this\n * check: it is injected by the market generation CLI from the\n * `--output-language` flag, not from `requiredInputs[]`.\n *\n * WARN severity — the snapshot still parses and the template still\n * renders, but the output will be off-spec at runtime. Authors\n * should either prune the unused entry from `requiredInputs[]` or\n * add the missing placeholder / entry.\n */\n MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH = 'MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH',\n}\n\nexport type MarketSnapshotIssueSeverity = 'ERROR' | 'WARN';\n\nexport interface MarketSnapshotIssue {\n kind: MarketSnapshotIssueKind;\n /** Dotted path inside the snapshot (e.g. `'icps[0].pains[2].painRef'`). */\n path: string;\n message: string;\n severity: MarketSnapshotIssueSeverity;\n}\n\nexport interface MarketSnapshotValidationResult {\n /** `true` iff no issue has severity `ERROR`. */\n ok: boolean;\n issues: MarketSnapshotIssue[];\n}\n\n/**\n * Options for this family validator.\n *\n * ## The cross-family sets are OPT-IN, and omitting one SKIPS its check\n *\n * A family validator sees one family. It cannot resolve a reference into another family's\n * vocabulary unless you hand it that family's refs — so each `available*Refs` option is the caller\n * saying \"I have this context, use it\". Omit one and the matching check does not run: no issue is\n * reported, and the absence looks exactly like a snapshot with no such reference.\n *\n * That is deliberate — the families are decoupled on purpose — but it means a validator called with\n * the snapshot alone is checking this family's INTERNAL consistency only. If you want dangling\n * cross-family references caught, supply the sets; if you validate one family in isolation, expect\n * them to be found later by whatever holds every family at once.\n */\nexport interface ValidateMarketSnapshotOptions {\n /**\n * Cross-family ref check for `FeatureBenefit.deliveredByFeatureRefs`.\n * Pass the application's full feature-spec key set; orphans are\n * reported as `ORPHAN_REF`. When omitted, the cross-family check is\n * SKIPPED (intra-snapshot orphans are still detected).\n */\n availableFeatureRefs?: ReadonlySet<string>;\n /**\n * Cross-family ref check for `MarketICP.recommendedProductRefs` /\n * `upsellPathProductRefs`. Same skip-when-omitted semantics.\n */\n availableProductRefs?: ReadonlySet<string>;\n /** Override \"now\" for `STALE_AUTHORED` checks (test affordance). Defaults to `new Date()`. */\n now?: Date;\n}\n\nexport function validateMarketSnapshot(\n snapshot: MarketSnapshot,\n options?: ValidateMarketSnapshotOptions,\n): MarketSnapshotValidationResult {\n const issues: MarketSnapshotIssue[] = [];\n\n detectOrphanRefs(snapshot, options, issues);\n detectThresholdBenefitsWithoutJob(snapshot, issues);\n detectMultipleThresholdsPerIcpJob(snapshot, issues);\n detectEmptyBenefitDeliveredBy(snapshot, issues);\n detectIcpWithoutPersona(snapshot, issues);\n detectInfluenceCycles(snapshot, issues);\n detectMissingPositioningForIcp(snapshot, issues);\n detectStaleAuthored(snapshot, options?.now ?? new Date(), issues);\n detectDuplicateEdgesPerEntity(snapshot, issues);\n detectInvalidAntiTargetPurposeMix(snapshot, issues);\n detectBuyingGroupPersonasMissingDmuRole(snapshot, issues);\n detectBuyingGroupBacklinkMissing(snapshot, issues);\n detectProofsWithoutSupport(snapshot, issues);\n detectProofKindPayloadMismatch(snapshot, issues);\n detectDuplicateJourneyStages(snapshot, issues);\n detectDuplicateBuyingJourneyForIcp(snapshot, issues);\n detectObjectionProofBenefitMismatch(snapshot, issues);\n detectMessageTemplatePlaceholderMismatch(snapshot, issues);\n\n const ok = issues.every(i => i.severity !== 'ERROR');\n return { ok, issues };\n}\n\n// ────────────────────────────────────────────────────────────────────\n// Detectors — one per rule, kept small and independently testable.\n// ────────────────────────────────────────────────────────────────────\n\nfunction detectOrphanRefs(\n snapshot: MarketSnapshot,\n options: ValidateMarketSnapshotOptions | undefined,\n issues: MarketSnapshotIssue[],\n): void {\n const icpRefs = new Set(snapshot.icps.map(i => i.ref));\n const personaRefs = new Set(snapshot.personas.map(p => p.ref));\n const jobRefs = new Set(snapshot.jobs.map(j => j.ref));\n const painRefs = new Set(snapshot.pains.map(p => p.ref));\n const gainRefs = new Set(snapshot.gains.map(g => g.ref));\n const voiceRefs = new Set(snapshot.tonesOfVoice.map(v => v.ref));\n const benefitRefs = new Set(snapshot.benefits.map(b => b.ref));\n const channelRefs = new Set(snapshot.channels.map(c => c.ref));\n const alternativeRefs = new Set(snapshot.alternatives.map(a => a.ref));\n const triggerRefs = new Set(snapshot.triggers.map(t => t.ref));\n const proofRefs = new Set(snapshot.proofs.map(p => p.ref));\n const objectionRefs = new Set(snapshot.objections.map(o => o.ref));\n\n const reportOrphan = (path: string, ref: string, kind: string): void => {\n issues.push({\n kind: MarketSnapshotIssueKind.ORPHAN_REF,\n path,\n message: `${kind} ref \"${ref}\" at ${path} does not resolve inside the snapshot.`,\n severity: 'ERROR',\n });\n };\n\n // ICP edges + cross-family + influences + voices + Phase-3 ref arrays.\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n const basePath = `icps[${iIdx}]`;\n\n icp.buyingGroup.forEach((entry, idx) => {\n if (!personaRefs.has(entry.personaRef)) {\n reportOrphan(`${basePath}.buyingGroup[${idx}].personaRef`, entry.personaRef, 'persona');\n }\n });\n icp.jobs.forEach((edge, idx) => {\n if (!jobRefs.has(edge.jobRef)) reportOrphan(`${basePath}.jobs[${idx}].jobRef`, edge.jobRef, 'job');\n });\n icp.pains.forEach((edge, idx) => {\n if (!painRefs.has(edge.painRef)) reportOrphan(`${basePath}.pains[${idx}].painRef`, edge.painRef, 'pain');\n });\n icp.gains.forEach((edge, idx) => {\n if (!gainRefs.has(edge.gainRef)) reportOrphan(`${basePath}.gains[${idx}].gainRef`, edge.gainRef, 'gain');\n });\n icp.influences.forEach((edge, idx) => {\n if (!icpRefs.has(edge.icpRef)) reportOrphan(`${basePath}.influences[${idx}].icpRef`, edge.icpRef, 'icp');\n });\n if (icp.preferredVoiceRef !== undefined && !voiceRefs.has(icp.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, icp.preferredVoiceRef, 'voice');\n }\n\n // Phase-3 ICP ref arrays (channels / triggers / alternatives /\n // proofs / objections). All are intra-snapshot — no caller-supplied\n // set required. Orphans here silently waste downstream targeting\n // (channel never reached, trigger never observed) so ERROR is the\n // right severity (D16).\n icp.channelRefs.forEach((ref, idx) => {\n if (!channelRefs.has(ref)) reportOrphan(`${basePath}.channelRefs[${idx}]`, ref, 'channel');\n });\n icp.triggerRefs.forEach((ref, idx) => {\n if (!triggerRefs.has(ref)) reportOrphan(`${basePath}.triggerRefs[${idx}]`, ref, 'trigger');\n });\n icp.alternativeRefs.forEach((ref, idx) => {\n if (!alternativeRefs.has(ref)) reportOrphan(`${basePath}.alternativeRefs[${idx}]`, ref, 'alternative');\n });\n icp.proofRefs.forEach((ref, idx) => {\n if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');\n });\n icp.objectionRefs.forEach((ref, idx) => {\n if (!objectionRefs.has(ref)) reportOrphan(`${basePath}.objectionRefs[${idx}]`, ref, 'objection');\n });\n\n if (options?.availableProductRefs !== undefined) {\n icp.recommendedProductRefs.forEach((ref, idx) => {\n if (!options.availableProductRefs!.has(ref)) {\n reportOrphan(`${basePath}.recommendedProductRefs[${idx}]`, ref, 'product');\n }\n });\n icp.upsellPathProductRefs.forEach((ref, idx) => {\n if (!options.availableProductRefs!.has(ref)) {\n reportOrphan(`${basePath}.upsellPathProductRefs[${idx}]`, ref, 'product');\n }\n });\n }\n }\n\n // Persona edges + cross-family voice ref + parent ICP refs + Phase-3\n // channel refs.\n for (const [pIdx, persona] of snapshot.personas.entries()) {\n const basePath = `personas[${pIdx}]`;\n\n persona.belongsToIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.belongsToIcpRefs[${idx}]`, ref, 'icp');\n });\n persona.jobs.forEach((edge, idx) => {\n if (!jobRefs.has(edge.jobRef)) reportOrphan(`${basePath}.jobs[${idx}].jobRef`, edge.jobRef, 'job');\n });\n persona.pains.forEach((edge, idx) => {\n if (!painRefs.has(edge.painRef)) reportOrphan(`${basePath}.pains[${idx}].painRef`, edge.painRef, 'pain');\n });\n persona.gains.forEach((edge, idx) => {\n if (!gainRefs.has(edge.gainRef)) reportOrphan(`${basePath}.gains[${idx}].gainRef`, edge.gainRef, 'gain');\n });\n persona.channelRefs.forEach((ref, idx) => {\n if (!channelRefs.has(ref)) reportOrphan(`${basePath}.channelRefs[${idx}]`, ref, 'channel');\n });\n if (persona.preferredVoiceRef !== undefined && !voiceRefs.has(persona.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, persona.preferredVoiceRef, 'voice');\n }\n }\n\n // Benefits — pain/gain/job + ICP refs + cross-family feature refs +\n // Phase-3 proof / objection back-refs.\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n const basePath = `benefits[${bIdx}]`;\n\n benefit.relieves.forEach((edge, idx) => {\n if (!painRefs.has(edge.painRef)) {\n reportOrphan(`${basePath}.relieves[${idx}].painRef`, edge.painRef, 'pain');\n }\n });\n benefit.creates.forEach((edge, idx) => {\n if (!gainRefs.has(edge.gainRef)) {\n reportOrphan(`${basePath}.creates[${idx}].gainRef`, edge.gainRef, 'gain');\n }\n });\n benefit.advances.forEach((edge, idx) => {\n if (!jobRefs.has(edge.jobRef)) {\n reportOrphan(`${basePath}.advances[${idx}].jobRef`, edge.jobRef, 'job');\n }\n });\n benefit.importanceByICP.forEach((edge, idx) => {\n if (!icpRefs.has(edge.icpRef)) {\n reportOrphan(`${basePath}.importanceByICP[${idx}].icpRef`, edge.icpRef, 'icp');\n }\n });\n benefit.proofRefs.forEach((ref, idx) => {\n if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');\n });\n benefit.addressesObjectionRefs.forEach((ref, idx) => {\n if (!objectionRefs.has(ref)) {\n reportOrphan(`${basePath}.addressesObjectionRefs[${idx}]`, ref, 'objection');\n }\n });\n\n if (options?.availableFeatureRefs !== undefined) {\n benefit.deliveredByFeatureRefs.forEach((ref, idx) => {\n if (!options.availableFeatureRefs!.has(ref)) {\n reportOrphan(`${basePath}.deliveredByFeatureRefs[${idx}]`, ref, 'feature');\n }\n });\n }\n }\n\n // Positionings — back to ICP + benefits + alternatives.\n for (const [pIdx, positioning] of snapshot.positionings.entries()) {\n const basePath = `positionings[${pIdx}]`;\n\n if (!icpRefs.has(positioning.icpRef)) {\n reportOrphan(`${basePath}.icpRef`, positioning.icpRef, 'icp');\n }\n if (positioning.preferredVoiceRef !== undefined && !voiceRefs.has(positioning.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, positioning.preferredVoiceRef, 'voice');\n }\n positioning.valuePillars.forEach((pillar, idx) => {\n pillar.backedByBenefitRefs.forEach((ref, j) => {\n if (!benefitRefs.has(ref)) {\n reportOrphan(`${basePath}.valuePillars[${idx}].backedByBenefitRefs[${j}]`, ref, 'benefit');\n }\n });\n });\n positioning.alternativesContrasted.forEach((entry, idx) => {\n if (!alternativeRefs.has(entry.alternativeRef)) {\n reportOrphan(\n `${basePath}.alternativesContrasted[${idx}].alternativeRef`,\n entry.alternativeRef,\n 'alternative',\n );\n }\n });\n }\n\n // Triggers — affected ICPs + recommended channels.\n for (const [tIdx, trigger] of snapshot.triggers.entries()) {\n const basePath = `triggers[${tIdx}]`;\n trigger.affectedIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.affectedIcpRefs[${idx}]`, ref, 'icp');\n });\n trigger.recommendedChannelRefs.forEach((ref, idx) => {\n if (!channelRefs.has(ref)) reportOrphan(`${basePath}.recommendedChannelRefs[${idx}]`, ref, 'channel');\n });\n }\n\n // Buying journeys — back to ICP.\n for (const [jIdx, journey] of snapshot.buyingJourneys.entries()) {\n const basePath = `buyingJourneys[${jIdx}]`;\n if (!icpRefs.has(journey.icpRef)) {\n reportOrphan(`${basePath}.icpRef`, journey.icpRef, 'icp');\n }\n }\n\n // Proofs — supports benefits + ICPs.\n for (const [pIdx, proof] of snapshot.proofs.entries()) {\n const basePath = `proofs[${pIdx}]`;\n proof.supportsBenefitRefs.forEach((ref, idx) => {\n if (!benefitRefs.has(ref)) reportOrphan(`${basePath}.supportsBenefitRefs[${idx}]`, ref, 'benefit');\n });\n proof.supportsIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.supportsIcpRefs[${idx}]`, ref, 'icp');\n });\n }\n\n // Objections — raised by ICPs + personas, cite proofs + related benefits.\n for (const [oIdx, objection] of snapshot.objections.entries()) {\n const basePath = `objections[${oIdx}]`;\n objection.raisedByIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.raisedByIcpRefs[${idx}]`, ref, 'icp');\n });\n objection.raisedByPersonaRefs.forEach((ref, idx) => {\n if (!personaRefs.has(ref)) reportOrphan(`${basePath}.raisedByPersonaRefs[${idx}]`, ref, 'persona');\n });\n objection.proofRefs.forEach((ref, idx) => {\n if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');\n });\n objection.relatedBenefitRefs.forEach((ref, idx) => {\n if (!benefitRefs.has(ref)) reportOrphan(`${basePath}.relatedBenefitRefs[${idx}]`, ref, 'benefit');\n });\n }\n\n // Message templates — Phase-2 slot, Phase-4 fill. The preferred-voice\n // ref MUST resolve when authored, otherwise the market generation CLI\n // silently falls back to the default voice and produces off-brand\n // copy.\n for (const [tIdx, template] of snapshot.messageTemplates.entries()) {\n const basePath = `messageTemplates[${tIdx}]`;\n if (template.preferredVoiceRef !== undefined && !voiceRefs.has(template.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, template.preferredVoiceRef, 'voice');\n }\n }\n}\n\n/**\n * D4 invariant: at most ONE THRESHOLD-classified benefit per\n * `(icpRef, jobRef)` cluster. THRESHOLD means \"table-stakes — without\n * it the offer is rejected\", so two competing THRESHOLDs against the\n * same (icp, job) means we have two unrelated table-stakes claims for\n * the same outcome which is structurally undefined for the FIT scorer\n * (`market-scoring.ts`).\n *\n * The detector dedupes per benefit by tracking the SET of benefit\n * `ref`s per (icp, job) — repeated `advances[]` entries on the SAME\n * benefit (which is itself a `DUPLICATE_EDGE_PER_ENTITY` WARN) do not\n * double-count and therefore do not trigger a false-positive ERROR\n * here. Benefits with empty `advances[]` are caught by\n * `THRESHOLD_BENEFIT_WITHOUT_JOB` (ERROR) — they would otherwise\n * structurally bypass this rule by having no (icp, job) cluster to\n * be counted in.\n */\nfunction detectMultipleThresholdsPerIcpJob(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const benefitRefsByJobByIcp = new Map<string, Map<string, Set<string>>>();\n\n for (const benefit of snapshot.benefits) {\n const icpRefsWithThreshold = new Set(\n benefit.importanceByICP\n .filter(e => e.kanoCategory === BenefitKanoCategory.THRESHOLD)\n .map(e => e.icpRef),\n );\n if (icpRefsWithThreshold.size === 0) continue;\n\n const distinctJobRefs = new Set(benefit.advances.map(e => e.jobRef));\n if (distinctJobRefs.size === 0) continue; // caught by THRESHOLD_BENEFIT_WITHOUT_JOB\n\n for (const icpRef of icpRefsWithThreshold) {\n const byJob = benefitRefsByJobByIcp.get(icpRef) ?? new Map<string, Set<string>>();\n for (const jobRef of distinctJobRefs) {\n const set = byJob.get(jobRef) ?? new Set<string>();\n set.add(benefit.ref);\n byJob.set(jobRef, set);\n }\n benefitRefsByJobByIcp.set(icpRef, byJob);\n }\n }\n\n for (const [icpRef, byJob] of benefitRefsByJobByIcp.entries()) {\n for (const [jobRef, refsSet] of byJob.entries()) {\n if (refsSet.size > 1) {\n const refs = [...refsSet].join(', ');\n issues.push({\n kind: MarketSnapshotIssueKind.MULTIPLE_THRESHOLDS_PER_ICP_JOB,\n path: `benefits.importanceByICP[icp=${icpRef}].advances[job=${jobRef}]`,\n message: `ICP \"${icpRef}\" job \"${jobRef}\" has multiple THRESHOLD benefits (${refs}). Only one THRESHOLD per (icp, job) cluster is allowed.`,\n severity: 'ERROR',\n });\n }\n }\n }\n}\n\n/**\n * Companion to `MULTIPLE_THRESHOLDS_PER_ICP_JOB`. THRESHOLD is defined\n * as a per-(ICP, job) classification — a benefit that declares any\n * `kanoCategory: THRESHOLD` entry on `importanceByICP[]` MUST also\n * advance at least one job, otherwise the invariant has no anchor and\n * the FIT scorer cannot place the table-stakes claim. ERROR.\n */\nfunction detectThresholdBenefitsWithoutJob(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n const hasThreshold = benefit.importanceByICP.some(\n e => e.kanoCategory === BenefitKanoCategory.THRESHOLD,\n );\n if (!hasThreshold) continue;\n if (benefit.advances.length > 0) continue;\n\n const thresholdIcpRefs = benefit.importanceByICP\n .filter(e => e.kanoCategory === BenefitKanoCategory.THRESHOLD)\n .map(e => e.icpRef)\n .join(', ');\n issues.push({\n kind: MarketSnapshotIssueKind.THRESHOLD_BENEFIT_WITHOUT_JOB,\n path: `benefits[${bIdx}].advances`,\n 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.`,\n severity: 'ERROR',\n });\n }\n}\n\nfunction detectEmptyBenefitDeliveredBy(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n // The schema enforces `.min(1)`; this detector remains as a defence\n // in depth for callers that bypass parsing (legitimate scenario:\n // tests building snapshots with type-asserted fixtures).\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n if (benefit.deliveredByFeatureRefs.length === 0) {\n issues.push({\n kind: MarketSnapshotIssueKind.EMPTY_BENEFIT_DELIVERED_BY,\n path: `benefits[${bIdx}].deliveredByFeatureRefs`,\n message: `Benefit \"${benefit.ref}\" has empty deliveredByFeatureRefs[]. A benefit must be delivered by at least one feature.`,\n severity: 'ERROR',\n });\n }\n }\n}\n\nfunction detectIcpWithoutPersona(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const personaParents = new Set<string>();\n for (const persona of snapshot.personas) {\n for (const ref of persona.belongsToIcpRefs) personaParents.add(ref);\n }\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n if (icp.priority === ICPPriority.ANTI_TARGET) continue;\n if (personaParents.has(icp.ref)) continue;\n\n const severity: MarketSnapshotIssueSeverity =\n icp.archetype === ICPArchetype.LEGAL_ENTITY ? 'ERROR' : 'WARN';\n issues.push({\n kind: MarketSnapshotIssueKind.ICP_WITHOUT_PERSONA,\n path: `icps[${iIdx}].ref`,\n message: `ICP \"${icp.ref}\" (archetype ${icp.archetype}) has no persona pointing at it. ${severity === 'ERROR' ? 'Required' : 'Recommended'} for ${icp.archetype}.`,\n severity,\n });\n }\n}\n\nfunction detectInfluenceCycles(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n // Self-loops first — always ERROR.\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n icp.influences.forEach((edge, idx) => {\n if (edge.icpRef === icp.ref) {\n issues.push({\n kind: MarketSnapshotIssueKind.INFLUENCE_CYCLE,\n path: `icps[${iIdx}].influences[${idx}].icpRef`,\n message: `ICP \"${icp.ref}\" has a self-loop in influences[]. Self-loops are not allowed.`,\n severity: 'ERROR',\n });\n }\n });\n }\n\n // Multi-node cycles — Tarjan-style SCC scan, report each cycle once.\n const adjacency = new Map<string, string[]>();\n for (const icp of snapshot.icps) {\n adjacency.set(\n icp.ref,\n icp.influences.filter(e => e.icpRef !== icp.ref).map(e => e.icpRef),\n );\n }\n\n const seenCycles = new Set<string>();\n const visited = new Set<string>();\n\n for (const startRef of adjacency.keys()) {\n if (visited.has(startRef)) continue;\n const stack: string[] = [];\n const onStack = new Set<string>();\n\n const dfs = (node: string): void => {\n visited.add(node);\n stack.push(node);\n onStack.add(node);\n\n for (const next of adjacency.get(node) ?? []) {\n if (!adjacency.has(next)) continue;\n if (!visited.has(next)) {\n dfs(next);\n } else if (onStack.has(next)) {\n const cycleStart = stack.indexOf(next);\n if (cycleStart >= 0) {\n const cycle = stack.slice(cycleStart);\n const key = [...cycle].sort().join('|');\n if (!seenCycles.has(key)) {\n seenCycles.add(key);\n issues.push({\n kind: MarketSnapshotIssueKind.INFLUENCE_CYCLE,\n path: `icps[*].influences`,\n message: `Influence cycle detected: ${cycle.join(' → ')} → ${next}. Cycles are accepted but emit a WARN.`,\n severity: 'WARN',\n });\n }\n }\n }\n }\n\n stack.pop();\n onStack.delete(node);\n };\n\n dfs(startRef);\n }\n}\n\nfunction detectMissingPositioningForIcp(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const positionedIcpRefs = new Set(snapshot.positionings.map(p => p.icpRef));\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n if (icp.priority !== ICPPriority.CORE && icp.priority !== ICPPriority.EXPANSION) continue;\n if (positionedIcpRefs.has(icp.ref)) continue;\n\n issues.push({\n kind: MarketSnapshotIssueKind.MISSING_POSITIONING_FOR_ICP,\n path: `icps[${iIdx}].ref`,\n message: `ICP \"${icp.ref}\" has priority ${icp.priority} but no MarketPositioning entry. CORE and EXPANSION ICPs must be positioned.`,\n severity: 'ERROR',\n });\n }\n}\n\nconst REVIEW_CADENCE_TO_DAYS: Record<ReviewCadence, number> = {\n [ReviewCadence.WEEKLY]: 7,\n [ReviewCadence.MONTHLY]: 31,\n [ReviewCadence.QUARTERLY]: 92,\n [ReviewCadence.YEARLY]: 366,\n [ReviewCadence.AS_NEEDED]: Number.POSITIVE_INFINITY,\n};\n\nfunction detectStaleAuthored(\n snapshot: MarketSnapshot,\n now: Date,\n issues: MarketSnapshotIssue[],\n): void {\n const checkAuthored = (authored: MarketAuthoredMetadata | undefined, path: string, ref: string): void => {\n if (authored?.reviewCadence === undefined) return;\n const days = REVIEW_CADENCE_TO_DAYS[authored.reviewCadence];\n if (!Number.isFinite(days)) return;\n const lastAuthored = new Date(authored.lastAuthoredAt).getTime();\n if (Number.isNaN(lastAuthored)) return;\n const ageMs = now.getTime() - lastAuthored;\n const ageDays = ageMs / (24 * 60 * 60 * 1000);\n if (ageDays > days) {\n issues.push({\n kind: MarketSnapshotIssueKind.STALE_AUTHORED,\n path,\n message: `Authored content for \"${ref}\" is ${Math.floor(ageDays)} days old (cadence ${authored.reviewCadence} ⇒ ${days}d). Re-author or remove the cadence.`,\n severity: 'WARN',\n });\n }\n };\n\n snapshot.icps.forEach((icp, idx) => checkAuthored(icp.authored, `icps[${idx}].authored`, icp.ref));\n snapshot.personas.forEach((p, idx) => checkAuthored(p.authored, `personas[${idx}].authored`, p.ref));\n snapshot.jobs.forEach((j, idx) => checkAuthored(j.authored, `jobs[${idx}].authored`, j.ref));\n snapshot.pains.forEach((p, idx) => checkAuthored(p.authored, `pains[${idx}].authored`, p.ref));\n snapshot.gains.forEach((g, idx) => checkAuthored(g.authored, `gains[${idx}].authored`, g.ref));\n snapshot.tonesOfVoice.forEach((v, idx) => checkAuthored(v.authored, `tonesOfVoice[${idx}].authored`, v.ref));\n snapshot.benefits.forEach((b, idx) => checkAuthored(b.authored, `benefits[${idx}].authored`, b.ref));\n snapshot.positionings.forEach((p, idx) => checkAuthored(p.authored, `positionings[${idx}].authored`, p.ref));\n snapshot.messageTemplates.forEach((t, idx) => checkAuthored(t.authored, `messageTemplates[${idx}].authored`, t.ref));\n snapshot.channels.forEach((c, idx) => checkAuthored(c.authored, `channels[${idx}].authored`, c.ref));\n snapshot.alternatives.forEach((a, idx) => checkAuthored(a.authored, `alternatives[${idx}].authored`, a.ref));\n snapshot.triggers.forEach((t, idx) => checkAuthored(t.authored, `triggers[${idx}].authored`, t.ref));\n snapshot.buyingJourneys.forEach((j, idx) => checkAuthored(j.authored, `buyingJourneys[${idx}].authored`, j.ref));\n snapshot.proofs.forEach((p, idx) => checkAuthored(p.authored, `proofs[${idx}].authored`, p.ref));\n snapshot.objections.forEach((o, idx) => checkAuthored(o.authored, `objections[${idx}].authored`, o.ref));\n checkAuthored(snapshot.category.authored, 'category.authored', snapshot.category.ref);\n}\n\n/**\n * Per-entity duplicate-edge detection.\n *\n * Scope (intentionally bounded — see `DUPLICATE_EDGE_PER_ENTITY` JSDoc\n * on the enum for the canonical list):\n * - ICP and persona `pains[].painRef` / `gains[].gainRef` /\n * `jobs[].jobRef`. Duplicates here are typically the result of an\n * `inheritFrom(parentIcp)` spread followed by a forgotten\n * `.filter()` step on the persona.\n * - Benefit `importanceByICP[].icpRef`. Duplicates make per-ICP\n * weighting non-deterministic in the FIT scorer (the last one wins\n * silently). We deliberately do NOT collapse the duplicates — we\n * surface them so authors fix the source instead of relying on\n * detector-side normalization.\n *\n * NOT covered (other detectors / schema constraints handle these):\n * - benefit `relieves` / `creates` / `advances` weighted edges — the\n * degree might legitimately differ across entries; future work.\n * - ICP `buyingGroup[].personaRef` — deduplication is enforced by\n * intent (a persona is in the group exactly once); future work.\n */\nfunction detectDuplicateEdgesPerEntity(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const reportDuplicates = (\n refs: string[],\n basePath: string,\n field: string,\n ownerRef: string,\n refSubpath: string = '',\n hint: string = 'Likely an inheritFrom() spread that wasn\\'t deduplicated.',\n ): void => {\n const seen = new Set<string>();\n refs.forEach((ref, idx) => {\n if (seen.has(ref)) {\n issues.push({\n kind: MarketSnapshotIssueKind.DUPLICATE_EDGE_PER_ENTITY,\n path: `${basePath}.${field}[${idx}]${refSubpath}`,\n message: `${field} ref \"${ref}\" appears more than once on \"${ownerRef}\". ${hint}`,\n severity: 'WARN',\n });\n }\n seen.add(ref);\n });\n };\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n const basePath = `icps[${iIdx}]`;\n reportDuplicates(icp.pains.map(e => e.painRef), basePath, 'pains', icp.ref, '.painRef');\n reportDuplicates(icp.gains.map(e => e.gainRef), basePath, 'gains', icp.ref, '.gainRef');\n reportDuplicates(icp.jobs.map(e => e.jobRef), basePath, 'jobs', icp.ref, '.jobRef');\n }\n for (const [pIdx, persona] of snapshot.personas.entries()) {\n const basePath = `personas[${pIdx}]`;\n reportDuplicates(persona.pains.map(e => e.painRef), basePath, 'pains', persona.ref, '.painRef');\n reportDuplicates(persona.gains.map(e => e.gainRef), basePath, 'gains', persona.ref, '.gainRef');\n reportDuplicates(persona.jobs.map(e => e.jobRef), basePath, 'jobs', persona.ref, '.jobRef');\n }\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n const basePath = `benefits[${bIdx}]`;\n reportDuplicates(\n benefit.importanceByICP.map(e => e.icpRef),\n basePath,\n 'importanceByICP',\n benefit.ref,\n '.icpRef',\n 'Each (benefit, icp) pair must appear at most once — duplicates make per-ICP weighting non-deterministic.',\n );\n }\n}\n\nfunction detectInvalidAntiTargetPurposeMix(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n if (icp.priority !== ICPPriority.ANTI_TARGET) continue;\n const isZero = icp.purposeMix.adoption === 0 && icp.purposeMix.revenue === 0;\n if (isZero) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.INVALID_ANTI_TARGET_PURPOSE_MIX,\n path: `icps[${iIdx}].purposeMix`,\n message: `ICP \"${icp.ref}\" has priority ANTI_TARGET but purposeMix=${JSON.stringify(icp.purposeMix)}. ANTI_TARGET ICPs MUST carry { adoption: 0, revenue: 0 }.`,\n severity: 'ERROR',\n });\n }\n}\n\nfunction detectBuyingGroupPersonasMissingDmuRole(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [pIdx, persona] of snapshot.personas.entries()) {\n if (persona.personaScope !== PersonaScope.BUYING_GROUP_MEMBER) continue;\n if (persona.dmuRole !== undefined) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.BUYING_GROUP_PERSONA_MISSING_DMU_ROLE,\n path: `personas[${pIdx}].dmuRole`,\n message: `Persona \"${persona.ref}\" has personaScope BUYING_GROUP_MEMBER but no dmuRole. DMU role is required for buying-group members.`,\n severity: 'ERROR',\n });\n }\n}\n\n/**\n * The ICP→persona buying-group link MUST be symmetric: when an ICP\n * lists a persona in `buyingGroup[].personaRef`, the persona's\n * `belongsToIcpRefs[]` MUST contain the ICP. Asymmetric links cause\n * downstream consumers (DMU rendering, persona-by-ICP indexing,\n * market generation targeting) to silently drop the persona because\n * the `belongsToIcpRefs[]` index is the canonical traversal path.\n *\n * ERROR severity — this is a structural integrity bug, not authoring\n * polish: the snapshot will pass parse + intent but will silently\n * misbehave at runtime.\n *\n * Reverse direction (persona declares an ICP that does NOT list the\n * persona in its `buyingGroup[]`) is intentionally NOT reported here:\n * personas of `INDIVIDUAL_SELF` / `INDIVIDUAL_INFLUENCER` scope are\n * legitimately attached to ICPs that have no formal buying group.\n * The detector only runs the ICP→persona direction.\n */\nfunction detectBuyingGroupBacklinkMissing(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const personasByRef = new Map(snapshot.personas.map(p => [p.ref, p] as const));\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n icp.buyingGroup.forEach((entry, idx) => {\n const persona = personasByRef.get(entry.personaRef);\n if (persona === undefined) return; // orphan caught elsewhere\n if (persona.belongsToIcpRefs.includes(icp.ref)) return;\n issues.push({\n kind: MarketSnapshotIssueKind.BUYING_GROUP_BACKLINK_MISSING,\n path: `icps[${iIdx}].buyingGroup[${idx}].personaRef`,\n 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.`,\n severity: 'ERROR',\n });\n });\n }\n}\n\n/**\n * Phase 3 — a `MarketProof` that supports neither a benefit nor an ICP\n * has no place to land in generated copy. WARN, not ERROR — the proof\n * may be in flight (\"about to wire it up next\") and should not block\n * boot.\n */\nfunction detectProofsWithoutSupport(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [pIdx, proof] of snapshot.proofs.entries()) {\n if (proof.supportsBenefitRefs.length > 0 || proof.supportsIcpRefs.length > 0) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.PROOF_WITHOUT_SUPPORT,\n path: `proofs[${pIdx}]`,\n message: `Proof \"${proof.ref}\" supports neither a benefit nor an ICP. Add at least one supportsBenefitRefs[] or supportsIcpRefs[] entry, or remove the proof.`,\n severity: 'WARN',\n });\n }\n}\n\n/**\n * Phase 3 — proofKind/payload coherence (WARN). The schema is\n * intentionally permissive (both `attribution` and `metric` are\n * optional on every kind) so that authors can mix proof shapes\n * without fighting the type system. This detector flags the two\n * mismatches that are unambiguously authoring drift:\n *\n * 1. `METRIC` proof without a `metric` block — the structured\n * `value + unit + period` payload is what distinguishes a\n * `METRIC` proof from a `QUOTE` that happens to carry a number.\n * Without it the rendering layer cannot format the proof as a\n * metric (no value to surface, no unit to localize). Authors\n * should either add the `metric` block or downgrade the kind to\n * `QUOTE` / `CASE_STUDY`.\n * 2. `LOGO` proof with a `metric` block — a logo carries no\n * quantitative payload by definition, so a `metric` block on a\n * `LOGO` is a category error. Either move the metric to a\n * sibling `METRIC` proof or change the kind.\n *\n * All other kind/payload combinations are deliberately accepted:\n * a `QUOTE` may carry a `metric` (a quote that quantifies an\n * outcome), an `AWARD` may carry an `attribution` (the awarding\n * body), etc. Adding more rules here trades flexibility for\n * marginal signal — keep this conservative.\n */\nfunction detectProofKindPayloadMismatch(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [pIdx, proof] of snapshot.proofs.entries()) {\n if (proof.proofKind === ProofKind.METRIC && proof.metric === undefined) {\n issues.push({\n kind: MarketSnapshotIssueKind.PROOF_KIND_PAYLOAD_MISMATCH,\n path: `proofs[${pIdx}].metric`,\n 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.`,\n severity: 'WARN',\n });\n }\n if (proof.proofKind === ProofKind.LOGO && proof.metric !== undefined) {\n issues.push({\n kind: MarketSnapshotIssueKind.PROOF_KIND_PAYLOAD_MISMATCH,\n path: `proofs[${pIdx}].metric`,\n 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.`,\n severity: 'WARN',\n });\n }\n }\n}\n\n/**\n * A `MarketBuyingJourney` listing the same `BuyingJourneyStage` enum\n * value more than once is a structural authoring bug (which entry\n * wins for prompt enrichment? non-deterministic). ERROR.\n */\nfunction detectDuplicateJourneyStages(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [jIdx, journey] of snapshot.buyingJourneys.entries()) {\n const seenStages = new Set<string>();\n journey.stages.forEach((entry, idx) => {\n if (seenStages.has(entry.stage)) {\n issues.push({\n kind: MarketSnapshotIssueKind.DUPLICATE_JOURNEY_STAGE,\n path: `buyingJourneys[${jIdx}].stages[${idx}].stage`,\n message: `Buying journey \"${journey.ref}\" lists stage ${entry.stage} more than once. Each BuyingJourneyStage may appear at most once per journey.`,\n severity: 'ERROR',\n });\n }\n seenStages.add(entry.stage);\n });\n }\n}\n\n/**\n * Two `MarketBuyingJourney` entries pointing at the same `icpRef` is\n * a structural authoring bug — the model is \"one journey per ICP\" and\n * downstream consumers (prompt enrichment, journey-by-ICP indexing)\n * will silently pick the first match. ERROR.\n */\nfunction detectDuplicateBuyingJourneyForIcp(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const seenIcpRefs = new Map<string, number>();\n snapshot.buyingJourneys.forEach((journey, idx) => {\n const previousIdx = seenIcpRefs.get(journey.icpRef);\n if (previousIdx !== undefined) {\n issues.push({\n kind: MarketSnapshotIssueKind.DUPLICATE_BUYING_JOURNEY_FOR_ICP,\n path: `buyingJourneys[${idx}].icpRef`,\n 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.`,\n severity: 'ERROR',\n });\n return;\n }\n seenIcpRefs.set(journey.icpRef, idx);\n });\n}\n\n/**\n * Semantic check: an objection citing `proofRefs[]` should point at\n * proofs whose support set actually intersects the objection's claim.\n *\n * Both sides of the intersection are unioned to be permissive without\n * being toothless:\n * - Proof support side: `proof.supportsBenefitRefs[]` ∪\n * `proof.supportsIcpRefs[]`. A proof that supports the ICP raising\n * the objection (e.g. a `LOGO` proof for that ICP) is considered\n * to back the objection even if it doesn't directly back a specific\n * benefit — logos and case studies are rarely benefit-scoped.\n * - Objection target side: `objection.relatedBenefitRefs[]` ∪\n * `objection.raisedByIcpRefs[]`.\n *\n * WARN (authoring drift, not catastrophic — the spec parses, but the\n * cited proofs will not render as supporting evidence in any of the\n * downstream prompt blocks). Orphan refs are caught separately by\n * `detectOrphanRefs`.\n *\n * Skipped for objections where either side of the intersection is\n * empty (no proofs cited OR neither related benefits nor raising ICPs\n * authored — the check has no signal then).\n */\nfunction detectObjectionProofBenefitMismatch(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const proofsByRef = new Map(snapshot.proofs.map(p => [p.ref, p] as const));\n\n for (const [oIdx, objection] of snapshot.objections.entries()) {\n if (objection.proofRefs.length === 0) continue;\n const objectionTargets = new Set<string>([\n ...objection.relatedBenefitRefs,\n ...objection.raisedByIcpRefs,\n ]);\n if (objectionTargets.size === 0) continue;\n\n const supported = new Set<string>();\n for (const proofRef of objection.proofRefs) {\n const proof = proofsByRef.get(proofRef);\n if (proof === undefined) continue; // orphan caught elsewhere\n for (const benefitRef of proof.supportsBenefitRefs) supported.add(benefitRef);\n for (const icpRef of proof.supportsIcpRefs) supported.add(icpRef);\n }\n\n const intersects = [...objectionTargets].some(ref => supported.has(ref));\n if (intersects) continue;\n\n issues.push({\n kind: MarketSnapshotIssueKind.OBJECTION_PROOF_BENEFIT_MISMATCH,\n path: `objections[${oIdx}].proofRefs`,\n 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.`,\n severity: 'WARN',\n });\n }\n}\n\n/**\n * Maps a `MarketMessageRequiredInput` enum value to the placeholder\n * shapes inside `promptTemplate` that consume it. Each input matches\n * either the bare `{{<value>}}` token or any dotted-property descent\n * `{{<entityName>.path}}` (e.g. `icpRef` is consumed by `{{icpRef}}`,\n * `{{icp.name}}`, `{{icp.profile.geographies}}`).\n *\n * The `entityName` form is the camelCase root WITHOUT the trailing\n * `Ref` suffix — i.e. `icpRef` → entity name `icp`, `benefitRef` →\n * `benefit`. This matches the conventional Mustache shape authors use\n * in templates (\"ICP context surfaces under `icp.*`\").\n */\nconst REQUIRED_INPUT_PLACEHOLDER_PATTERNS: Record<MarketMessageRequiredInput, RegExp> = {\n [MarketMessageRequiredInput.ICP_REF]: /\\{\\{\\s*(?:icpRef|icp(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n [MarketMessageRequiredInput.BENEFIT_REF]: /\\{\\{\\s*(?:benefitRef|benefit(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n [MarketMessageRequiredInput.CHANNEL_REF]: /\\{\\{\\s*(?:channelRef|channel(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n [MarketMessageRequiredInput.OBJECTION_REF]: /\\{\\{\\s*(?:objectionRef|objection(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n};\n\n/**\n * Inverse of `REQUIRED_INPUT_PLACEHOLDER_PATTERNS` — given a Mustache\n * placeholder name extracted from a template body, return the\n * `MarketMessageRequiredInput` it consumes (or `undefined` if the\n * leading token is the exempt `{{output_language}}` / an unknown\n * camelCase root).\n *\n * Keyed on the **leading entity name** in two distinct shapes:\n * - the dotted-root entity (`icp` → consumed by `{{icp.name}}`,\n * `{{icp.profile.…}}`);\n * - the explicit `<entity>Ref` token (`icpRef` → consumed by\n * `{{icpRef}}`).\n *\n * The bare-entity token `{{icp}}` (no dot, no `Ref` suffix) is\n * intentionally NOT a recognized form here: Direction-1 of the\n * validator (declared → used) rejects it (the regex requires\n * `\\{\\{icpRef\\}\\}` OR `\\{\\{icp\\.<segment>\\}\\}`), so accepting it in\n * Direction-2 would create an asymmetric false-positive WARN. The\n * detector enforces this in `isRecognizedPlaceholderToken(...)`\n * before consulting the map.\n */\nconst PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT: Record<string, MarketMessageRequiredInput> = {\n icp: MarketMessageRequiredInput.ICP_REF,\n icpRef: MarketMessageRequiredInput.ICP_REF,\n benefit: MarketMessageRequiredInput.BENEFIT_REF,\n benefitRef: MarketMessageRequiredInput.BENEFIT_REF,\n channel: MarketMessageRequiredInput.CHANNEL_REF,\n channelRef: MarketMessageRequiredInput.CHANNEL_REF,\n objection: MarketMessageRequiredInput.OBJECTION_REF,\n objectionRef: MarketMessageRequiredInput.OBJECTION_REF,\n};\n\n/**\n * Returns the `MarketMessageRequiredInput` consumed by a Mustache\n * placeholder body (everything between `{{` and `}}` with whitespace\n * stripped), or `undefined` when the token does not consume any\n * required input.\n *\n * Symmetric with `REQUIRED_INPUT_PLACEHOLDER_PATTERNS`:\n * - dotted access (`icp.name`, `icp.profile.geographies`) → consumes\n * the dotted root's required input;\n * - explicit `<entity>Ref` (`icpRef`) → consumes the matching\n * required input;\n * - bare entity (`icp`) → DOES NOT consume — same as Direction-1.\n */\nfunction lookupConsumedRequiredInput(\n innerExpression: string,\n): MarketMessageRequiredInput | undefined {\n const dotIndex = innerExpression.indexOf('.');\n if (dotIndex >= 0) {\n const dottedRoot = innerExpression.slice(0, dotIndex).trim();\n return PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT[dottedRoot];\n }\n // No dot — only the explicit `<entity>Ref` form is recognized.\n if (!innerExpression.endsWith('Ref')) return undefined;\n return PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT[innerExpression];\n}\n\n/**\n * Mustache token names that are CLI-injected at render time and are\n * therefore NOT expected to appear in `requiredInputs[]`. Today only\n * `output_language` is in this set (substituted from the\n * `--output-language` flag), but the set\n * is structured to grow with future CLI-side affordances.\n */\nconst PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS: ReadonlySet<string> = new Set([\n 'output_language',\n]);\n\n/**\n * Match every Mustache placeholder inside a template body. Captures\n * the inner expression with surrounding whitespace stripped so callers\n * can split on `.` to extract the leading entity name.\n *\n * Permissive on identifier shape — accepts kebab-free dot paths\n * (`icp.name`, `icp.profile.geographies`) and bare identifiers\n * (`icpRef`, `output_language`). Mustache section tokens\n * (`{{#...}}` / `{{^...}}` / `{{/...}}` / `{{!...}}`) are filtered\n * via the leading sigil check below.\n */\nconst MUSTACHE_PLACEHOLDER_REGEX = /\\{\\{\\s*([^}]+?)\\s*\\}\\}/g;\n\n/**\n * Phase-4 (§10.3 of the plan) — declared/used coherence check on\n * `MarketMessageTemplate.promptTemplate` ↔ `requiredInputs[]`.\n *\n * The detector is symmetric: it surfaces both directions of drift\n * (declared but never substituted; used in the body but never\n * declared) under the same `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH`\n * kind. The message text disambiguates the direction so authors can\n * fix it from the report alone.\n *\n * The exempt token set ({{output_language}} today) is filtered before\n * the \"used but not declared\" pass — see\n * `PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS`. Unknown camelCase\n * roots (e.g. `{{persona.name}}` if persona ever becomes a placeholder\n * shape) are silently ignored — this detector covers ONLY the inputs\n * declared in `MarketMessageRequiredInput`. Adding a new required-input\n * shape requires extending both `PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT`\n * and `REQUIRED_INPUT_PLACEHOLDER_PATTERNS` together.\n */\nfunction detectMessageTemplatePlaceholderMismatch(\n snapshot: MarketSnapshot,\n issues: MarketSnapshotIssue[],\n): void {\n for (const [tIdx, template] of snapshot.messageTemplates.entries()) {\n const declaredInputs = new Set<MarketMessageRequiredInput>(template.requiredInputs ?? []);\n\n // Direction 1: declared but the body has no consuming placeholder.\n for (const declared of declaredInputs) {\n const pattern = REQUIRED_INPUT_PLACEHOLDER_PATTERNS[declared];\n if (pattern.test(template.promptTemplate)) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH,\n path: `messageTemplates[${tIdx}].requiredInputs`,\n message:\n `Message template \"${template.ref}\" declares requiredInput \"${declared}\" but no `\n + `\\`{{${declared.replace(/Ref$/, '')}.*}}\\` / \\`{{${declared}}}\\` placeholder exists in promptTemplate. `\n + `Add the placeholder or prune the requiredInput entry.`,\n severity: 'WARN',\n });\n }\n\n // Direction 2: body references a known input shape that is not declared.\n const referencedInputs = new Set<MarketMessageRequiredInput>();\n MUSTACHE_PLACEHOLDER_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = MUSTACHE_PLACEHOLDER_REGEX.exec(template.promptTemplate)) !== null) {\n const inner = match[1] ?? '';\n // Skip Mustache section / inverted / closing / comment tokens.\n const firstChar = inner[0];\n if (firstChar === '#' || firstChar === '^' || firstChar === '/' || firstChar === '!') continue;\n\n const leadingEntity = inner.split('.')[0]?.trim() ?? '';\n if (leadingEntity.length === 0) continue;\n if (PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS.has(leadingEntity)) continue;\n\n const consumedInput = lookupConsumedRequiredInput(inner);\n if (consumedInput === undefined) continue; // unknown entity root — out of scope for this detector\n referencedInputs.add(consumedInput);\n }\n\n for (const referenced of referencedInputs) {\n if (declaredInputs.has(referenced)) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH,\n path: `messageTemplates[${tIdx}].promptTemplate`,\n message:\n `Message template \"${template.ref}\" references \\`{{${referenced.replace(/Ref$/, '')}.*}}\\` / `\n + `\\`{{${referenced}}}\\` placeholders but does not declare \"${referenced}\" in requiredInputs[]. `\n + `Add the requiredInput entry or remove the placeholder.`,\n severity: 'WARN',\n });\n }\n }\n}\n\n/** @wildo_source:part:end market.snapshot.validation */\n"]}
1
+ {"version":3,"file":"market-snapshot-validation.js","sourceRoot":"","sources":["../../../../../src/_core/market/market-snapshot-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAN,IAAY,uBAiFX;AAjFD,WAAY,uBAAuB;IACjC,oDAAyB,CAAA;IACzB,8FAAmE,CAAA;IACnE;;;;;;;OAOG;IACH,0FAA+D,CAAA;IAC/D,oFAAyD,CAAA;IACzD,sEAA2C,CAAA;IAC3C,8DAAmC,CAAA;IACnC,sFAA2D,CAAA;IAC3D,4DAAiC,CAAA;IACjC;;;;;;;;;;;OAWG;IACH,kFAAuD,CAAA;IACvD,8FAAmE,CAAA;IACnE,0GAA+E,CAAA;IAC/E;;;;;OAKG;IACH,0FAA+D,CAAA;IAC/D,uGAAuG;IACvG,0EAA+C,CAAA;IAC/C;;;;;;;;OAQG;IACH,sFAA2D,CAAA;IAC3D,qFAAqF;IACrF,8EAAmD,CAAA;IACnD,8GAA8G;IAC9G,gGAAqE,CAAA;IACrE,wGAAwG;IACxG,gGAAqE,CAAA;IACrE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,0GAA+E,CAAA;AACjF,CAAC,EAjFW,u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AK,MAAM,UAAU,IAAI,gBAAgB,EAAE,CAAC;YAC1C,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC;gBAAE,SAAS;YAC7C,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,uBAAuB,CAAC,qCAAqC;gBACnE,IAAI,EAAE,oBAAoB,IAAI,kBAAkB;gBAChD,OAAO,EACL,qBAAqB,QAAQ,CAAC,GAAG,oBAAoB,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW;sBAC5F,OAAO,UAAU,2CAA2C,UAAU,yBAAyB;sBAC/F,wDAAwD;gBAC5D,QAAQ,EAAE,MAAM;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED,wDAAwD","sourcesContent":["import { BenefitKanoCategory } from './feature-benefit.schemas';\nimport type { MarketAuthoredMetadata } from './market-authored-metadata.schemas';\nimport { ReviewCadence } from './market-authored-metadata.schemas';\nimport { ICPArchetype, ICPPriority, TARGETED_ICP_PRIORITIES } from './market-icp.schemas';\nimport { MarketMessageRequiredInput } from './market-message-template.schemas';\nimport { PersonaScope } from './market-persona.schemas';\nimport { ProofKind } from './market-proof.schemas';\nimport type { MarketSnapshot } from './market-snapshot.schemas';\n\n/**\n * @wildo_source:part:start market.snapshot.validation facet:layer:specification facet:family:market\n *\n * Authoring-consistency validator for an assembled `MarketSnapshot`.\n *\n * The function is a **pure**, **typed** graph walker over the\n * snapshot — no Zod introspection, no LocalizedString visitor, no\n * runtime registry access. Each rule is implemented as a tiny\n * standalone detector composed by the top-level\n * `validateMarketSnapshot`.\n *\n * Rule table — currently 18 kinds:\n *\n * | Kind | Severity | Trigger |\n * |--------------------------------------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n * | `ORPHAN_REF` | ERROR | A `<entity>Ref` does not resolve inside the snapshot. Cross-family refs (`featureRefs`, `productRefs`) are skipped if no set is passed. |\n * | `MULTIPLE_THRESHOLDS_PER_ICP_JOB` | ERROR | An (icpRef, jobRef) cluster has more than one distinct benefit with `kanoCategory: THRESHOLD`. Deduped by benefit `ref`. |\n * | `THRESHOLD_BENEFIT_WITHOUT_JOB` | ERROR | A benefit declares any `kanoCategory: THRESHOLD` entry but `advances[]` is empty (no job to anchor the THRESHOLD claim against). |\n * | `EMPTY_BENEFIT_DELIVERED_BY` | ERROR | A `FeatureBenefit.deliveredByFeatureRefs[]` is empty (defence in depth — Zod also rejects). |\n * | `ICP_WITHOUT_PERSONA` | ERROR (LEGAL_ENTITY) / WARN (INDIVIDUAL) | A non-`ANTI_TARGET` ICP has no persona pointing at its `ref` via `belongsToIcpRefs`. |\n * | `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). |\n * | `MISSING_POSITIONING_FOR_ICP` | ERROR | An ICP of priority `CORE` or `EXPANSION` has no `MarketPositioning`. Other priorities exempt. |\n * | `STALE_AUTHORED` | WARN | `lastAuthoredAt + reviewCadence < now`. No check when `reviewCadence` is undefined or `AS_NEEDED`. |\n * | `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`). |\n * | `INVALID_ANTI_TARGET_PURPOSE_MIX` | ERROR | `priority === ANTI_TARGET` and `purposeMix !== { adoption: 0, revenue: 0 }`. |\n * | `BUYING_GROUP_PERSONA_MISSING_DMU_ROLE` | ERROR | `personaScope === BUYING_GROUP_MEMBER` and `dmuRole` is undefined. |\n * | `BUYING_GROUP_BACKLINK_MISSING` | ERROR | An ICP's `buyingGroup[].personaRef` resolves to a persona whose `belongsToIcpRefs[]` does NOT include the ICP (asymmetric link). |\n * | `PROOF_WITHOUT_SUPPORT` | WARN | A `MarketProof` carries empty `supportsBenefitRefs[]` AND empty `supportsIcpRefs[]`. |\n * | `PROOF_KIND_PAYLOAD_MISMATCH` | WARN | A `MarketProof` carries a payload incoherent with its `proofKind` (`METRIC` without `metric`, `LOGO` with `metric`). |\n * | `DUPLICATE_JOURNEY_STAGE` | ERROR | A `MarketBuyingJourney` lists the same `BuyingJourneyStage` enum value more than once. |\n * | `DUPLICATE_BUYING_JOURNEY_FOR_ICP` | ERROR | Two `MarketBuyingJourney` entries point at the same `icpRef`. The model is \"one journey per ICP\". |\n * | `OBJECTION_PROOF_BENEFIT_MISMATCH` | WARN | An objection cites `proofRefs[]` whose union of `supportsBenefitRefs[]` ∪ `supportsIcpRefs[]` does not intersect `relatedBenefitRefs[]` ∪ `raisedByIcpRefs[]`. |\n * | `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). |\n *\n * Issue ordering inside `result.issues[]` is detector-order, then\n * snapshot-walk order. It is **not** a stable contract — callers\n * must group/sort by `kind` + `severity` themselves.\n *\n * Loaded by application registries at boot. Callers should:\n * - throw a `BusinessConfigError` (re-exported from\n * `@wildo-ai/saas-backend-lib`) when `result.ok === false`,\n * listing every ERROR-severity issue;\n * - log WARN-severity issues through the standard backend logger.\n *\n * The validator never mutates the snapshot.\n */\nexport enum MarketSnapshotIssueKind {\n ORPHAN_REF = 'ORPHAN_REF',\n MULTIPLE_THRESHOLDS_PER_ICP_JOB = 'MULTIPLE_THRESHOLDS_PER_ICP_JOB',\n /**\n * A benefit declares any `kanoCategory: THRESHOLD` entry on\n * `importanceByICP[]` but its `advances[]` is empty. THRESHOLD is\n * defined as \"table-stakes for a specific (icp, job)\" — without a\n * job to anchor against, the THRESHOLD claim has no semantic\n * cluster and the `MULTIPLE_THRESHOLDS_PER_ICP_JOB` invariant is\n * structurally bypassed (ERROR).\n */\n THRESHOLD_BENEFIT_WITHOUT_JOB = 'THRESHOLD_BENEFIT_WITHOUT_JOB',\n EMPTY_BENEFIT_DELIVERED_BY = 'EMPTY_BENEFIT_DELIVERED_BY',\n ICP_WITHOUT_PERSONA = 'ICP_WITHOUT_PERSONA',\n INFLUENCE_CYCLE = 'INFLUENCE_CYCLE',\n MISSING_POSITIONING_FOR_ICP = 'MISSING_POSITIONING_FOR_ICP',\n STALE_AUTHORED = 'STALE_AUTHORED',\n /**\n * Same target ref appears more than once in the same per-entity\n * edge list. Currently covers:\n * - ICP and persona `pains[].painRef`, `gains[].gainRef`,\n * `jobs[].jobRef` — typically the result of an `inheritFrom()`\n * spread followed by a forgotten `.filter()` step;\n * - benefit `importanceByICP[].icpRef` — duplicate (benefit, icp)\n * pairs make per-ICP scoring non-deterministic.\n *\n * Severity is WARN — the snapshot still parses, but the duplicate\n * edge silently double-counts in downstream FIT scoring.\n */\n DUPLICATE_EDGE_PER_ENTITY = 'DUPLICATE_EDGE_PER_ENTITY',\n INVALID_ANTI_TARGET_PURPOSE_MIX = 'INVALID_ANTI_TARGET_PURPOSE_MIX',\n BUYING_GROUP_PERSONA_MISSING_DMU_ROLE = 'BUYING_GROUP_PERSONA_MISSING_DMU_ROLE',\n /**\n * An ICP's `buyingGroup[].personaRef` resolves to a persona, but\n * the persona's `belongsToIcpRefs[]` does not contain the ICP. The\n * link is asymmetric and downstream consumers (DMU rendering,\n * persona-by-ICP indexing) silently drop the persona. ERROR.\n */\n BUYING_GROUP_BACKLINK_MISSING = 'BUYING_GROUP_BACKLINK_MISSING',\n /** A proof entity that supports neither a benefit nor an ICP — has no place to land in copy (WARN). */\n PROOF_WITHOUT_SUPPORT = 'PROOF_WITHOUT_SUPPORT',\n /**\n * A `MarketProof` carries a payload incoherent with its\n * `proofKind`. The schema is permissive (both `attribution` and\n * `metric` are optional on every kind). This detector catches the\n * strongest mismatches as authoring drift (WARN — the spec parses,\n * but the proof renders badly):\n * - `METRIC` without a `metric` block;\n * - `LOGO` with a `metric` block.\n */\n PROOF_KIND_PAYLOAD_MISMATCH = 'PROOF_KIND_PAYLOAD_MISMATCH',\n /** Same `BuyingJourneyStage` enum value listed twice on a single journey (ERROR). */\n DUPLICATE_JOURNEY_STAGE = 'DUPLICATE_JOURNEY_STAGE',\n /** Two `MarketBuyingJourney` entries point at the same `icpRef`. The model is one journey per ICP (ERROR). */\n DUPLICATE_BUYING_JOURNEY_FOR_ICP = 'DUPLICATE_BUYING_JOURNEY_FOR_ICP',\n /** Objection's cited proofs do not back any of its `relatedBenefitRefs` or `raisedByIcpRefs` (WARN). */\n OBJECTION_PROOF_BENEFIT_MISMATCH = 'OBJECTION_PROOF_BENEFIT_MISMATCH',\n /**\n * A `MarketMessageTemplate` has a mismatch between its declared\n * `requiredInputs[]` and the `{{<entity>.*}}` / `{{<entity>Ref}}`\n * placeholders that actually appear inside `promptTemplate`.\n *\n * Two symmetric cases:\n * 1. Declared but unused — `requiredInputs` lists `icpRef` but the\n * body has no `{{icp.*}}` / `{{icpRef}}` reference. The CLI will\n * require the caller to pass the input but never substitute it.\n * 2. Used but undeclared — the body references `{{benefit.claim}}`\n * but `requiredInputs` does not include `benefitRef`. The CLI\n * will not enforce the input and the placeholder will render\n * literally (e.g. `{{benefit.claim}}`).\n *\n * The `{{output_language}}` placeholder is **exempt** from this\n * check: it is injected by the market generation CLI from the\n * `--output-language` flag, not from `requiredInputs[]`.\n *\n * WARN severity — the snapshot still parses and the template still\n * renders, but the output will be off-spec at runtime. Authors\n * should either prune the unused entry from `requiredInputs[]` or\n * add the missing placeholder / entry.\n */\n MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH = 'MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH',\n}\n\nexport type MarketSnapshotIssueSeverity = 'ERROR' | 'WARN';\n\nexport interface MarketSnapshotIssue {\n kind: MarketSnapshotIssueKind;\n /** Dotted path inside the snapshot (e.g. `'icps[0].pains[2].painRef'`). */\n path: string;\n message: string;\n severity: MarketSnapshotIssueSeverity;\n}\n\nexport interface MarketSnapshotValidationResult {\n /** `true` iff no issue has severity `ERROR`. */\n ok: boolean;\n issues: MarketSnapshotIssue[];\n}\n\n/**\n * Options for this family validator.\n *\n * ## The cross-family sets are OPT-IN, and omitting one SKIPS its check\n *\n * A family validator sees one family. It cannot resolve a reference into another family's\n * vocabulary unless you hand it that family's refs — so each `available*Refs` option is the caller\n * saying \"I have this context, use it\". Omit one and the matching check does not run: no issue is\n * reported, and the absence looks exactly like a snapshot with no such reference.\n *\n * That is deliberate — the families are decoupled on purpose — but it means a validator called with\n * the snapshot alone is checking this family's INTERNAL consistency only. If you want dangling\n * cross-family references caught, supply the sets; if you validate one family in isolation, expect\n * them to be found later by whatever holds every family at once.\n */\nexport interface ValidateMarketSnapshotOptions {\n /**\n * Cross-family ref check for `FeatureBenefit.deliveredByFeatureRefs`.\n * Pass the application's full feature-spec key set; orphans are\n * reported as `ORPHAN_REF`. When omitted, the cross-family check is\n * SKIPPED (intra-snapshot orphans are still detected).\n */\n availableFeatureRefs?: ReadonlySet<string>;\n /**\n * Cross-family ref check for `MarketICP.recommendedProductRefs` /\n * `upsellPathProductRefs`. Same skip-when-omitted semantics.\n */\n availableProductRefs?: ReadonlySet<string>;\n /** Override \"now\" for `STALE_AUTHORED` checks (test affordance). Defaults to `new Date()`. */\n now?: Date;\n}\n\nexport function validateMarketSnapshot(\n snapshot: MarketSnapshot,\n options?: ValidateMarketSnapshotOptions,\n): MarketSnapshotValidationResult {\n const issues: MarketSnapshotIssue[] = [];\n\n detectOrphanRefs(snapshot, options, issues);\n detectThresholdBenefitsWithoutJob(snapshot, issues);\n detectMultipleThresholdsPerIcpJob(snapshot, issues);\n detectEmptyBenefitDeliveredBy(snapshot, issues);\n detectIcpWithoutPersona(snapshot, issues);\n detectInfluenceCycles(snapshot, issues);\n detectMissingPositioningForIcp(snapshot, issues);\n detectStaleAuthored(snapshot, options?.now ?? new Date(), issues);\n detectDuplicateEdgesPerEntity(snapshot, issues);\n detectInvalidAntiTargetPurposeMix(snapshot, issues);\n detectBuyingGroupPersonasMissingDmuRole(snapshot, issues);\n detectBuyingGroupBacklinkMissing(snapshot, issues);\n detectProofsWithoutSupport(snapshot, issues);\n detectProofKindPayloadMismatch(snapshot, issues);\n detectDuplicateJourneyStages(snapshot, issues);\n detectDuplicateBuyingJourneyForIcp(snapshot, issues);\n detectObjectionProofBenefitMismatch(snapshot, issues);\n detectMessageTemplatePlaceholderMismatch(snapshot, issues);\n\n const ok = issues.every(i => i.severity !== 'ERROR');\n return { ok, issues };\n}\n\n// ────────────────────────────────────────────────────────────────────\n// Detectors — one per rule, kept small and independently testable.\n// ────────────────────────────────────────────────────────────────────\n\nfunction detectOrphanRefs(\n snapshot: MarketSnapshot,\n options: ValidateMarketSnapshotOptions | undefined,\n issues: MarketSnapshotIssue[],\n): void {\n const icpRefs = new Set(snapshot.icps.map(i => i.ref));\n const personaRefs = new Set(snapshot.personas.map(p => p.ref));\n const jobRefs = new Set(snapshot.jobs.map(j => j.ref));\n const painRefs = new Set(snapshot.pains.map(p => p.ref));\n const gainRefs = new Set(snapshot.gains.map(g => g.ref));\n const voiceRefs = new Set(snapshot.tonesOfVoice.map(v => v.ref));\n const benefitRefs = new Set(snapshot.benefits.map(b => b.ref));\n const channelRefs = new Set(snapshot.channels.map(c => c.ref));\n const alternativeRefs = new Set(snapshot.alternatives.map(a => a.ref));\n const triggerRefs = new Set(snapshot.triggers.map(t => t.ref));\n const proofRefs = new Set(snapshot.proofs.map(p => p.ref));\n const objectionRefs = new Set(snapshot.objections.map(o => o.ref));\n\n const reportOrphan = (path: string, ref: string, kind: string): void => {\n issues.push({\n kind: MarketSnapshotIssueKind.ORPHAN_REF,\n path,\n message: `${kind} ref \"${ref}\" at ${path} does not resolve inside the snapshot.`,\n severity: 'ERROR',\n });\n };\n\n // ICP edges + cross-family + influences + voices + Phase-3 ref arrays.\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n const basePath = `icps[${iIdx}]`;\n\n icp.buyingGroup.forEach((entry, idx) => {\n if (!personaRefs.has(entry.personaRef)) {\n reportOrphan(`${basePath}.buyingGroup[${idx}].personaRef`, entry.personaRef, 'persona');\n }\n });\n icp.jobs.forEach((edge, idx) => {\n if (!jobRefs.has(edge.jobRef)) reportOrphan(`${basePath}.jobs[${idx}].jobRef`, edge.jobRef, 'job');\n });\n icp.pains.forEach((edge, idx) => {\n if (!painRefs.has(edge.painRef)) reportOrphan(`${basePath}.pains[${idx}].painRef`, edge.painRef, 'pain');\n });\n icp.gains.forEach((edge, idx) => {\n if (!gainRefs.has(edge.gainRef)) reportOrphan(`${basePath}.gains[${idx}].gainRef`, edge.gainRef, 'gain');\n });\n icp.influences.forEach((edge, idx) => {\n if (!icpRefs.has(edge.icpRef)) reportOrphan(`${basePath}.influences[${idx}].icpRef`, edge.icpRef, 'icp');\n });\n if (icp.preferredVoiceRef !== undefined && !voiceRefs.has(icp.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, icp.preferredVoiceRef, 'voice');\n }\n\n // Phase-3 ICP ref arrays (channels / triggers / alternatives /\n // proofs / objections). All are intra-snapshot — no caller-supplied\n // set required. Orphans here silently waste downstream targeting\n // (channel never reached, trigger never observed) so ERROR is the\n // right severity (D16).\n icp.channelRefs.forEach((ref, idx) => {\n if (!channelRefs.has(ref)) reportOrphan(`${basePath}.channelRefs[${idx}]`, ref, 'channel');\n });\n icp.triggerRefs.forEach((ref, idx) => {\n if (!triggerRefs.has(ref)) reportOrphan(`${basePath}.triggerRefs[${idx}]`, ref, 'trigger');\n });\n icp.alternativeRefs.forEach((ref, idx) => {\n if (!alternativeRefs.has(ref)) reportOrphan(`${basePath}.alternativeRefs[${idx}]`, ref, 'alternative');\n });\n icp.proofRefs.forEach((ref, idx) => {\n if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');\n });\n icp.objectionRefs.forEach((ref, idx) => {\n if (!objectionRefs.has(ref)) reportOrphan(`${basePath}.objectionRefs[${idx}]`, ref, 'objection');\n });\n\n if (options?.availableProductRefs !== undefined) {\n icp.recommendedProductRefs.forEach((ref, idx) => {\n if (!options.availableProductRefs!.has(ref)) {\n reportOrphan(`${basePath}.recommendedProductRefs[${idx}]`, ref, 'product');\n }\n });\n icp.upsellPathProductRefs.forEach((ref, idx) => {\n if (!options.availableProductRefs!.has(ref)) {\n reportOrphan(`${basePath}.upsellPathProductRefs[${idx}]`, ref, 'product');\n }\n });\n }\n }\n\n // Persona edges + cross-family voice ref + parent ICP refs + Phase-3\n // channel refs.\n for (const [pIdx, persona] of snapshot.personas.entries()) {\n const basePath = `personas[${pIdx}]`;\n\n persona.belongsToIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.belongsToIcpRefs[${idx}]`, ref, 'icp');\n });\n persona.jobs.forEach((edge, idx) => {\n if (!jobRefs.has(edge.jobRef)) reportOrphan(`${basePath}.jobs[${idx}].jobRef`, edge.jobRef, 'job');\n });\n persona.pains.forEach((edge, idx) => {\n if (!painRefs.has(edge.painRef)) reportOrphan(`${basePath}.pains[${idx}].painRef`, edge.painRef, 'pain');\n });\n persona.gains.forEach((edge, idx) => {\n if (!gainRefs.has(edge.gainRef)) reportOrphan(`${basePath}.gains[${idx}].gainRef`, edge.gainRef, 'gain');\n });\n persona.channelRefs.forEach((ref, idx) => {\n if (!channelRefs.has(ref)) reportOrphan(`${basePath}.channelRefs[${idx}]`, ref, 'channel');\n });\n if (persona.preferredVoiceRef !== undefined && !voiceRefs.has(persona.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, persona.preferredVoiceRef, 'voice');\n }\n }\n\n // Benefits — pain/gain/job + ICP refs + cross-family feature refs +\n // Phase-3 proof / objection back-refs.\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n const basePath = `benefits[${bIdx}]`;\n\n benefit.relieves.forEach((edge, idx) => {\n if (!painRefs.has(edge.painRef)) {\n reportOrphan(`${basePath}.relieves[${idx}].painRef`, edge.painRef, 'pain');\n }\n });\n benefit.creates.forEach((edge, idx) => {\n if (!gainRefs.has(edge.gainRef)) {\n reportOrphan(`${basePath}.creates[${idx}].gainRef`, edge.gainRef, 'gain');\n }\n });\n benefit.advances.forEach((edge, idx) => {\n if (!jobRefs.has(edge.jobRef)) {\n reportOrphan(`${basePath}.advances[${idx}].jobRef`, edge.jobRef, 'job');\n }\n });\n benefit.importanceByICP.forEach((edge, idx) => {\n if (!icpRefs.has(edge.icpRef)) {\n reportOrphan(`${basePath}.importanceByICP[${idx}].icpRef`, edge.icpRef, 'icp');\n }\n });\n benefit.proofRefs.forEach((ref, idx) => {\n if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');\n });\n benefit.addressesObjectionRefs.forEach((ref, idx) => {\n if (!objectionRefs.has(ref)) {\n reportOrphan(`${basePath}.addressesObjectionRefs[${idx}]`, ref, 'objection');\n }\n });\n\n if (options?.availableFeatureRefs !== undefined) {\n benefit.deliveredByFeatureRefs.forEach((ref, idx) => {\n if (!options.availableFeatureRefs!.has(ref)) {\n reportOrphan(`${basePath}.deliveredByFeatureRefs[${idx}]`, ref, 'feature');\n }\n });\n }\n }\n\n // Positionings — back to ICP + benefits + alternatives.\n for (const [pIdx, positioning] of snapshot.positionings.entries()) {\n const basePath = `positionings[${pIdx}]`;\n\n if (!icpRefs.has(positioning.icpRef)) {\n reportOrphan(`${basePath}.icpRef`, positioning.icpRef, 'icp');\n }\n if (positioning.preferredVoiceRef !== undefined && !voiceRefs.has(positioning.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, positioning.preferredVoiceRef, 'voice');\n }\n positioning.valuePillars.forEach((pillar, idx) => {\n pillar.backedByBenefitRefs.forEach((ref, j) => {\n if (!benefitRefs.has(ref)) {\n reportOrphan(`${basePath}.valuePillars[${idx}].backedByBenefitRefs[${j}]`, ref, 'benefit');\n }\n });\n });\n positioning.alternativesContrasted.forEach((entry, idx) => {\n if (!alternativeRefs.has(entry.alternativeRef)) {\n reportOrphan(\n `${basePath}.alternativesContrasted[${idx}].alternativeRef`,\n entry.alternativeRef,\n 'alternative',\n );\n }\n });\n }\n\n // Triggers — affected ICPs + recommended channels.\n for (const [tIdx, trigger] of snapshot.triggers.entries()) {\n const basePath = `triggers[${tIdx}]`;\n trigger.affectedIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.affectedIcpRefs[${idx}]`, ref, 'icp');\n });\n trigger.recommendedChannelRefs.forEach((ref, idx) => {\n if (!channelRefs.has(ref)) reportOrphan(`${basePath}.recommendedChannelRefs[${idx}]`, ref, 'channel');\n });\n }\n\n // Buying journeys — back to ICP.\n for (const [jIdx, journey] of snapshot.buyingJourneys.entries()) {\n const basePath = `buyingJourneys[${jIdx}]`;\n if (!icpRefs.has(journey.icpRef)) {\n reportOrphan(`${basePath}.icpRef`, journey.icpRef, 'icp');\n }\n }\n\n // Proofs — supports benefits + ICPs.\n for (const [pIdx, proof] of snapshot.proofs.entries()) {\n const basePath = `proofs[${pIdx}]`;\n proof.supportsBenefitRefs.forEach((ref, idx) => {\n if (!benefitRefs.has(ref)) reportOrphan(`${basePath}.supportsBenefitRefs[${idx}]`, ref, 'benefit');\n });\n proof.supportsIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.supportsIcpRefs[${idx}]`, ref, 'icp');\n });\n }\n\n // Objections — raised by ICPs + personas, cite proofs + related benefits.\n for (const [oIdx, objection] of snapshot.objections.entries()) {\n const basePath = `objections[${oIdx}]`;\n objection.raisedByIcpRefs.forEach((ref, idx) => {\n if (!icpRefs.has(ref)) reportOrphan(`${basePath}.raisedByIcpRefs[${idx}]`, ref, 'icp');\n });\n objection.raisedByPersonaRefs.forEach((ref, idx) => {\n if (!personaRefs.has(ref)) reportOrphan(`${basePath}.raisedByPersonaRefs[${idx}]`, ref, 'persona');\n });\n objection.proofRefs.forEach((ref, idx) => {\n if (!proofRefs.has(ref)) reportOrphan(`${basePath}.proofRefs[${idx}]`, ref, 'proof');\n });\n objection.relatedBenefitRefs.forEach((ref, idx) => {\n if (!benefitRefs.has(ref)) reportOrphan(`${basePath}.relatedBenefitRefs[${idx}]`, ref, 'benefit');\n });\n }\n\n // Message templates — Phase-2 slot, Phase-4 fill. The preferred-voice\n // ref MUST resolve when authored, otherwise the market generation CLI\n // silently falls back to the default voice and produces off-brand\n // copy.\n for (const [tIdx, template] of snapshot.messageTemplates.entries()) {\n const basePath = `messageTemplates[${tIdx}]`;\n if (template.preferredVoiceRef !== undefined && !voiceRefs.has(template.preferredVoiceRef)) {\n reportOrphan(`${basePath}.preferredVoiceRef`, template.preferredVoiceRef, 'voice');\n }\n }\n}\n\n/**\n * D4 invariant: at most ONE THRESHOLD-classified benefit per\n * `(icpRef, jobRef)` cluster. THRESHOLD means \"table-stakes — without\n * it the offer is rejected\", so two competing THRESHOLDs against the\n * same (icp, job) means we have two unrelated table-stakes claims for\n * the same outcome which is structurally undefined for the FIT scorer\n * (`market-scoring.ts`).\n *\n * The detector dedupes per benefit by tracking the SET of benefit\n * `ref`s per (icp, job) — repeated `advances[]` entries on the SAME\n * benefit (which is itself a `DUPLICATE_EDGE_PER_ENTITY` WARN) do not\n * double-count and therefore do not trigger a false-positive ERROR\n * here. Benefits with empty `advances[]` are caught by\n * `THRESHOLD_BENEFIT_WITHOUT_JOB` (ERROR) — they would otherwise\n * structurally bypass this rule by having no (icp, job) cluster to\n * be counted in.\n */\nfunction detectMultipleThresholdsPerIcpJob(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const benefitRefsByJobByIcp = new Map<string, Map<string, Set<string>>>();\n\n for (const benefit of snapshot.benefits) {\n const icpRefsWithThreshold = new Set(\n benefit.importanceByICP\n .filter(e => e.kanoCategory === BenefitKanoCategory.THRESHOLD)\n .map(e => e.icpRef),\n );\n if (icpRefsWithThreshold.size === 0) continue;\n\n const distinctJobRefs = new Set(benefit.advances.map(e => e.jobRef));\n if (distinctJobRefs.size === 0) continue; // caught by THRESHOLD_BENEFIT_WITHOUT_JOB\n\n for (const icpRef of icpRefsWithThreshold) {\n const byJob = benefitRefsByJobByIcp.get(icpRef) ?? new Map<string, Set<string>>();\n for (const jobRef of distinctJobRefs) {\n const set = byJob.get(jobRef) ?? new Set<string>();\n set.add(benefit.ref);\n byJob.set(jobRef, set);\n }\n benefitRefsByJobByIcp.set(icpRef, byJob);\n }\n }\n\n for (const [icpRef, byJob] of benefitRefsByJobByIcp.entries()) {\n for (const [jobRef, refsSet] of byJob.entries()) {\n if (refsSet.size > 1) {\n const refs = [...refsSet].join(', ');\n issues.push({\n kind: MarketSnapshotIssueKind.MULTIPLE_THRESHOLDS_PER_ICP_JOB,\n path: `benefits.importanceByICP[icp=${icpRef}].advances[job=${jobRef}]`,\n message: `ICP \"${icpRef}\" job \"${jobRef}\" has multiple THRESHOLD benefits (${refs}). Only one THRESHOLD per (icp, job) cluster is allowed.`,\n severity: 'ERROR',\n });\n }\n }\n }\n}\n\n/**\n * Companion to `MULTIPLE_THRESHOLDS_PER_ICP_JOB`. THRESHOLD is defined\n * as a per-(ICP, job) classification — a benefit that declares any\n * `kanoCategory: THRESHOLD` entry on `importanceByICP[]` MUST also\n * advance at least one job, otherwise the invariant has no anchor and\n * the FIT scorer cannot place the table-stakes claim. ERROR.\n */\nfunction detectThresholdBenefitsWithoutJob(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n const hasThreshold = benefit.importanceByICP.some(\n e => e.kanoCategory === BenefitKanoCategory.THRESHOLD,\n );\n if (!hasThreshold) continue;\n if (benefit.advances.length > 0) continue;\n\n const thresholdIcpRefs = benefit.importanceByICP\n .filter(e => e.kanoCategory === BenefitKanoCategory.THRESHOLD)\n .map(e => e.icpRef)\n .join(', ');\n issues.push({\n kind: MarketSnapshotIssueKind.THRESHOLD_BENEFIT_WITHOUT_JOB,\n path: `benefits[${bIdx}].advances`,\n 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.`,\n severity: 'ERROR',\n });\n }\n}\n\nfunction detectEmptyBenefitDeliveredBy(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n // The schema enforces `.min(1)`; this detector remains as a defence\n // in depth for callers that bypass parsing (legitimate scenario:\n // tests building snapshots with type-asserted fixtures).\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n if (benefit.deliveredByFeatureRefs.length === 0) {\n issues.push({\n kind: MarketSnapshotIssueKind.EMPTY_BENEFIT_DELIVERED_BY,\n path: `benefits[${bIdx}].deliveredByFeatureRefs`,\n message: `Benefit \"${benefit.ref}\" has empty deliveredByFeatureRefs[]. A benefit must be delivered by at least one feature.`,\n severity: 'ERROR',\n });\n }\n }\n}\n\nfunction detectIcpWithoutPersona(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const personaParents = new Set<string>();\n for (const persona of snapshot.personas) {\n for (const ref of persona.belongsToIcpRefs) personaParents.add(ref);\n }\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n if (icp.priority === ICPPriority.ANTI_TARGET) continue;\n if (personaParents.has(icp.ref)) continue;\n\n const severity: MarketSnapshotIssueSeverity =\n icp.archetype === ICPArchetype.LEGAL_ENTITY ? 'ERROR' : 'WARN';\n issues.push({\n kind: MarketSnapshotIssueKind.ICP_WITHOUT_PERSONA,\n path: `icps[${iIdx}].ref`,\n message: `ICP \"${icp.ref}\" (archetype ${icp.archetype}) has no persona pointing at it. ${severity === 'ERROR' ? 'Required' : 'Recommended'} for ${icp.archetype}.`,\n severity,\n });\n }\n}\n\nfunction detectInfluenceCycles(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n // Self-loops first — always ERROR.\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n icp.influences.forEach((edge, idx) => {\n if (edge.icpRef === icp.ref) {\n issues.push({\n kind: MarketSnapshotIssueKind.INFLUENCE_CYCLE,\n path: `icps[${iIdx}].influences[${idx}].icpRef`,\n message: `ICP \"${icp.ref}\" has a self-loop in influences[]. Self-loops are not allowed.`,\n severity: 'ERROR',\n });\n }\n });\n }\n\n // Multi-node cycles — Tarjan-style SCC scan, report each cycle once.\n const adjacency = new Map<string, string[]>();\n for (const icp of snapshot.icps) {\n adjacency.set(\n icp.ref,\n icp.influences.filter(e => e.icpRef !== icp.ref).map(e => e.icpRef),\n );\n }\n\n const seenCycles = new Set<string>();\n const visited = new Set<string>();\n\n for (const startRef of adjacency.keys()) {\n if (visited.has(startRef)) continue;\n const stack: string[] = [];\n const onStack = new Set<string>();\n\n const dfs = (node: string): void => {\n visited.add(node);\n stack.push(node);\n onStack.add(node);\n\n for (const next of adjacency.get(node) ?? []) {\n if (!adjacency.has(next)) continue;\n if (!visited.has(next)) {\n dfs(next);\n } else if (onStack.has(next)) {\n const cycleStart = stack.indexOf(next);\n if (cycleStart >= 0) {\n const cycle = stack.slice(cycleStart);\n const key = [...cycle].sort().join('|');\n if (!seenCycles.has(key)) {\n seenCycles.add(key);\n issues.push({\n kind: MarketSnapshotIssueKind.INFLUENCE_CYCLE,\n path: `icps[*].influences`,\n message: `Influence cycle detected: ${cycle.join(' → ')} → ${next}. Cycles are accepted but emit a WARN.`,\n severity: 'WARN',\n });\n }\n }\n }\n }\n\n stack.pop();\n onStack.delete(node);\n };\n\n dfs(startRef);\n }\n}\n\nfunction detectMissingPositioningForIcp(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const positionedIcpRefs = new Set(snapshot.positionings.map(p => p.icpRef));\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n if (!TARGETED_ICP_PRIORITIES.has(icp.priority)) continue;\n if (positionedIcpRefs.has(icp.ref)) continue;\n\n issues.push({\n kind: MarketSnapshotIssueKind.MISSING_POSITIONING_FOR_ICP,\n path: `icps[${iIdx}].ref`,\n message: `ICP \"${icp.ref}\" has priority ${icp.priority} but no MarketPositioning entry. CORE and EXPANSION ICPs must be positioned.`,\n severity: 'ERROR',\n });\n }\n}\n\nconst REVIEW_CADENCE_TO_DAYS: Record<ReviewCadence, number> = {\n [ReviewCadence.WEEKLY]: 7,\n [ReviewCadence.MONTHLY]: 31,\n [ReviewCadence.QUARTERLY]: 92,\n [ReviewCadence.YEARLY]: 366,\n [ReviewCadence.AS_NEEDED]: Number.POSITIVE_INFINITY,\n};\n\nfunction detectStaleAuthored(\n snapshot: MarketSnapshot,\n now: Date,\n issues: MarketSnapshotIssue[],\n): void {\n const checkAuthored = (authored: MarketAuthoredMetadata | undefined, path: string, ref: string): void => {\n if (authored?.reviewCadence === undefined) return;\n const days = REVIEW_CADENCE_TO_DAYS[authored.reviewCadence];\n if (!Number.isFinite(days)) return;\n const lastAuthored = new Date(authored.lastAuthoredAt).getTime();\n if (Number.isNaN(lastAuthored)) return;\n const ageMs = now.getTime() - lastAuthored;\n const ageDays = ageMs / (24 * 60 * 60 * 1000);\n if (ageDays > days) {\n issues.push({\n kind: MarketSnapshotIssueKind.STALE_AUTHORED,\n path,\n message: `Authored content for \"${ref}\" is ${Math.floor(ageDays)} days old (cadence ${authored.reviewCadence} ⇒ ${days}d). Re-author or remove the cadence.`,\n severity: 'WARN',\n });\n }\n };\n\n snapshot.icps.forEach((icp, idx) => checkAuthored(icp.authored, `icps[${idx}].authored`, icp.ref));\n snapshot.personas.forEach((p, idx) => checkAuthored(p.authored, `personas[${idx}].authored`, p.ref));\n snapshot.jobs.forEach((j, idx) => checkAuthored(j.authored, `jobs[${idx}].authored`, j.ref));\n snapshot.pains.forEach((p, idx) => checkAuthored(p.authored, `pains[${idx}].authored`, p.ref));\n snapshot.gains.forEach((g, idx) => checkAuthored(g.authored, `gains[${idx}].authored`, g.ref));\n snapshot.tonesOfVoice.forEach((v, idx) => checkAuthored(v.authored, `tonesOfVoice[${idx}].authored`, v.ref));\n snapshot.benefits.forEach((b, idx) => checkAuthored(b.authored, `benefits[${idx}].authored`, b.ref));\n snapshot.positionings.forEach((p, idx) => checkAuthored(p.authored, `positionings[${idx}].authored`, p.ref));\n snapshot.messageTemplates.forEach((t, idx) => checkAuthored(t.authored, `messageTemplates[${idx}].authored`, t.ref));\n snapshot.channels.forEach((c, idx) => checkAuthored(c.authored, `channels[${idx}].authored`, c.ref));\n snapshot.alternatives.forEach((a, idx) => checkAuthored(a.authored, `alternatives[${idx}].authored`, a.ref));\n snapshot.triggers.forEach((t, idx) => checkAuthored(t.authored, `triggers[${idx}].authored`, t.ref));\n snapshot.buyingJourneys.forEach((j, idx) => checkAuthored(j.authored, `buyingJourneys[${idx}].authored`, j.ref));\n snapshot.proofs.forEach((p, idx) => checkAuthored(p.authored, `proofs[${idx}].authored`, p.ref));\n snapshot.objections.forEach((o, idx) => checkAuthored(o.authored, `objections[${idx}].authored`, o.ref));\n checkAuthored(snapshot.category.authored, 'category.authored', snapshot.category.ref);\n}\n\n/**\n * Per-entity duplicate-edge detection.\n *\n * Scope (intentionally bounded — see `DUPLICATE_EDGE_PER_ENTITY` JSDoc\n * on the enum for the canonical list):\n * - ICP and persona `pains[].painRef` / `gains[].gainRef` /\n * `jobs[].jobRef`. Duplicates here are typically the result of an\n * `inheritFrom(parentIcp)` spread followed by a forgotten\n * `.filter()` step on the persona.\n * - Benefit `importanceByICP[].icpRef`. Duplicates make per-ICP\n * weighting non-deterministic in the FIT scorer (the last one wins\n * silently). We deliberately do NOT collapse the duplicates — we\n * surface them so authors fix the source instead of relying on\n * detector-side normalization.\n *\n * NOT covered (other detectors / schema constraints handle these):\n * - benefit `relieves` / `creates` / `advances` weighted edges — the\n * degree might legitimately differ across entries; future work.\n * - ICP `buyingGroup[].personaRef` — deduplication is enforced by\n * intent (a persona is in the group exactly once); future work.\n */\nfunction detectDuplicateEdgesPerEntity(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const reportDuplicates = (\n refs: string[],\n basePath: string,\n field: string,\n ownerRef: string,\n refSubpath: string = '',\n hint: string = 'Likely an inheritFrom() spread that wasn\\'t deduplicated.',\n ): void => {\n const seen = new Set<string>();\n refs.forEach((ref, idx) => {\n if (seen.has(ref)) {\n issues.push({\n kind: MarketSnapshotIssueKind.DUPLICATE_EDGE_PER_ENTITY,\n path: `${basePath}.${field}[${idx}]${refSubpath}`,\n message: `${field} ref \"${ref}\" appears more than once on \"${ownerRef}\". ${hint}`,\n severity: 'WARN',\n });\n }\n seen.add(ref);\n });\n };\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n const basePath = `icps[${iIdx}]`;\n reportDuplicates(icp.pains.map(e => e.painRef), basePath, 'pains', icp.ref, '.painRef');\n reportDuplicates(icp.gains.map(e => e.gainRef), basePath, 'gains', icp.ref, '.gainRef');\n reportDuplicates(icp.jobs.map(e => e.jobRef), basePath, 'jobs', icp.ref, '.jobRef');\n }\n for (const [pIdx, persona] of snapshot.personas.entries()) {\n const basePath = `personas[${pIdx}]`;\n reportDuplicates(persona.pains.map(e => e.painRef), basePath, 'pains', persona.ref, '.painRef');\n reportDuplicates(persona.gains.map(e => e.gainRef), basePath, 'gains', persona.ref, '.gainRef');\n reportDuplicates(persona.jobs.map(e => e.jobRef), basePath, 'jobs', persona.ref, '.jobRef');\n }\n for (const [bIdx, benefit] of snapshot.benefits.entries()) {\n const basePath = `benefits[${bIdx}]`;\n reportDuplicates(\n benefit.importanceByICP.map(e => e.icpRef),\n basePath,\n 'importanceByICP',\n benefit.ref,\n '.icpRef',\n 'Each (benefit, icp) pair must appear at most once — duplicates make per-ICP weighting non-deterministic.',\n );\n }\n}\n\nfunction detectInvalidAntiTargetPurposeMix(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n if (icp.priority !== ICPPriority.ANTI_TARGET) continue;\n const isZero = icp.purposeMix.adoption === 0 && icp.purposeMix.revenue === 0;\n if (isZero) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.INVALID_ANTI_TARGET_PURPOSE_MIX,\n path: `icps[${iIdx}].purposeMix`,\n message: `ICP \"${icp.ref}\" has priority ANTI_TARGET but purposeMix=${JSON.stringify(icp.purposeMix)}. ANTI_TARGET ICPs MUST carry { adoption: 0, revenue: 0 }.`,\n severity: 'ERROR',\n });\n }\n}\n\nfunction detectBuyingGroupPersonasMissingDmuRole(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [pIdx, persona] of snapshot.personas.entries()) {\n if (persona.personaScope !== PersonaScope.BUYING_GROUP_MEMBER) continue;\n if (persona.dmuRole !== undefined) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.BUYING_GROUP_PERSONA_MISSING_DMU_ROLE,\n path: `personas[${pIdx}].dmuRole`,\n message: `Persona \"${persona.ref}\" has personaScope BUYING_GROUP_MEMBER but no dmuRole. DMU role is required for buying-group members.`,\n severity: 'ERROR',\n });\n }\n}\n\n/**\n * The ICP→persona buying-group link MUST be symmetric: when an ICP\n * lists a persona in `buyingGroup[].personaRef`, the persona's\n * `belongsToIcpRefs[]` MUST contain the ICP. Asymmetric links cause\n * downstream consumers (DMU rendering, persona-by-ICP indexing,\n * market generation targeting) to silently drop the persona because\n * the `belongsToIcpRefs[]` index is the canonical traversal path.\n *\n * ERROR severity — this is a structural integrity bug, not authoring\n * polish: the snapshot will pass parse + intent but will silently\n * misbehave at runtime.\n *\n * Reverse direction (persona declares an ICP that does NOT list the\n * persona in its `buyingGroup[]`) is intentionally NOT reported here:\n * personas of `INDIVIDUAL_SELF` / `INDIVIDUAL_INFLUENCER` scope are\n * legitimately attached to ICPs that have no formal buying group.\n * The detector only runs the ICP→persona direction.\n */\nfunction detectBuyingGroupBacklinkMissing(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const personasByRef = new Map(snapshot.personas.map(p => [p.ref, p] as const));\n\n for (const [iIdx, icp] of snapshot.icps.entries()) {\n icp.buyingGroup.forEach((entry, idx) => {\n const persona = personasByRef.get(entry.personaRef);\n if (persona === undefined) return; // orphan caught elsewhere\n if (persona.belongsToIcpRefs.includes(icp.ref)) return;\n issues.push({\n kind: MarketSnapshotIssueKind.BUYING_GROUP_BACKLINK_MISSING,\n path: `icps[${iIdx}].buyingGroup[${idx}].personaRef`,\n 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.`,\n severity: 'ERROR',\n });\n });\n }\n}\n\n/**\n * Phase 3 — a `MarketProof` that supports neither a benefit nor an ICP\n * has no place to land in generated copy. WARN, not ERROR — the proof\n * may be in flight (\"about to wire it up next\") and should not block\n * boot.\n */\nfunction detectProofsWithoutSupport(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [pIdx, proof] of snapshot.proofs.entries()) {\n if (proof.supportsBenefitRefs.length > 0 || proof.supportsIcpRefs.length > 0) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.PROOF_WITHOUT_SUPPORT,\n path: `proofs[${pIdx}]`,\n message: `Proof \"${proof.ref}\" supports neither a benefit nor an ICP. Add at least one supportsBenefitRefs[] or supportsIcpRefs[] entry, or remove the proof.`,\n severity: 'WARN',\n });\n }\n}\n\n/**\n * Phase 3 — proofKind/payload coherence (WARN). The schema is\n * intentionally permissive (both `attribution` and `metric` are\n * optional on every kind) so that authors can mix proof shapes\n * without fighting the type system. This detector flags the two\n * mismatches that are unambiguously authoring drift:\n *\n * 1. `METRIC` proof without a `metric` block — the structured\n * `value + unit + period` payload is what distinguishes a\n * `METRIC` proof from a `QUOTE` that happens to carry a number.\n * Without it the rendering layer cannot format the proof as a\n * metric (no value to surface, no unit to localize). Authors\n * should either add the `metric` block or downgrade the kind to\n * `QUOTE` / `CASE_STUDY`.\n * 2. `LOGO` proof with a `metric` block — a logo carries no\n * quantitative payload by definition, so a `metric` block on a\n * `LOGO` is a category error. Either move the metric to a\n * sibling `METRIC` proof or change the kind.\n *\n * All other kind/payload combinations are deliberately accepted:\n * a `QUOTE` may carry a `metric` (a quote that quantifies an\n * outcome), an `AWARD` may carry an `attribution` (the awarding\n * body), etc. Adding more rules here trades flexibility for\n * marginal signal — keep this conservative.\n */\nfunction detectProofKindPayloadMismatch(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [pIdx, proof] of snapshot.proofs.entries()) {\n if (proof.proofKind === ProofKind.METRIC && proof.metric === undefined) {\n issues.push({\n kind: MarketSnapshotIssueKind.PROOF_KIND_PAYLOAD_MISMATCH,\n path: `proofs[${pIdx}].metric`,\n 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.`,\n severity: 'WARN',\n });\n }\n if (proof.proofKind === ProofKind.LOGO && proof.metric !== undefined) {\n issues.push({\n kind: MarketSnapshotIssueKind.PROOF_KIND_PAYLOAD_MISMATCH,\n path: `proofs[${pIdx}].metric`,\n 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.`,\n severity: 'WARN',\n });\n }\n }\n}\n\n/**\n * A `MarketBuyingJourney` listing the same `BuyingJourneyStage` enum\n * value more than once is a structural authoring bug (which entry\n * wins for prompt enrichment? non-deterministic). ERROR.\n */\nfunction detectDuplicateJourneyStages(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n for (const [jIdx, journey] of snapshot.buyingJourneys.entries()) {\n const seenStages = new Set<string>();\n journey.stages.forEach((entry, idx) => {\n if (seenStages.has(entry.stage)) {\n issues.push({\n kind: MarketSnapshotIssueKind.DUPLICATE_JOURNEY_STAGE,\n path: `buyingJourneys[${jIdx}].stages[${idx}].stage`,\n message: `Buying journey \"${journey.ref}\" lists stage ${entry.stage} more than once. Each BuyingJourneyStage may appear at most once per journey.`,\n severity: 'ERROR',\n });\n }\n seenStages.add(entry.stage);\n });\n }\n}\n\n/**\n * Two `MarketBuyingJourney` entries pointing at the same `icpRef` is\n * a structural authoring bug — the model is \"one journey per ICP\" and\n * downstream consumers (prompt enrichment, journey-by-ICP indexing)\n * will silently pick the first match. ERROR.\n */\nfunction detectDuplicateBuyingJourneyForIcp(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const seenIcpRefs = new Map<string, number>();\n snapshot.buyingJourneys.forEach((journey, idx) => {\n const previousIdx = seenIcpRefs.get(journey.icpRef);\n if (previousIdx !== undefined) {\n issues.push({\n kind: MarketSnapshotIssueKind.DUPLICATE_BUYING_JOURNEY_FOR_ICP,\n path: `buyingJourneys[${idx}].icpRef`,\n 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.`,\n severity: 'ERROR',\n });\n return;\n }\n seenIcpRefs.set(journey.icpRef, idx);\n });\n}\n\n/**\n * Semantic check: an objection citing `proofRefs[]` should point at\n * proofs whose support set actually intersects the objection's claim.\n *\n * Both sides of the intersection are unioned to be permissive without\n * being toothless:\n * - Proof support side: `proof.supportsBenefitRefs[]` ∪\n * `proof.supportsIcpRefs[]`. A proof that supports the ICP raising\n * the objection (e.g. a `LOGO` proof for that ICP) is considered\n * to back the objection even if it doesn't directly back a specific\n * benefit — logos and case studies are rarely benefit-scoped.\n * - Objection target side: `objection.relatedBenefitRefs[]` ∪\n * `objection.raisedByIcpRefs[]`.\n *\n * WARN (authoring drift, not catastrophic — the spec parses, but the\n * cited proofs will not render as supporting evidence in any of the\n * downstream prompt blocks). Orphan refs are caught separately by\n * `detectOrphanRefs`.\n *\n * Skipped for objections where either side of the intersection is\n * empty (no proofs cited OR neither related benefits nor raising ICPs\n * authored — the check has no signal then).\n */\nfunction detectObjectionProofBenefitMismatch(snapshot: MarketSnapshot, issues: MarketSnapshotIssue[]): void {\n const proofsByRef = new Map(snapshot.proofs.map(p => [p.ref, p] as const));\n\n for (const [oIdx, objection] of snapshot.objections.entries()) {\n if (objection.proofRefs.length === 0) continue;\n const objectionTargets = new Set<string>([\n ...objection.relatedBenefitRefs,\n ...objection.raisedByIcpRefs,\n ]);\n if (objectionTargets.size === 0) continue;\n\n const supported = new Set<string>();\n for (const proofRef of objection.proofRefs) {\n const proof = proofsByRef.get(proofRef);\n if (proof === undefined) continue; // orphan caught elsewhere\n for (const benefitRef of proof.supportsBenefitRefs) supported.add(benefitRef);\n for (const icpRef of proof.supportsIcpRefs) supported.add(icpRef);\n }\n\n const intersects = [...objectionTargets].some(ref => supported.has(ref));\n if (intersects) continue;\n\n issues.push({\n kind: MarketSnapshotIssueKind.OBJECTION_PROOF_BENEFIT_MISMATCH,\n path: `objections[${oIdx}].proofRefs`,\n 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.`,\n severity: 'WARN',\n });\n }\n}\n\n/**\n * Maps a `MarketMessageRequiredInput` enum value to the placeholder\n * shapes inside `promptTemplate` that consume it. Each input matches\n * either the bare `{{<value>}}` token or any dotted-property descent\n * `{{<entityName>.path}}` (e.g. `icpRef` is consumed by `{{icpRef}}`,\n * `{{icp.name}}`, `{{icp.profile.geographies}}`).\n *\n * The `entityName` form is the camelCase root WITHOUT the trailing\n * `Ref` suffix — i.e. `icpRef` → entity name `icp`, `benefitRef` →\n * `benefit`. This matches the conventional Mustache shape authors use\n * in templates (\"ICP context surfaces under `icp.*`\").\n */\nconst REQUIRED_INPUT_PLACEHOLDER_PATTERNS: Record<MarketMessageRequiredInput, RegExp> = {\n [MarketMessageRequiredInput.ICP_REF]: /\\{\\{\\s*(?:icpRef|icp(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n [MarketMessageRequiredInput.BENEFIT_REF]: /\\{\\{\\s*(?:benefitRef|benefit(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n [MarketMessageRequiredInput.CHANNEL_REF]: /\\{\\{\\s*(?:channelRef|channel(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n [MarketMessageRequiredInput.OBJECTION_REF]: /\\{\\{\\s*(?:objectionRef|objection(?:\\.[A-Za-z0-9_]+)+)\\s*\\}\\}/,\n};\n\n/**\n * Inverse of `REQUIRED_INPUT_PLACEHOLDER_PATTERNS` — given a Mustache\n * placeholder name extracted from a template body, return the\n * `MarketMessageRequiredInput` it consumes (or `undefined` if the\n * leading token is the exempt `{{output_language}}` / an unknown\n * camelCase root).\n *\n * Keyed on the **leading entity name** in two distinct shapes:\n * - the dotted-root entity (`icp` → consumed by `{{icp.name}}`,\n * `{{icp.profile.…}}`);\n * - the explicit `<entity>Ref` token (`icpRef` → consumed by\n * `{{icpRef}}`).\n *\n * The bare-entity token `{{icp}}` (no dot, no `Ref` suffix) is\n * intentionally NOT a recognized form here: Direction-1 of the\n * validator (declared → used) rejects it (the regex requires\n * `\\{\\{icpRef\\}\\}` OR `\\{\\{icp\\.<segment>\\}\\}`), so accepting it in\n * Direction-2 would create an asymmetric false-positive WARN. The\n * detector enforces this in `isRecognizedPlaceholderToken(...)`\n * before consulting the map.\n */\nconst PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT: Record<string, MarketMessageRequiredInput> = {\n icp: MarketMessageRequiredInput.ICP_REF,\n icpRef: MarketMessageRequiredInput.ICP_REF,\n benefit: MarketMessageRequiredInput.BENEFIT_REF,\n benefitRef: MarketMessageRequiredInput.BENEFIT_REF,\n channel: MarketMessageRequiredInput.CHANNEL_REF,\n channelRef: MarketMessageRequiredInput.CHANNEL_REF,\n objection: MarketMessageRequiredInput.OBJECTION_REF,\n objectionRef: MarketMessageRequiredInput.OBJECTION_REF,\n};\n\n/**\n * Returns the `MarketMessageRequiredInput` consumed by a Mustache\n * placeholder body (everything between `{{` and `}}` with whitespace\n * stripped), or `undefined` when the token does not consume any\n * required input.\n *\n * Symmetric with `REQUIRED_INPUT_PLACEHOLDER_PATTERNS`:\n * - dotted access (`icp.name`, `icp.profile.geographies`) → consumes\n * the dotted root's required input;\n * - explicit `<entity>Ref` (`icpRef`) → consumes the matching\n * required input;\n * - bare entity (`icp`) → DOES NOT consume — same as Direction-1.\n */\nfunction lookupConsumedRequiredInput(\n innerExpression: string,\n): MarketMessageRequiredInput | undefined {\n const dotIndex = innerExpression.indexOf('.');\n if (dotIndex >= 0) {\n const dottedRoot = innerExpression.slice(0, dotIndex).trim();\n return PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT[dottedRoot];\n }\n // No dot — only the explicit `<entity>Ref` form is recognized.\n if (!innerExpression.endsWith('Ref')) return undefined;\n return PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT[innerExpression];\n}\n\n/**\n * Mustache token names that are CLI-injected at render time and are\n * therefore NOT expected to appear in `requiredInputs[]`. Today only\n * `output_language` is in this set (substituted from the\n * `--output-language` flag), but the set\n * is structured to grow with future CLI-side affordances.\n */\nconst PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS: ReadonlySet<string> = new Set([\n 'output_language',\n]);\n\n/**\n * Match every Mustache placeholder inside a template body. Captures\n * the inner expression with surrounding whitespace stripped so callers\n * can split on `.` to extract the leading entity name.\n *\n * Permissive on identifier shape — accepts kebab-free dot paths\n * (`icp.name`, `icp.profile.geographies`) and bare identifiers\n * (`icpRef`, `output_language`). Mustache section tokens\n * (`{{#...}}` / `{{^...}}` / `{{/...}}` / `{{!...}}`) are filtered\n * via the leading sigil check below.\n */\nconst MUSTACHE_PLACEHOLDER_REGEX = /\\{\\{\\s*([^}]+?)\\s*\\}\\}/g;\n\n/**\n * Phase-4 (§10.3 of the plan) — declared/used coherence check on\n * `MarketMessageTemplate.promptTemplate` ↔ `requiredInputs[]`.\n *\n * The detector is symmetric: it surfaces both directions of drift\n * (declared but never substituted; used in the body but never\n * declared) under the same `MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH`\n * kind. The message text disambiguates the direction so authors can\n * fix it from the report alone.\n *\n * The exempt token set ({{output_language}} today) is filtered before\n * the \"used but not declared\" pass — see\n * `PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS`. Unknown camelCase\n * roots (e.g. `{{persona.name}}` if persona ever becomes a placeholder\n * shape) are silently ignored — this detector covers ONLY the inputs\n * declared in `MarketMessageRequiredInput`. Adding a new required-input\n * shape requires extending both `PLACEHOLDER_ENTITY_TO_REQUIRED_INPUT`\n * and `REQUIRED_INPUT_PLACEHOLDER_PATTERNS` together.\n */\nfunction detectMessageTemplatePlaceholderMismatch(\n snapshot: MarketSnapshot,\n issues: MarketSnapshotIssue[],\n): void {\n for (const [tIdx, template] of snapshot.messageTemplates.entries()) {\n const declaredInputs = new Set<MarketMessageRequiredInput>(template.requiredInputs ?? []);\n\n // Direction 1: declared but the body has no consuming placeholder.\n for (const declared of declaredInputs) {\n const pattern = REQUIRED_INPUT_PLACEHOLDER_PATTERNS[declared];\n if (pattern.test(template.promptTemplate)) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH,\n path: `messageTemplates[${tIdx}].requiredInputs`,\n message:\n `Message template \"${template.ref}\" declares requiredInput \"${declared}\" but no `\n + `\\`{{${declared.replace(/Ref$/, '')}.*}}\\` / \\`{{${declared}}}\\` placeholder exists in promptTemplate. `\n + `Add the placeholder or prune the requiredInput entry.`,\n severity: 'WARN',\n });\n }\n\n // Direction 2: body references a known input shape that is not declared.\n const referencedInputs = new Set<MarketMessageRequiredInput>();\n MUSTACHE_PLACEHOLDER_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = MUSTACHE_PLACEHOLDER_REGEX.exec(template.promptTemplate)) !== null) {\n const inner = match[1] ?? '';\n // Skip Mustache section / inverted / closing / comment tokens.\n const firstChar = inner[0];\n if (firstChar === '#' || firstChar === '^' || firstChar === '/' || firstChar === '!') continue;\n\n const leadingEntity = inner.split('.')[0]?.trim() ?? '';\n if (leadingEntity.length === 0) continue;\n if (PLACEHOLDER_ENTITY_EXEMPT_FROM_REQUIRED_INPUTS.has(leadingEntity)) continue;\n\n const consumedInput = lookupConsumedRequiredInput(inner);\n if (consumedInput === undefined) continue; // unknown entity root — out of scope for this detector\n referencedInputs.add(consumedInput);\n }\n\n for (const referenced of referencedInputs) {\n if (declaredInputs.has(referenced)) continue;\n issues.push({\n kind: MarketSnapshotIssueKind.MESSAGE_TEMPLATE_PLACEHOLDER_MISMATCH,\n path: `messageTemplates[${tIdx}].promptTemplate`,\n message:\n `Message template \"${template.ref}\" references \\`{{${referenced.replace(/Ref$/, '')}.*}}\\` / `\n + `\\`{{${referenced}}}\\` placeholders but does not declare \"${referenced}\" in requiredInputs[]. `\n + `Add the requiredInput entry or remove the placeholder.`,\n severity: 'WARN',\n });\n }\n }\n}\n\n/** @wildo_source:part:end market.snapshot.validation */\n"]}
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { ApplicationInterviewDepth } from "@wildo-ai/saas-models/meta-workflows";
2
3
  import { ApplicationSpecificationFamily } from "../_core/application-specification-family-identity.schemas";
3
4
  /**
4
5
  * THE DOSSIER's committed half: what the creator answered, question by question (#1454, Step 5).
@@ -30,6 +31,28 @@ import { ApplicationSpecificationFamily } from "../_core/application-specificati
30
31
  * here and WRITTEN into `wildo.saas.config.ts` by the run that reads it — the dossier is the
31
32
  * interview's memory, the config stays the declaration.
32
33
  */
34
+ /**
35
+ * Whether an answer is something the creator DECIDED or something assumed on their behalf (#2129).
36
+ *
37
+ * Orthogonal to WHO answered (`answeredByRef`): a person can relay an assumption, and an agent can relay a
38
+ * derivation the application's own files settle. What this records is the answer's epistemic standing —
39
+ * whether anything downstream may treat it as the creator's statement.
40
+ */
41
+ export declare enum ApplicationCreatorInputAnswerStanding {
42
+ /**
43
+ * The creator decided it, or the application's own files settle it. The meaning of every answer recorded
44
+ * before this vocabulary existed, and of an answer that declares no standing.
45
+ */
46
+ DECIDED = "decided",
47
+ /**
48
+ * Proposed by the companion, never decided by the creator: either the creator did not know and let the
49
+ * proposal stand, or the creator chose a quick interview and an unattended round recorded the proposal with
50
+ * nobody present (#2129). The companion proposed it from what the creator had already said and what the
51
+ * application holds; the run treats it as a working hypothesis, and the dossier lists it to revisit. Always
52
+ * carries its rationale. Refused for a question whose `whenUnknown` is ASK.
53
+ */
54
+ ASSUMED = "assumed"
55
+ }
33
56
  export declare const ApplicationCreatorInputAnswerSchema: z.ZodObject<{
34
57
  /** The playbook that asks this question — its compiled `ref` (`top_down.vision-elicitation`). */
35
58
  playbookRef: z.ZodString;
@@ -47,6 +70,17 @@ export declare const ApplicationCreatorInputAnswerSchema: z.ZodObject<{
47
70
  answeredAt: z.ZodISODateTime;
48
71
  /** Who answered — a user ref of the workbench session that recorded it. Provenance, never authority. */
49
72
  answeredByRef: z.ZodString;
73
+ /**
74
+ * DECIDED or ASSUMED (#2129). Absent means DECIDED — read it through {@link creatorInputAnswerStanding},
75
+ * never directly — so every answer recorded before assumptions existed keeps the meaning it had.
76
+ */
77
+ standing: z.ZodOptional<z.ZodEnum<typeof ApplicationCreatorInputAnswerStanding>>;
78
+ /**
79
+ * Why the proposed answer was assumed, in the proposer's words: what it inferred the value from. Every ASSUMED
80
+ * answer carries one and only an ASSUMED answer does (the family validator refuses both mismatches), so a reader
81
+ * can always see the basis of an assumption before deciding whether to keep it.
82
+ */
83
+ assumptionRationale: z.ZodOptional<z.ZodString>;
50
84
  }, z.core.$strict>;
51
85
  export type ApplicationCreatorInputAnswer = z.infer<typeof ApplicationCreatorInputAnswerSchema>;
52
86
  /**
@@ -132,6 +166,17 @@ export declare const ApplicationCreatorInputsSchema: z.ZodObject<{
132
166
  answeredAt: z.ZodISODateTime;
133
167
  /** Who answered — a user ref of the workbench session that recorded it. Provenance, never authority. */
134
168
  answeredByRef: z.ZodString;
169
+ /**
170
+ * DECIDED or ASSUMED (#2129). Absent means DECIDED — read it through {@link creatorInputAnswerStanding},
171
+ * never directly — so every answer recorded before assumptions existed keeps the meaning it had.
172
+ */
173
+ standing: z.ZodOptional<z.ZodEnum<typeof ApplicationCreatorInputAnswerStanding>>;
174
+ /**
175
+ * Why the proposed answer was assumed, in the proposer's words: what it inferred the value from. Every ASSUMED
176
+ * answer carries one and only an ASSUMED answer does (the family validator refuses both mismatches), so a reader
177
+ * can always see the basis of an assumption before deciding whether to keep it.
178
+ */
179
+ assumptionRationale: z.ZodOptional<z.ZodString>;
135
180
  }, z.core.$strict>>;
136
181
  /**
137
182
  * The playbook instances the creator opened, keyed by instance id (`<ref>@<key>`), in SORTED key order
@@ -179,8 +224,17 @@ export declare const ApplicationCreatorInputsSchema: z.ZodObject<{
179
224
  */
180
225
  refinedFamilies: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof ApplicationSpecificationFamily>>>;
181
226
  }, z.core.$strict>>>;
227
+ /**
228
+ * How deep this application's interviews go (#2129). Absent until the creator chooses: a surface that
229
+ * starts an interview asks first, and records the answer with {@link withInterviewDepth}.
230
+ */
231
+ interviewDepth: z.ZodOptional<z.ZodEnum<typeof ApplicationInterviewDepth>>;
182
232
  }, z.core.$strict>;
183
233
  export type ApplicationCreatorInputs = z.infer<typeof ApplicationCreatorInputsSchema>;
234
+ /** The answer's standing — DECIDED when it declares none. The ONE place absence is interpreted. */
235
+ export declare function creatorInputAnswerStanding(answer: ApplicationCreatorInputAnswer): ApplicationCreatorInputAnswerStanding;
236
+ /** The dossier with its interview depth recorded or changed. Answers and activations are untouched. */
237
+ export declare function withInterviewDepth(inputs: ApplicationCreatorInputs | undefined, interviewDepth: ApplicationInterviewDepth): ApplicationCreatorInputs;
184
238
  /**
185
239
  * The one key an answer is addressed by. `playbookRef` and `questionRef` are refs, never free text, so `#`
186
240
  * cannot occur in either. The default instance keeps the key it always had (`<ref>#<question>`); an
@@ -213,10 +267,17 @@ export declare function validateApplicationCreatorInputs(inputs: ApplicationCrea
213
267
  * For an INSTANCE (#1609), its own answer wins per question and the default instance's fills the rest:
214
268
  * what the company answered once is shared, and the instance answers only what differs for it.
215
269
  */
216
- export declare function readCreatorInputAnswersForPlaybook(inputs: ApplicationCreatorInputs | undefined, playbookRef: string, instanceKey?: string): readonly {
270
+ export declare function readCreatorInputAnswersForPlaybook(inputs: ApplicationCreatorInputs | undefined, playbookRef: string, instanceKey?: string): readonly CreatorInputAnswerForPlaybook[];
271
+ /**
272
+ * One answer as a playbook READS it: the value, and — for an ASSUMED one only (#2129) — its standing and the
273
+ * proposer's reason, so a run can tell the creator's statement from a hypothesis. No `standing` means DECIDED.
274
+ */
275
+ export interface CreatorInputAnswerForPlaybook {
217
276
  readonly questionRef: string;
218
277
  readonly answer: string;
219
- }[];
278
+ readonly standing?: ApplicationCreatorInputAnswerStanding;
279
+ readonly assumptionRationale?: string;
280
+ }
220
281
  /**
221
282
  * The dossier after one more answer, or after one answer changed — REPLACE by key, keep the rest,
222
283
  * keep the file's order for the entries that were already there so a diff shows only the change.
@@ -1 +1 @@
1
- {"version":3,"file":"application-creator-inputs.application-creation.schemas.d.ts","sourceRoot":"","sources":["../../../../src/application-creation/application-creator-inputs.application-creation.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAG5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,mCAAmC;IAC9C,iGAAiG;;IAEjG,sFAAsF;;IAEtF;;;;OAIG;;IAEH,+GAA+G;;IAE/G,mGAAmG;;IAEnG,wGAAwG;;kBAExG,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;;;;;GAOG;AACH;;;GAGG;AACH,oBAAY,sCAAsC;IAChD,qEAAqE;IACrE,SAAS,cAAc;IACvB;;;OAGG;IACH,SAAS,cAAc;CACxB;AAED,eA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GAOG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,wBAAwB,GAAG,SAAS,MAAM,EAAE,CAoBpG;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAC5C,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GACnB,SAAS;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAWtE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAC5C,MAAM,EAAE,6BAA6B,GACpC,wBAAwB,CAW1B"}
1
+ {"version":3,"file":"application-creator-inputs.application-creation.schemas.d.ts","sourceRoot":"","sources":["../../../../src/application-creation/application-creator-inputs.application-creation.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAG5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;;;;;;GAMG;AACH,oBAAY,qCAAqC;IAC/C;;;OAGG;IACH,OAAO,YAAY;IACnB;;;;;;OAMG;IACH,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,mCAAmC;IAC9C,iGAAiG;;IAEjG,sFAAsF;;IAEtF;;;;OAIG;;IAEH,+GAA+G;;IAE/G,mGAAmG;;IAEnG,wGAAwG;;IAExG;;;OAGG;;IAEH;;;;OAIG;;kBAEH,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;;;;;GAOG;AACH;;;GAGG;AACH,oBAAY,sCAAsC;IAChD,qEAAqE;IACrE,SAAS,cAAc;I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