@cratis/pi 8.4.1 → 8.5.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 (137) hide show
  1. package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +2 -1
  2. package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +1 -1
  3. package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +2 -1
  4. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +131 -9
  5. package/package/corpus/rules/ai-distribution.md +2 -1
  6. package/package/corpus/rules/exit-codes-and-wrappers.md +1 -1
  7. package/package/corpus/rules/scripting.md +2 -1
  8. package/package/corpus/skills/cratis-application-growth/references/csharp.md +1 -1
  9. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +3 -3
  10. package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +28 -3
  11. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp-query-security.md +3 -3
  12. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +1 -1
  13. package/package/corpus/skills/cratis-arc-authorize-request/references/typescript.md +2 -0
  14. package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -0
  15. package/package/corpus/skills/cratis-arc-connect-storage/references/elixir.md +9 -2
  16. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-chronicle.md +1 -1
  17. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-history.md +2 -2
  18. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +7 -7
  19. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-abilities.md +2 -2
  20. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-recovery.md +6 -4
  21. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +2 -2
  22. package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
  23. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +6 -6
  24. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/java.md +1 -1
  25. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/kotlin.md +1 -1
  26. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp-diagnose-tool-call.md +9 -7
  27. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp.md +3 -1
  28. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +1 -1
  29. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +10 -7
  30. package/package/corpus/skills/cratis-arc-expose-query/references/go.md +2 -2
  31. package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +6 -3
  32. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +7 -5
  33. package/package/corpus/skills/cratis-arc-host-application/references/csharp-identity.md +3 -2
  34. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +7 -0
  35. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp-extensions.md +4 -0
  36. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +1 -1
  37. package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +4 -2
  38. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +17 -22
  39. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-commands.md +11 -1
  40. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-host.md +10 -3
  41. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-identity.md +7 -3
  42. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-queries.md +1 -1
  43. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript.md +1 -1
  44. package/package/corpus/skills/cratis-arc-testing-typescript/references/typescript.md +2 -2
  45. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +1 -0
  46. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +5 -5
  47. package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +11 -3
  48. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +22 -0
  49. package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +17 -3
  50. package/package/corpus/skills/cratis-chronicle-cli-operations/references/setup-and-target.md +8 -2
  51. package/package/corpus/skills/cratis-chronicle-connect-application/references/python.md +2 -2
  52. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +1 -1
  53. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +4 -3
  54. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/configuration.md +86 -16
  55. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/kernel-options.md +3 -3
  56. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +14 -6
  57. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +33 -1
  58. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/upgrade-and-recovery.md +27 -1
  59. package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
  60. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +4 -4
  61. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +8 -7
  62. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/go.md +2 -2
  63. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +1 -1
  64. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +1 -1
  65. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +1 -1
  66. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +1 -1
  67. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-model-bound.md +1 -1
  68. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-reading.md +2 -0
  69. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +1 -1
  70. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +3 -3
  71. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +2 -0
  72. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +1 -1
  73. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp-scopes.md +1 -1
  74. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +2 -2
  75. package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
  76. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +4 -2
  77. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +6 -5
  78. package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir-integrations.md +3 -3
  79. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +2 -1
  80. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-pages.md +1 -1
  81. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +3 -3
  82. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
  83. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +2 -2
  84. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
  85. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +1 -1
  86. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +4 -3
  87. package/package/corpus/skills/cratis-ci-pipeline-performance/references/publish-pipelines.md +19 -4
  88. package/package/corpus/skills/cratis-code-review/SKILL.md +6 -2
  89. package/package/corpus/skills/cratis-code-review/references/csharp.md +3 -3
  90. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +6 -38
  91. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +2 -0
  92. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md +5 -4
  93. package/package/corpus/skills/cratis-commits-and-pull-requests/references/workflow-inputs.md +39 -0
  94. package/package/corpus/skills/cratis-components-submit-form/SKILL.md +6 -6
  95. package/package/corpus/skills/cratis-components-submit-form/references/typescript-commanddialog.md +21 -1
  96. package/package/corpus/skills/cratis-components-submit-form/references/typescript.md +2 -2
  97. package/package/corpus/skills/cratis-fundamentals-concept/references/csharp-serialization.md +2 -1
  98. package/package/corpus/skills/cratis-fundamentals-concept/references/csharp.md +1 -0
  99. package/package/corpus/skills/cratis-fundamentals-concept/references/go.md +1 -1
  100. package/package/corpus/skills/cratis-fundamentals-concept/references/java-json.md +3 -2
  101. package/package/corpus/skills/cratis-fundamentals-concept/references/kotlin-json.md +3 -2
  102. package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-serialization.md +8 -2
  103. package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -7
  104. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +3 -3
  105. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md +3 -0
  106. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp.md +2 -2
  107. package/package/corpus/skills/cratis-platform-deliver-slice/references/typescript.md +14 -1
  108. package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +8 -8
  109. package/package/corpus/skills/cratis-platform-prepare-release-pr/references/product-release-checks.md +16 -2
  110. package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -1
  111. package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +6 -3
  112. package/package/corpus/skills/cratis-screenplay-accept-model/references/csharp.md +5 -3
  113. package/package/corpus/skills/cratis-screenplay-accept-model/references/read-the-evidence.md +2 -2
  114. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -10
  115. package/package/corpus/skills/cratis-screenplay-declare-slice/references/commands.md +8 -4
  116. package/package/corpus/skills/cratis-screenplay-declare-slice/references/projections.md +2 -0
  117. package/package/corpus/skills/cratis-screenplay-declare-slice/references/structure-and-imports.md +19 -1
  118. package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +2 -1
  119. package/package/corpus/skills/cratis-screenplay-edit-workspace/references/mcp-tools.md +1 -1
  120. package/package/corpus/skills/cratis-screenplay-handoff-slice/references/csharp.md +13 -1
  121. package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +1 -1
  122. package/package/corpus/skills/cratis-screenplay-model-translation/references/boundary-diagnostics.md +1 -1
  123. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +26 -48
  124. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/studio.md +5 -0
  125. package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +8 -12
  126. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/running-mcp.md +12 -0
  127. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/scenarios.md +2 -2
  128. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +1 -1
  129. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-events.md +6 -0
  130. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-integration.md +3 -2
  131. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-reactors.md +15 -2
  132. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-read-models.md +4 -2
  133. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +1 -1
  134. package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +4 -2
  135. package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +6 -0
  136. package/package/corpus/skills/cratis-stage-render-slice/references/semantic-conformance.md +64 -0
  137. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Workflow inputs and outputs
5
+
6
+ ## Policy workflow inputs
7
+
8
+ Check the caller's workflow for which inputs its referenced policy supports.
9
+
10
+ - `runs-on` — select a different runner when the normal runner cannot run policy.
11
+ - `release-intent` — control the `main` release-label gate; use only when the repository deliberately differs.
12
+ - `extra-allowed` — allow additional root Markdown file names, comma-separated.
13
+ - `extra-allowed-paths` — allow additional documentation directory prefixes, comma-separated.
14
+ - `agent-authors` — list agent logins (comma- or newline-separated) to warn when a valid trace is missing on checked pull requests.
15
+ - `require-agent-trace` — make that warning a failure for listed authors, regardless of label.
16
+
17
+ ## Release-action inputs and outputs
18
+
19
+ For workflow maintainers; use the repository's existing publication workflow when delivering a pull request.
20
+
21
+ - `github-token` — supply a token when the workflow token cannot read pull requests or write releases with the required scopes.
22
+ - `version` — use an explicit version for an authorized manual release instead of deriving it from intent.
23
+ - `release-notes` — supply the body for an explicit manual release when no pull request body will be read.
24
+ - `tag-prefix` — align version tags with a repository's naming convention.
25
+ - `major-labels` — map alternate labels to a breaking release.
26
+ - `minor-labels` — map alternate labels to a compatible feature release.
27
+ - `patch-labels` — map alternate labels to a fix release.
28
+ - `no-release-labels` — map alternate labels to intentional non-publication.
29
+ - `release-window` — opt into batching by setting the wait in minutes; use a scheduled trigger and serialize publication across triggers.
30
+ - `hotfix-labels` — map alternate labels to bypass the release window.
31
+ - `close-resolved-issues` — turn off issue closing when the workflow should only publish; enabled closing requires `issues: write`.
32
+ - `should-publish` — gate downstream publication jobs on intent after the release job succeeds.
33
+ - `version` (output) — version to publish under.
34
+ - `tag` — release tag to verify against the intended commit.
35
+ - `prerelease` — select prerelease artifact handling.
36
+ - `isolated-for-pull-request` — select pull-request-only publication when indicated.
37
+ - `previous-version` — identify the predecessor for release comparison, when known.
38
+ - `pull-requests` — inspect the included pull request numbers in a batched decision.
39
+ - `reason` — distinguish unexpected non-publication from an intentional skip or a pending batch.
@@ -56,15 +56,15 @@ Choose `CommandForm` instead when the input stays on the page: put the same fiel
56
56
  **Submission in the Components containers.** Confirm (or Submit) starts a busy state: the primary button shows a spinner and dialog dismissal is blocked. `CommandDialog` makes fields inert; steppers keep fields editable unless `confirmBeforeExecute` is set and disable Next and Submit (`StepperCommandDialog` also Previous and Cancel). Then, in order:
57
57
 
58
58
  1. `onBeforeExecute` — sync or async, must return the values; a missing return keeps the current values with a warning; a throw stops everything.
59
- 2. `confirmBeforeExecute` — executes only on literal `true`; if the values changed while it was pending nothing runs; a rejection goes to `onException`.
59
+ 2. `confirmBeforeExecute` — executes only on literal `true`. Any other answer, or values changed while it was pending, skips execution with no result callback; a throw or rejection also skips it and goes to `onException` (logged when absent).
60
60
  3. The command runs; busy ends; result callbacks are awaited.
61
61
  4. Success: `onSuccess(response)`, then the close decision. Failure: `onFailed`, then as they apply `onException`, `onUnauthorized`, `onValidationFailure`; the result is applied to the fields and the container stays open. In `CommandDialog` only, a validation refusal is announced (`validationAnnouncement`) and focus moves to the first invalid field; steppers just show the messages.
62
62
 
63
- This sequence, and the validity gate before it, belong to the containers' own buttons. The form's `execute()` handle is the inline path: inside a container it skips the async transform, approval, announcement and close, so keep the container's buttons (relabel them) instead of a custom footer.
63
+ On `CommandDialog` and `StepperCommandDialog`, `formRef`'s `execute()` runs this same submission (transform, confirmation, result callbacks, close on success). On a standalone `CommandStepper` it reaches the inner form and skips the stepper's transform and confirmation; use the stepper's Submit. Prefer the containers' own buttons, relabelled.
64
64
 
65
65
  A callback that throws or rejects stops the chain: no later callback, no field messages, no close; the command outcome stands.
66
66
 
67
- **Inline `CommandForm`.** It renders a native form: a submit button inside it runs it, as does `execute()` on `formRef` (see Inline CommandForm in your language reference). There is no validity gate: only a custom field error blocks before the transform; the command's own client validation then refuses invalid values without a request. `onBeforeExecute` is synchronous and there is no `confirmBeforeExecute`. The result is published to the form first, then callbacks fire unawaited. `execute()` resolves with the result, including refusals and server exceptions; a throw (for example in the transform) rejects it and shows nothing, so catch it. `onStateChange` reports execution, validity, authorization and validation-snapshot changes. An `onFieldValidate` message blocks execution and reports through `onFailed` and `onValidationFailure`. Nothing closes or resets. Field errors, a summary of results no field claims, and the safe `exceptionMessage` render inside the form unless `showErrors` is false — never raw exception text.
67
+ **Inline `CommandForm`.** It renders a native form: a submit button inside it runs it, as does `execute()` on `formRef` (see Inline CommandForm in your language reference). There is no validity gate: only a custom field error blocks before the transform; the command's own client validation then refuses invalid values without a request. `onBeforeExecute` is synchronous and there is no `confirmBeforeExecute`. The result is published to the form first, then callbacks fire unawaited. `execute()` resolves with the result, including refusals and server exceptions; a throw (for example in the transform) rejects it and shows nothing, so catch it. An `onFieldValidate` message blocks execution and reports through `onFailed` and `onValidationFailure`. Nothing closes or resets. Field errors, a summary of results no field claims, and the safe `exceptionMessage` render inside the form unless `showErrors` is false — never raw exception text.
68
68
 
69
69
  **Closing.** `CommandDialog` closes through the surrounding `useDialog` context:
70
70
 
@@ -74,7 +74,7 @@ A callback that throws or rejects stops the chain: no later callback, no field m
74
74
  - Failure or a refused confirmation never closes. A close veto does not undo a successful command.
75
75
  - Without `useDialog` nothing closes itself: render the dialog conditionally and hide it from `onSuccess` and `onCancel`.
76
76
 
77
- **Steps.** Each element child of a stepper is one step: one `StepperPanel` per step; a fragment around several panels is one step; a conditionally rendered panel is fine. A step's fields are found in its panel's element tree; a field a custom component renders internally does not count for that step. Next (or a header, with `linear` off) is refused while the current step shows field errors — displayed errors, not missing values, so under blur validation an untouched blank field does not block it (`validateOnInit` does). Moving back is always allowed; with `linear` (default) headers are not clickable. `onChangeStep` reports an accepted move. Removing a conditional panel keeps its values and its command rules. `StepperCommandDialog` hides Submit until the last step and a valid form, closes like `CommandDialog`, and offers no footer Cancel unless `showCancel`. `CommandStepper` shows Submit on the last step, disabled while invalid, busy or while any step shows field errors; success leaves it in place, so navigate or reset from `onSuccess`. Both use the same transform, confirmation and callback sequence. Put each bound property on exactly one step with a distinct `header`; keep the built-in navigation and relabel it. Each panel is named by its step header. Stable parts carry `data-*` state attributes for styling (see Several steps in your language reference).
77
+ **Steps.** Each element child of a stepper is one step: use one `StepperPanel` per step with a distinct `header`, and put each bound property on exactly one step. Next is refused while the current step shows field errors; moving back is always allowed. `StepperCommandDialog` closes like `CommandDialog`; `CommandStepper` stays in place after success, so navigate or reset from `onSuccess`. Both use the same transform, confirmation and callback sequence. Keep the built-in navigation and relabel it. Step rules, Submit visibility and styling attributes: see Several steps in your language reference.
78
78
 
79
79
  **Binding.** Fields bind wherever they render inside the form, including inside layout elements and custom components. A field binds one top-level property: a nested accessor binds its first member, and `fieldName` is a literal property name for a computed accessor. Edit an object-valued property with one custom field (see Nested data in your language reference). Server validation results map to fields by member name; results no field claims go to the summary.
80
80
 
@@ -94,9 +94,9 @@ Fields and generation come from Components' form entry point, containers from it
94
94
  | `onFieldChange` | Notified per change with old and new value and that field's validity. |
95
95
  | `onBeforeExecute` | Transform values just before execution and return them; never for required values (validation already ran). |
96
96
  | `onSuccess` | Receives the command response. |
97
- | `onFailed`, `onException`, `onUnauthorized`, `onValidationFailure` | Failure callbacks, in that order; log `onException` diagnostics, do not show them. |
97
+ | `onFailed`, `onException`, `onUnauthorized`, `onValidationFailure` | Failure callbacks; for a failed command result the applicable ones run in that order. A declined `confirmBeforeExecute` calls none; one that throws calls only `onException`, with no command result. Signatures: `onFailed(result)` (the whole result, including `correlationId`), `onException(messages, stackTrace)` (no result), `onUnauthorized()`, `onValidationFailure(validationResults)`. Log exception diagnostics; never show them. |
98
98
  | `formRef` | Handle with `execute()` and live `isExecuting`, `isValid`, `isAuthorized`, `validation`; run the form from outside it. |
99
- | `onStateChange` | Called when execution, validity or authorization changes. |
99
+ | `onStateChange` | Called when execution, validity, authorization or the validation snapshot changes. |
100
100
  | `showTitles`, `showErrors` | Field titles; errors, summary and exception panel (both default on). |
101
101
  | `exceptionMessage` | Safe, localized text shown when the command throws. |
102
102
  | `validationSummaryComponent`, `exceptionDisplayComponent` | Replace the summary (a visible one needs an alert role) or the exception panel. |
@@ -4,6 +4,7 @@
4
4
 
5
5
  - Transform before executing
6
6
  - Confirm before executing
7
+ - Submit from outside the dialog
7
8
  - Yes and No buttons
8
9
  - Several steps
9
10
  - Stepper layout and styling
@@ -46,6 +47,16 @@ export const SiteDialogs = () => (
46
47
 
47
48
  In an app that opens dialogs with `useDialog`, render the `useDialog` wrapper inside `DialogComponents`, usually registered once at the app root.
48
49
 
50
+ Any answer other than `true` skips execution without calling a result callback. A throw or rejection also skips it and is reported through `onException`, or logged when there is none.
51
+
52
+ ## Submit from outside the dialog
53
+
54
+ On `CommandDialog` and `StepperCommandDialog`, `formRef.current?.execute()` runs the dialog's own submission, the one its confirm button runs: `onBeforeExecute`, `confirmBeforeExecute`, the command, the result callbacks, and the close on success. Do not close the dialog again afterwards.
55
+
56
+ The promise resolves with the command result when the command ran. When it did not run (a declined or failed confirmation, values changed while pending, a submission already running, or a close being decided) it resolves with a result whose `isSuccess` is `false` and that carries no errors. Always check `isSuccess`.
57
+
58
+ On a standalone `CommandStepper`, `formRef` reaches the inner `CommandForm`, so `execute()` skips the stepper's `onBeforeExecute` and `confirmBeforeExecute`. Use the stepper's Submit button instead.
59
+
49
60
  ## Yes and No buttons
50
61
 
51
62
  Use `buttons={DialogButtons.YesNo}` when the dialog asks a question and has no fields to review; keep the default OK and Cancel for a form.
@@ -85,7 +96,16 @@ Use `StepperCommandDialog` in a dialog and `CommandStepper` on a page. Give each
85
96
  </CommandStepper>
86
97
  ```
87
98
 
88
- A conditional step is `{needsBilling && <StepperPanel header="Billing">…</StepperPanel>}`; hiding it keeps its values and the command's rules for them. On `CommandStepper`, `showNavigation={false}` hides the whole built-in footer, Submit included, and `showSubmit={false}` hides only Submit; labels fall back to the provider's stepper messages.
99
+ A conditional step is `{needsBilling && <StepperPanel header="Billing">…</StepperPanel>}`; hiding it keeps its values and the command's rules for them.
100
+
101
+ Step rules:
102
+
103
+ - Each element child is one step; a fragment around several panels is one step.
104
+ - A step's fields are found in its panel's element tree; a field that a custom component renders internally does not count for that step.
105
+ - Next (or a header, with `linear` off) is refused while the current step shows field errors. These are displayed errors, not missing values: under blur validation an untouched blank field does not block it, unless `validateOnInit` is set.
106
+ - Moving back is always allowed. With `linear` (the default) headers are not clickable. `onChangeStep` reports an accepted move.
107
+ - `StepperCommandDialog` hides Submit until the last step and a valid form, and offers no footer Cancel unless `showCancel` is set.
108
+ - `CommandStepper` shows Submit on the last step, disabled while the form is invalid or busy, or while any step shows field errors. On `CommandStepper`, `showNavigation={false}` hides the whole built-in footer, Submit included, and `showSubmit={false}` hides only Submit; labels fall back to the provider's stepper messages.
89
109
 
90
110
  ## Stepper layout and styling
91
111
 
@@ -93,14 +93,14 @@ Pass the selection as dialog input: `useDialog<TResponse, TInput>(EditOperator)`
93
93
  ## Topic references
94
94
 
95
95
  - [Fields](typescript-fields.md): every field with an example, nested data, custom fields and generated forms.
96
- - [Command dialogs and steppers](typescript-commanddialog.md): transforms, confirmation, steppers and their parts, controlled visibility and the dialog footer.
96
+ - [Command dialogs and steppers](typescript-commanddialog.md): transforms, confirmation, submitting through `formRef`, step rules, steppers and their parts, controlled visibility and the dialog footer.
97
97
  - [Inline CommandForm](typescript-commandform.md): the inline form, `formRef.execute()` and its result contract, form context operations, validation freshness, display customization and shared defaults.
98
98
 
99
99
  ## Avoid
100
100
 
101
101
  - Putting `CommandForm` inside a container; the container already is the form. To generate fields inside one, use `AutoCommandFields`.
102
102
  - Executing a second command from a close or click handler; put caller-owned effects in `onSuccess`.
103
- - Calling `formRef.current?.execute()` from your own button to submit a `CommandDialog` or stepper; that is the inline path, so it skips the container's transform, `confirmBeforeExecute`, the refusal announcement and closing. Keep the container's buttons and relabel them.
103
+ - Calling `formRef.current?.execute()` on a standalone `CommandStepper`; it reaches the inner form and skips the stepper's transform and `confirmBeforeExecute`. Use the stepper's Submit. (On `CommandDialog` and `StepperCommandDialog` it runs the dialog's own submission.)
104
104
  - Required values known to the caller in `onBeforeExecute`; validation runs before it, so they belong in `initialValues`.
105
105
  - Returning a spread copy (`{ ...command }`) from `onBeforeExecute`; mutate and return the instance you receive.
106
106
  - Constructing the `initialValues` object inline when it holds a fresh `Guid.create()`; capture it once with `useState`.
@@ -63,7 +63,8 @@ public record CustomerName(string Value) : ConceptAs<string>(Value);
63
63
  | `null` properties | Omitted | `JsonIgnoreCondition.WhenWritingNull` |
64
64
  | Concept | Its wrapped value | `ConceptAsJsonConverterFactory` |
65
65
  | Collection of concepts | Array of wrapped values | `EnumerableConceptAsJsonConverterFactory` |
66
- | Enum | Number when written; a number or a case-insensitive name when read. A number that is not a defined value (or, for a `[Flags]` enum, not a combination of defined values) is rejected | `EnumConverterFactory` |
66
+ | Enum | Number when written. When read, a number must be an integer that fits the enum's backing type and must be a defined value; for a `[Flags]` enum, any combination of declared bits passes, so `1` passes when the only member is `Both = 3`. A string may be a case-insensitive name, comma-separated names or a number, and is not checked against the defined values, so `"99"` binds; check membership in a validator when it matters | `EnumConverterFactory` |
67
+ | Concept wrapping an enum | Number when written. When read, a number must be an integer that fits the enum's backing type but need not be a defined value. A string may be a member name (case-sensitive), comma-separated names, or a number (`"99"`), none checked against the defined values. A string that does not parse throws `ArgumentException` (`OverflowException` for a number out of range), not `JsonException`. Reject undefined values in the concept's validator | `ConceptAsJsonConverterFactory` |
67
68
  | `DateOnly`, `TimeOnly` | ISO text (`2025-03-01`, `13:45:00.0000000`) | `DateOnlyJsonConverter`, `TimeOnlyJsonConverter` |
68
69
  | `Uri` | Text | `UriJsonConverter` |
69
70
  | `Type` | `Full.Type.Name, AssemblyName` | `TypeJsonConverter` |
@@ -26,6 +26,7 @@ public record PageCount(int Value) : ConceptAs<int>(Value);
26
26
  ```
27
27
 
28
28
  - Declare it as a `record` with exactly one wrapped value; a second property is lost on every surface because only `Value` is serialized.
29
+ - Keep the constructor a plain wrapper. JSON, route and query binding, MongoDB and the EF Core converters from `BaseDbContext`, `ApplyConceptAsConversion` or `.AsConcept()` convert the incoming value to the backing type, call the constructor with it, and then set `Value` back to that converted value if the constructor changed it. The EF Core converter that `AddConceptAsSupport()` installs keeps what the constructor produced instead. A trim or case change in the constructor or base argument therefore applies on some paths and not others; a constructor that throws still rejects the value. To handle non-canonical input, reject it in a `ConceptValidator<>`, which Arc applies when it validates commands, queries and MVC models (reading JSON or storage does not validate), or normalize it in a named factory method that your boundary code calls.
29
30
  - Add the `T` to concept implicit operator only when callers benefit; it is not required by any Cratis surface.
30
31
  - Model absence as a nullable reference (`CustomerName?`). `ConceptAs<Guid?>` violates the `IComparable` constraint.
31
32
  - Add a `NotSet` or `Empty` value only when the domain reserves that backing value.
@@ -196,7 +196,7 @@ func (id *CustomerID) UnmarshalText(data []byte) error {
196
196
 
197
197
  - **SQL (UUID only):** forward `func (id CustomerID) Value() (driver.Value, error) { return concepts.UUID(id).Value() }` and `func (id *CustomerID) Scan(src any) error { return (*concepts.UUID)(id).Scan(src) }`. `Value` writes canonical text, zero included, never NULL. `Scan` accepts dashed text or exactly 16 RFC-order bytes and rejects NULL: use `sql.Null[CustomerID]` or a pointer for a nullable column, and read a SQL Server `uniqueidentifier` as text. The other shared scalars have no SQL codecs.
198
198
  - **Other UUID libraries:** a 16-byte RFC-order UUID type converts with a plain type conversion in both directions; no bytes are reordered.
199
- - **Legacy .NET text:** `concepts.ParseDotNetGUID(text)` accepts the other .NET GUID text forms and returns a `concepts.UUID`. Use it only to import an existing .NET text contract, never from the forwarding codecs, and bound the input length first: it has no length cap.
199
+ - **Legacy .NET text:** `concepts.ParseDotNetGUID(text)` accepts the other .NET GUID text forms and returns a `concepts.UUID`. Use it only to import an existing .NET text contract, never from the forwarding codecs, and bound the input length first: it has no length cap. Empty or rejected input returns `UUID{}` and an error, so check `err` first. A valid all-zero input succeeds with the all-zero UUID, and in the legacy forms some components that hold nothing but a `+` or `0x` prefix read as zero, so then check `IsZero()` as in Validating decoders before you use the result as an identity.
200
200
 
201
201
  ## Recognize and check
202
202
 
@@ -52,7 +52,7 @@ A concept is written as its bare value and read back through the concept's own c
52
52
  - JSON `null` reads as `null`; a list of concepts is a list of bare values, `null` elements kept.
53
53
  - Construction order: the canonical constructor of a one-component Java record, then a public static `of(value)`, then a public single-argument constructor. A private constructor with a public static `of(value)` works. In a named Java module, open the concept's package to reflection.
54
54
  - A concept used as a map key is written as the value's text. `new ConceptsModule(ConceptKeyFormat.EMBEDDED_JSON)` writes the key as compact JSON instead, as the .NET serializer does for dictionaries (a string key then carries its quotes), and still reads plain keys. Module discovery always uses the plain form.
55
- - Payloads shared with .NET differ in a few spellings: a `Byte` is signed, whole floating-point numbers keep `.0`, and timestamps keep nanoseconds.
55
+ - Payloads shared with .NET are not identical. A JVM `Byte` holds -128 to 127, a .NET `byte` 0 to 255. Whole floating-point numbers keep `.0`. An `OffsetDateTime` keeps up to nine fraction digits where .NET keeps seven, while `LocalTime` and `TimeSpanModule` `Duration` values are truncated to 100 ns on write. Quotes inside an embedded-JSON key are escaped as `\"` where .NET usually writes `\u0022`. Never compare shared payloads as raw text or as parsed JSON trees: decode both sides into values, embedded-JSON keys included, and compare those under the agreed contract.
56
56
 
57
57
  ## Module catalog
58
58
 
@@ -94,7 +94,8 @@ var shape = mapper.readValue(json, Shape.class);
94
94
  - Every superclass of your own is a target too, so a member declared as the base class resolves the same way.
95
95
  - Annotate only concrete classes: not an interface, an abstract class, an enum or a concept.
96
96
  - One module per mapper: a second `DerivedTypesModule` replaces the first, so put every family in the same registry. `DerivedTypes.EMPTY` registers nothing.
97
- - A missing `_derivedTypeId` reads as `null`. An unknown, `null` or non-text identifier fails, and so does writing an annotated class that is not in the registry.
97
+ - Reading checks the declared type. When it has a derived class in the registry and no Jackson type information (`@JsonTypeInfo` or default typing) applies, a missing `_derivedTypeId` reads as `null` and an unknown, `null` or non-text identifier fails. Any other declared type gets plain Jackson handling, so reading it as an interface or abstract class fails unless your own Jackson setup handles it.
98
+ - Writing checks the runtime class. A registered class written by runtime value adds `_derivedTypeId` to its object, whatever the declared type, `Object` included; one whose body is not a JSON object fails to write. A writer fixed to an interface type is not covered. An annotated class that is not in the registry fails to write when it is assignable to a type that has a derived class in the registry. Any other class is written by plain Jackson, without `_derivedTypeId`.
98
99
  - Property naming, creators and custom serializers of the body stay Jackson's. Serialize by runtime value (`writeValueAsString(value)`).
99
100
  - Query the registry with `derivedTypeFor(target, new DerivedTypeId(id))`, `targetTypeFor(type)`, `isDerivedType(type)`, `hasDerivatives(type)` and `getTypesWithDerivatives()`.
100
101
 
@@ -52,7 +52,7 @@ A concept is written as its bare value and read back through the concept's own c
52
52
  - JSON `null` reads as `null`; a list of concepts is a list of bare values, `null` elements kept.
53
53
  - Construction order: the canonical constructor of a one-component Java record, then a public static `of(value)`, then a public single-argument constructor. A private constructor with a public `@JvmStatic` companion `of(value)` works. The Jackson Kotlin module is not needed for concepts.
54
54
  - A concept used as a map key is written as the value's text. `ConceptsModule(ConceptKeyFormat.EMBEDDED_JSON)` writes the key as compact JSON instead, as the .NET serializer does for dictionaries (a string key then carries its quotes), and still reads plain keys. Module discovery always uses the plain form.
55
- - Payloads shared with .NET differ in a few spellings: a `Byte` is signed, whole floating-point numbers keep `.0`, and timestamps keep nanoseconds.
55
+ - Payloads shared with .NET are not identical. A JVM `Byte` holds -128 to 127, a .NET `byte` 0 to 255. Whole floating-point numbers keep `.0`. An `OffsetDateTime` keeps up to nine fraction digits where .NET keeps seven, while `LocalTime` and `TimeSpanModule` `Duration` values are truncated to 100 ns on write. Quotes inside an embedded-JSON key are escaped as `\"` where .NET usually writes `\u0022`. Never compare shared payloads as raw text or as parsed JSON trees: decode both sides into values, embedded-JSON keys included, and compare those under the agreed contract.
56
56
 
57
57
  ## Module catalog
58
58
 
@@ -96,7 +96,8 @@ val shape = mapper.readValue(json, Shape::class.java)
96
96
  - Every superclass of your own is a target too, so a member declared as the base class resolves the same way.
97
97
  - Annotate only concrete classes: not an interface, an abstract class, an enum or a concept.
98
98
  - One module per mapper: a second `DerivedTypesModule` replaces the first, so put every family in the same registry. `DerivedTypes.EMPTY` registers nothing.
99
- - A missing `_derivedTypeId` reads as `null`. An unknown, `null` or non-text identifier fails, and so does writing an annotated class that is not in the registry.
99
+ - Reading checks the declared type. When it has a derived class in the registry and no Jackson type information (`@JsonTypeInfo` or default typing) applies, a missing `_derivedTypeId` reads as `null` and an unknown, `null` or non-text identifier fails. Any other declared type gets plain Jackson handling, so reading it as an interface or abstract class fails unless your own Jackson setup handles it.
100
+ - Writing checks the runtime class. A registered class written by runtime value adds `_derivedTypeId` to its object, whatever the declared type, `Object` included; one whose body is not a JSON object fails to write. A writer fixed to an interface type is not covered. An annotated class that is not in the registry fails to write when it is assignable to a type that has a derived class in the registry. Any other class is written by plain Jackson, without `_derivedTypeId`.
100
101
  - Property naming, creators and custom serializers of the body stay Jackson's. Serialize by runtime value (`writeValueAsString(value)`).
101
102
  - Query the registry with `derivedTypeFor(target, DerivedTypeId(id))`, `targetTypeFor(type)`, `isDerivedType(type)`, `hasDerivatives(type)` and `typesWithDerivatives`.
102
103
 
@@ -158,7 +158,13 @@ const price = priceList.prices.get(key);
158
158
  | `get(key)` | The value, or `undefined` |
159
159
  | `entries()` | Iterates `[key, value]` pairs in insertion order |
160
160
 
161
- Object keys are equal when their JSON is equal, so property order matters: build a lookup key with the same members in the same order as the class declares them. Without `genericArguments` the map is read back empty.
161
+ Every `get` and `set` checks the stored keys in insertion order and uses the first one that equals the given key: strictly equal (`===`), or else, for two objects, the same `JSON.stringify` text. When either of two `Date` keys was read from text with nonzero digits finer than a millisecond, they match only if both have the same instant and the same extra digits, so a `Date` you create never matches such a key; reuse the key from `entries()`. It is not a deep-equality map:
162
+
163
+ - Decorate every key member with `@field`. Reading fills only declared fields (and keeps any `_derivedTypeId`), so keys that differ only in undecorated members read back equal.
164
+ - Property order is part of the text. Build a lookup key the way reading does: create it with `new` so the class's initializers run, then assign its members in declared order. Or reuse a key from `entries()`.
165
+ - A member that is `undefined` or absent writes no text; a .NET key omits a `null` member only when its serializer options do, as the Cratis defaults do. Reading leaves an absent member at what the constructor or its initializer gives it, except that an absent array member becomes `[]`; a member that is `null` in the text stays `null`. Give each member of a lookup key the value the read key has: leave an absent member unassigned, set an absent array member to `[]`, and set `null` only where the stored key holds `null`. Or reuse a key from `entries()`.
166
+ - Keys are stored by reference, not copied. Changing a key taken from `entries()` changes which lookups find its entry. There is no delete: to re-key an entry, build a new map.
167
+ - Without `genericArguments` the map is read back empty.
162
168
 
163
169
  ## Geospatial values
164
170
 
@@ -199,5 +205,5 @@ A converter is chosen by exact type, and registering one for a type that already
199
205
  | A polymorphic member comes back as the base type | The subclass module was not imported, the identifier differs from the backend's, or `derivatives` omits it | Import it, align the identifier, or list it |
200
206
  | `Derived type identifier '…' is already registered for '…'` | Two different classes use one identifier under the same base | Give each a unique identifier |
201
207
  | `Not a Guid.`, `Invalid DateOnly format`, `Invalid TimeOnly format`, `Invalid TimeSpan format` | The text is not the wire format in the Value types table | Fix the payload or the declared type |
202
- | A `ValueMap` lookup returns `undefined` for a key that exists | The lookup key's members are in a different order, or the key class has no `@field` members | Build the key like the declared class |
208
+ | A `ValueMap` lookup returns `undefined` for a key that exists, or another key's value | The lookup key's members are in a different order, a member differs from what reading gives it (`null` versus absent, or an array member unset instead of `[]`), a read `Date` key kept sub-millisecond digits, a stored key was changed after insertion, or the key class has no `@field` members | Decorate every key member with `@field`; create lookup keys with `new`, assign members in declared order, give each member the value the read key has (absent stays unassigned, an absent array is `[]`, `null` only where the stored key is `null`), or reuse a key from `entries()`; never change a stored key |
203
209
  | A console warning at load about more than one copy of the package | The package was loaded twice: two installs (even of the same release), or one install reached as both ESM and CommonJS. Converters registered on one copy do not reach the other | Deduplicate the dependency and load it through one module format |
@@ -24,7 +24,8 @@ A concept names a value; this skill decides **who chooses a new value, how it is
24
24
  | --- | --- |
25
25
  | A reference to existing state (the order to cancel) | A command input. Never generate a replacement: the caller's choice is the point. |
26
26
  | New and owned by the application (the identity of what is being created, a code, a token) | Generate it on the server through the concept's own factory. |
27
- | Derived from an input, the same every time | A name-based UUID or a digest, never a random value. |
27
+ | Derived from an input, the same every time | A name-based UUID or a digest, never a random value, and only from stable, non-sensitive input: anyone who knows the namespace and the input can recompute it. When the input is personal data or a secret and the value is an event-source identity, allocate an opaque identity once, store it, reuse it for that entity, and keep the input in protected event content (a property marked as personal data). An event-source identity is stored in plain text and is never protected by Chronicle's personal-data handling, even where an SDK accepts a personal-data marker on its type. |
28
+ | The identity of something a retried request creates | The identity chosen on the first attempt, never a fresh value per attempt. Reach it by one of: the caller sends the same identity on every retry; it is derived only from stable, non-sensitive input; or the server allocates an opaque identity once under a caller-supplied operation key and every attempt uses the stored one. For the last, claim the key atomically (for example a conditional insert that, on conflict, rereads the stored identity) and append only with the identity that won; an unchecked read followed by an unconditional write lets overlapping attempts store different identities and both append, because the empty-source check covers only the source being appended to. Append the create requiring the whole event source to be empty, because the automatic guard covers only server-generated values. A retry after an attempt that committed is then rejected with a concurrency violation and appends nothing; a retry after an attempt that did not commit appends. A keyed append (C# only) reports a retry as already appended only when the key and the whole event match (type, generation, content, event source, stream and subject), and as already appended after erasure when that event was since erased; a different event under the same key is refused as a key conflict. Keyed appends are refused inside a unit of work, so they cannot carry the events a command returns or stages: append immediately, supply the empty-source scope on that append yourself, and never put personal data in the key. Add a unique constraint on a natural key only when that key must stay unique across identities. |
28
29
  | A gap-free number (invoice numbers) | A coordinated counter. No generator produces consecutive values. |
29
30
 
30
31
  Whether an identity is an event-source identity or a plain one is a declaration choice (`cratis-fundamentals-concept`); generation is the same for both.
@@ -42,9 +43,9 @@ Whether an identity is an event-source identity or a plain one is a declaration
42
43
  ## Default path
43
44
 
44
45
  1. Make the identity concept self-generating with a random UUID. Choose another strategy only for a stated need in "Choose a strategy".
45
- 2. Ask for the new value as a server-generated handler parameter and return it as the command response. (C# only; where the SDK has none, call the concept's factory inside the handler and return the value.)
46
- 3. In specs, pin the value by name and assert that the response and the appended event use it. (C# only; where pins do not exist, read the value from the response and assert its format.)
47
- 4. Check: the request contract has no field for the generated value, and the spec asserts the exact value or the format.
46
+ 2. Ask for the new value as a server-generated handler parameter and return it as the command response. (C# only; where the SDK has none, call the concept's factory inside the handler and return the value.) When a retry must reach the same identity, do not generate a fresh value per attempt: reach it as "Who chooses the value" describes for retried creates, and take a caller-supplied identity as a command input.
47
+ 3. For a generated value, pin it by name in specs and assert that the response and the appended event use it. (C# only; where pins do not exist, read the value from the response and assert its format.) For an identity a retry reuses, send the same request twice without a pin that forces the same identity (allow generation instead where the handler has a generated parameter), and assert that the first appended the expected create on the expected event source and that the second appended nothing.
48
+ 4. Check: the request contract has no field for a server-generated value, a caller-supplied identity is a command input the server never replaces, and the spec asserts the exact value or the format.
48
49
 
49
50
  Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Node server `package.json` → typescript, `*.kt` → kotlin, `*.java` → java, `go.mod` → go, `mix.exs` → elixir); only the project's languages are installed.
50
51
 
@@ -58,7 +59,7 @@ Python has no application SDK: call the owning service's command through its HTT
58
59
  | UUID column that should append to indexes | Time-ordered UUID (v7) | Reveals creation time |
59
60
  | Sortable string identity | ULID | 80 random bits; reveals creation time |
60
61
  | Identity that names its kind in logs and URLs | TypeID with a prefix | Time-ordered; prefix rules apply |
61
- | Same input must give the same identity | Name-based UUID (v5) | Guessable by anyone who knows namespace and name |
62
+ | Same input must give the same identity | Name-based UUID (v5) | Guessable by anyone who knows namespace and name; only from stable, non-sensitive input. For an event-source identity whose input is personal data or a secret, allocate an opaque identity once and keep the input in protected event content |
62
63
  | Compact URL-safe string | NanoID with defaults | 21 characters, 126 random bits |
63
64
  | Code people read or type | Pattern, or NanoID with a look-alike-free alphabet | Few random bits: back it with a uniqueness check; never an identity |
64
65
  | Numeric ticket | Integer in an inclusive range | Not a sequence, low entropy |
@@ -116,7 +117,7 @@ Not every SDK ships every item below. Your language reference names the exact AP
116
117
 
117
118
  ## Done when
118
119
 
119
- - Every new identity, code or token is produced by its concept's factory with a strategy chosen from the table above, and no caller-selected reference is generated.
120
+ - Every new identity, code or token the server chooses is produced by its concept's factory with a strategy chosen from the table above; caller-selected references and caller-supplied identities are inputs the server never replaces, and a retried create reuses its first attempt's identity.
120
121
  - No value that must be unguessable comes from a non-cryptographic source.
121
- - Specs fix the generated value (or the clock and tenant) and assert the exact value or its format.
122
+ - Specs fix each generated value (or the clock and tenant) and assert the exact value or its format; a create a retry may repeat is tested, without a pin that forces the reused identity, to append once on the expected source and nothing the second time.
122
123
  - Each shared concept sits at the lowest level that contains every slice using its meaning.
@@ -40,7 +40,7 @@ Do not use it when the consumer needs one chosen service. Inject that service's
40
40
  - **Reflected members:** a provider without generated records (the plain providers of an explicit universe, or the reflection fallback) contributes every non-interface, non-abstract type its assemblies define. That includes non-public and generic classes, which an instance set cannot resolve, so filter such a set or register what it must resolve.
41
41
  - **Closed generic contracts:** generated records key a generic contract only by its open definition, and lookups match keys exactly. A set or query for a closed contract, such as the handlers of one message type, therefore holds only implementations that were also reflected: those the conventions bind and those from reflected providers. Others, for example an ignore-convention class registered by hand, are silently missing. For a complete set, query the open definition and keep the types assignable to the closed contract.
42
42
  - **Set semantics:** a contract is never a member of its own set, each implementation appears once, and the order means nothing.
43
- - **Contributing assemblies:** an assembly contributes only if it was compiled with the generator and was loaded, or reachable through the references of loaded assemblies, when the universe was built.
43
+ - **Contributing assemblies:** an assembly compiled with the generator registers its own provider, which adds its types to all types and the assembly to the contributing assemblies. A project's generator also adds binding-only implementations from some referenced assemblies whose names start with `Cratis` (ordinary runtime references, not analyzers, build tasks, aliased references or assemblies that depend on Roslyn): the public classes it binds by convention or as themselves. Contract and full-name lookups find these, but they enter all types and the contributing assemblies only through a provider of their own assembly, and an ignore-convention class appears only through that provider. Being found is not being resolvable: an instance set resolves each implementation as itself, so one that is bound only under its interface makes enumeration fail. Implementations from any other referenced assembly do not enter generated discovery, and adding a package prefix does not change that. An external interface or base class that a local implementation fulfils is still indexed as its contract and found by full name. To include another assembly's implementations, compile it with the generator or register a hand-written provider that supplies its types. Every contributor must be loaded, or reachable through the references of loaded assemblies, when the universe is built.
44
44
  - **Universe lifetime:** the default universe is built once for each distinct set of generated providers and shared by every container in the process. If registering discovery again finds new providers, a new universe is built. An existing universe never grows.
45
45
  - **Instance set enumeration:** the type list is fixed when the set is created. The set keeps the service provider that resolved it: the root container for a singleton consumer, or the operation's scope for a consumer resolved in that scope, even a transient one. Each enumeration resolves every type again, as itself, from that provider. Resolve a scope-bound consumer inside the operation's scope and finish enumerating before the scope ends. Without a marker an implementation is transient, so every enumeration creates new instances; when an operation must reuse them, materialize the set once. Enumeration fails if a discovered type has no registration as itself.
46
46
  - **Lifetimes:** no marker means transient, the singleton marker means one instance per container, and the scoped marker means one instance per scope. Put the marker on the implementation class itself, because a marker on a base class is not inherited. A singleton consumer's instance set resolves from the root container, so it must not enumerate scoped implementations: scope validation rejects them, and without validation they are silently shared.
@@ -71,11 +71,11 @@ Consume:
71
71
  - **Instance set:** enumerates a resolved instance of every implementation of a closed contract. This is the default for acting on all implementations.
72
72
  - **Type set:** enumerates the implementation types of a closed contract without constructing them. Use it for metadata, or when a long-lived consumer must resolve each type from the scope of the current operation.
73
73
  - **Known instance set:** a fixed set (empty, or given instances) that replaces discovery in a unit spec.
74
- - **Type universe: all types:** every discovered type, including non-implementations. Use it for custom scans the contract queries cannot express.
74
+ - **Type universe: all types:** every type a provider defines, including non-implementations. Binding-only implementations from referenced Cratis assemblies are not in it. Use it for custom scans the contract queries cannot express.
75
75
  - **Type universe: find multiple:** returns the implementations of a contract given as a type: an interface, a base class or an open generic definition. An open generic definition matches implementations of every closed form; query it and filter by assignability for a complete closed generic set.
76
76
  - **Type universe: find single:** takes the same kinds of contract and returns the one implementation, or nothing when none exists. It fails with *multiple types found* when there is more than one. Use it for an optional single provider.
77
77
  - **Type universe: find by full name:** finds a type by its namespace-qualified name, without the assembly name. It fails with *unable to resolve type by name* when no type has that name, and with an invalid-operation error when several discovered types share it. Use it to turn a stored or transmitted type name back into a type.
78
- - **Type universe: assemblies:** the assemblies that contributed. Use it in diagnostics.
78
+ - **Type universe: assemblies:** the assemblies that providers supplied. An assembly that contributes only binding-only implementations is not listed. Use it in diagnostics.
79
79
  - **Type universe: discovery mode:** one of *generated*, the normal case; *explicit*, when the caller supplied assembly providers; *reflected*, a fallback used only when no generated provider exists, which does not happen while Fundamentals itself is referenced; and *unknown*, when a custom universe implementation does not report a mode.
80
80
 
81
81
  Register in the host:
@@ -29,6 +29,9 @@ First establish whether the type is missing from the universe, then whether it i
29
29
  - **The universe was captured too early:** `Types.Instance`, or a `Types` you constructed before the providers were registered, misses later providers. Use the container's `ITypes`, or `TypesServiceCollectionExtensions.CurrentTypeUniverse()`.
30
30
  - **Trimmed or ahead-of-time publish:** an assembly that only discovery reaches, and that no compiled code references, can be trimmed away. Discovery cannot recover it. Keep it with `<TrimmerRootAssembly Include="Contoso.Plugins" />` or a `DynamicDependency` attribute.
31
31
  - **Explicit universe:** only the assemblies its providers supply are present. `PackageReferencedAssemblies` includes only names that start with a configured prefix (`Cratis` by default). Call `AddAssemblyPrefixesToInclude` before the universe is built.
32
+ - **A type from another library:** generated discovery includes another assembly's implementations only through a provider: its own generated provider, when it was compiled with the generator, or a hand-written one. Without one, a referenced assembly whose name starts with `Cratis` adds only binding-only implementations through your project's provider: the public classes the conventions bind. Contract and full-name lookups find them, but an `[IgnoreConvention]` class from it is missing, its types are not in `All`, and the assembly is not listed in `Assemblies`. Aliased references, analyzer or build-task assets and assemblies that depend on Roslyn add nothing. `AddAssemblyPrefixesToInclude` changes none of this, because it configures only `PackageReferencedAssemblies`. To include another library:
33
+ - **Default universe (Arc, or a plain host that calls `AddTypeDiscovery()` without providers):** pass a hand-written provider to `GeneratedTypeDiscoveryRegistry.Register` before type discovery and the conventions run. `AddCratisArc` on an application builder runs them at once; the `IHostBuilder` overload runs them when the host builds its services. A universe built from explicit providers ignores the registry. Register the implementations as themselves unless the provider supplies self bindings (see Explicit universe and custom providers in [csharp.md](csharp.md)).
34
+ - **Plain host only:** call `PackageReferencedAssemblies.Instance.AddAssemblyPrefixesToInclude("Contoso")` before anything initializes that provider, pass `[ProjectReferencedAssemblies.Instance, PackageReferencedAssemblies.Instance]` to `AddTypeDiscovery`, and register the implementations as themselves. The prefix matches the runtime library (package) name, and the provider loads the assembly by that name. Confirm that `DiscoveryMode` is `Explicit` and that `Assemblies` lists the assembly; if it does not, use a hand-written provider. Arc works from the default universe it captures during setup, so this route does not work there.
32
35
 
33
36
  ## Enumeration throws
34
37
 
@@ -122,8 +122,8 @@ Inject `ITypes` (namespace `Cratis.Types`) for queries that the sets cannot expr
122
122
  | `FindMultiple<T>()`, `FindMultiple(Type)` | Implementations of an interface or base class. Pass an open generic definition such as `typeof(IHandle<>)` to match every closed form. |
123
123
  | `FindSingle<T>()`, `FindSingle(Type)` | The one implementation, or `null` when there is none. Throws `MultipleTypesFound` when there are several. |
124
124
  | `FindTypeByFullName(string)` | A type by namespace-qualified name, without the assembly name. Throws `UnableToResolveTypeByName` when no type has that name. |
125
- | `All` | Every discovered type. |
126
- | `Assemblies` | The contributing assemblies. |
125
+ | `All` | Every type a provider defines. Excludes binding-only implementations from referenced `Cratis` assemblies, which contract and full-name lookups still find. |
126
+ | `Assemblies` | The assemblies that providers supplied. An assembly that contributes only binding-only implementations is not listed. |
127
127
  | `DiscoveryMode` | `TypeDiscoveryMode.Generated`, `Explicit`, `Reflected` or `Unknown`. |
128
128
 
129
129
  Outside a container, call `TypesServiceCollectionExtensions.CurrentTypeUniverse()`. It returns the same instance that `AddTypeDiscovery()` registers. Avoid `Types.Instance`, which is a snapshot taken the first time anything touches it, and avoid `new Types()`, which repeats the build.
@@ -55,6 +55,17 @@ const application = await builder.build();
55
55
  override configuration). `builder.withChronicle({...})` is the same after `import '@cratis/arc.chronicle'`.
56
56
  Options: `completionTimeoutMs` waits for observers after each append; `readModelNamingPolicy` (Arc-owned
57
57
  client only); `activateArtifactsInScopes` resolves reactors/reducers per delivery from Arc's container.
58
+ The wait does not narrow observers by appended event type: it counts every observer on that event log
59
+ in the command's event store and namespace (except kernel-owned reactors not subscribed there) and
60
+ waits for each to reach the tail of the append. One exception: when the append ends at sequence zero
61
+ (the log's first event), a currently subscribed observer with tag, event source type or event stream
62
+ type filters is skipped unless that event matches both its filters and its subscribed event types. A counted observer without a failed partition that stays behind the tail — for
63
+ example one that does not handle the last appended event — holds the wait until the timeout. A failed
64
+ partition ends the wait as soon as no other counted observer is outstanding. A timeout or a failed
65
+ partition makes the command report an exception; the append is not rolled back. Cancelling the command
66
+ after the append stops Arc's wait without reporting an error; the completion request already sent to
67
+ Chronicle is not cancelled. Set it only when every counted observer reaches the tail; otherwise
68
+ let the client tolerate read-model lag.
58
69
 
59
70
  **Generated metadata is required for idiomatic code.** TypeScript erases parameter types; the generator
60
71
  records them so `handle(service: Svc)` and `@query()` bind without explicit descriptors. Arc refuses to
@@ -127,7 +138,9 @@ export class OnePermitPerPlate implements IConstraint {
127
138
  key; personal data takes `@pii()` (`@cratis/chronicle/compliance`) instead. Do not rely on
128
139
  secret-looking field names being skipped.
129
140
  - Command operation: return `tuple(event, new MyOperation())` (`CommandOperation` with `execute` and
130
- `compensate`); operations run first and are compensated only on a known rejection of the batch.
141
+ `compensate`); operations run first. If the command then fails, they are compensated in reverse order
142
+ unless the append's outcome is unknown. A failed or timed-out completion wait also compensates them,
143
+ although the events stay appended.
131
144
 
132
145
  ## Serving
133
146
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-platform-prepare-release-pr
3
- description: Use when a finished change to a Cratis library, tool or AI corpus needs a pull request title, release note and release intent, or when a merged change appears unreleased. Not for implementing changes (use cratis-platform-contribute-change), repairing releases or writing upgrade guides (use cratis-release-notes), or coordinating repositories (use cratis-engineering-release-trains).
3
+ description: Use when a finished change to a Cratis library, tool or AI corpus needs a pull request title, release note and release intent, when a merged change appears unreleased, when a pull request build should publish a prerelease, or for product release rules (Go v0.x labels, a fix for an older major line, Studio, MCP artifacts). Not for implementing changes (use cratis-platform-contribute-change), repairing releases or writing upgrade guides (use cratis-release-notes), or coordinating repositories (use cratis-engineering-release-trains).
4
4
  ---
5
5
 
6
6
  # Prepare a platform release pull request
@@ -50,19 +50,19 @@ Choose by what a consumer observes after upgrading, not by which folder changed.
50
50
 
51
51
  | Label | The consumer, after upgrading... |
52
52
  | --- | --- |
53
- | `major` | must change something. Examples: a removed or renamed public type or member, a changed wire, persisted or event shape, a changed result, a removed CLI option |
54
- | `minor` | can adopt something new, and nothing existing changes |
53
+ | `major` | must change something. Examples: a removed or renamed public type or member, a changed wire, persisted or event shape, a changed result, a removed CLI option. Exception: the v0.x Go modules (Fundamentals.Go, Arc.Go and Chronicle.Go) use `minor` for a breaking API change |
54
+ | `minor` | can adopt something new, and nothing existing changes. In the v0.x Go modules (Fundamentals.Go, Arc.Go and Chronicle.Go) it also covers a breaking API change, which the note must describe |
55
55
  | `patch` | gets a fix or an internal change, with identical contracts |
56
56
  | `no-release` | cannot observe any change. Examples: documentation, CI, repository automation, specs and tests, tooling that ships no artifact |
57
57
 
58
58
  - The PR policy rejects missing or conflicting intent (including `no-release` beside a bump). `no-release` still requires all required checks. Ask when the consumer impact is unclear rather than burning a version.
59
- - `major` requires explicit human approval of the release and a human merge. For root-module ceilings or nested-module changes, see the [product release checks](references/product-release-checks.md).
59
+ - `major` requires explicit human approval of the release and a human merge. The action applies a label's bump to the highest stable GitHub release. With no stable release, it uses the highest version tag, else `0.0.0`; if the lookup fails, it uses `0.0.0`. In automatic releases, `no-release` leaves out that PR's own bump and notes, but its merge can still publish other pending PRs. For the Go modules (v0.x labels, major ceiling, nested modules) or a fix for an older major line, such as Components 3, see the [product release checks](references/product-release-checks.md).
60
60
  - AI corpus: use `patch` for corrections, `minor` for new guidance, and `no-release` for tests, evaluations or CI that do not ship. For hooks, tell consumers to run `cratis ai update`.
61
61
  - Dependabot is exempt from the hosted policy check and omitted from action-driven release notes and bumps; use `no-release` for non-shipping maintenance.
62
62
 
63
63
  ## Writing the title and note
64
64
 
65
- Title the PR with the change a consumer can recognize at a glance. Use a short, specific action phrase and follow the repository's title convention if it has one. Do not use the title to set release intent; the workflow takes it from labels or explicit inputs. Never add a CI skip token to a PR title: it can carry into the merge commit and suppress verification on `main`.
65
+ Title the PR with the change a consumer can recognize at a glance. Use a short, specific action phrase and follow the repository's title convention if it has one. For automatic releases, the title does not set release intent; the workflow takes it from labels or explicit inputs. A Fundamentals.Go nested-module release PR is the exception (see the [product release checks](references/product-release-checks.md)). Never add a CI skip token to a PR title: it can carry into the merge commit and suppress verification on `main`.
66
66
 
67
67
  Write what changed for the upgrader, not how the change was built. The full body contract is in `cratis-commits-and-pull-requests`.
68
68
 
@@ -92,10 +92,10 @@ A label-derived decision checks for an existing release at its target before sel
92
92
 
93
93
  ### Release intent labels
94
94
 
95
- - `major`: breaking consumer change; requires explicit human approval and a human merge.
96
- - `minor`: backward-compatible addition; use for new opt-in capabilities.
95
+ - `major`: breaking consumer change; requires explicit human approval and a human merge. The v0.x Go modules use `minor` instead.
96
+ - `minor`: backward-compatible addition; use for new opt-in capabilities. In the v0.x Go modules, also a breaking API change, described in the note.
97
97
  - `patch`: compatible fix or improvement; use when existing contracts stay intact.
98
- - `no-release`: no version or notes for this PR, even if its merge is an ancestor of a later release.
98
+ - `no-release`: in automatic releases, no version or notes for this PR, even if its merge is an ancestor of a later release.
99
99
  - `hotfix`: in windowed batching, add beside a bump to skip the wait for the entire pending set; a pending `major` gives `error` on the hotfix's merge run and `batched` on other non-manual runs.
100
100
 
101
101
  ### Note body
@@ -11,11 +11,25 @@
11
11
  - The compatibility gate can hold **deployment after publication**. Check the tag and images separately, then the compatibility output and deployment/smoke results. A green run with a hold and skipped deploy is not production evidence.
12
12
  - **Release compatibility retry** checks production again and dispatches the production deployment when compatible; it does not publish a new release. Confirm the deployed version and smoke result before saying it reached production.
13
13
 
14
+ ## Components
15
+
16
+ - Components 3 is in maintenance on the `support/3.x` branch, never released from `main`. The automatic release on `main` bumps from the highest stable release, which is on the current major, so it cannot release a 3.x fix, and dispatching Publish on `main` refuses an older-major version.
17
+ - Land a 3.x fix by pull request into `support/3.x`. Then propose dispatching **Publish** from `support/3.x` with the exact new 3.x version, unless the request authorizes the dispatch.
18
+ - The 3.x packages publish under the `v3-lts` npm dist-tag, and `latest` stays on the current major. Consumers on a `^3` range receive the fix through it; others install the exact version or `@v3-lts`.
19
+ - A 3.x release gets a plain `v3.x.y` tag and no GitHub release. Re-running a failed support run skips packages already published and continues where it stopped.
20
+
14
21
  ## Arc and Chronicle Go SDKs
15
22
 
16
23
  - Publish runs on a push to `main` and releases only the canonical lowercase root module, after Go and Markdown verification. Check the GitHub release/tag and that the version resolves through the public Go module proxy at `github.com/cratis/arc.go` or `github.com/cratis/chronicle.go`. If indexing fails after tagging, request a retry of the failed jobs for that same tag rather than moving the tag or bumping again.
17
- - The Go major-release policy and Publish enforce `GO_RELEASE_MAJOR_CEILING`: the neutral setting `0` blocks the first major launch, and a maintainer must approve setting it to `1`. A further major needs a new module path and release design, not a label workaround.
18
- - For a nested-module change, ask the maintainer how it should ship. Do not assume the root workflow publishes it or prescribe a special title or dispatch.
24
+ - Both Go SDKs are v0.x. Label a breaking API change `minor` and a compatible fix `patch`, and describe the break explicitly in the note.
25
+ - While `GO_RELEASE_MAJOR_CEILING` is `0` (the default), a `major` label fails the Go major-release policy check, because the bump would publish v1.0.0. Setting it to `1` is only for a maintainer-approved v1 launch that a human merges, never a way to pass one pull request; with `1`, the check permits the first v1 bump but rejects any further `major`. Values above `1` are rejected: v2 and later need a `/vN` module path and a separate release design, not a label workaround.
26
+ - Publish tags and indexes only the root module (`vX.Y.Z`). A root tag does not release a nested module, and nested-module publication is not set up. Never push a nested-module tag yourself; ask the maintainer how the change should ship.
27
+
28
+ ## Fundamentals.Go
29
+
30
+ - Fundamentals.Go is v0.x and uses the same labels as the Go SDKs: `minor` for a breaking API change, described explicitly in the note, and `patch` for a compatible fix. Publish releases the root module on a push to `main`, and the root `major` label is subject to the same `GO_RELEASE_MAJOR_CEILING` check.
31
+ - A nested module releases only through a manual path, and only if the repository allow-lists it for publication. The `recipes` module is CI-tested source and is never tagged or published.
32
+ - For a publishable nested module, use one dedicated PR to `main` per module. Title it exactly `release(<module>): <bump>` (`patch`, `minor` or `major`), give it only the `no-release` label to suppress automatic root publication, and write the nested module's release notes as its body. After the merge, a maintainer dispatches **Publish nested module**, which computes the version from that module's own releases and rejects it if its major exceeds `GO_RELEASE_MAJOR_CEILING`. Read the repository's release documentation before proposing one.
19
33
 
20
34
  ## MCP artifacts
21
35
 
@@ -104,7 +104,7 @@ These are `cratis/release-action` inputs and outputs, not a promise that a repos
104
104
  | `release-notes` input | Body and closure references for an explicit-version action release. Supply verified notes for the whole release range. In a PR-derived batch the descriptions supply the notes instead |
105
105
  | `version` input | An explicit version overrides label selection; a prerelease suffix creates a GitHub prerelease. With no version, the action works from PRs. On dispatch with batching enabled, empty or `0.0.0` releases the pending batch; without batching the placeholder forces no release |
106
106
  | `close-resolved-issues` input | Set to `false` to disable automatic closure; propose verified closures separately |
107
- | `release-window` input | Positive minutes hold a batch from its oldest pending merge; use with a schedule and one concurrency group shared by all release triggers |
107
+ | `release-window` input | Positive minutes hold a batch from its oldest pending merge; use with a schedule and one concurrency group shared by all release triggers, keeping `queue: max` |
108
108
  | `hotfix-labels` input | Bypass the window for the pending batch unless a major is pending. Only the hotfix's own merge run fails (`error`); later runs leave the range pending (`batched`) |
109
109
  | `major-labels` input | Names labels that select a major bump; use for the repository's major-release intent |
110
110
  | `minor-labels` input | Names labels that select a minor bump; use for the repository's minor-release intent |
@@ -42,12 +42,15 @@ Exit 0 means the tag contains the change: recover that version, not a new one. E
42
42
  | Nothing published, action `reason` is `no-label` or `error` | Read the decision log even if the workflow is green. Check for missing or conflicting intent labels, a version decision failure, or a multi-PR batch with no collected change section. Correct the offending labels or notes. A push-triggered action can re-read PR metadata on rerun; a `pull_request` rerun replays the old event's metadata. Use an explicit-version dispatch only if the workflow supports it, with the verified notes for its full target range. If no safe trigger exists, propose recovery to the maintainer instead of improvising a release. |
43
43
  | Release creation fails with a 403 because the target's workflow files differ from the default branch | Rerunning the old target does not fix workflow drift. If an authorized dispatch can target the current default branch, verify its commit, range, notes and gates first. For another 403, diagnose permissions or credentials instead. |
44
44
  | The release step reports that a tag belongs to another commit | Verify the tag owner and whether the intended change already shipped. Do not move or delete the tag. If the version was calculated, retry only after confirming the decision will use the new base. A fixed-version rerun reuses the colliding version; choose a new version only if an unreleased range genuinely needs releasing. |
45
- | Release exists but publishing failed | Inspect which artifacts are missing. A full rerun may report `already-released` and skip jobs gated on `should-publish`; some workflows deliberately recover the same tag. Retry failed jobs if they reuse the verified version, or use the workflow's same-tag recovery route. Confirm the artifact jobs ran and the artifacts exist. |
45
+ | Release exists but publishing failed | Inspect which artifacts are missing. A full rerun may report `already-released` and skip jobs gated on `should-publish`; some workflows deliberately recover the same tag. Retry failed jobs if they reuse the verified version, or use the workflow's same-tag recovery route. For Components, follow only the Components path below, whether packing or publication failed. Confirm the artifact jobs ran and the artifacts exist. |
46
+ | Merges landed close together; one release was tagged but its artifacts never published, or a merge's Publish run was cancelled before it started | Read the Publish `concurrency` block and how each run chooses what to release. With `cancel-in-progress: true`, a newer run in the same group cancels the release in flight, possibly after it tagged but before it finished publishing. Without `queue: max`, a newer run replaces the pending run in the same group. That loses a release only in a workflow that releases one merge per run. Some workflows aggregate on purpose: Studio keeps one pending slot, and its next successful release covers everything merged since the previous release. A compatibility hold or deferred checks can postpone that release, and its notes omit `no-release`, Dependabot and net-reverted pull requests, which still ship. There, keep the aggregation and confirm coverage with the ancestry check above against a later shipped tag, not by reading its notes. For a per-merge workflow, fix it: one group for every release trigger, `queue: max`, and `cancel-in-progress` omitted or `false` (GitHub rejects `true` with `queue: max`); see `cratis-ci-pipeline-performance` (in `cratis/engineering/core`). In either case, do not cut a new release for a change a later shipped release already contains. That later release does not repair an earlier tagged version whose artifacts never published: recover that version with the rows above. |
46
47
 
47
- Two paths that differ from a generic manual release:
48
+ Paths that differ from a generic manual release:
48
49
 
49
50
  - **Chronicle.Go:** Publish is push-only. On an indexing failure, rerun the failed jobs; the workflow can also recover `already-released` by selecting the same stable tag for that commit, verifying its target, and retrying module indexing. Verify the public Go proxy download before calling it recovered.
50
- - **Components:** Dispatch bypasses the release action and must target `main`. The placeholder `0.0.0` is a no-op; use an approved explicit stable version and the complete verified notes for the target range. The dispatch path verifies tag ownership and allows a same-commit retry of the latest tag without rewriting its release notes. It never closes issues. Verify the npm jobs and published packages; follow up on any open issues separately.
51
+ - **Components:** If the release exists but packing or npm publication failed, use **Re-run failed jobs** on the original run. It reruns the failed job and the jobs that depend on it, at the original commit and version. When packing succeeded, do this while its release artifact is still available: the publish job reuses those tarballs and skips a version already on the registry with matching integrity. Do not re-run all jobs or dispatch: either can rebuild the tarballs. If integrity differs or the artifact has expired, stop and investigate; never repack to get past the check.
52
+ - **Components mainline dispatch:** On `main`, use dispatch to recover an automatic release that never created its release, such as the 403 case above. When packing already succeeded, re-run failed jobs instead, as above. It bypasses the release action and is accepted only from `main`. Supply an exact stable version (`major.minor.patch`, no `v` prefix or prerelease suffix) greater than the highest existing stable `vX.Y.Z` tag (prerelease tags do not count); the only exception is a same-commit retry of that latest tag. So an older major is refused, and so is an unused version below the highest stable tag, even if its own run never released. If a later release superseded the lost one, check what that release delivered before choosing a route; do not pick a new version just to recover. The placeholder `0.0.0` is a no-op. Start from the original merged pull request's verified notes, then reconcile them with the entire range at the commit the dispatch actually targets. The dispatch path verifies tag ownership and allows a same-commit retry of the latest tag without rewriting its release notes; that retry repacks, so it is never a fallback once packing succeeded. It never closes issues. Verify the npm jobs and published packages; follow up on any open issues separately.
53
+ - **Components 3:** Maintenance releases are normal dispatches, not recovery: dispatch the Publish workflow on `support/3.x` with a new exact 3.x version. It publishes under the `v3-lts` dist-tag and pushes a plain tag without creating a GitHub release, so there is no release body to write or repair.
51
54
 
52
55
  An explicit-version release **through the action** uses `release-notes` for both the body and closure authorization. Pass the verified body, not the workflow's default filler, and verify any closures after publishing.
53
56
 
@@ -63,12 +63,14 @@ return 0;
63
63
 
64
64
  `ModelComparison.Compare(before, after)` (namespace `Cratis.Screenplay.Comparison`) returns the same `ModelDifference` that `screenplay diff --format json` prints. Build each side with `ComparedModel`:
65
65
 
66
- - `ComparedModel.WithIdentities(workspace)` — match by persisted identity, so renames and moves read as one change.
67
- - `ComparedModel.WithoutIdentities(workspace)` — force address matching.
66
+ - `ComparedModel.WithIdentities(workspace)` — declares the workspace's identity catalog authoritative for matching.
67
+ - `ComparedModel.WithoutIdentities(workspace)` — matches by address rather than semantic ID, without changing the workspace.
68
68
  - `ComparedModel.FromSources(applicationName, sources)` — compile in-memory sources keyed by file path; always address matching.
69
69
  - `ComparedModel.FromWorkspaceExport(json)` — a workspace export, with its identities.
70
70
 
71
- Two identity-bearing sides from different applications throw `IncompatibleModelIdentities`.
71
+ Identity matching applies only when both inputs declare persisted identities and belong to the same application. Two such inputs from different applications throw `IncompatibleModelIdentities`. If at least one input does not declare persisted identities, comparison matches by address, even across applications. A renamed or moved declaration is then not recognized as the same declaration: it usually reads as a removal plus an addition, and if another declaration now holds its old address, the two are compared as one. Under identity matching, a declaration that keeps the same semantic ID is recognized as the same declaration, so a rename or move is not reported as a removal plus an addition; a rename combined with a move to another document can still produce separate `DeclarationChangeKind.Renamed` and `DeclarationChangeKind.Moved` entries. Declarations without an assigned ID are compared only by exact kind and authoring address; groups that cannot be compared that way are reported as coverage gaps.
72
+
73
+ To compare an authored model with one generated from code, build the authored side with `WithIdentities` and the generated side with `WithoutIdentities` or `FromSources`. A generated workspace's automatically allocated catalog does not make its identities authoritative, so this comparison matches by address.
72
74
 
73
75
  ```csharp
74
76
  using Cratis.Screenplay.Comparison;
@@ -25,9 +25,9 @@ A `screenplay.json` at the model root declares the default gate for both CLIs:
25
25
 
26
26
  ## Diff
27
27
 
28
- `screenplay diff --format json` has `before` and `after` (path, revision, whether persisted identities were used, and the model revision) and `difference`:
28
+ `screenplay diff --format json` has `before` and `after` (`path`, `sourceRevision`, `persistedIdentities` — whether that input supplied a persisted identity catalog, not whether it was used for matching — and `modelRevision`, `null` when that side has no compiled model) and `difference`:
29
29
 
30
- - `matching`: `identity` when both folders hold persisted identities for the same application, so renames and moves read as one change. Otherwise `address`, where a rename reads as a removal plus an addition. Confirm continuity with the owner before calling a removal and addition a rename.
30
+ - `matching`: `identity` when both inputs are folders holding persisted identities for the same application; a declaration that keeps its semantic ID is then recognized as the same declaration rather than a removal plus an addition, though a rename combined with a move to another document can still produce separate `renamed` and `moved` entries. `address` when either input lacks persisted identities, even if the other has them and even across applications; a `.play` file input never has them. A renamed or moved declaration is then not recognized as the same declaration: it usually reads as a removal plus an addition, and if another declaration now holds its old address, the two are compared as one. Two identity folders from different applications do not compare (exit `2`). Confirm continuity with the owner before calling a removal and addition a rename.
31
31
  - `complete` and `hasSemanticChange`: `true` means a known change exists. `false` is possible only for a complete comparison. `null` means coverage is incomplete. Address matching is always incomplete, even for identical sources, so read the change lists instead of trusting the verdict.
32
32
  - `beforeExecutable` and `afterExecutable`: whether each side binds. With address matching, if either side does not bind, both sides compare by authoring declaration keys only, without property-level matching, and `sections` reports the gap. Identity matching is not reduced this way.
33
33
  - `declarations`: added, removed, renamed and moved declarations.