@cratis/pi 8.0.1 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (486) hide show
  1. package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +9 -102
  2. package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +3 -5
  3. package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +8 -49
  4. package/package/corpus/harnesses/copilot/instructions/code-health.instructions.md +1 -1
  5. package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +3 -84
  6. package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +6 -51
  7. package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +4 -81
  8. package/package/corpus/harnesses/copilot/instructions/codescene.instructions.md +5 -54
  9. package/package/corpus/harnesses/copilot/instructions/components.instructions.md +1 -1
  10. package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +5 -22
  11. package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +7 -315
  12. package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +1 -1
  13. package/package/corpus/harnesses/copilot/instructions/discoverability.instructions.md +3 -25
  14. package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +5 -151
  15. package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +5 -104
  16. package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +5 -63
  17. package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +8 -55
  18. package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +3 -33
  19. package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +6 -79
  20. package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +4 -27
  21. package/package/corpus/harnesses/copilot/instructions/framework-dotnet.instructions.md +4 -6
  22. package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +0 -2
  23. package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +0 -1
  24. package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +1 -1
  25. package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +7 -138
  26. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +19 -19
  27. package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +1 -4
  28. package/package/corpus/harnesses/copilot/instructions/go.instructions.md +2 -7
  29. package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +5 -6
  30. package/package/corpus/harnesses/copilot/instructions/java.instructions.md +7 -129
  31. package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +8 -165
  32. package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -98
  33. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
  34. package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
  35. package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
  36. package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
  37. package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
  38. package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
  39. package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
  40. package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
  41. package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
  42. package/package/corpus/hooks/README.md +4 -7
  43. package/package/corpus/hooks/scripts/quality-gates.json +3 -5
  44. package/package/corpus/rules/ai-distribution.md +9 -102
  45. package/package/corpus/rules/authoring-skills.md +3 -5
  46. package/package/corpus/rules/browser.md +8 -49
  47. package/package/corpus/rules/code-health-policy.txt +4 -24
  48. package/package/corpus/rules/code-health.md +1 -1
  49. package/package/corpus/rules/code-quality.csharp.md +3 -84
  50. package/package/corpus/rules/code-quality.md +6 -51
  51. package/package/corpus/rules/code-quality.typescript.md +4 -81
  52. package/package/corpus/rules/codescene.md +5 -54
  53. package/package/corpus/rules/components.md +1 -1
  54. package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
  55. package/package/corpus/rules/csharp.md +7 -315
  56. package/package/corpus/rules/dialogs.md +1 -1
  57. package/package/corpus/rules/discoverability.md +3 -25
  58. package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
  59. package/package/corpus/rules/documentation.md +5 -104
  60. package/package/corpus/rules/editing-cratis-docs.md +5 -63
  61. package/package/corpus/rules/efcore.md +8 -55
  62. package/package/corpus/rules/efcore.specs.md +3 -33
  63. package/package/corpus/rules/elixir.md +6 -79
  64. package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
  65. package/package/corpus/rules/framework-dotnet.md +4 -6
  66. package/package/corpus/rules/framework.md +0 -2
  67. package/package/corpus/rules/frontend-quality.md +0 -1
  68. package/package/corpus/rules/frontend-testing.md +1 -1
  69. package/package/corpus/rules/general.md +2 -2
  70. package/package/corpus/rules/github-actions.md +7 -138
  71. package/package/corpus/rules/glossary.md +19 -19
  72. package/package/corpus/rules/go-engineering.md +1 -4
  73. package/package/corpus/rules/go.md +2 -7
  74. package/package/corpus/rules/guards-and-fuses.md +5 -6
  75. package/package/corpus/rules/java.md +7 -129
  76. package/package/corpus/rules/kotlin.md +8 -165
  77. package/package/corpus/rules/orleans.md +5 -98
  78. package/package/corpus/rules/profiles.md +9 -63
  79. package/package/corpus/rules/scripting.md +1 -1
  80. package/package/corpus/rules/specs.csharp.md +8 -148
  81. package/package/corpus/rules/specs.elixir.md +4 -37
  82. package/package/corpus/rules/specs.typescript.md +3 -1
  83. package/package/corpus/rules/storybook.md +7 -70
  84. package/package/corpus/rules/typescript.md +8 -98
  85. package/package/corpus/rules/writing-correct-examples.md +3 -47
  86. package/package/corpus/rules/writing-cratis-docs.md +3 -65
  87. package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
  88. package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
  89. package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
  90. package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
  91. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
  92. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
  93. package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
  94. package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
  95. package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
  96. package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
  97. package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
  98. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
  99. package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
  100. package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
  101. package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
  102. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
  103. package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
  104. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
  105. package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
  106. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
  107. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
  108. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
  109. package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
  110. package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
  111. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
  112. package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
  113. package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
  114. package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
  115. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
  116. package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
  117. package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
  118. package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
  119. package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
  120. package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
  121. package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
  122. package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
  123. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
  124. package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
  125. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
  126. package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
  127. package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
  128. package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
  129. package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
  130. package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
  131. package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
  132. package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
  133. package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
  134. package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
  135. package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
  136. package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
  137. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
  138. package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
  139. package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
  140. package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
  141. package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
  142. package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
  143. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
  144. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
  145. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
  146. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
  147. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
  148. package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
  149. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
  150. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
  151. package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
  152. package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
  153. package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
  154. package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
  155. package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
  156. package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
  157. package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
  158. package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
  159. package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
  160. package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
  161. package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
  162. package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
  163. package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
  164. package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
  165. package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
  166. package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
  167. package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
  168. package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
  169. package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
  170. package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
  171. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
  172. package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
  173. package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
  174. package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
  175. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
  176. package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
  177. package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
  178. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
  179. package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
  180. package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
  181. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
  182. package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
  183. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
  184. package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
  185. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
  186. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
  187. package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
  188. package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
  189. package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
  190. package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
  191. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
  192. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
  193. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
  194. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
  195. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
  196. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
  197. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
  198. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
  199. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
  200. package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
  201. package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
  202. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
  203. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
  204. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
  205. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
  206. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
  207. package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
  208. package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
  209. package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
  210. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
  211. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
  212. package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
  213. package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
  214. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
  215. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
  216. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
  217. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
  218. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
  219. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
  220. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
  221. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
  222. package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
  223. package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
  224. package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
  225. package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
  226. package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
  227. package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
  228. package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
  229. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
  230. package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
  231. package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
  232. package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
  233. package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
  234. package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
  235. package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
  236. package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
  237. package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
  238. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
  239. package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
  240. package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
  241. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
  242. package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
  243. package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
  244. package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
  245. package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
  246. package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
  247. package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
  248. package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
  249. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
  250. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
  251. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
  252. package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
  253. package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
  254. package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
  255. package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
  256. package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
  257. package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
  258. package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
  259. package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
  260. package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
  261. package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
  262. package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
  263. package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
  264. package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
  265. package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
  266. package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
  267. package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
  268. package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
  269. package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
  270. package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
  271. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
  272. package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
  273. package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
  274. package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
  275. package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
  276. package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
  277. package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
  278. package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
  279. package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
  280. package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
  281. package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
  282. package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
  283. package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
  284. package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
  285. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
  286. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
  287. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
  288. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
  289. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
  290. package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
  291. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
  292. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
  293. package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
  294. package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
  295. package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
  296. package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
  297. package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
  298. package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
  299. package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
  300. package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
  301. package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
  302. package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
  303. package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
  304. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
  305. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
  306. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
  307. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
  308. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
  309. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
  310. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
  311. package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
  312. package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
  313. package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
  314. package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
  315. package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
  316. package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
  317. package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
  318. package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
  319. package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
  320. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
  321. package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
  322. package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
  323. package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
  324. package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
  325. package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
  326. package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
  327. package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
  328. package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
  329. package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
  330. package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
  331. package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
  332. package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
  333. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
  334. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
  335. package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
  336. package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
  337. package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
  338. package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
  339. package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
  340. package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
  341. package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
  342. package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
  343. package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
  344. package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
  345. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
  346. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
  347. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
  348. package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
  349. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
  350. package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
  351. package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
  352. package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
  353. package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
  354. package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
  355. package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
  356. package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
  357. package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
  358. package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
  359. package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
  360. package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
  361. package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
  362. package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
  363. package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
  364. package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
  365. package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +10 -0
  366. package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
  367. package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
  368. package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
  369. package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
  370. package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
  371. package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
  372. package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
  373. package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
  374. package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
  375. package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
  376. package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
  377. package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
  378. package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
  379. package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
  380. package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
  381. package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
  382. package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
  383. package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
  384. package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
  385. package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
  386. package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
  387. package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
  388. package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
  389. package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
  390. package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
  391. package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
  392. package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
  393. package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
  394. package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
  395. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
  396. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
  397. package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
  398. package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
  399. package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
  400. package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
  401. package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
  402. package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
  403. package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
  404. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
  405. package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
  406. package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
  407. package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
  408. package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
  409. package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
  410. package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
  411. package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
  412. package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
  413. package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
  414. package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
  415. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
  416. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
  417. package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
  418. package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
  419. package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
  420. package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
  421. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
  422. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
  423. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
  424. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
  425. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
  426. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
  427. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
  428. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
  429. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
  430. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
  431. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
  432. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
  433. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
  434. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
  435. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
  436. package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
  437. package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
  438. package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
  439. package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
  440. package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
  441. package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
  442. package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
  443. package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
  444. package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
  445. package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
  446. package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
  447. package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
  448. package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
  449. package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
  450. package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
  451. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
  452. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
  453. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
  454. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
  455. package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
  456. package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
  457. package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
  458. package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
  459. package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
  460. package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
  461. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
  462. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
  463. package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
  464. package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
  465. package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
  466. package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
  467. package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
  468. package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
  469. package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
  470. package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
  471. package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
  472. package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
  473. package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
  474. package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
  475. package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
  476. package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
  477. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
  478. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
  479. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
  480. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
  481. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
  482. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
  483. package/package.json +1 -1
  484. /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
  485. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
  486. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/unintended-release-regression.md → unintended-release-regression.md} +0 -0
@@ -1,202 +1,40 @@
1
1
  ---
2
2
  name: cratis-fundamentals-type-discovery
3
- description: Use when a Cratis handler set, filter chain, strategy set or dispatcher must discover every implementation of an abstraction. Not for selecting one service implementation at composition time.
3
+ description: Use when a .NET handler set, strategy set or dispatcher must discover every implementation of an abstraction. Not for choosing dependencies across application modules (use cratis-application-growth).
4
4
  license: MIT
5
5
  ---
6
6
 
7
- # Cratis implementation discovery
7
+ # Discover implementations in .NET
8
8
 
9
- `services.AddSingleton<IFoo, Foo>()` looks free at the registration line. The
10
- cost arrives later: a new implementation in another folder does nothing until
11
- someone remembers the line, a removed one leaves a registration that fails at
12
- startup, and every specification setup has to mirror the composition root.
9
+ When a consumer needs every implementation, inject `IInstancesOf<T>` from `Cratis.Types`. Use a concrete, non-generic implementation of an interface or abstract class. Discovering a set avoids maintaining a second list in the composition root. For one chosen service, inject that service's interface instead; for a sequence returned as data, use an ordinary collection type.
13
10
 
14
- `IInstancesOf<T>` moves that knowledge into the implementation. Adding or
15
- removing one becomes a single-file change.
11
+ 1. Reference `Cratis.Fundamentals` in projects that contribute implementations; its NuGet package carries the discovery analyzer. Arc's `AddCratisArc()` already configures discovery and convention bindings. **Choose explicit host setup when** using a plain .NET host: call `services.AddTypeDiscovery()`, `services.AddBindingsByConvention()` and `services.AddSelfBindings()` before building the provider (`Cratis.DependencyInjection` and `Microsoft.Extensions.DependencyInjection`). A project reference to Fundamentals source doesn't bring the analyzer: see [discovery diagnostics](references/diagnostics.md) if the host can't see a contributor.
12
+ 2. Implement the contract. Leave the lifetime unspecified for a transient; use `[Scoped]` for a scope-bound implementation or `[Singleton]` for an implementation safe to share across scopes and concurrent calls. Both attributes are in `Cratis.DependencyInjection`. Keep the consumer within a scope if it resolves scoped implementations.
13
+ 3. Enumerate the discovered set in the operation. In this example, neither the consumer nor its implementations needs a manual registration in an Arc host:
16
14
 
17
- ## Packages covered
15
+ ```csharp
16
+ using System.Linq;
17
+ using Cratis.Types;
18
18
 
19
- | Package | Purpose |
20
- | --- | --- |
21
- | `Cratis.Fundamentals` | `IInstancesOf<T>`, `IImplementationsOf<T>`, `ITypes`, convention bindings and the bundled `Cratis.Fundamentals.TypeDiscovery.Generator` |
19
+ namespace Reports;
22
20
 
23
- Reverify against the Cratis Fundamentals repository before claiming support for
24
- another version.
21
+ public interface IReportSection
22
+ {
23
+ string Heading { get; }
24
+ }
25
25
 
26
- ## Route near misses
26
+ public class TotalsSection : IReportSection
27
+ {
28
+ public string Heading => "Totals";
29
+ }
27
30
 
28
- - The consumer needs **one** implementation chosen at composition time:
29
- constructor-inject the interface and let the `IFoo → Foo` convention resolve
30
- it. This skill does not apply.
31
- - The method **returns** a sequence of values to a caller: `IEnumerable<T>` (or
32
- `IReadOnlyList<T>`) is still the right return type. The rule is about
33
- *injecting* implementations of an abstraction, not about returning values.
34
- - You only need the **types**, never instances: inject `IImplementationsOf<T>`,
35
- which enumerates `Type` rather than `T`.
31
+ public class ReportOutline(IInstancesOf<IReportSection> sections)
32
+ {
33
+ public string[] GetHeadings() => sections.Select(section => section.Heading).ToArray();
34
+ }
35
+ ```
36
36
 
37
- ## When you need this
37
+ The set resolves concrete self-bindings, not `IEnumerable<T>` interface registrations. Remove old manual registrations only after checking that no other consumer needs them. Each enumeration resolves instances from the captured provider, so a singleton consumer cannot safely resolve scoped implementations. Materialize once when an operation needs to reuse the same resolved instances. Do not rely on discovery order as business precedence; apply an explicit order when it matters.
38
+ 4. Build and exercise the behavior through the host. Assert the expected contributions, not just that iteration completed: an empty set can otherwise pass a fan-out spec. If a contribution is missing or enumeration throws, use [discovery diagnostics](references/diagnostics.md).
38
39
 
39
- The consumer of an abstraction has to iterate, filter, or fan out to **every**
40
- registered implementation:
41
-
42
- - Anything plural that delegates to a set — `*Handlers`, `*Filters`,
43
- `*Validators`, `*Formatters`, `*Strategies`, `*Providers`, `*Resolvers`.
44
- - A dispatcher that asks each implementation `CanHandle(...)` and forwards to
45
- the one that says yes.
46
- - A composite that fans one input out to all implementations and aggregates.
47
-
48
- ## Step 1 — Confirm the implementations are discoverable
49
-
50
- Discovery normally uses compile-time generated providers, not a walk of
51
- `DefinedTypes`. Reflection is the fallback when no generated providers exist.
52
-
53
- - Use concrete, non-generic implementations. Generated contract maps exclude
54
- open-generic implementors. An assembly's own provider can include its internal
55
- types; references emitted from another assembly require public types.
56
- - `T` is an interface or abstract class (`where T : class`).
57
- - Instances resolve by concrete type, so each implementation needs a self-binding.
58
- `AddSelfBindings()` honors `[Singleton]`, `[Scoped]`, and `[IgnoreConvention]`;
59
- it excludes static/abstract/interface/exception types, System/Microsoft
60
- namespaces, and classes with primitive or record-typed constructor parameters.
61
- `IFoo → Foo` bindings require matching names in the same namespace and exactly
62
- one implementation; they do not replace self-bindings for a discovered set.
63
-
64
- The host must call `services.AddTypeDiscovery()` to register `ITypes`,
65
- `IInstancesOf<>`, and `IImplementationsOf<>`, plus the convention binding setup.
66
- Arc's `AddCratisArc` does this; a plain host must do it.
67
- No per-implementation registration is needed when self-binding applies.
68
-
69
- The Fundamentals NuGet package carries the generator as an analyzer. A project
70
- reference does **not** carry it: reference the generator explicitly, otherwise
71
- only Fundamentals' own provider may contribute. A captured `ITypes` universe
72
- never gains late-loaded assemblies. `AddTypeDiscovery()` reuses the default
73
- universe while the provider set is unchanged; a later call rebuilds it if new
74
- providers registered, without changing earlier consumers.
75
-
76
- ## Step 2 — Choose the lifetime with an attribute
77
-
78
- ```csharp
79
- using Cratis.DependencyInjection;
80
-
81
- [Singleton]
82
- public class CsvReportFormatter(IClock clock) : IReportFormatter
83
- {
84
- public bool CanHandle(ReportRequest request) => request.Format == "csv";
85
- public string Format(Report report) => /* … */;
86
- }
87
- ```
88
-
89
- ⚠️ `[Singleton]` lives in **`Cratis.DependencyInjection`**, not `Cratis`. That
90
- is the using directive to add when it does not resolve.
91
-
92
- The convention reads exactly three attributes:
93
-
94
- | Attribute | Lifetime |
95
- | --- | --- |
96
- | `[Singleton]` | Singleton |
97
- | `[Scoped]` | Scoped |
98
- | neither | **Transient** |
99
-
100
- `[IgnoreConvention]` opts a type out of convention binding entirely.
101
-
102
- Skip `[Singleton]` only when the implementation genuinely holds per-call state.
103
- The `IFoo → Foo` convention still applies to transients — do not register them
104
- explicitly either.
105
-
106
- ## Step 3 — Inject `IInstancesOf<T>` in the consumer
107
-
108
- ```csharp
109
- using Cratis.DependencyInjection;
110
- using Cratis.Types;
111
-
112
- [Singleton]
113
- public class ReportFormatters(IInstancesOf<IReportFormatter> formatters) : IReportFormatters
114
- {
115
- public bool CanHandle(ReportRequest request) =>
116
- formatters.Any(formatter => formatter.CanHandle(request));
117
-
118
- public string Format(ReportRequest request, Report report) =>
119
- formatters.First(formatter => formatter.CanHandle(request)).Format(report);
120
- }
121
- ```
122
-
123
- `IInstancesOf<T>` implements `IEnumerable<T>`, so LINQ works on it directly.
124
-
125
- **The type set is fixed at construction; instances resolve on every enumeration**
126
- through the service provider captured by `InstancesOf<T>`. The consumer's scope
127
- therefore matters: the singleton above is safe only when no implementation is
128
- scoped. A singleton captures the root provider and would make a scoped
129
- implementation captive or fail scope validation. Use a scoped or transient
130
- consumer resolved inside a scope when any implementation is scoped; follow the
131
- lifetime rule in `csharp.md`. Materialize with `.ToArray()` only when one operation
132
- needs a stable instance snapshot.
133
-
134
- ## Step 4 — Delete the dead registrations
135
-
136
- Find every line in a composition root or service-collection extension that
137
- registered the implementations or the consumer, and remove it:
138
-
139
- ```csharp
140
- // Delete — IInstancesOf<T> discovers them, [Singleton] gives them their lifetime
141
- services.AddSingleton<IReportFormatter, CsvReportFormatter>();
142
- services.AddSingleton<IReportFormatter, JsonReportFormatter>();
143
- services.AddSingleton<IReportFormatters, ReportFormatters>();
144
- ```
145
-
146
- Search for every remaining reference before deleting, so nothing else was
147
- relying on a registration for a different reason.
148
-
149
- ## Reuse derived-type discovery
150
-
151
- Requires Fundamentals and its generator 7.26.1 for per-universe caching plus nested-generic/experimental-type generator fixes; check `dotnet list package`, or keep the older construction path until upgrading.
152
-
153
- Use `Cratis.Serialization.DerivedTypes.For(types)` when several service
154
- collections share the same `ITypes` instance. It returns one shared `DerivedTypes`
155
- per universe, held weakly; distinct universes stay isolated. Do not construct one
156
- per scope or replace a host's explicit universe with `DerivedTypes.Instance`.
157
-
158
- The generator omits nested open-generic types from referenced Cratis packages
159
- and handles referenced `[Experimental]` diagnostic IDs. Upgrade the generator
160
- rather than editing its output to bypass those build failures.
161
-
162
- ## What breaks
163
-
164
- - **`[Singleton]` does not resolve.** The using directive is
165
- `Cratis.DependencyInjection`, not `Cratis`.
166
- - **An implementation is silently absent from the set.** Its assembly did not
167
- contribute a generated provider before the universe was built, or its type is
168
- abstract, generic, or inaccessible to the emitted provider. Inspect
169
- `ITypes.DiscoveryMode` (`Unknown`, `Generated`, `Reflected`, or `Explicit`) and
170
- `ITypes.Assemblies`; ask `TypeDiscoveryDiagnostics.FindMissingContributors(types)`
171
- for referenced assembly names that did not contribute (it loads nothing and
172
- may also report libraries with no discoverable types). The reflection fallback
173
- includes package assemblies by prefix: `Cratis` by default, configurable through
174
- `PackageReferencedAssemblies.Instance.AddAssemblyPrefixesToInclude(...)` before
175
- discovery.
176
- - **Discovery dependencies cannot resolve.** The plain host omitted
177
- `services.AddTypeDiscovery()`.
178
- - **Enumeration yields null.** The concrete type was discovered but not registered
179
- as itself, for example because `[IgnoreConvention]` or a self-binding exclusion
180
- skipped it. `InstancesOf<T>` uses `GetService(type)`, not `GetRequiredService`.
181
- - **An implementation is a new instance every time it is touched.** It has no
182
- lifetime attribute, so the convention made it transient. That is correct
183
- behavior for the convention and usually the wrong intent — add `[Singleton]`.
184
- - **A stale registration fails at startup.** A hand-written
185
- `AddSingleton<TInterface, Impl>()` survived a type being removed. Step 4 is
186
- what prevents it.
187
- - **Injecting `IEnumerable<T>` seems to work and returns nothing.** That
188
- signature only sees hand-registered implementations. It is the failure mode
189
- this skill exists to remove — it fails silently and empty, not loudly.
190
-
191
- ## How it is proven
192
-
193
- `dotnet build` — zero warnings, zero errors — then run the specifications for
194
- the affected behavior. The non-vacuity check matters here: assert the **count**
195
- of discovered implementations, not just that iterating them threw nothing. A
196
- fan-out over an empty set passes every assertion that only says "nothing went
197
- wrong".
198
-
199
- Assert the expected `ITypes.DiscoveryMode` and contributing assembly names too.
200
- For startup diagnostics, collect EventSource `Cratis.Fundamentals.TypeDiscovery`
201
- with `dotnet-trace`: it reports universe construction and warns when only
202
- Fundamentals contributed.
40
+ **Choose `IImplementationsOf<T>` when** the consumer needs only type metadata. It enumerates `Type` without constructing the implementations, so concrete self-bindings aren't needed for that enumeration.
@@ -0,0 +1,14 @@
1
+ # Diagnose a discovery or binding gap
2
+
3
+ ## Missing type versus missing registration
4
+
5
+ - **Missing from the discovered set:** inspect `ITypes.DiscoveryMode` (`Unknown`, `Generated`, `Reflected`, or `Explicit`) and `ITypes.Assemblies`. The normal path uses generated providers; reflection is a fallback when no providers are available. Generated contract maps exclude open generic implementations. An assembly can contribute internal types through its own provider; providers emitted by another assembly can reference only accessible types. With a project reference to Fundamentals source, reference the generator as an analyzer in the contributing project instead of editing generated code.
6
+ - **Missing assembly:** `TypeDiscoveryDiagnostics.FindMissingContributors(types)` reports referenced assembly names that did not contribute. It doesn't load assemblies and can name libraries that have nothing to discover. For reflected discovery, set any extra package prefixes with `PackageReferencedAssemblies.Instance.AddAssemblyPrefixesToInclude(...)` before building the universe; `Cratis` is included by default. For startup diagnostics, collect the `Cratis.Fundamentals.TypeDiscovery` EventSource with `dotnet-trace`. In a discovery diagnostic test, assert the expected mode and contributing assemblies.
7
+ - **Type was found but enumeration throws:** `IInstancesOf<T>` resolves each discovered concrete type with `GetRequiredService`. Check the concrete self-registration and its dependencies. `[IgnoreConvention]` opts out of convention binding, not discovery. Automatic self-binding can skip types such as exceptions or types with primitive or record constructor parameters. When an intentionally excluded implementation still belongs in the set, explicitly bind its concrete type at the appropriate lifetime before convention setup. An interface-only registration won't satisfy the lookup.
8
+ - **An injected `IEnumerable<T>` is empty:** that collection sees only registrations for `T`, not the discovery set. The single-implementation convention binds `IFoo` to `Foo` when they share a namespace and there is only one eligible implementation; it is not a substitute for a self-binding for each discovered implementation.
9
+
10
+ ## Multiple hosts or serializer composition
11
+
12
+ An existing `ITypes` snapshot does not gain late-loaded providers. A later default `AddTypeDiscovery()` call reuses the universe if the generated provider set is unchanged, or creates a new one if the set changed. Check the universe resolved by the host you are testing.
13
+
14
+ When composing serializers against an existing universe, use `Cratis.Serialization.DerivedTypes.For(types)`. It shares the derived-type registry per `ITypes` instance; separate universes keep separate registries. Do not replace a host's explicit universe with `DerivedTypes.Instance`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-governed-release-methodology
3
- description: Use when planning release assurance, support claims, promotion and recovery, or deciding whether supply-chain evidence is warranted. Not for product code, publish-command syntax or credentials.
3
+ description: Use when planning release assurance, support claims, promotion and recovery, or deciding whether supply-chain evidence is warranted. Not for preparing a platform release PR (use cratis-platform-prepare-release-pr).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -17,6 +17,9 @@ pushing container images, and one whose whole delivery is a merge to `main`. It
17
17
  grants no release authority of its own: it tells you what a claim costs, not
18
18
  that you may make it.
19
19
 
20
+ This skill sets the assurance and recovery plan, not product implementation,
21
+ publish-command syntax, or credential provisioning.
22
+
20
23
  ## Start with the artifact, not the process
21
24
 
22
25
  The single most expensive mistake is applying package-release ceremony to
@@ -94,10 +97,9 @@ Two rules keep the ladder honest:
94
97
  or mocked host proves the pipeline, never the host. Classify every observation
95
98
  as synthetic, local, hosted, or real-consumer, and never let a synthetic
96
99
  observation satisfy an execution requirement.
97
- - **A missing or version-mismatched host is a blocked outcome, not a skip.** If
98
- the canary needed host 2.1.245 and the runner had 2.1.235, the phase did not
99
- pass; it did not run. A skipped phase that reports green is worse than a red
100
- one, because it retires the question.
100
+ - **A missing or version-mismatched host is a blocked outcome, not a skip.**
101
+ Record what the canary required and what was available. A skipped phase
102
+ supplies no execution evidence.
101
103
 
102
104
  ## The lifecycle phases a real install cycle must cover
103
105
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-lens-browser-extension
3
- description: Use when setting up Lens for a development Arc application, diagnosing app detection or checking switched identities and tenants. Not for production authentication, authorization design or Chronicle inspection.
3
+ description: Use when setting up Lens for a development Arc application, diagnosing app detection or checking switched identities and tenants. Not for designing access rules for Arc endpoints (use cratis-arc-authorize-request).
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -10,17 +10,12 @@ Screenplay `user` declarations are development identities Stage can offer to Len
10
10
 
11
11
  Lens is a Manifest V3 browser extension that impersonates a user and a tenant
12
12
  against an Arc application you are developing, and executes that application's
13
- commands and queries from a popup. It changes nothing in the application: it
14
- rewrites request headers at the network boundary and reads Arc's own
15
- introspection endpoints.
13
+ commands and queries from a popup. Lens needs no application code changes: it
14
+ rewrites request headers and reads Arc's introspection endpoints. Running a
15
+ command from the popup sends a real request and can change application state.
16
+ Use disposable fixtures and verify the target before running a command.
16
17
 
17
- ⚠️ Lens is a **development** tool that can present any identity to any origin
18
- the developer points it at. Nothing in it is production tooling.
19
-
20
- ⚠️ **There is no published store listing.** Nothing in the Lens repository links
21
- a Chrome Web Store, Edge Add-ons, AMO, or App Store entry — the only store URLs
22
- present are developer-console links inside its own publishing guide. Building
23
- from source and loading unpacked is the only install path that exists.
18
+ Use an unpacked build in a dedicated development browser profile.
24
19
 
25
20
  ## Safety
26
21
 
@@ -38,6 +33,8 @@ inject into any page.
38
33
 
39
34
  ## Install
40
35
 
36
+ Use the Node.js version selected by Lens’s build workflow, Yarn, and Chromium.
37
+
41
38
  ```bash
42
39
  cd Source
43
40
  yarn install
@@ -46,20 +43,16 @@ yarn build # writes the unpacked extension to Source/dist/
46
43
 
47
44
  Then open `chrome://extensions`, enable **Developer mode**, choose **Load
48
45
  unpacked**, and select `Source/dist`. Chrome lists it as **Cratis Lens** — the
49
- name in `manifest.json`; the repository's own tutorial calls it "Lens - Cratis
50
- Developer Tools", which is stale.
46
+ name in its manifest.
51
47
 
52
48
  `yarn dev` is `vite build --watch`; the extension still has to be reloaded in
53
49
  Chrome after each rebuild. `yarn ci` runs `typecheck`, `test` and `build` — the
54
50
  same three the pull-request workflow runs. There is no lint script.
55
51
 
56
- On `main`, `yarn build-package` runs `scripts/build-package.js` and writes zip
57
- packages into repo-root `dist/`; the manifest description changed, but the name
58
- is still **Cratis Lens**. the script instead zips to `lens-extension.zip`.
52
+ If you need a local ZIP rather than an unpacked build, run `yarn build-package`
53
+ from `Source`; it writes `lens-extension.zip` at the repository root.
59
54
 
60
- The code uses the `chrome.*` namespace throughout with no polyfill. The release
61
- workflow also packages for Edge, Firefox and Safari, but no cross-browser
62
- behavior is tested; treat Chromium as the supported target.
55
+ Use Chromium for development; release packaging for other browsers does not establish runtime support.
63
56
 
64
57
  ## What the Arc application must already provide
65
58
 
@@ -78,15 +71,6 @@ strips client-supplied identity headers.
78
71
  | `GET /.cratis/tenants` | every `ICanProvideTenants`, identity discovery policy | The importable tenant list |
79
72
  | `GET /.cratis/identity-details/schema` | the identity endpoint mapper | The schema-driven editor for a user's `identityDetails` |
80
73
 
81
- Requires Arc 22.45.0 for discovery to be anonymous by default **only in Development**; older versions serve it anonymously everywhere.
82
-
83
- Discovery is anonymous by default **only in Development**.
84
- Against a deployed host Lens needs the user signed in; hosts unable to authenticate
85
- omit those routes (404). `Introspection.Enabled` controls catalogs and
86
- `IdentityDiscovery` the roster/tenant/schema routes. Forwarded identity switching
87
- also needs the explicit host-wide `TrustForwardedIdentityHeaders` opt-in, only
88
- behind a header-stripping ingress.
89
-
90
74
  `MapIntrospectionEndpoints` runs during Arc activation, subject to these settings. The user and tenant
91
75
  routes return whatever the application implements — with **no implementation
92
76
  registered they return an empty list**, and Lens treats a `404` on either as
@@ -100,138 +84,20 @@ the host cannot enforce it. `Cratis:Arc:Introspection` options `Enabled` and
100
84
  access. Register development user/tenant providers with fixtures, not production
101
85
  rosters.
102
86
 
103
- ### Identity
104
-
105
- Lens sends exactly three forwarded client-principal headers. Arc ignores them
106
- and treats the request as anonymous unless
107
- `Cratis:Arc:TrustForwardedIdentityHeaders=true`; a default Arc app therefore
108
- does not honor Lens identity switching:
109
-
110
- ```text
111
- X-MS-CLIENT-PRINCIPAL-ID
112
- X-MS-CLIENT-PRINCIPAL-NAME
113
- X-MS-CLIENT-PRINCIPAL # base64 of the principal JSON
114
- ```
115
-
116
- The principal document it base64-encodes is
117
- `{ identityProvider, userId, userDetails, userRoles, claims: [{ typ, val }], … }`
118
- with the user's `identityDetails` and `applicationProperties` spread over it.
119
- `identityProvider` defaults to `aad` and `userRoles` falls back to
120
- `["authenticated", "anonymous"]` when the user has no roles.
121
-
122
- ⚠️ That is Lens's **only** identity mode. There is no bearer token, no OIDC, no
123
- sign-in. The application has to be running on the Microsoft-Identity-Platform
124
- forwarded-header path, and the reverse proxy in front of it in production must
125
- be the only thing that can set those headers.
126
-
127
- ### Tenancy
128
-
129
- Lens sets one header, named by its `tenantHeaderName` setting, whose default is
130
- `x-cratis-tenant-id`. That matches `TenancyOptions.HttpHeader`'s default, and
131
- `TenantResolverType.Header` is Arc's default resolver — so a default Arc
132
- application needs no change.
133
-
134
- ⚠️ **`tenantHeaderName` has no user interface.** It is a stored setting with a
135
- default and nothing binds it to an input. An application that resolves tenancy
136
- by query parameter, claim, subdomain, or a renamed header **cannot be driven by
137
- Lens** without editing `chrome.storage.local` by hand. Guidance describing
138
- a "Tenant Header Name" field on an options page is describing something that
139
- does not exist — there is no `options_page` in the manifest at all.
140
-
141
- ### The frontend
142
-
143
- Detection is not header-level and is not invisible. Lens injects a function into
144
- the page's main world and looks for:
145
-
146
- 1. an element with `id="root"`;
147
- 2. a React fiber or container key on it (`__reactFiber…` / `__reactContainer…`);
148
- 3. a context value on the fiber tree carrying either a `reconnectQueries`
149
- property, or a `configuration` object with one of `baseUrl`, `apiBaseUrl`,
150
- `apiSurface`, `apiSurfaceBaseUrl`, `baseUri` or `baseAddress`.
151
-
152
- If that fails it falls back to matching the path
153
- `/projects/{guid}/application/{guid}`, and otherwise to the host being
154
- `localhost` or `127.0.0.1`.
155
-
156
- ⚠️ A non-React frontend, a root element with another id, or a React version that
157
- renames its internal fiber keys leaves Lens undetected — the Commands, Queries
158
- and Query Diagnostics tabs are then **disabled**, and only Context and Settings
159
- work. The detected base URL is also what the Commands and Queries tabs call, so
160
- without detection there is nothing to call.
161
-
162
- ## Switch the active user or tenant
163
-
164
- Pick both on the **Context** tab. Two things then happen, in this order:
165
-
166
- 1. The service worker rebuilds its `declarativeNetRequest` **dynamic** rules —
167
- at most two, one for the identity headers and one for the tenant header.
168
- 2. It deletes the Arc identity cookie `.cratis-identity` on the detected base URL
169
- and page origins, then reloads every open tab on those origins.
170
-
171
- The backend neither reads nor writes that legacy identity
172
- cookie. Lens still deletes it for older hosts; reloading clears the frontend's
173
- in-memory identity and asks `/.cratis/me` again. Header-based switching requires
174
- the host-wide trust opt-in and a suitable development/ingress boundary; the
175
- extension cannot turn unsigned headers into authenticated credentials.
176
-
177
- The rules are scoped, deliberately. When a page origin is known the condition is
178
- `{ urlFilter: '*', initiatorDomains: [<page host>] }`; otherwise it is
179
- `||<base URL host>`. **With neither resolvable, no rules are installed at all** —
180
- `host_permissions` is `<all_urls>`, so a wildcard filter would attach
181
- impersonation headers to every XHR on every site the developer browses.
182
-
183
- ⚠️ The rules match `XMLHTTPREQUEST` **only**. Document navigations, WebSocket
184
- connections and EventSource/SSE streams carry no injected headers. Arc's
185
- observable-query transports (`/.cratis/queries/ws`, `/.cratis/queries/sse`) are
186
- therefore **not** covered by header injection.
187
-
188
- ## Execute a command or query
189
-
190
- The Commands and Queries tabs read the introspection lists and group them into a
191
- tree by splitting the namespace on `.`.
192
-
193
- A command is always `POST <base URL><route>` with `Content-Type: application/json`
194
- and the active context headers, and a body built by the schema-driven editor. A
195
- query is always `GET`, with `{name}` segments in the route substituted from the
196
- path-parameter inputs and the same context headers.
197
-
198
- ⚠️ **The schema-driven payload form does not receive a schema from
199
- Arc.** Lens reads an optional property named `schema` off each introspection
200
- item, and falls back to trying `/.cratis/types/{type}`, `/.cratis/schema/{type}`,
201
- `/.cratis/schemas/{type}` and `/.cratis/types?type={type}` in turn. Arc names the
202
- property **`payloadSchema`** on a command and **`argumentsSchema`** on a query,
203
- and maps none of those four fallback routes. Every branch therefore misses, and
204
- the panel shows *"No payload schema available. Lens will execute this command
205
- with an empty payload object."*
206
-
207
- There is **no raw-JSON editor** behind that empty state, so a command reached
208
- this way can only be fired with `{}`. Expect that for every command until the two
209
- sides agree on a property name; do not read it as a broken application. Queries
210
- are unaffected — their inputs come from the `{name}` segments of the route, not
211
- from a schema.
212
-
213
- Both result panels parse defensively rather than against a contract: success is
214
- `isSuccess` when present and HTTP 2xx otherwise, messages are harvested from
215
- `exceptionMessages`/`errors`/`message`/`title`/`detail`, and a query payload is
216
- unwrapped from the first of `data`, `result`, `items`, `results`, `value`,
217
- `payload` or `content` that is present.
218
-
219
- ⚠️ **The two introspection fetches send no headers and no credentials**, while
220
- the Settings user/tenant refresh does send both. So an application that puts
221
- authentication in front of `/.cratis/commands` and `/.cratis/queries` breaks
222
- those tabs while Settings may keep working. This is the default outside
223
- Development. Run the app in **Development**, or knowingly set
224
- `Cratis:Arc:Introspection:RequireAuthentication=false` on an isolated development
225
- host; do not weaken production discovery for Lens.
87
+ ## Switch context and inspect
226
88
 
227
- Queries are path-parameter GETs only: no query-string arguments, no paging or
228
- sorting inputs, and no observable subscription from the popup.
89
+ Open the popup on the application tab. In **Context**, choose a user and tenant.
90
+ The tab reloads; check that the application reports the selected values. Use
91
+ fixture identities, whether imported from Arc or created in Lens Settings.
229
92
 
230
- ## Query diagnostics
93
+ Open **Commands** or **Queries** to inspect discovered endpoints. Use the normal
94
+ client for commands that need a payload: Lens expects a different schema field
95
+ than Arc supplies and has no raw JSON editor. Popup queries accept path
96
+ parameters, not live subscriptions or paging options.
231
97
 
232
- The Query Diagnostics tab is read-only and polls every 2 seconds. It requires the
233
- detected Arc context to expose `observableQueryDiagnostics.getSnapshot()`; when
234
- it does not, the panel reports no data. Nothing else in Lens depends on it.
98
+ Read [Lens troubleshooting](references/troubleshooting.md) when context switching
99
+ fails, tabs are disabled, a payload editor is missing, or observable diagnostics
100
+ show no data.
235
101
 
236
102
  ## Verify
237
103
 
@@ -0,0 +1,139 @@
1
+ # Troubleshoot Lens against an Arc application
2
+
3
+ ## Contents
4
+
5
+ - Identity
6
+ - Tenancy
7
+ - Frontend detection
8
+ - Switch the active user or tenant
9
+ - Execute a command or query
10
+ - Query diagnostics
11
+
12
+ ## Identity
13
+
14
+ Lens sends exactly three forwarded client-principal headers. Arc ignores them
15
+ and treats the request as anonymous unless
16
+ `Cratis:Arc:TrustForwardedIdentityHeaders=true`; a default Arc app therefore
17
+ does not honor Lens identity switching:
18
+
19
+ ```text
20
+ X-MS-CLIENT-PRINCIPAL-ID
21
+ X-MS-CLIENT-PRINCIPAL-NAME
22
+ X-MS-CLIENT-PRINCIPAL # base64 of the principal JSON
23
+ ```
24
+
25
+ The principal document it base64-encodes is
26
+ `{ identityProvider, userId, userDetails, userRoles, claims: [{ typ, val }], … }`
27
+ with the user's `identityDetails` and `applicationProperties` spread over it.
28
+ `identityProvider` defaults to `aad` and `userRoles` falls back to
29
+ `["authenticated", "anonymous"]` when the user has no roles.
30
+
31
+ ⚠️ That is Lens's **only** identity mode. There is no bearer token, no OIDC, no
32
+ sign-in. The application has to be running on the Microsoft-Identity-Platform
33
+ forwarded-header path, and the reverse proxy in front of it in production must
34
+ be the only thing that can set those headers.
35
+
36
+ ## Tenancy
37
+
38
+ Lens sets one header, named by its `tenantHeaderName` setting, whose default is
39
+ `x-cratis-tenant-id`. That matches `TenancyOptions.HttpHeader`'s default, and
40
+ `TenantResolverType.Header` is Arc's default resolver — so a default Arc
41
+ application needs no change.
42
+
43
+ ⚠️ **`tenantHeaderName` has no user interface.** It is a stored setting with a
44
+ default and nothing binds it to an input. An application that resolves tenancy
45
+ by query parameter, claim, subdomain, or a renamed header **cannot be driven by
46
+ Lens** without editing `chrome.storage.local` by hand. Guidance describing
47
+ a "Tenant Header Name" field on an options page is describing something that
48
+ does not exist — there is no `options_page` in the manifest at all.
49
+
50
+ ## Frontend detection
51
+
52
+ Detection is not header-level and is not invisible. Lens injects a function into
53
+ the page's main world and looks for:
54
+
55
+ 1. an element with `id="root"`;
56
+ 2. a React fiber or container key on it (`__reactFiber…` / `__reactContainer…`);
57
+ 3. a context value on the fiber tree carrying either a `reconnectQueries`
58
+ property, or a `configuration` object with one of `baseUrl`, `apiBaseUrl`,
59
+ `apiSurface`, `apiSurfaceBaseUrl`, `baseUri` or `baseAddress`.
60
+
61
+ The page probe recognizes `/projects/{guid}/application/{guid}` as a fallback.
62
+ If script execution errors or produces no result, the extension also accepts
63
+ `localhost` or `127.0.0.1`. A negative result from a successfully executed
64
+ probe is not overridden simply because the tab is on localhost.
65
+
66
+ If neither React inspection nor a fallback detects the application, Lens leaves it undetected — the Commands, Queries
67
+ and Query Diagnostics tabs are then **disabled**, and only Context and Settings
68
+ work. The detected base URL is also what the Commands and Queries tabs call, so
69
+ without detection there is nothing to call.
70
+
71
+ ## Switch the active user or tenant
72
+
73
+ Pick both on the **Context** tab. Two things then happen, in this order:
74
+
75
+ 1. The service worker rebuilds its `declarativeNetRequest` **dynamic** rules —
76
+ at most two, one for the identity headers and one for the tenant header.
77
+ 2. It deletes the Arc identity cookie `.cratis-identity` on the detected base URL
78
+ and page origins, then reloads every open tab on those origins.
79
+
80
+ Reloading clears the frontend’s in-memory identity and requests `/.cratis/me` again. Header-based switching requires
81
+ the host-wide trust opt-in and a suitable development/ingress boundary; the
82
+ extension cannot turn unsigned headers into authenticated credentials.
83
+
84
+ The rules are scoped, deliberately. When a page origin is known the condition is
85
+ `{ urlFilter: '*', initiatorDomains: [<page host>] }`; otherwise it is
86
+ `||<base URL host>`. **With neither resolvable, no rules are installed at all** —
87
+ `host_permissions` is `<all_urls>`, so a wildcard filter would attach
88
+ impersonation headers to every XHR on every site the developer browses.
89
+
90
+ ⚠️ The rules match `XMLHTTPREQUEST` **only**. Document navigations, WebSocket
91
+ connections and EventSource/SSE streams carry no injected headers. Arc's
92
+ observable-query transports (`/.cratis/queries/ws`, `/.cratis/queries/sse`) are
93
+ therefore **not** covered by header injection.
94
+
95
+ ## Execute a command or query
96
+
97
+ The Commands and Queries tabs read the introspection lists and group them into a
98
+ tree by splitting the namespace on `.`.
99
+
100
+ A command is always `POST <base URL><route>` with `Content-Type: application/json`
101
+ and the active context headers, and a body built by the schema-driven editor. A
102
+ query is always `GET`, with `{name}` segments in the route substituted from the
103
+ path-parameter inputs and the same context headers.
104
+
105
+ ⚠️ **The schema-driven payload form does not receive a schema from
106
+ Arc.** Lens reads an optional property named `schema` off each introspection
107
+ item, and falls back to trying `/.cratis/types/{type}`, `/.cratis/schema/{type}`,
108
+ `/.cratis/schemas/{type}` and `/.cratis/types?type={type}` in turn. Arc names the
109
+ property **`payloadSchema`** on a command and **`argumentsSchema`** on a query,
110
+ and maps none of those four fallback routes. Every branch therefore misses, and
111
+ the panel shows *"No payload schema available. Lens will execute this command
112
+ with an empty payload object."*
113
+
114
+ There is no raw JSON editor. If no schema is available, the command would send
115
+ `{}`; use the normal client for a command that needs a payload. Query inputs
116
+ come from the `{name}` segments of the route, not from a schema.
117
+
118
+ Both result panels parse defensively rather than against a contract: success is
119
+ `isSuccess` when present and HTTP 2xx otherwise, messages are harvested from
120
+ `exceptionMessages`/`errors`/`message`/`title`/`detail`, and a query payload is
121
+ unwrapped from the first of `data`, `result`, `items`, `results`, `value`,
122
+ `payload` or `content` that is present.
123
+
124
+ ⚠️ **The two introspection fetches do not set context headers or opt into cross-origin credentials**, while
125
+ the Settings user/tenant refresh does send both. So an application that puts
126
+ authentication in front of `/.cratis/commands` and `/.cratis/queries` breaks
127
+ those tabs while Settings may keep working. This is the default outside
128
+ Development. Run the app in **Development**, or knowingly set
129
+ `Cratis:Arc:Introspection:RequireAuthentication=false` on an isolated development
130
+ host; do not weaken production discovery for Lens.
131
+
132
+ Queries are path-parameter GETs only: no query-string arguments, no paging or
133
+ sorting inputs, and no observable subscription from the popup.
134
+
135
+ ## Query diagnostics
136
+
137
+ The Query Diagnostics tab is read-only and polls every 2 seconds. It requires the
138
+ detected Arc context to expose `observableQueryDiagnostics.getSnapshot()`; when
139
+ it does not, the panel reports no data. Nothing else in Lens depends on it.