@wildo-ai/framework-knowledge 1.1.8 → 1.1.10

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 (480) hide show
  1. package/dist/claude-marketplace/.claude-plugin/marketplace.json +1 -1
  2. package/dist/claude-marketplace/plugins/wildo/.claude-plugin/plugin.json +1 -1
  3. package/dist/claude-marketplace/plugins/wildo/references/acceptance.md +11 -0
  4. package/dist/claude-marketplace/plugins/wildo/references/composites-and-the-loop.md +9 -2
  5. package/dist/claude-marketplace/plugins/wildo/references/creation-state.md +21 -0
  6. package/dist/claude-marketplace/plugins/wildo/references/derived-artifacts.md +121 -0
  7. package/dist/claude-marketplace/plugins/wildo/references/expert-personas-and-deliberations.md +26 -7
  8. package/dist/claude-marketplace/plugins/wildo/references/runs-judges-and-questions.md +31 -5
  9. package/dist/claude-marketplace/plugins/wildo/skills/accept/SKILL.md +4 -2
  10. package/dist/claude-marketplace/plugins/wildo/skills/answer/SKILL.md +29 -2
  11. package/dist/claude-marketplace/plugins/wildo/skills/build/SKILL.md +69 -24
  12. package/dist/claude-marketplace/plugins/wildo/skills/doctor/SKILL.md +10 -0
  13. package/dist/claude-marketplace/plugins/wildo/skills/run/SKILL.md +21 -5
  14. package/dist/claude-marketplace/plugins/wildo/skills/start/SKILL.md +31 -5
  15. package/dist/claude-marketplace/plugins/wildo/skills/status/SKILL.md +2 -0
  16. package/dist/claude-marketplace/plugins/wildo/skills/why/SKILL.md +20 -4
  17. package/dist/esm/framework-knowledge.definitions.d.ts +1 -1
  18. package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -1
  19. package/dist/esm/framework-knowledge.definitions.js +95 -5
  20. package/dist/esm/framework-knowledge.definitions.js.map +1 -1
  21. package/dist/esm/framework-knowledge.loader.d.ts.map +1 -1
  22. package/dist/esm/index.d.ts.map +1 -1
  23. package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts +2 -2
  24. package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts.map +1 -1
  25. package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js +2 -2
  26. package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js.map +1 -1
  27. package/dist/esm/playbooks/bottom_up.build/playbook.definition.d.ts +11 -11
  28. package/dist/esm/playbooks/bottom_up.build/playbook.definition.d.ts.map +1 -1
  29. package/dist/esm/playbooks/bottom_up.build/playbook.definition.js +29 -22
  30. package/dist/esm/playbooks/bottom_up.build/playbook.definition.js.map +1 -1
  31. package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +41 -3
  32. package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -1
  33. package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +175 -14
  34. package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -1
  35. package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts +1 -1
  36. package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -1
  37. package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js +3 -3
  38. package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js.map +1 -1
  39. package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts +1 -1
  40. package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js +1 -1
  41. package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js.map +1 -1
  42. package/dist/esm/playbooks/bottom_up.conception/playbook.definition.d.ts +8 -4
  43. package/dist/esm/playbooks/bottom_up.conception/playbook.definition.d.ts.map +1 -1
  44. package/dist/esm/playbooks/bottom_up.conception/playbook.definition.js +13 -6
  45. package/dist/esm/playbooks/bottom_up.conception/playbook.definition.js.map +1 -1
  46. package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +4 -2
  47. package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -1
  48. package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +90 -13
  49. package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -1
  50. package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.d.ts +4 -3
  51. package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.d.ts.map +1 -1
  52. package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.js +4 -3
  53. package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.js.map +1 -1
  54. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +8 -0
  55. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -1
  56. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +12 -4
  57. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -1
  58. package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +12 -3
  59. package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -1
  60. package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +8 -4
  61. package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -1
  62. package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.d.ts +4 -1
  63. package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.d.ts.map +1 -1
  64. package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.js +2 -1
  65. package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.js.map +1 -1
  66. package/dist/esm/playbooks/cross_cutting.application-creation/playbook.definition.d.ts.map +1 -1
  67. package/dist/esm/playbooks/cross_cutting.compliance/playbook.definition.d.ts.map +1 -1
  68. package/dist/esm/playbooks/cross_cutting.feature-development/playbook.definition.d.ts.map +1 -1
  69. package/dist/esm/playbooks/cross_cutting.refinement/playbook.definition.d.ts.map +1 -1
  70. package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -1
  71. package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +1 -1
  72. package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -1
  73. package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +13 -1
  74. package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -1
  75. package/dist/esm/playbooks/refinement.feature-contribution/playbook.definition.d.ts.map +1 -1
  76. package/dist/esm/playbooks/refinement.governance-document-candidate/playbook.definition.d.ts.map +1 -1
  77. package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +25 -27
  78. package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -1
  79. package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +91 -43
  80. package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -1
  81. package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.d.ts +41 -0
  82. package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.d.ts.map +1 -0
  83. package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.js +43 -0
  84. package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.js.map +1 -0
  85. package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.d.ts +200 -0
  86. package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.d.ts.map +1 -0
  87. package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.js +203 -0
  88. package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.js.map +1 -0
  89. package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.d.ts +81 -0
  90. package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.d.ts.map +1 -0
  91. package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.js +93 -0
  92. package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.js.map +1 -0
  93. package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts +3 -1
  94. package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -1
  95. package/dist/esm/playbooks/top_down.business-model/playbook.definition.js +27 -18
  96. package/dist/esm/playbooks/top_down.business-model/playbook.definition.js.map +1 -1
  97. package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -1
  98. package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.d.ts +11 -1
  99. package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.d.ts.map +1 -1
  100. package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.js +11 -11
  101. package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.js.map +1 -1
  102. package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.d.ts +2 -0
  103. package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.d.ts.map +1 -1
  104. package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.js +3 -1
  105. package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.js.map +1 -1
  106. package/dist/esm/playbooks/top_down.compliance-evidence-adequacy/playbook.definition.d.ts.map +1 -1
  107. package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts +2 -0
  108. package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -1
  109. package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js +3 -1
  110. package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js.map +1 -1
  111. package/dist/esm/playbooks/top_down.compliance-research/playbook.definition.d.ts.map +1 -1
  112. package/dist/esm/playbooks/top_down.definition/playbook.definition.d.ts +5 -2
  113. package/dist/esm/playbooks/top_down.definition/playbook.definition.d.ts.map +1 -1
  114. package/dist/esm/playbooks/top_down.definition/playbook.definition.js +16 -4
  115. package/dist/esm/playbooks/top_down.definition/playbook.definition.js.map +1 -1
  116. package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.d.ts +27 -6
  117. package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.d.ts.map +1 -1
  118. package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.js +32 -12
  119. package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.js.map +1 -1
  120. package/dist/esm/playbooks/top_down.feature-drafts/playbook.definition.d.ts.map +1 -1
  121. package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -1
  122. package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -1
  123. package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -1
  124. package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +2 -1
  125. package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -1
  126. package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +13 -5
  127. package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -1
  128. package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts +7 -3
  129. package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -1
  130. package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +71 -2
  131. package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -1
  132. package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +2 -1
  133. package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -1
  134. package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +23 -8
  135. package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -1
  136. package/dist/esm/playbooks/top_down.risk-register/playbook.definition.d.ts +7 -1
  137. package/dist/esm/playbooks/top_down.risk-register/playbook.definition.d.ts.map +1 -1
  138. package/dist/esm/playbooks/top_down.risk-register/playbook.definition.js +4 -2
  139. package/dist/esm/playbooks/top_down.risk-register/playbook.definition.js.map +1 -1
  140. package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts +9 -3
  141. package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -1
  142. package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js +3 -3
  143. package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js.map +1 -1
  144. package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -1
  145. package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts +35 -2
  146. package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -1
  147. package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +41 -17
  148. package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -1
  149. package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -1
  150. package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/external-framework-mapping.json +1 -1
  151. package/dist/knowledge/manifest.json +8 -8
  152. package/dist/knowledge/playbooks/bottom_up.assemble-verify/method.md +22 -7
  153. package/dist/knowledge/playbooks/bottom_up.assemble-verify/playbook.json +3 -3
  154. package/dist/knowledge/playbooks/bottom_up.build/method.md +17 -15
  155. package/dist/knowledge/playbooks/bottom_up.build/playbook.json +4 -3
  156. package/dist/knowledge/playbooks/bottom_up.build-decompose/evaluation-protocol.json +1 -1
  157. package/dist/knowledge/playbooks/bottom_up.build-decompose/evaluation-treatment.json +1 -1
  158. package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +261 -34
  159. package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +42 -4
  160. package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +188 -59
  161. package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +2 -2
  162. package/dist/knowledge/playbooks/bottom_up.build-scale/method.md +169 -276
  163. package/dist/knowledge/playbooks/bottom_up.build-scale/playbook.json +2 -2
  164. package/dist/knowledge/playbooks/bottom_up.capability-composition/method.md +8 -1
  165. package/dist/knowledge/playbooks/bottom_up.capability-composition/playbook.json +1 -1
  166. package/dist/knowledge/playbooks/bottom_up.conception/method.md +3 -2
  167. package/dist/knowledge/playbooks/bottom_up.conception/playbook.json +11 -3
  168. package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -1
  169. package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -1
  170. package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +129 -17
  171. package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +7 -4
  172. package/dist/knowledge/playbooks/bottom_up.experience-plan/method.md +28 -6
  173. package/dist/knowledge/playbooks/bottom_up.experience-plan/playbook.json +5 -4
  174. package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +13 -5
  175. package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +50 -0
  176. package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +16 -4
  177. package/dist/knowledge/playbooks/bottom_up.website-plan/method.md +19 -0
  178. package/dist/knowledge/playbooks/bottom_up.website-plan/playbook.json +5 -2
  179. package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +7 -3
  180. package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +1 -1
  181. package/dist/knowledge/playbooks/refinement.document-facts/method.md +8 -0
  182. package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +3 -2
  183. package/dist/knowledge/playbooks/refinement.feature-contribution/method.md +5 -2
  184. package/dist/knowledge/playbooks/refinement.feature-contribution/playbook.json +1 -1
  185. package/dist/knowledge/playbooks/top_down.brand-identity/evaluation-protocol.json +1 -1
  186. package/dist/knowledge/playbooks/top_down.brand-identity/evaluation-treatment.json +1 -1
  187. package/dist/knowledge/playbooks/top_down.brand-identity/method.md +75 -37
  188. package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +35 -38
  189. package/dist/knowledge/playbooks/top_down.brand-name-research/method.md +145 -0
  190. package/dist/knowledge/playbooks/top_down.brand-name-research/playbook.json +57 -0
  191. package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/evaluation-protocol.json +1 -0
  192. package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/evaluation-treatment.json +1 -0
  193. package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/method.md +99 -0
  194. package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/playbook.json +65 -0
  195. package/dist/knowledge/playbooks/top_down.brand-naming/method.md +56 -0
  196. package/dist/knowledge/playbooks/top_down.brand-naming/playbook.json +76 -0
  197. package/dist/knowledge/playbooks/top_down.business-model/evaluation-protocol.json +1 -1
  198. package/dist/knowledge/playbooks/top_down.business-model/evaluation-treatment.json +1 -1
  199. package/dist/knowledge/playbooks/top_down.business-model/method.md +60 -6
  200. package/dist/knowledge/playbooks/top_down.business-model/playbook.json +15 -10
  201. package/dist/knowledge/playbooks/top_down.capability-map/method.md +10 -9
  202. package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +1 -1
  203. package/dist/knowledge/playbooks/top_down.compliance-analysis/playbook.json +30 -10
  204. package/dist/knowledge/playbooks/top_down.compliance-conception/playbook.json +3 -1
  205. package/dist/knowledge/playbooks/top_down.compliance-posture/playbook.json +4 -1
  206. package/dist/knowledge/playbooks/top_down.definition/method.md +8 -3
  207. package/dist/knowledge/playbooks/top_down.definition/playbook.json +6 -4
  208. package/dist/knowledge/playbooks/top_down.expert-personas/playbook.json +16 -2
  209. package/dist/knowledge/playbooks/top_down.feature-drafts/method.md +5 -2
  210. package/dist/knowledge/playbooks/top_down.feature-drafts/playbook.json +1 -1
  211. package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -1
  212. package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -1
  213. package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +26 -0
  214. package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +4 -2
  215. package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -1
  216. package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -1
  217. package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +11 -1
  218. package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -1
  219. package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -1
  220. package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +84 -9
  221. package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +6 -3
  222. package/dist/knowledge/playbooks/top_down.risk-register/method.md +21 -0
  223. package/dist/knowledge/playbooks/top_down.risk-register/playbook.json +8 -2
  224. package/dist/knowledge/playbooks/top_down.scope-roadmap/playbook.json +4 -2
  225. package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +29 -0
  226. package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +58 -17
  227. package/dist/knowledge/references/brand.name-choice.config.md +144 -0
  228. package/dist/knowledge/references/brand.name-screening.config.md +308 -0
  229. package/dist/knowledge/references/build-plan.task-graph.config.md +119 -11
  230. package/dist/knowledge/references/business-model.pricing-plan.config.md +16 -0
  231. package/dist/knowledge/references/business-model.snapshot.config.md +64 -0
  232. package/dist/knowledge/references/business-model.snapshot.validation.md +68 -4
  233. package/dist/knowledge/references/capability-composition.config.md +67 -4
  234. package/dist/knowledge/references/companion.market.prompt-renderer.md +11 -6
  235. package/dist/knowledge/references/example.authorization.application-roles.office-and-field.md +44 -0
  236. package/dist/knowledge/references/example.backend.custom-operation.audit-event.md +81 -0
  237. package/dist/knowledge/references/example.backend.custom-operation.child-line-total.md +258 -0
  238. package/dist/knowledge/references/example.backend.custom-operation.computed-total.md +153 -0
  239. package/dist/knowledge/references/example.backend.custom-operation.create-related-resource.md +107 -0
  240. package/dist/knowledge/references/example.data-seeding.minimal.md +39 -10
  241. package/dist/knowledge/references/example.data-seeding.row-reference.md +80 -0
  242. package/dist/knowledge/references/example.email.template.minimal.md +1 -1
  243. package/dist/knowledge/references/example.resource.config-wiring.retention-policy-operations.md +74 -0
  244. package/dist/knowledge/references/example.resource.personal-data.free-text-field.md +19 -0
  245. package/dist/knowledge/references/example.resource.personal-data.person-without-account.md +27 -0
  246. package/dist/knowledge/references/example.resource.status-lifecycle.quote.md +152 -0
  247. package/dist/knowledge/references/example.resource.ui-behavior.filter-presets.md +15 -0
  248. package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +8 -0
  249. package/dist/knowledge/references/example.views.app-level.home-definition.md +13 -0
  250. package/dist/knowledge/references/example.views.chart-definition.shared.md +83 -0
  251. package/dist/knowledge/references/experience-plan.config.md +60 -7
  252. package/dist/knowledge/references/market.context-block.builder.md +1 -1
  253. package/dist/knowledge/references/market.snapshot.validation.md +1 -1
  254. package/dist/knowledge/references/placement-plan.config.md +43 -0
  255. package/dist/knowledge/references/requirements.functional-requirement.config.md +8 -2
  256. package/dist/knowledge/references/requirements.non-functional-requirement.config.md +2 -0
  257. package/dist/knowledge/references/requirements.references.conventions.md +1 -1
  258. package/dist/knowledge/references/requirements.snapshot.config.md +57 -1
  259. package/dist/knowledge/references/requirements.snapshot.validation.md +35 -1
  260. package/dist/knowledge/references/saas.backend.audit-logs.log-event.md +63 -0
  261. package/dist/knowledge/references/saas.backend.document-sequence.issue-in-operation.md +60 -0
  262. package/dist/knowledge/references/saas.backend.document-sequence.raise-floor.md +156 -0
  263. package/dist/knowledge/references/saas.backend.email.send.md +77 -0
  264. package/dist/knowledge/references/saas.backend.notifications.operation-email-template-ref.md +60 -0
  265. package/dist/knowledge/references/saas.data-seeding.bootstrap-wiring.md +7 -1
  266. package/dist/knowledge/references/saas.data-seeding.computed-entry.md +43 -0
  267. package/dist/knowledge/references/saas.data-seeding.definition-input.md +14 -2
  268. package/dist/knowledge/references/saas.data-seeding.row-reference.md +93 -0
  269. package/dist/knowledge/references/saas.frontend.collection-filter-presets.md +124 -0
  270. package/dist/knowledge/references/saas.frontend.launcher.item-refs.md +316 -0
  271. package/dist/knowledge/references/saas.frontend.launcher.merge-rules.md +106 -0
  272. package/dist/knowledge/references/saas.frontend.launcher.runtime-availability.md +60 -0
  273. package/dist/knowledge/references/saas.frontend.resource-label-params.md +52 -0
  274. package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +47 -18
  275. package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +4 -1
  276. package/dist/knowledge/references/saas.frontend.settings-hub.engine-destination-roles.md +25 -0
  277. package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +2 -2
  278. package/dist/knowledge/references/saas.models.audit.trail-config.md +45 -0
  279. package/dist/knowledge/references/saas.models.notifications.user-notification-definition.md +5 -3
  280. package/dist/knowledge/references/saas.models.queue.scheduled-recovery.md +81 -2
  281. package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +26 -0
  282. package/dist/knowledge/references/saas.models.roles.definition.md +61 -0
  283. package/dist/knowledge/references/saas.models.roles.organization-defaults.md +97 -0
  284. package/dist/knowledge/references/saas.public-runtime.contract.md +26 -0
  285. package/dist/knowledge/references/saas.specifications.companion-exports.contract.md +10 -0
  286. package/dist/knowledge/references/saas.website.astro.bridge.md +10 -0
  287. package/dist/knowledge/references/saas.website.astro.label-loader.md +12 -0
  288. package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +14 -1
  289. package/dist/knowledge/references/saas.website.astro.site-context.md +13 -0
  290. package/dist/knowledge/references/saas.website.blog.bridge.md +4 -0
  291. package/dist/knowledge/references/saas.website.config.site-context-loader.md +3 -0
  292. package/dist/knowledge/references/saas.website.factories.define-section.md +4 -0
  293. package/dist/knowledge/references/saas.website.legal.public-document-links.md +76 -0
  294. package/dist/knowledge/references/saas.website.page-manifest.schema.md +12 -3
  295. package/dist/knowledge/references/saas.website.page-sections.component.md +72 -0
  296. package/dist/knowledge/references/saas.website.root-config.seo.md +2 -1
  297. package/dist/knowledge/references/saas.website.runtime.context.md +7 -0
  298. package/dist/knowledge/references/saas.website.sections.definition-schema.md +11 -0
  299. package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +2 -0
  300. package/dist/knowledge/references/website-plan.config.md +26 -0
  301. package/dist/knowledge/references/zod.decorators.chainable-runtime.md +13 -0
  302. package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +7 -0
  303. package/dist/knowledge/references/zod.decorators.document-sequence.md +65 -0
  304. package/dist/knowledge/references/zod.decorators.schema-metadata.md +1 -0
  305. package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +21 -0
  306. package/dist/knowledge/references/zod.factories.bigdecimal.md +1 -0
  307. package/dist/knowledge/references/zod.factories.code.md +1 -0
  308. package/dist/knowledge/references/zod.factories.duration.md +1 -0
  309. package/dist/knowledge/references/zod.factories.money.md +1 -0
  310. package/dist/knowledge/registries/assurance-authority-bases.json +1 -1
  311. package/dist/knowledge/registries/framework-topics.json +374 -1
  312. package/dist/knowledge/registries/playbooks.json +76 -28
  313. package/dist/knowledge/registries/source-tags.json +1513 -898
  314. package/dist/knowledge/rules/live-context-door.md +5 -2
  315. package/dist/knowledge/skills/INDEX.md +5 -2
  316. package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +16 -3
  317. package/dist/knowledge/skills/application-database-migrations/SKILL.md +14 -3
  318. package/dist/knowledge/skills/application-roles-authoring/SKILL.md +158 -0
  319. package/dist/knowledge/skills/application-roles-authoring/references/framework-application-roles-api.md +169 -0
  320. package/dist/knowledge/skills/application-roles-authoring/references/office-and-field-worked-example.md +63 -0
  321. package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +6 -1
  322. package/dist/knowledge/skills/backend-custom-operation/SKILL.md +256 -9
  323. package/dist/knowledge/skills/backend-custom-operation/references/after-the-operation.md +42 -0
  324. package/dist/knowledge/skills/backend-custom-operation/references/framework-audit-log-event-api.md +220 -0
  325. package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +5 -0
  326. package/dist/knowledge/skills/brand-name-screening/SKILL.md +178 -0
  327. package/dist/knowledge/skills/brand-name-screening/references/framework-brand-name-screening-api.md +466 -0
  328. package/dist/knowledge/skills/brand-name-screening/references/screening-procedure.md +87 -0
  329. package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +7 -3
  330. package/dist/knowledge/skills/config-app-shell/SKILL.md +58 -5
  331. package/dist/knowledge/skills/config-app-shell/references/framework-launcher-items-api.md +461 -0
  332. package/dist/knowledge/skills/config-app-shell/references/framework-launcher-visibility-api.md +80 -0
  333. package/dist/knowledge/skills/config-design-system/SKILL.md +28 -6
  334. package/dist/knowledge/skills/config-navigation/SKILL.md +14 -3
  335. package/dist/knowledge/skills/config-saas/SKILL.md +56 -15
  336. package/dist/knowledge/skills/config-saas/references/compliance-declarations.md +65 -2
  337. package/dist/knowledge/skills/config-saas/references/framework-audit-trail-config-api.md +62 -2
  338. package/dist/knowledge/skills/config-saas/references/framework-background-work-api.md +81 -2
  339. package/dist/knowledge/skills/config-saas-backend/SKILL.md +6 -1
  340. package/dist/knowledge/skills/configure-billing/SKILL.md +18 -4
  341. package/dist/knowledge/skills/email-add-template/SKILL.md +28 -6
  342. package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +1 -1
  343. package/dist/knowledge/skills/email-add-template/references/framework-email-send-api.md +128 -0
  344. package/dist/knowledge/skills/email-add-template/references/framework-operation-email-template-ref-api.md +99 -0
  345. package/dist/knowledge/skills/engine-component-registration/SKILL.md +6 -1
  346. package/dist/knowledge/skills/engine-product-definitions/SKILL.md +21 -8
  347. package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +10 -2
  348. package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +18 -4
  349. package/dist/knowledge/skills/frontend-component-catalog/SKILL.md +11 -3
  350. package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-catalog.md +2 -1
  351. package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-usage.md +8 -0
  352. package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +19 -5
  353. package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +10 -2
  354. package/dist/knowledge/skills/inbound-channels/SKILL.md +2 -2
  355. package/dist/knowledge/skills/infra-environment-config/SKILL.md +6 -1
  356. package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +17 -2
  357. package/dist/knowledge/skills/local-environment-bootstrap/references/derived-artifact-currency.md +122 -0
  358. package/dist/knowledge/skills/local-environment-bootstrap/references/framework-upgrade-and-dependency-alignment.md +11 -0
  359. package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +9 -2
  360. package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +10 -2
  361. package/dist/knowledge/skills/market-alternatives/SKILL.md +10 -2
  362. package/dist/knowledge/skills/market-authoring-overview/SKILL.md +10 -2
  363. package/dist/knowledge/skills/market-category/SKILL.md +21 -7
  364. package/dist/knowledge/skills/market-channels/SKILL.md +6 -1
  365. package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +22 -4
  366. package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +12 -2
  367. package/dist/knowledge/skills/market-generation-cli/SKILL.md +21 -11
  368. package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +11 -6
  369. package/dist/knowledge/skills/market-icp/SKILL.md +10 -2
  370. package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +6 -1
  371. package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +6 -1
  372. package/dist/knowledge/skills/market-message-templates-authoring/references/framework-message-template-api.md +1 -1
  373. package/dist/knowledge/skills/market-persona/SKILL.md +14 -3
  374. package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +6 -1
  375. package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +10 -2
  376. package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +6 -1
  377. package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +15 -4
  378. package/dist/knowledge/skills/market-snapshot-validation/references/framework-snapshot-validation-api.md +1 -1
  379. package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +6 -1
  380. package/dist/knowledge/skills/model-cost-attribution/references/framework-work-unit-api.md +26 -0
  381. package/dist/knowledge/skills/module-companion-exports/SKILL.md +7 -1
  382. package/dist/knowledge/skills/module-companion-exports/references/companion-exports-by-package.md +10 -0
  383. package/dist/knowledge/skills/module-relationships/SKILL.md +37 -8
  384. package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +4 -2
  385. package/dist/knowledge/skills/provider-address-lookup/SKILL.md +14 -3
  386. package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +6 -1
  387. package/dist/knowledge/skills/provider-operation-calls/SKILL.md +14 -3
  388. package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +10 -2
  389. package/dist/knowledge/skills/resource-add-field/SKILL.md +10 -2
  390. package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +46 -17
  391. package/dist/knowledge/skills/resource-add-resource/SKILL.md +14 -2
  392. package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +26 -0
  393. package/dist/knowledge/skills/resource-config-wiring/SKILL.md +29 -3
  394. package/dist/knowledge/skills/resource-config-wiring/references/framework-collection-operation-declarations.md +19 -4
  395. package/dist/knowledge/skills/resource-config-wiring/references/framework-operation-audit-api.md +5 -2
  396. package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +103 -0
  397. package/dist/knowledge/skills/resource-config-wiring/references/framework-retention-policy-operations.md +135 -0
  398. package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +26 -0
  399. package/dist/knowledge/skills/resource-config-wiring/references/framework-user-notifications-api.md +26 -7
  400. package/dist/knowledge/skills/resource-custom-view/SKILL.md +10 -2
  401. package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +46 -17
  402. package/dist/knowledge/skills/resource-external-data/references/erasure-suppression.md +2 -2
  403. package/dist/knowledge/skills/resource-retention-binding/SKILL.md +5 -1
  404. package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +15 -1
  405. package/dist/knowledge/skills/resource-schema-authoring/references/computed-totals.md +569 -0
  406. package/dist/knowledge/skills/resource-schema-authoring/references/document-numbers.md +358 -0
  407. package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +8 -0
  408. package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +21 -0
  409. package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +7 -2
  410. package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +13 -0
  411. package/dist/knowledge/skills/resource-status-lifecycle/SKILL.md +153 -0
  412. package/dist/knowledge/skills/resource-status-lifecycle/references/commercial-documents.md +46 -0
  413. package/dist/knowledge/skills/resource-status-lifecycle/references/quote-lifecycle-worked-example.md +198 -0
  414. package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +30 -4
  415. package/dist/knowledge/skills/resource-ui-behavior/references/framework-collection-filter-presets-api.md +157 -0
  416. package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +101 -19
  417. package/dist/knowledge/skills/seeding-authoring/SKILL.md +202 -39
  418. package/dist/knowledge/skills/seeding-authoring/references/cross-seed-row-references.md +67 -0
  419. package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +154 -4
  420. package/dist/knowledge/skills/seeding-authoring/references/seed-row-overlay.md +22 -0
  421. package/dist/knowledge/skills/seeding-operations/references/framework-data-seeding-operations-api.md +7 -1
  422. package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +43 -0
  423. package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +2 -2
  424. package/dist/knowledge/skills/spec-companion-exports/SKILL.md +6 -1
  425. package/dist/knowledge/skills/spec-companion-exports/references/framework-companion-exports-contract-api.md +10 -0
  426. package/dist/knowledge/skills/spec-component-update/SKILL.md +10 -2
  427. package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +2 -2
  428. package/dist/knowledge/skills/spec-family-update/SKILL.md +71 -66
  429. package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +1 -1
  430. package/dist/knowledge/skills/spec-resource-update/SKILL.md +30 -10
  431. package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +28 -0
  432. package/dist/knowledge/skills/spec-update-after-change/SKILL.md +22 -5
  433. package/dist/knowledge/skills/views-add-composite-view/SKILL.md +6 -1
  434. package/dist/knowledge/skills/views-add-custom-view/SKILL.md +10 -2
  435. package/dist/knowledge/skills/views-app-level/SKILL.md +13 -3
  436. package/dist/knowledge/skills/views-app-level/references/application-home.md +56 -0
  437. package/dist/knowledge/skills/views-chart-authoring/SKILL.md +221 -37
  438. package/dist/knowledge/skills/views-composite-authoring/SKILL.md +22 -5
  439. package/dist/knowledge/skills/views-execution-authoring/SKILL.md +1 -1
  440. package/dist/knowledge/skills/website-anonymous-session/SKILL.md +32 -2
  441. package/dist/knowledge/skills/website-blog-authoring/SKILL.md +16 -3
  442. package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +4 -0
  443. package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +7 -1
  444. package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +13 -1
  445. package/dist/knowledge/skills/website-factory-advanced/SKILL.md +14 -2
  446. package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +13 -1
  447. package/dist/knowledge/skills/website-layout-overrides/SKILL.md +6 -1
  448. package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +19 -1
  449. package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +55 -18
  450. package/dist/knowledge/skills/website-navigation-authoring/references/framework-public-document-links-api.md +98 -0
  451. package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +8 -11
  452. package/dist/knowledge/skills/website-page-authoring/SKILL.md +100 -8
  453. package/dist/knowledge/skills/website-page-authoring/references/framework-site-context-loader-api.md +3 -0
  454. package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +6 -1
  455. package/dist/knowledge/skills/website-section-contact/SKILL.md +15 -0
  456. package/dist/knowledge/skills/website-section-contact/references/define-website-section-api.md +15 -0
  457. package/dist/knowledge/skills/website-section-cta/SKILL.md +15 -0
  458. package/dist/knowledge/skills/website-section-cta/references/define-website-section-api.md +15 -0
  459. package/dist/knowledge/skills/website-section-faq/SKILL.md +21 -1
  460. package/dist/knowledge/skills/website-section-faq/references/define-website-section-api.md +15 -0
  461. package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +21 -1
  462. package/dist/knowledge/skills/website-section-feature-benefit-summary/references/define-website-section-api.md +15 -0
  463. package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +25 -2
  464. package/dist/knowledge/skills/website-section-feature-detail/references/define-website-section-api.md +15 -0
  465. package/dist/knowledge/skills/website-section-footer-cta/SKILL.md +15 -0
  466. package/dist/knowledge/skills/website-section-footer-cta/references/define-website-section-api.md +15 -0
  467. package/dist/knowledge/skills/website-section-hero/SKILL.md +33 -10
  468. package/dist/knowledge/skills/website-section-hero/references/define-website-section-api.md +15 -0
  469. package/dist/knowledge/skills/website-section-pricing/SKILL.md +21 -1
  470. package/dist/knowledge/skills/website-section-pricing/references/define-website-section-api.md +15 -0
  471. package/dist/knowledge/skills/website-section-social-proof/SKILL.md +27 -2
  472. package/dist/knowledge/skills/website-section-social-proof/references/define-website-section-api.md +15 -0
  473. package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +16 -4
  474. package/dist/knowledge/skills/website-seo-aeo-geo/references/aeo-api.md +11 -0
  475. package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +16 -1
  476. package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +2 -1
  477. package/dist/knowledge/topic-index.json +1590 -292
  478. package/dist/tsconfig.build.tsbuildinfo +1 -1
  479. package/dist/tsconfig.tsbuildinfo +1 -1
  480. package/package.json +4 -4
@@ -0,0 +1,153 @@
1
+ # example.backend.custom-operation.computed-total
2
+
3
+
4
+ ## Usage Example
5
+
6
+ ```typescript
7
+ import { CoreResourceOperation, ErrorCustomMessageReference, ErrorType, ResourceOperationVariantType } from '@wildo-ai/saas-models';
8
+ import {
9
+ currencyMinorUnitDecimals,
10
+ MoneyMinorUnitConversionError,
11
+ MoneyMinorUnitConversionFailure,
12
+ toCurrencyMinorUnitAmountOrThrow,
13
+ type MoneyValue,
14
+ } from '@wildo-ai/zod-decorators';
15
+ import {
16
+ createResourceCustomServiceImplementation,
17
+ type ResourceCustomServiceImplementationFactory,
18
+ type ResourcesRegistryBackendService,
19
+ } from '@wildo-ai/saas-backend-lib';
20
+
21
+ /** In an application this comes from its shared-lib. */
22
+ enum Sales_ResourceType {
23
+ QUOTES = 'quotes',
24
+ }
25
+
26
+ /**
27
+ * A quote line as the schema declares it: `lines: z.array(z.object({ description, quantity: z.number().int().min(1),
28
+ * unitPrice: z_money() }))`. Whole quantities only: for hours or metres, price per smallest unit you sell (a quarter
29
+ * hour, a centimetre) so the product stays an integer, instead of rounding here.
30
+ */
31
+ export interface QuoteLine {
32
+ readonly description: string;
33
+ readonly quantity: number;
34
+ readonly unitPrice: MoneyValue;
35
+ }
36
+
37
+ /** Why a total cannot be computed honestly. Each is a different fix for the person who sent the quote. */
38
+ export enum QuoteTotalRefusal {
39
+ /** A line is priced in another currency than the quote's: a sum across currencies is not a total. */
40
+ LINE_CURRENCY_DIFFERS = 'line_currency_differs_from_quote',
41
+ /** The quote's currency has no minor unit this framework resolves (`XXX`, `XDR`). */
42
+ CURRENCY_HAS_NO_MINOR_UNIT = 'currency_has_no_minor_unit',
43
+ /** A unit price is authored more finely than the currency allows (1.005 EUR): rounding it would invent money. */
44
+ PRICE_FINER_THAN_CURRENCY = 'price_finer_than_currency',
45
+ /** A unit price is too large to convert exactly at the currency's scale. */
46
+ PRICE_TOO_LARGE = 'price_too_large',
47
+ /** A quantity is not a whole number of at least 1. */
48
+ QUANTITY_NOT_WHOLE = 'quantity_not_whole',
49
+ /** The discount is outside 0–100 %. */
50
+ DISCOUNT_OUT_OF_RANGE = 'discount_out_of_range',
51
+ }
52
+
53
+ /**
54
+ * The quote's total in the quote's own currency, at that currency's scale.
55
+ *
56
+ * A `MoneyValue` carries its own AUTHORED scale (`decimals`), which need not be the currency's: `1005n` with 3
57
+ * decimals is 1.005. So every line is first converted exactly to the currency's scale, and refused when that would
58
+ * lose a fraction; only then are amounts summed, all in `bigint`, with nothing rounded until the discount.
59
+ */
60
+ export function computeQuoteTotal(
61
+ lines: readonly QuoteLine[],
62
+ discountPercent: number,
63
+ currency: string,
64
+ ): { readonly total: MoneyValue } | { readonly refusal: QuoteTotalRefusal } {
65
+ const decimals = currencyMinorUnitDecimals(currency);
66
+ if (decimals === undefined) return { refusal: QuoteTotalRefusal.CURRENCY_HAS_NO_MINOR_UNIT };
67
+ if (!(discountPercent >= 0 && discountPercent <= 100)) return { refusal: QuoteTotalRefusal.DISCOUNT_OUT_OF_RANGE };
68
+ let gross = 0n;
69
+ for (const line of lines) {
70
+ if (line.unitPrice.currency !== currency) return { refusal: QuoteTotalRefusal.LINE_CURRENCY_DIFFERS };
71
+ // The schema says `.int().min(1)`, but a total must not trust that every caller went through it.
72
+ if (!Number.isSafeInteger(line.quantity) || line.quantity < 1) return { refusal: QuoteTotalRefusal.QUANTITY_NOT_WHOLE };
73
+ try {
74
+ gross += BigInt(toCurrencyMinorUnitAmountOrThrow(line.unitPrice, 'a quote line price')) * BigInt(line.quantity);
75
+ } catch (error) {
76
+ if (!(error instanceof MoneyMinorUnitConversionError)) throw error;
77
+ // Each reason is a different fix, so each gets its own refusal.
78
+ switch (error.reason) {
79
+ case MoneyMinorUnitConversionFailure.PRECISION_LOSS:
80
+ return { refusal: QuoteTotalRefusal.PRICE_FINER_THAN_CURRENCY };
81
+ case MoneyMinorUnitConversionFailure.UNSAFE_MAGNITUDE:
82
+ return { refusal: QuoteTotalRefusal.PRICE_TOO_LARGE };
83
+ case MoneyMinorUnitConversionFailure.UNKNOWN_MINOR_UNIT:
84
+ return { refusal: QuoteTotalRefusal.CURRENCY_HAS_NO_MINOR_UNIT };
85
+ }
86
+ // A reason added later must not fall through and silently leave this line out of the total.
87
+ throw error;
88
+ }
89
+ }
90
+ // Basis points keep the discount in integers, floored so a discount never exceeds what was declared (10.006 % is
91
+ // 1000 bp); the division then drops the discount's fraction of the smallest unit for the same reason.
92
+ const basisPoints = BigInt(Math.floor(discountPercent * 100));
93
+ const net = gross - (gross * basisPoints) / 10_000n;
94
+ return { total: { amount: net, currency, decimals } };
95
+ }
96
+
97
+ /**
98
+ * The same prefix on every operation that can change a line, the discount or the currency: CREATE and UPDATE, and
99
+ * their bulk companions if the resource offers them (a bulk operation is a separate registration). In an application
100
+ * each is its own `quotes.<operation>.<variant>.operation.ts` whose DEFAULT export is the factory, which is what the
101
+ * scanner registers. The schema marks `total` `.excludeFromCreate().excludeFromUpdate()`, so a client can never send
102
+ * it. `authoritativeFields: ['total']` keeps the prefix's value when a caller reaches the service with `total` already
103
+ * in its payload (an MCP tool, another service), where the strict re-parse would otherwise drop it.
104
+ *
105
+ * `transactionalCore: true` makes the prefix read the stored row inside the write's transaction, with its write lock,
106
+ * so two partial UPDATEs arriving together (one editing lines, one the discount) never both commit a total computed from
107
+ * the row before the other: PostgreSQL makes the second wait and re-read, MongoDB aborts it with a write conflict.
108
+ */
109
+ function quotesTotalCustomImpl(operationIdentifier: CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE): ResourceCustomServiceImplementationFactory {
110
+ return (resourcesRegistryService: ResourcesRegistryBackendService) => {
111
+ const operationPath = {
112
+ resourceIdentifier: Sales_ResourceType.QUOTES,
113
+ operationIdentifier,
114
+ variantType: ResourceOperationVariantType.API_CALL,
115
+ isOperationDefault: true,
116
+ };
117
+ const requestDtoSchema = resourcesRegistryService.getRequestDtoFromPath(operationPath);
118
+ const responseDtoSchema = resourcesRegistryService.getResponseDtoFromPath(operationPath);
119
+
120
+ return createResourceCustomServiceImplementation<typeof requestDtoSchema, typeof responseDtoSchema>({
121
+ operationPath,
122
+ requestDtoSchema,
123
+ responseDtoSchema,
124
+ authoritativeFields: ['total'],
125
+ transactionalCore: true,
126
+ transactionParticipants: {},
127
+ handlers: {
128
+ prefixCoreOperations: async (_id, input, executionContext, _operationPath, utils) => {
129
+ // An UPDATE may carry only the discount, or only the lines: merge with the stored row before computing.
130
+ const request = input as { lines?: QuoteLine[]; discountPercent?: number; currency?: string };
131
+ const stored = (utils.currentObject ?? {}) as { lines?: QuoteLine[]; discountPercent?: number; currency?: string };
132
+ const total = computeQuoteTotal(
133
+ request.lines ?? stored.lines ?? [],
134
+ request.discountPercent ?? stored.discountPercent ?? 0,
135
+ // `currency` is a required field of the quote (`CurrencySchema`), so one of the two is always present.
136
+ (request.currency ?? stored.currency) as string,
137
+ );
138
+ if ('refusal' in total) {
139
+ throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {
140
+ customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,
141
+ context: { field: 'total', reason: total.refusal },
142
+ });
143
+ }
144
+ return { ...request, total: total.total } as typeof input;
145
+ },
146
+ },
147
+ });
148
+ };
149
+ }
150
+
151
+ export const quotesCreateTotal: ResourceCustomServiceImplementationFactory = quotesTotalCustomImpl(CoreResourceOperation.CREATE);
152
+ export const quotesUpdateTotal: ResourceCustomServiceImplementationFactory = quotesTotalCustomImpl(CoreResourceOperation.UPDATE);
153
+ ```
@@ -0,0 +1,107 @@
1
+ # example.backend.custom-operation.create-related-resource
2
+
3
+
4
+ ## Usage Example
5
+
6
+ ```typescript
7
+ /**
8
+ * `quick-add` — capture a todo from anywhere, into the organization's inbox unless a list is named.
9
+ *
10
+ * ## What PREFIX decides
11
+ *
12
+ * The one thing the caller did not: which list the todo belongs to. A request that names a list keeps
13
+ * it, and the core CREATE's own write-integrity guard checks that list exists in this organization,
14
+ * exactly as it does for the ordinary CREATE. A request that names none is given the inbox — the list
15
+ * whose `slug` is {@link TODOS_QUICK_ADD_INBOX_LIST_SLUG} — which is created the first time an
16
+ * organization captures into it.
17
+ *
18
+ * ## The inbox is found by slug whatever its status
19
+ *
20
+ * An ARCHIVED inbox is still the inbox: `slug` is unique per organization regardless of status, so
21
+ * creating a second one beside it would be refused by the same unique index that guarantees there is
22
+ * only one. The capture therefore lands there and the organization, which archived it, restores it
23
+ * when it wants its backlog back. The todo itself is created, reachable and counted either way.
24
+ *
25
+ * ## Atomicity and the first-capture race
26
+ *
27
+ * `transactionalCore` makes the inbox creation and the todo one boundary: a capture that fails leaves
28
+ * no empty inbox behind. Two first captures in the same organization at the same instant both see no
29
+ * inbox and both create one; the unique `slug` index refuses the loser, and the conflict resolver
30
+ * spends the framework's single bounded retry — on which the loser finds the winner's inbox and
31
+ * files its todo there. A second conflict is not retried again: the resolver is only asked once.
32
+ */
33
+ const todosQuickAddCustomImpl: ResourceCustomServiceImplementationFactory = (
34
+ resourcesRegistryService: ResourcesRegistryBackendService,
35
+ ) => {
36
+ const operationPath = {
37
+ resourceIdentifier: TasksManager_ResourceType.TODOS,
38
+ operationIdentifier: Todos_Operations.QUICK_ADD,
39
+ variantType: ResourceOperationVariantType.API_CALL,
40
+ isOperationDefault: true,
41
+ };
42
+ const requestDtoSchema = resourcesRegistryService.getRequestDtoFromPath(operationPath);
43
+ const responseDtoSchema = resourcesRegistryService.getResponseDtoFromPath(operationPath);
44
+
45
+ return createResourceCustomServiceImplementation<typeof requestDtoSchema, typeof responseDtoSchema>({
46
+ operationPath,
47
+ requestDtoSchema,
48
+ responseDtoSchema,
49
+ transactionalCore: true,
50
+ // `todos` is included automatically as the operation's own resource; the inbox lookup and its
51
+ // first-use creation are the one additional resource these phases touch.
52
+ transactionParticipants: {
53
+ inboxList: TasksManager_ResourceType.TODO_LISTS,
54
+ },
55
+ // The only unique constraint this boundary can trip is the inbox's per-organization `slug`, and
56
+ // the retry is what resolves it (see the class comment). A todo has no unique field of its own.
57
+ transactionalCoreConflictResolver: async () => ({
58
+ action: ResourceCustomServiceImplementationTransactionalCoreConflictAction.RETRY_TRANSACTION,
59
+ }),
60
+ handlers: {
61
+ prefixCoreOperations: async (_id, input, executionContext, _operationPath, utils) => {
62
+ const capture = input as Todos_QuickAddRequest;
63
+ if (capture.todoListId) {
64
+ return input;
65
+ }
66
+
67
+ // Scoped to the caller's organization by the sub-call context, so this can only ever find
68
+ // THIS organization's inbox. Every nested call forwards the operation's options, or it would
69
+ // read and write outside the transaction it belongs to.
70
+ const listed = await utils.servicesRegistry.list<TodoLists>(
71
+ TasksManager_ResourceType.TODO_LISTS,
72
+ await utils.executionContextCreator.createForSubCall(
73
+ executionContext,
74
+ TasksManager_ResourceType.TODO_LISTS,
75
+ CoreResourceOperation.LIST,
76
+ utils.serviceOptions,
77
+ ),
78
+ { slug: TODOS_QUICK_ADD_INBOX_LIST_SLUG },
79
+ undefined,
80
+ utils.serviceOptions,
81
+ );
82
+ const existingInbox = (Array.isArray(listed) ? listed : (listed?.data ?? []))[0];
83
+
84
+ const inbox = existingInbox ?? await utils.servicesRegistry.create<TodoLists>(
85
+ TasksManager_ResourceType.TODO_LISTS,
86
+ await utils.executionContextCreator.createForSubCall(
87
+ executionContext,
88
+ TasksManager_ResourceType.TODO_LISTS,
89
+ CoreResourceOperation.CREATE,
90
+ utils.serviceOptions,
91
+ ),
92
+ { name: TODOS_QUICK_ADD_INBOX_LIST_NAME, slug: TODOS_QUICK_ADD_INBOX_LIST_SLUG },
93
+ utils.serviceOptions,
94
+ );
95
+
96
+ if (!existingInbox) {
97
+ utils.logger.info('Created the organization inbox list for a quick-add capture', { todoListId: inbox._id });
98
+ }
99
+
100
+ return { ...capture, todoListId: inbox._id };
101
+ },
102
+ },
103
+ });
104
+ };
105
+
106
+ export default todosQuickAddCustomImpl;
107
+ ```
@@ -4,13 +4,15 @@
4
4
  ## Usage Example
5
5
 
6
6
  ```typescript
7
+ import { RuntimeEnvironment } from '@wildo-ai/saas-models';
7
8
  import {
8
9
  createDataSeedDefinition,
10
+ DataSeedExistingRowTreatment,
9
11
  DataSeedMode,
10
12
  DataSeedResourceLifecyclePhase,
11
13
  DataSeedScopeKind,
12
14
  DataSeedTriggerKind,
13
- } from '~wildo-backend-lib/data-seeding/models/data-seed.shared.schemas';
15
+ } from '@wildo-ai/saas-backend-lib/data-seeding-models';
14
16
 
15
17
  // ─────────────────────────────────────────────────────────────────────
16
18
  // Level-A example — UPGRADE on app version upgrade.
@@ -68,7 +70,11 @@ const systemEmailTemplatesSeed = createDataSeedDefinition({
68
70
  // Level-B example — ADDITIVE on Organization afterCreate.
69
71
  // "When an Organization is created, spawn its default Workspace once."
70
72
  // Computed `entry` lets the seed read the triggering row's `_id` and
71
- // the audit `triggeredByUserId` for attribution. ADDITIVE is safe to
73
+ // the audit `triggeredByUserId` for attribution. The organization's id
74
+ // goes in the BUSINESS KEY: every organization has its own default
75
+ // workspace, so the organization is part of that row's identity (a key
76
+ // of `workspaceKey` alone would make every organization share one row).
77
+ // ADDITIVE is safe to
72
78
  // re-run: the dispatcher inspects `DataSeedRun` keyed on
73
79
  // `(seedKey, scopeKind, relatedId)` and skips on COMPLETED.
74
80
  //
@@ -80,15 +86,12 @@ const systemEmailTemplatesSeed = createDataSeedDefinition({
80
86
  // ─────────────────────────────────────────────────────────────────────
81
87
  const organizationDefaultWorkspaceSeed = createDataSeedDefinition({
82
88
  seedKey: 'tasks-manager:org-default-workspace',
83
- scope: {
84
- kind: DataSeedScopeKind.CUSTOM,
85
- relatedResourceType: 'organization',
86
- },
89
+ scope: { kind: DataSeedScopeKind.ORGANIZATION },
87
90
  resourceType: 'workspace',
88
91
  triggers: [
89
92
  {
90
93
  triggerKind: DataSeedTriggerKind.RESOURCE_LIFECYCLE,
91
- resourceType: 'organization',
94
+ resourceType: 'organizations',
92
95
  phase: DataSeedResourceLifecyclePhase.AFTER_CREATE,
93
96
  },
94
97
  ],
@@ -101,14 +104,40 @@ const organizationDefaultWorkspaceSeed = createDataSeedDefinition({
101
104
  // DOES project through it, and rejects an empty list) or `SYNC`. See
102
105
  // the `DataSeedMode` JSDoc for the full mode-by-mode contract.
103
106
  entry: ({ triggeringRow, executionContext }) => ({
104
- businessKey: { workspaceKey: 'default' },
107
+ // The workspace resource declares `businessKeySet(['organizationId', 'workspaceKey'])`.
108
+ businessKey: { organizationId: triggeringRow?._id, workspaceKey: 'default' },
105
109
  data: {
106
- organizationId: triggeringRow?._id,
107
110
  name: 'My Workspace',
108
111
  ownerId: executionContext.triggeredByUserId,
109
112
  },
110
113
  }),
111
114
  });
112
115
 
113
- export { organizationDefaultWorkspaceSeed, systemEmailTemplatesSeed };
116
+ // ─────────────────────────────────────────────────────────────────────
117
+ // Demonstration data — sample rows that make a freshly created application
118
+ // look lived-in, kept OUT of production by `allowedApplicationEnvironments`.
119
+ // Without it these customers would be inserted beside real ones the first
120
+ // time the application starts in production. A restricted seed is withheld
121
+ // at registration, so no trigger, schedule or manual run can reach it there.
122
+ //
123
+ // `FILL_MISSING_DEFAULTS`: a person edits demo rows while trying the app, and
124
+ // the default treatment would re-stamp the declared payload over their edits
125
+ // on every pass.
126
+ // ─────────────────────────────────────────────────────────────────────
127
+ const demoCustomersSeed = createDataSeedDefinition({
128
+ seedKey: 'crm:demo-customers',
129
+ scope: { kind: DataSeedScopeKind.APPLICATION },
130
+ resourceType: 'customer',
131
+ triggers: [{ triggerKind: DataSeedTriggerKind.ON_APP_INIT }],
132
+ mode: DataSeedMode.ADDITIVE,
133
+ version: 1,
134
+ existingRowTreatment: DataSeedExistingRowTreatment.FILL_MISSING_DEFAULTS,
135
+ allowedApplicationEnvironments: [RuntimeEnvironment.DEVELOPMENT, RuntimeEnvironment.STAGING],
136
+ entries: [
137
+ { businessKey: { email: 'ana.martin@example.com' }, data: { name: 'Ana Martin', company: 'Martin Renovations' } },
138
+ { businessKey: { email: 'luc.bernard@example.com' }, data: { name: 'Luc Bernard', company: 'Bernard Plumbing' } },
139
+ ],
140
+ });
141
+
142
+ export { demoCustomersSeed, organizationDefaultWorkspaceSeed, systemEmailTemplatesSeed };
114
143
  ```
@@ -0,0 +1,80 @@
1
+ # example.data-seeding.row-reference
2
+
3
+
4
+ ## Usage Example
5
+
6
+ ```typescript
7
+ import { RuntimeEnvironment } from '@wildo-ai/saas-models';
8
+ import {
9
+ createDataSeedDefinition,
10
+ DataSeedExistingRowTreatment,
11
+ DataSeedMode,
12
+ DataSeedResourceLifecyclePhase,
13
+ DataSeedScopeKind,
14
+ DataSeedTriggerKind,
15
+ referenceDataSeedRow,
16
+ type DataSeedTrigger,
17
+ } from '@wildo-ai/saas-backend-lib/data-seeding-models';
18
+
19
+ // Every new organization gets its own sample rows; production never gets any.
20
+ const ON_ORGANIZATION_CREATED: DataSeedTrigger[] = [{
21
+ triggerKind: DataSeedTriggerKind.RESOURCE_LIFECYCLE,
22
+ resourceType: 'organizations',
23
+ phase: DataSeedResourceLifecyclePhase.AFTER_CREATE,
24
+ }];
25
+ const DEMONSTRATION_ONLY = [RuntimeEnvironment.DEVELOPMENT, RuntimeEnvironment.STAGING];
26
+
27
+ // ─────────────────────────────────────────────────────────────────────
28
+ // The referenced seed. Its resource's business key is
29
+ // `businessKeySet(['organizationId', 'email'])`; the entries name only
30
+ // `email`, and `anchorEntriesToScopeForeignKey` adds the organization.
31
+ // ─────────────────────────────────────────────────────────────────────
32
+ const demoCustomersSeed = createDataSeedDefinition({
33
+ seedKey: 'crm:demo-customers',
34
+ scope: { kind: DataSeedScopeKind.ORGANIZATION },
35
+ resourceType: 'customers',
36
+ triggers: ON_ORGANIZATION_CREATED,
37
+ mode: DataSeedMode.ADDITIVE,
38
+ version: 1,
39
+ existingRowTreatment: DataSeedExistingRowTreatment.FILL_MISSING_DEFAULTS,
40
+ allowedApplicationEnvironments: DEMONSTRATION_ONLY,
41
+ anchorEntriesToScopeForeignKey: true,
42
+ entries: [
43
+ { businessKey: { email: 'ana.martin@example.com' }, data: { name: 'Ana Martin' } },
44
+ { businessKey: { email: 'office@becker.example.com' }, data: { name: 'Becker Hausverwaltung GmbH' } },
45
+ ],
46
+ });
47
+
48
+ // ─────────────────────────────────────────────────────────────────────
49
+ // The referring seed. `customerId` is a REFERENCE, not a value: the
50
+ // engine replaces it with the customer row's `_id` before writing. The
51
+ // reference omits `organizationId` — both seeds are ORGANIZATION-scoped,
52
+ // so the engine fills in the organization being seeded. A contact whose
53
+ // customer row does not exist is reported on the run and not written.
54
+ // ─────────────────────────────────────────────────────────────────────
55
+ const demoContactsSeed = createDataSeedDefinition({
56
+ seedKey: 'crm:demo-contacts',
57
+ scope: { kind: DataSeedScopeKind.ORGANIZATION },
58
+ resourceType: 'contacts',
59
+ triggers: ON_ORGANIZATION_CREATED,
60
+ mode: DataSeedMode.ADDITIVE,
61
+ version: 1,
62
+ existingRowTreatment: DataSeedExistingRowTreatment.FILL_MISSING_DEFAULTS,
63
+ allowedApplicationEnvironments: DEMONSTRATION_ONLY,
64
+ anchorEntriesToScopeForeignKey: true,
65
+ // Required for every seed an entry references: it is what runs the customers first.
66
+ dependsOn: [{ seedKey: demoCustomersSeed.seedKey }],
67
+ entries: [
68
+ {
69
+ businessKey: { email: 'ana@martin.example.com' },
70
+ data: { firstName: 'Ana', customerId: referenceDataSeedRow(demoCustomersSeed, { email: 'ana.martin@example.com' }) },
71
+ },
72
+ {
73
+ businessKey: { email: 'jonas.becker@becker.example.com' },
74
+ data: { firstName: 'Jonas', customerId: referenceDataSeedRow(demoCustomersSeed, { email: 'office@becker.example.com' }) },
75
+ },
76
+ ],
77
+ });
78
+
79
+ export { demoContactsSeed, demoCustomersSeed };
80
+ ```
@@ -10,7 +10,7 @@ import { EmailTemplateType } from '@wildo-ai/saas-models';
10
10
  import type {
11
11
  EmailTemplateDefinition,
12
12
  EmailTemplateProps,
13
- } from '~wildo-backend-lib/notifications/email/models/email-template-definition';
13
+ } from '@wildo-ai/saas-backend-lib';
14
14
 
15
15
  export interface MinimalExampleLabels {
16
16
  subject: string;
@@ -0,0 +1,74 @@
1
+ # example.resource.config-wiring.retention-policy-operations
2
+
3
+
4
+ ## Usage Example
5
+
6
+ ```typescript
7
+ type OrganizationEscalationPolicies_CoreOperations =
8
+ | CoreResourceOperation.READ
9
+ | CoreResourceOperation.LIST
10
+ | CoreResourceOperation.CREATE
11
+ | CoreResourceOperation.UPDATE
12
+ | CoreResourceOperation.UPDATE_MANY
13
+ | CoreResourceOperation.DELETE;
14
+ ```
15
+
16
+ ## Usage Example
17
+
18
+ ```typescript
19
+ /**
20
+ * RETAIN_ONLY, and the contrast with the sibling rota is the point.
21
+ *
22
+ * `organizationEscalationContacts` holds a contact number, so it holds personal data of its own and
23
+ * declares RETAIN_AND_IMPERSONALIZE. A policy holds none: its `targetUserId` is a foreign key that
24
+ * NAMES a person without being data about them (the never-scrub floor treats scope and actor keys
25
+ * exactly this way), and `webhookUrl` addresses a system rather than a human. So there is nothing
26
+ * here an erasure could scrub, and claiming otherwise would be a declaration the factory refuses —
27
+ * RETAIN_AND_IMPERSONALIZE requires at least one genuinely scrubbable field.
28
+ */
29
+ retentionPolicy: { mode: ErasureRetentionMode.RETAIN_ONLY },
30
+
31
+ /**
32
+ * Erasing a policy revokes no session. It is a configuration record, not a person: `targetUserId`
33
+ * names an escalation ACTOR, which is the exact case the enum's own documentation gives for
34
+ * NO_PRINCIPAL, and revoking their session because a policy was deleted would log out someone who
35
+ * merely appeared in it.
36
+ */
37
+ dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
38
+
39
+ coreOperations: [
40
+ CoreResourceOperation.READ,
41
+ CoreResourceOperation.LIST,
42
+ CoreResourceOperation.CREATE,
43
+ CoreResourceOperation.UPDATE,
44
+ /*
45
+ * Declared for the RETENTION POLICY, not as an authoring affordance — and required even under
46
+ * RETAIN_ONLY, which is worth knowing before assuming it is only the scrub's concern. Retaining a
47
+ * row still WRITES to it: the erasure marks `retentionStatus`, in place, through
48
+ * `updateManyAsSystem`. So a resource that declares how it behaves under erasure must grant the
49
+ * writer that carries it out, whether or not any field is scrubbed.
50
+ *
51
+ * Its variant is INTERNAL_CALL, so it registers no route and no affordance. Nobody bulk-edits
52
+ * escalation policies; the erasure writer does.
53
+ */
54
+ CoreResourceOperation.UPDATE_MANY,
55
+ CoreResourceOperation.DELETE,
56
+ ],
57
+ ```
58
+
59
+ ## Usage Example
60
+
61
+ ```typescript
62
+ [CoreResourceOperation.UPDATE_MANY]: {
63
+ variants: [{
64
+ // INTERNAL_CALL, because this operation exists only for the erasure writer (see
65
+ // `coreOperations` above). As API_CALL it registered a `PUT` collection route that failed
66
+ // validation on every request and was published in the API reference; declaring no view
67
+ // for it does not withhold the route.
68
+ variantType: ResourceOperationVariantType.INTERNAL_CALL,
69
+ isDefault: true,
70
+ roles: [CORE_ORG_ROLES.ORG_ADMIN],
71
+ riskLevel: ResourceOperationRiskLevel.HIGH,
72
+ }]
73
+ },
74
+ ```
@@ -0,0 +1,19 @@
1
+ # example.resource.personal-data.free-text-field
2
+
3
+
4
+ ## Usage Example
5
+
6
+ ```typescript
7
+ /*
8
+ * Free prose about a person — routinely holds far more personal data than the name does.
9
+ *
10
+ * Declared `USER_CONTENT` rather than a narrower category, and the honesty of that is worth
11
+ * stating: the declaration says what the field is FOR, never what it will contain. A CRM note is
12
+ * the classic surface where a special category (a health remark, a religious observance) arrives
13
+ * unannounced, and no schema can certify otherwise. If this field is ever used for one
14
+ * FORESEEABLY, declare that member alongside — the decorator takes an array for exactly this.
15
+ */
16
+ description: z.string().max(1000).optional()
17
+ .impersonalizeWith(RedactionType.REMOVE)
18
+ .dataCategories(PersonalDataCategory.USER_CONTENT),
19
+ ```
@@ -0,0 +1,27 @@
1
+ # example.resource.personal-data.person-without-account
2
+
3
+
4
+ ## Usage Example
5
+
6
+ ```typescript
7
+ systemAccessPolicy: {
8
+ // Art. 15 and Art. 20 both reach a contact: it is the personal data a customer stores about a
9
+ // third party, and it is the data most likely to be the SUBJECT of a request rather than
10
+ // incidental to one.
11
+ exportSubject: ResourceSystemAccessMode.ALLOWED,
12
+ },
13
+
14
+ /**
15
+ * A contact IS a person, and the person has no account here. The two declarations below say so on two
16
+ * independent axes:
17
+ *
18
+ * - `RETAIN_AND_IMPERSONALIZE` — this row holds personal data of its own, and the fields carrying
19
+ * `.impersonalizeWith()` are what an erasure destroys. The row itself is kept and frozen, because
20
+ * a deal referencing a contact that vanished is a broken record rather than an erased one.
21
+ * - `NO_PRINCIPAL` — erasing it revokes no session, because a contact never had one. Nothing about
22
+ * the person's rights follows from that: `eraseSubjectAsSystem(CONTACT, ids)` takes a resource
23
+ * type and row ids and needs no login.
24
+ */
25
+ retentionPolicy: { mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE },
26
+ dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
27
+ ```