@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
@@ -55,7 +55,7 @@ A stored or up-to-date view, a validator over such a view, a reactor, and a posi
55
55
  - **Stream type / stream ID** restrict the guard to the relevant stream dimensions; event source and stream identity are not interchangeable.
56
56
  - **Event types** restrict the guard to the finite set affecting the decision; omitting a relevant type permits stale decisions.
57
57
  - **Source-bound operations** reuse a scope for writes to the same source when the SDK offers that shorthand.
58
- - **Batch scopes** carry checks for several dependencies on one append. Keep source labels and filters consistent; do not discard one of two conflicting guards to make the batch pass.
58
+ - **Batch scopes** carry checks for several dependencies on one append. Keep source labels and filters consistent; do not discard one of two conflicting guards to make the batch pass. Without idempotency keys, every active guard is checked against the state before the batch; if any fails, no event in the batch is appended. Unchecked scopes are skipped. A batch carrying idempotency keys checks only labels that still have new events to write: it drops guards on read-only dependencies and on labels whose events were already appended. Do not use idempotency keys when the decision depends on such a guard.
59
59
  - **Tail resolution / routing-derived scope** computes a boundary for the selected dimensions when constructing an optimistic write; a policy applied only at append time does not guard an earlier application read.
60
60
  - **Declared dimensions:** where the SDK derives a scope from a registered declaration (see your language reference), a stream's declared concurrency dimensions replace its source's dimensions; they are not added to them. A stream that declares none uses the source's, so a stream cannot opt out; an append without a stream uses the source's. A declared set that omits the `EventSourceId` dimension spans every instance with that route. The scopes are asymmetric: an append scoped to the whole source checks events in all of its streams, but an append scoped to one stream does not check the others. Any derived guard covers only the window from tail lookup to append.
61
61
  - **Strategy and first-append policy** choose derived, unchecked or custom behavior for writes without explicit scopes; verify whether an empty scope is checked before relying on a first-write race being detected.
@@ -24,7 +24,7 @@ Import `Cratis.Chronicle.Events` for `GetEventType()`.
24
24
  - Add `.WithEventSourceType(sourceType)`, `.WithEventStreamType(streamType)` or `.WithEventStreamId(streamId)` only for dimensions that bounded the read; omitting a dimension broadens the predicate. `ForEventSource<Trip>(stream: "Departures", streamId: streamId)` uses an `IEventSource` definition to set source type and resolve the declared stream, **not** the source ID.
25
25
  - `WithEventType(typeof(SeatReserved))` and `WithEventType(eventType)` accept runtime types and Chronicle event types; `WithEventTypes(watched)` adds a collection. Without a type restriction all matching types count. Never omit a type that can change the rule.
26
26
  - For several operations on one source, import `Cratis.Chronicle.EventSequences.Operations` and use `await eventStore.EventLog.ForEventSourceId(source, s => s.WithConcurrencyScope(scope).Append(new SeatReserved())).Perform();`. The configuration overload, e.g. `WithConcurrencyScope(b => b.WithEventSourceId(source).ExpectingNoMatchingEvent())`, builds the scope inline.
27
- - For a mixed batch use `await eventStore.EventLog.AppendMany(events, concurrencyScopes: new Dictionary<EventSourceId, ConcurrencyScope> { [source] = scope, [other] = otherScope });`. Match the label to the scope's explicit source ID. An independent guard (a label without appended events) must identify its own protected history explicitly. For multiple predicates under one label pass the ordered `IEnumerable<KeyValuePair<EventSourceId, ConcurrencyScope>>` overload with `correlationId` and `tags`. Repeated labels need a kernel that advertises scope conjunctions; otherwise the append throws `IncompatibleConcurrencyScopesForEventSource`. Do not overwrite a guard in a dictionary. Inspect `AppendManyResult.ConcurrencyViolations` (single append: `AppendResult.ConcurrencyViolation`) separately from constraint violations and unknown outcomes.
27
+ - For a mixed batch use `await eventStore.EventLog.AppendMany(events, concurrencyScopes: new Dictionary<EventSourceId, ConcurrencyScope> { [source] = scope, [other] = otherScope });`. Match the label to the scope's explicit source ID. An independent guard (a label without appended events) must identify its own protected history explicitly. For multiple predicates under one label pass the ordered `IEnumerable<KeyValuePair<EventSourceId, ConcurrencyScope>>` overload with `correlationId` and `tags`. With no explicit scope for a label, the client resolves each distinct route (declared dimensions, stream type, stream ID and source type) through the strategy. A route can resolve to no checked guard, for example an empty matching history under default settings. Equal resolved predicates share the earliest expected position, even when they come from different routes; different predicates keep separate guards, and the client never widens them into a whole-source check. In a batch without idempotency keys, several guards under one label, derived or explicit, need a kernel that advertises scope conjunctions. Otherwise the client throws `IncompatibleConcurrencyScopesForEventSource` before sending, and nothing is appended. Upgrade the kernel, or deliberately pass one explicit scope that covers the whole decision and accept broader conflicts. A batch in which any event carries an idempotency key refuses several distinct guards under one label even on a capable kernel, and writes nothing. It also checks only labels that still have new events to write, so it drops independent guards and guards on labels whose events were already appended. Do not use idempotency keys when the decision depends on such a guard. Do not split the batch: separate appends no longer protect the decision atomically. Do not overwrite a guard in a dictionary. Inspect `AppendManyResult.ConcurrencyViolations` (single append: `AppendResult.ConcurrencyViolation`) separately from constraint violations and unknown outcomes.
28
28
 
29
29
  ## Derive a scope only for writes without an earlier decision
30
30
 
@@ -88,7 +88,7 @@ Return both events in one `IEnumerable<EventForEventSourceId>` batch: `SeatReser
88
88
 
89
89
  - Prefer an injected model: use the command's source key, `[LookUpBy(nameof(Property))]` for another command property, or `[LookUpBy<CallerSubject>]` in `Handle` for the authenticated subject.
90
90
  - For a key on another protected model in the same member, use `[LookUpBy("order", nameof(OrderSummary.CustomerId))]`. The property must match the target key type; both reads are guarded under `On`.
91
- - For keys injection can't express (such as a service-computed hash), compute the key in `Handle` under `On` and await the injected `IDecisionReads.Get<T>(key)`. Justify any `ARCCHR0040` suppression.
91
+ - For keys injection can't express (such as a service-computed hash, or a key only an application service can supply), compute the key in `Handle` under `On` and await the injected `IDecisionReads`. Use `Get<T>(key)` for a source-scoped model. For a per-stream model, use `Get<T>(eventSourceId, eventStreamType, eventStreamId, eventSourceType)`, always passing the declaration's event source type and stream type for an `[EventStream<TSource>]` model (an omitted or different value is refused with `StreamScopeDoesNotMatchReadModel`); a key-only read of a per-stream model is refused with `ReadModelRequiresStreamScope`. Keep the reader in `Handle`; never move it into `Provide()` to silence `ARCCHR0040`. `ARCCHR0040` is Info only: it has no code fix and changes no runtime behaviour. Suppress it only around that declaration (`#pragma warning disable ARCCHR0040` … `restore`), with a concrete reason and a link to the issue tracking the missing binding; never project-wide. Suppression does not waive concurrency, authorization or acquisition-failure handling.
92
92
 
93
93
  A null or blank secondary scalar key gives a nullable model parameter `null` without a read or guard. A valid key with no instance still keeps its guard: if no matching event exists yet, the first matching append by someone else refuses this one. For required keys, reject blanks before invocation if you need a field message: acquisition can fail before validator rules run.
94
94
 
@@ -124,7 +124,7 @@ Under `On` these are code defects, not competing writes. Fix the command; never
124
124
  | `ImmediateAppendWhileReadsAreProtected` | The command appended directly instead of through its commit | Return the event from `Handle`, or append through `IEventLog.Transactional` |
125
125
  | `ReadOfSourceWithStagedEvents` | A source was read after events for it were staged; the read cannot see them | Decide once in the outer command and pass the value down |
126
126
  | `ReadAfterProtectedCommit` | A read ran after an aggregate `Commit()` | Read before committing; return the commit result last |
127
- | `ReadAndAggregateOnSameSource` | A read model and an aggregate guard the same source | Decide from one of them |
127
+ | `ReadAndAggregateOnSameSource` | A protected read model and an aggregate use the same event source ID label at runtime, even if their stream or source types differ. Under `On`, analyzer `ARCCHR0033` warns earlier, but only when an automatically injected aggregate and read-model parameter statically resolve to the same key; the runtime check is authoritative | Decide from the aggregate's state, or mark a read that does not decide `[Unprotected("why")]`. A protected read of a different event source ID may stay beside the aggregate |
128
128
  | `DecisionReadConflictsWithConcurrencyScope` | One source has both a decision read and an explicit concurrency scope | Remove the explicit scope, or do not decision-read that source |
129
129
  | `DeclaredRoutingNotCoveredByExplicitScope` | An explicit scope is narrower than the concurrency the event source declares | Widen the scope or remove the declared concurrency |
130
130
  | `DecisionReadRequiresUnitOfWork` | A decision read ran with no ambient unit of work | Read inside the command or an owned unit |
@@ -31,6 +31,6 @@ Names are illustrative. To protect a technician's contact number:
31
31
  - **Managed query:** use a supported releasing query after authorization; verify both storage and query output because release passes unprotected plaintext through.
32
32
  - **Explicit release:** for raw storage, cached instances or watch results that have not been released, use the SDK's release operation with intact ownership metadata; use collection release for multiple instances where available. Never log the result.
33
33
  - **Subject erasure:** delete the subject key in the approved namespace. For an application store this fences the subject across registered non-system stores there, deletes the key, evicts cached keys and removes associated uniqueness claims; it does not delete the documents. Resolve incomplete coverage or partial failures and retry.
34
- - **Erasure-aware event read:** when an empty value must be distinguished from an erased field, opt into erased property paths where available, outside command decision logic. Empty values alone prove nothing: wrong-key decryption can also empty a property, and transport or key-store failures can fail the read.
34
+ - **Erasure-aware event read:** when an empty value must be distinguished from an erased field, opt into erased property paths where available, outside command decision logic. Empty values alone prove nothing: wrong-key decryption can also empty a property, and transport or key-store failures can fail the read. A path is listed only when its value is recognized as ciphertext, the key it needs is deleted or fenced (the key revision recorded in the value, or the subject's current key when the value records none) **and** the subject's erasure was recorded; values not recognized as ciphertext, decryptable values, missing keys without a recorded erasure and other release failures are never listed. A newer live key does not stop a value with a recorded revision from being listed, but a value without one is tried against that newer key and can fail the read instead. Recognition is by shape only (the legacy format is any Base64 value of a fixed decoded length), and nothing is decrypted once the key is gone, so a listed path proves neither that the value was encrypted nor that the ciphertext was intact. An unlisted path or an empty list therefore proves nothing: the list is not an erasure audit and cannot certify that nothing is left to erase. The paths describe only the returned current content, not the separately stored original, revision-history or per-generation content. A server without this read fails the call rather than returning an empty list; treat that as a failed read.
35
35
  - **New lifecycle:** only after separate approval, allow a new key for future personal data. The fence otherwise refuses provisioning; the new key cannot unlock old ciphertext.
36
36
  - **Redaction and retention:** key erasure empties only values that were marked personal when they were written. To remove the content of particular recorded events (selected event types for a source, or plaintext written before marking), redact those events with a reason that contains no personal data; `cratis-chronicle-record-event` owns the call and its limits. Redaction keeps the event's position and replaces its content with a marker; routing identifiers, tags and subject remain; the marker keeps the original Occurred, CorrelationId and CausedBy (causation types only, without property values), and the event's own context records the redaction. Copies outside the sequence are untouched. Every reducer or reactor that derived state from those types should also handle the marker (`EventRedacted` in C#) to remove or sanitize that state. Redaction is not a substitute for subject erasure. Omit causation property values on new writes if they should not be retained; deleting a key does not scrub existing causation metadata. Erasure also leaves the acting identity's display name in event metadata: renaming an identity corrects a name, appends no event and erases nothing, so keep personal data out of identity names that must be erasable. Plan separately for historical plaintext, other namespaces, downstream recipients, exports, backups and recoverable key copies.
@@ -31,7 +31,7 @@ Here an order owns the history, but the technician owns the contact data. `[Subj
31
31
  - Marking a nested member protects that member. Marking a collection property (e.g. `[PII] string[] ContactNumbers`) protects the whole collection, precluding element indexing; erasure empties it. To retain other members, mark the personal members of a concrete item type instead.
32
32
  - Details default to empty and document purpose, not key selection. Nonempty resolved `[ComplianceDetails]` takes precedence; otherwise the first nonempty PII details on the property, matching parameter, declaring type or property type win, in that order.
33
33
  - `[PII(SpecialCategory = SpecialCategory.Health)]` classifies Article 9 data. Alternatives are `RacialOrEthnicOrigin`, `PoliticalOpinions`, `ReligiousOrPhilosophicalBeliefs`, `TradeUnionMembership`, `Genetic`, `Biometric`, `SexLifeOrSexualOrientation`; default `None`. `[PII(Criminal = true)]` classifies conviction/offense data; `[PII(OperationalSecret = true)]` classifies personal data that is also a secret. Both flags default to false. These flags are not emitted as schema metadata and add no protection layer.
34
- - For a **non-personal** secret use `[Encrypted]` on a property, parameter or class instead. Its default `EncryptionScope.Subject` uses a separate non-erasable-by-PII key; `[Encrypted(EncryptionScope.Namespace, details: "Authenticate the dispatch integration")]` shares a key within the store namespace; `EncryptionScope.Global` shares across the installation. Details default to empty. Never combine with PII on the same value.
34
+ - For a **non-personal** secret use `[Encrypted]` (`Cratis.Chronicle.ProtectedValues`, like `EncryptionScope`) on a property, parameter or class instead. Its default `EncryptionScope.Subject` uses a separate non-erasable-by-PII key; `[Encrypted(EncryptionScope.Namespace, details: "Authenticate the dispatch integration")]` shares a key within the store namespace; `EncryptionScope.Global` shares across the installation. Details default to empty. Never combine with PII on the same value.
35
35
  - Adding protection metadata to an existing generation protects future writes only. Removing or changing existing protection metadata in place is refused. Review earlier plaintext and other writers before rollout.
36
36
 
37
37
  ## Supply policy when annotations are unavailable
@@ -51,7 +51,7 @@ public sealed class PagerPolicy : ICanProvideComplianceMetadataForProperty
51
51
 
52
52
  For an always-personal external concept implement `ICanProvideComplianceMetadataForType` instead (`bool CanProvide(Type type) => type == typeof(ExternalPagerNumber);`, `ComplianceMetadata Provide(Type type) => new(ComplianceMetadataType.PII, "Reach the technician");`). Verify the generated schema rather than assuming a provider was discovered.
53
53
 
54
- Confidentiality has its own pair of discovered providers, for a non-personal secret on a type you cannot mark `[Encrypted]`: `ICanProvideSecurityMetadataForType` and `ICanProvideSecurityMetadataForProperty` (`Cratis.Chronicle.Confidentiality`), with the same `CanProvide`/`Provide` shape, returning `new SecurityMetadata(SecurityMetadataType.EncryptedSubject, "Authenticate the dispatch integration")`. `EncryptedNamespace` and `EncryptedGlobal` select the wider key scopes. Never let a compliance provider and a security provider both classify the same value.
54
+ Confidentiality has its own pair of discovered providers, for a non-personal secret on a type you cannot mark `[Encrypted]`: `ICanProvideSecurityMetadataForType` and `ICanProvideSecurityMetadataForProperty` (`Cratis.Chronicle.Confidentiality`, with `SecurityMetadata` and `SecurityMetadataType`; `[Encrypted]` is not there), with the same `CanProvide`/`Provide` shape, returning `new SecurityMetadata(SecurityMetadataType.EncryptedSubject, "Authenticate the dispatch integration")`. `EncryptedNamespace` and `EncryptedGlobal` select the wider key scopes. Never let a compliance provider and a security provider both classify the same value.
55
55
 
56
56
  ## Query after authorization
57
57
 
@@ -80,6 +80,8 @@ var erasedPaths = history.SelectMany(entry => entry.Context.ErasedProperties);
80
80
 
81
81
  Check the expected field paths on the affected event and query the view afresh; confirm the control still releases. The read optionally takes `filterEventTypes` as well as `eventSourceId`; omit the source only when the wider read is intended. Erasure fences new provisioning, removes the key, evicts cached keys and removes associated uniqueness claims across registered non-system stores in the namespace for an application store. Discovery and permission must cover the targets. Failure mid-deletion may be partial: resolve and retry. Do not report document deletion or coverage of forwarded copies, other namespaces or recoverable backups.
82
82
 
83
+ `ErasedProperties` is also available directly on each returned `AppendedEvent`. Paths use JSON/schema names, dotted members and bracketed indices, such as `profile.name` or `contacts[0].email`; a protected whole container reports only its boundary (`contacts`). Dictionary keys are not escaped, so a path such as `contacts.work.email` can mean a literal `work.email` key rather than nested members; do not treat paths as unambiguous field addresses, and treat them as potentially sensitive because they can contain dictionary keys. `Content` still holds the released defaults with no markers. The paths describe the current `Content` only, never `OriginalContent`. On a server without this read the call throws an `RpcException` (`StatusCode.Unimplemented`) instead of returning an empty list.
84
+
83
85
  Only after independent approval for **future** personal data: `await eventStore.PII.AllowNewEncryptionKeyFor(technicianId.ToString());`. Never do this automatically on refusal to provision. A new key cannot release earlier ciphertext.
84
86
 
85
87
  To redact event content instead, use `await eventStore.EventLog.Redact(sequenceNumber, reason);` or `await eventStore.EventLog.Redact(orderId, reason, typeof(TechnicianAssigned));`. Omitting the type filter on the latter targets the entire source. Redaction removes event content and retained causation property values, not the subject's key. The stored event keeps its position and becomes an `EventRedacted` marker (`Cratis.Chronicle.Events`). To clear derived state, add an `EventRedacted` handler to the reducer or reactor that already handles the original event type; a reducer returns `null` to remove the model. Then verify the removal. The marker, what it keeps and the observer rules are in the history reference of `cratis-chronicle-record-event`.
@@ -39,11 +39,11 @@ C#-only: derived publication, the output sequence override, keyed append-once, n
39
39
  - **Namespace and history:** Matching namespace names are case-insensitive; forwarding does not create a missing source namespace. A fresh subscription reads retained history from the beginning; an existing checkpoint resumes even after a disconnect.
40
40
  - **Metadata and protection:** Forwarding preserves event-source identity, stream route, tags and subject. A missing target subject key may be copied if permitted; an erased subject's blocked key is not restored. Handle downstream copies separately from namespace-wide key erasure.
41
41
  - **Recovery:** Replay the inbox observer to reprocess existing rows. Replay the source forwarding observer only to deliver retained publications again: this can append additional inbox rows. Make downstream effects tolerate repeats.
42
- - **Across separate kernels (federation):** an operator binds the logical source name to the producing kernel and the producer grants the stores, namespaces and event types that may be read. Application code does not change: the same origin declarations and subscriptions decide what arrives. Setup is in `cratis-chronicle-deploy-kernel`.
42
+ - **Across separate kernels (federation):** an operator binds the logical source name to the producing kernel and the producer grants the stores, namespaces and event types that may be read. Application code does not change: the same origin declarations and subscriptions decide what arrives. Setup is in `cratis-chronicle-deploy-kernel`. Only public types cross a link. Among requested, granted events, the producer withholds the whole event when its registered schema carries compliance metadata (such as a personal-data marking) anywhere it can reach, or when it cannot determine that, such as through an unresolved dynamic reference: it skips the event, counts it in a metric and moves past it. It does not inspect payloads, so it neither detects unmarked personal data nor withholds values marked only for encryption. Keep personal data and secrets out of a type meant for another kernel; record them in a private event. Subject keys and erasure never cross a link; the key copy under metadata applies only within one kernel.
43
43
 
44
44
  ## Kernel-run integrations with systems outside Chronicle
45
45
 
46
- Use these only when the other side is not a Chronicle store. They are edge cases next to the outbox and inbox above. The kernel, not the application, makes the calls, so the target must be reachable from the kernel and allowed by the kernel's destination policy (`cratis-chronicle-deploy-kernel`, webhooks reference). The application only registers the definition; a completed registration proves neither delivery nor that the definition changed. Read the stored definition back, then verify an actual delivery. What each SDK can register is in its integrations reference, linked from `references/<language>.md`.
46
+ Use webhooks, external services and HTTP captures only when the other side is not a Chronicle store; a public-events capture is the exception: it reads this store's own inbox, where another Chronicle store's events arrive, and calls no external service. They are edge cases next to the outbox and inbox above. For webhooks, external services and HTTP captures the kernel, not the application, makes the calls, so the target must be reachable from the kernel and allowed by the kernel's destination policy (`cratis-chronicle-deploy-kernel`, webhooks reference). The application only registers the definition; a completed registration proves neither delivery nor that the definition changed. Read the stored definition back, then verify an actual delivery. What each SDK can register is in its integrations reference, linked from `references/<language>.md`.
47
47
 
48
48
  | Integration | What it is | What to know |
49
49
  |---|---|---|
@@ -70,8 +70,9 @@ Use these only when the other side is not a Chronicle store. They are edge cases
70
70
 
71
71
  **Capture**
72
72
 
73
- - Two sources run: polling an HTTP external service on an interval, and reading another store's public events from the inbox to produce this store's own private events.
74
- - A capture names a key that identifies an item, and append rules that choose the event to append when an item is added, changed or removed, with the values to copy into it. Register the external service and the appended event types first.
75
- - The kernel parses a textual capture declaration; SDK builders produce that declaration. Validate before starting: a declaration can be well formed and still not runnable. The engine does not run webhook or message-topic sources, value mapping, nested or child scopes, or expression conditions.
73
+ - Two sources run: polling an HTTP external service on an interval, and reading another store's public events from the inbox to produce this store's own non-public events.
74
+ - A capture names a key that identifies an item, and append rules that choose the event to append and the values to copy into it. Every `append` needs a `when`; without one the declaration does not compile. The engine runs `when added`, `when removed`, `when <property>` (it changed), `when <p1> or <p2>`, `when <p1> and <p2>` and `when <property> from <old> to <new>` (a value transition). Only `when added` matches the first observation of a key; the property, `or`, `and` and transition rules match only changes to an item already seen. `when removed` fires only for an HTTP capture, when an item leaves the polled result; a public-events capture accepts it but never fires it. Register the appended event types first, and for an HTTP capture the external service too.
75
+ - The kernel parses a textual capture declaration; SDK builders produce that declaration. Validate before starting: compiling checks structure only, so a declaration can compile and still not run. Validation reports webhook or message-topic sources, `map` (value mapping), nested or child scopes, and a backtick expression condition (``when `expr` ``) as unsupported.
76
+ - A public-events capture reads the inbox of one origin. Every `from` type must be registered as public with an origin, and all must share that origin; split types from different stores into separate captures. Do not set `poll` on this source: the declaration does not compile. Appended types must be registered, not public, and not also listed in `from`: a capture does not publish. `key $eventSourceId` groups incoming events by event source; each event's properties are merged into the state kept for its key, and the rules compare against that. Assignments can read `$.path`, `$context.<property>` (for example `occurred`) and `$eventSourceId`; here `$.path` reads the merged state, so it can return a field kept from an earlier event. An HTTP capture cannot read `$context` or `$eventSourceId`.
76
77
  - Saving does not start a capture, and a capture with any validation message is not started. A started capture cannot be changed: saving over it is refused, so stop it, save, then start it again, on redeploy too.
77
78
  - The two sources run differently. A public-events capture subscribes to the inbox in every namespace, including ones added later, and appends in the namespace the event arrived in. An HTTP capture runs one poller for the whole event store and appends to the default namespace only. Stopping ends the subscription or the poller. Deleting also removes its progress and the state it remembered; events it appended remain.
@@ -91,14 +91,14 @@ end
91
91
  | --- | --- |
92
92
  | `use ... Capture, name:, id:, start:` | `name` defaults to the module's last segment; `id` defaults to a stable id derived from the module name, so a redeploy addresses the same capture; `start: true` asks the kernel to start it after saving (default `false`: saved but stopped) |
93
93
  | `api_source(service_name, route:, poll:)` | Poll a registered external service |
94
- | `events_source([EventModule, ...])` | Capture from another store's public events arriving in the inbox; use `key("$eventSourceId")`. Takes no poll interval, and every appended event must be a private event type of this store, different from the source events |
94
+ | `events_source([EventModule, ...])` | Capture from another store's public events arriving in this store's inbox; use `key("$eventSourceId")`. Takes no poll interval, and every appended event must be a registered, non-public event type of this store, different from the source events |
95
95
  | `webhook_source(path)` | Inbound webhook path. Not runnable, see the kernel limitation below |
96
96
  | `key(path)` | Required. Property that identifies an item and is used to detect change |
97
- | `append Event, when: condition do set(:field, expression) end` | Append `Event` when the condition matches. `set` targets a field of the event struct; the expression is `"$.path"` (a payload property) and, with `events_source` only, `"$eventSourceId"` or `"$context.<property>"` |
97
+ | `append Event, when: condition do set(:field, expression) end` | Append `Event` when the condition matches. `set` targets a field of the event struct; the expression is `"$.path"` (a property of the current item; with `events_source`, of the state merged from every event for the key so far) and, with `events_source` only, `"$eventSourceId"` or `"$context.<property>"` |
98
98
  | `map do ... end` | Not runnable. `rename(target, source)`, `template(target, "Hello, ${name}")`, `translate(target, source, [{"from", "to"}])`, `split(source, by: ",", into: [:a, :b])` |
99
99
  | `nested :path do ... end`, `children :path, identified_by: :key do ... end` | Not runnable. Scopes holding their own `map` and `append` blocks |
100
100
 
101
- `when:` conditions: `"property"` (it changed), `{:any, [...]}`, `{:all, [...]}`, `{:transition, property, from, to}`, `:added`, `:removed`, `{:expression, "..."}` (raw declaration text; not runnable).
101
+ `when:` conditions: `"property"` (it changed), `{:any, [...]}`, `{:all, [...]}`, `{:transition, property, from, to}`, `:added`, `:removed`, `{:expression, "..."}` (raw declaration text; not runnable). Only `:added` matches the first observation of a key; `"property"`, `:any`, `:all` and `:transition` match only changes to an item already seen.
102
102
 
103
103
  Rules that fail at compile time: exactly one source (`MissingCaptureSourceConfiguration`); a `key` (`MissingCaptureKey`); a `when:` on every `append` (`MissingAppendCondition`); `set` on a field the event struct lacks (`TargetPropertyMustBeAProperty`); and an appended event type whose **id** does not start with an uppercase letter or contains anything but letters, digits and underscores (`ArgumentError`). Declare such an event with an id like `"InvoiceStatusChanged"`, not `"invoice-status-changed"`.
104
104
 
@@ -66,7 +66,8 @@ Use the project's reference for the supported form of each operation.
66
66
  - Partition concurrency — cap independent partitions processed concurrently for downstream capacity; preserve order within each partition, not across them.
67
67
  - Subscription readiness — wait before appending in a live-only test; handle timeout or cancellation rather than assuming registration means ready.
68
68
  - State and failures — inspect progress and failed partitions before retrying; clear quarantine only after fixing the cause.
69
- - Replay or fast-forward — replay to process history again; fast-forward abandons pending work rather than repairing it.
69
+ - Replay or fast-forward — replay to process history again. Fast-forward is the opposite: it moves the observer to the tail, skips every unhandled event without invoking the handler and discards its failed partitions (no separate deletion needed). On an empty event sequence it does nothing and keeps the failed partitions; an observer already past the tail is left alone only when no partitions are catching up or failed. State already built is kept. Events appended after the tail was read are handled once the observer routes again; fast-forward does not lift an observer quarantine. Use it only to abandon a backlog deliberately, never as a repair.
70
70
  - Operational diagnosis and repair — diagnose with `cratis-chronicle-inspect-observer`, which stops before changing state; perform an authorized retry, quarantine clear, replay, fast-forward, observer removal or job stop, resume or delete through `cratis-chronicle-cli-operations`, or through the SDK calls in your language reference. Each returns an outcome to match: an accepted call is not a completed repair.
71
71
  - Retired reactor — a reactor whose code is deleted, renamed or moved without a pinned identity stays registered as a disconnected observer with its position. Remove it only when no service needs it; removal covers every namespace, and registering it again starts from the beginning.
72
+ - Two versions connected at once — when instances of two application versions register the same observer with different event types, the last registration wins and the other version stops receiving. Only when the last connected instance of the winner leaves does a superseded version take over: connected standbys are tried newest first, and one that cannot take over is skipped. This automatic hand-over neither lifts a quarantine nor reactivates a retired observer (a redeploy or restart that subscribes the reactor again does end its observer quarantine), and events of types only the departed version handled are not replayed to the new one. Serving both type sets at once is not supported: keep the overlap short or put new handling in a separate reactor with its own ID. The hand-over is not exactly-once, so keep effects keyed on delivery identity.
72
73
  - Read-model reactor — observe additions, modifications or removals when the change to a view is the trigger. Use materialized change detection for stored snapshots when needed. Delivery is best-effort, not a durable event subscription: a failing handler is logged or reported and never retried, with no failed partition to recover and no exactly-once delivery. Changes made while disconnected are not guaranteed to arrive, a change can arrive again after reconnecting, and snapshot comparison can merge intermediate states. Never trigger once-only external effects (payments, messages) from a view change; react to the domain event with an event reactor and make the external call idempotent.
@@ -34,7 +34,7 @@ await handler.WaitTillReachesEventSequenceNumber(position, TimeSpan.FromSeconds(
34
34
 
35
35
  `GetHandlerFor<CarrierNotice>()`, `GetHandlerFor(type)` and `GetHandlerById(id)` require a known registration. On its handler use `WaitForState` / `WaitForStateAndGetState` for a specified running state, `WaitTillActive` / `WaitTillActiveAndGetState` for active processing and `WaitForThereToBeFailedPartitions` when testing failure. Supply bounded timeouts. `IReactors` also offers generic waits for state, active, subscribed, position and failures.
36
36
 
37
- Use `GetStateFor<CarrierNotice>()` and `GetFailedPartitionsFor<CarrierNotice>()` (or pass `Type`) on the owning store and namespace. Fix the cause, then `await reactors.RetryFailedPartitionFor<CarrierNotice>(partition)` and inspect the outcome. For quarantined work `ClearFailedPartitionQuarantineFor<CarrierNotice>(partition, retryImmediately: false)` clears without an immediate retry, and automatic retries then resume on the normal retry schedule; the default also requests an immediate retry. `Replay<CarrierNotice>()`, `Replay(type)` or `Replay(id)` schedules a job and returns its ID. `FastForward<CarrierNotice>()` or `FastForward(id)` returns a result; inspect it. This abandons pending work and is not failure repair.
37
+ Use `GetStateFor<CarrierNotice>()` and `GetFailedPartitionsFor<CarrierNotice>()` (or pass `Type`) on the owning store and namespace. Fix the cause, then `await reactors.RetryFailedPartitionFor<CarrierNotice>(partition)`. Its `Accepted` outcome means the request was queued, not that the partition recovered. Every returned failure record is open: recovery deletes the partition's record, so confirm it by the partition's absence from `GetFailedPartitionsFor` and by the effect, not by `IsResolved`. For quarantined work `ClearFailedPartitionQuarantineFor<CarrierNotice>(partition, retryImmediately: false)` requests clearing without an immediate retry; the default also requests an immediate retry. Its result is likewise `Accepted` only. Once the quarantine is actually cleared, the partition returns to the normal retry schedule, but a quarantined observer still blocks its recovery; check `GetFailedPartitionsFor` afterwards. `Replay<CarrierNotice>()`, `Replay(type)` or `Replay(id)` returns the `JobId` of a command job: it asks the observer to replay, then waits until the replay job is no longer outstanding. `JobId.NotSet` means the reactor is not replayable or the command job could not be started; check for it before waiting. Wait with `var job = await eventStore.Jobs.WaitTillJobCompletesOrIsDeleted(jobId, timeout);` (`Cratis.Chronicle.Jobs`). A successful command job is removed, so `null` is the usual result, but it only means the job record is gone, not that the replay succeeded. A returned job whose `Status` is not `CompletedSuccessfully` means the command failed, for example because the observer is quarantined or has no connected client; the replay may still have started, so inspect the state rather than assume nothing ran. `WaitTillJobProgressCompleted` needs the job record, so it can time out with `TaskCanceledException` if the job is removed before a poll sees it complete. Whatever the wait returns, confirm the outcome: `GetStateFor<CarrierNotice>()` no longer reports `RunningState` `Replaying`, the effects are present and `GetFailedPartitionsFor` shows no new failures. `FastForward<CarrierNotice>()` or `FastForward(id)` returns a `FastForwardResult` whose `Outcome` is `Accepted` when the call succeeds: the request was queued and the reactor has not moved yet. No job ID is returned and both position fields are unavailable. Jobs in `eventStore.Jobs.GetJobs()` labelled `FastForward <reactor ID>` can belong to earlier or later requests, so a matching job does not report this request's outcome; verify the observer instead. When the queued work runs, it reads the tail at that moment, skips every unhandled event up to it without invoking the handler and discards the failed partitions; it abandons that work and is not failure repair. It changes nothing for a replaying, retired or removed observer (fast-forward a replaying one after the replay completes), on an empty sequence (the cursor and failed partitions stay as they were) or when the observer is already past the tail with no partitions catching up or failed. When it did run, `GetStateFor` shows `NextEventSequenceNumber` advanced past the skipped range and the failures that existed before are gone; events appended later are delivered normally and can fail again.
38
38
 
39
39
  ## When the input is a view change
40
40
 
@@ -44,12 +44,12 @@ The client binds one handler per event type, and separately one `[Replay]` handl
44
44
  - Never combine `[EventStore]`/`FromEventStore` with an explicit sequence; registration refuses it.
45
45
  - `options.EventGenerationDelivery = EventGenerationDelivery.Pinned` requests the declared generation rather than compatibility delivery; this is a client option, not a handler attribute.
46
46
  - `[Tag("shipping", "operations")]` or `[Tags("shipping", "operations")]` labels the reactor for inspection. Repeat `[FilterEventsByTag("urgent")]` with different values for an any-tag input filter. `[EventSourceType("parcel")]` and `[EventStreamType("dispatch")]` further restrict delivery by append metadata; these restrictions intersect. To filter by a declared route instead, `[FromEventSource<Parcel>("Dispatch")]` (`Cratis.Chronicle.EventSources`) sets both from an `IEventSource` definition and one stream it declares; explicit `[EventSourceType]`/`[EventStreamType]` may only repeat those values. An unregistered source or undeclared stream fails registration. `[EventStreamId("notifications")]` routes outputs, not inputs.
47
- - Prefer constructor injection for infrastructure. Handler parameters can also receive services, `EventContext` (e.g. `context.EventSourceId`, `context.SequenceNumber`), `ReactorDelivery`, or related read models. `Task Notify(ParcelDispatched fact, Depot depot)` loads `Depot` by triggering source ID. For a different relationship implement `ICanResolveReadModelKey` on the reactor: `public ReadModelKey Resolve(object fact, EventContext context) => ((ParcelDispatched)fact).DepotId;`. Supply a key for every type that uses this resolver. Stored state can lag; don't treat it as part of the triggering fact. Avoid mutable fields across events.
47
+ - Prefer constructor injection for infrastructure. Handler parameters can also receive services, `EventContext` (e.g. `context.EventSourceId`, `context.SequenceNumber`), `ReactorDelivery`, or related read models. By default every read-model parameter is loaded with the event's `EventSourceId` as its key, so `Task Notify(ParcelDispatched fact, Depot depot)` looks `Depot` up by the parcel's source ID. The lookup uses only that key value: for a model keyed by something else you get whatever is stored under that value; a materialized model returns null when its sink has no row for it. A stream-scoped model (`[EventStream<TSource>("stream")]`) refuses key-only lookup, so read it with `IReadModels.GetInstanceById<T>(eventSourceId, eventStreamId)` instead of a parameter. To use another key implement `ICanResolveReadModelKey` on the reactor. `Resolve` runs for each read-model parameter and receives the fact and context but not the parameter type, so handle every event the reactor observes: `public ReadModelKey Resolve(object fact, EventContext context) => fact switch { ParcelDispatched dispatched => dispatched.DepotId, _ => (ReadModelKey)context.EventSourceId };`. All read-model parameters of one handler get the same key; read a differently keyed model with `IReadModels.GetInstanceById<T>(key)`. A materialized read model is read from its sink and may not yet include the event being handled; don't treat it as part of the triggering fact. Avoid mutable fields across events.
48
48
  - For tracing, implement `IReactorMiddleware.BeforeInvoke(EventContext, object)` and `AfterInvoke(EventContext, object)` returning `Task`; override the overloads with leading `ReactorId` when tagging spans by observer. Middleware surrounds individual invocations, not a cross-partition transaction.
49
49
 
50
50
  ## Register without discovery
51
51
 
52
- For explicitly selected artifacts use `options.ExplicitArtifacts.RegisterReactor<CarrierNotice>()` (or the `Type` overload). In manual startup `await reactors.Discover(); await reactors.Register();` discovers then registers all; `Register<CarrierNotice>()` or `Register(typeof(CarrierNotice))` registers one. Do not repeat the host's automatic registration.
52
+ For explicitly selected artifacts use `options.ExplicitArtifacts.RegisterReactor<CarrierNotice>()` (or the `Type` overload). Discovery never finds a class that does not implement `IReactor` by its method signatures; nominate it this way or register it in manual startup with `Register(typeof(CarrierNotice))` below. In manual startup `await reactors.Discover(); await reactors.Register();` discovers then registers all; `Register<CarrierNotice>()` or `Register(typeof(CarrierNotice))` registers one. Do not repeat the host's automatic registration.
53
53
 
54
54
  ```csharp
55
55
  var reactors = eventStore.Reactors;
@@ -66,7 +66,7 @@ For runtime schemas use `await reactors.Register(id, b => b.WithEventType(eventT
66
66
 
67
67
  `[OnceOnly]` on the reactor excludes the whole observer from replay; on a method it skips that method during replay. Neither prevents retry. To substitute replay behavior, add e.g. `[Replay] public Task Rebuild(ParcelDispatched fact) => cache.Restore(fact);`. A replay method may also bind a type without a live handler. Otherwise ordinary replayable handlers run. For lifecycle callbacks implement `ICanBeNotifiedWhenReplay` (`Task BeginReplay()`, `Task EndReplay()`) or `ICanBeNotifiedWhenPartitionReplayed` (`Task BeginReplayPartition(Partition partition)`, `Task EndReplayPartition(Partition partition)`).
68
68
 
69
- See [Returned events and command outcomes](csharp-outputs.md) for derived facts, routing, guarded appends and custom return values. If the activation is not domain history, [record an occurrence](csharp-occurrences.md) instead. See [Pages and recovery](csharp-pages.md) for batch processing, capacity, waits, repair and view-change reactions.
69
+ See [Returned events and command outcomes](csharp-outputs.md) for derived facts, routing, guarded appends and custom return values. If the activation is not domain history, [record an occurrence](csharp-occurrences.md) instead. See [Pages and recovery](csharp-pages.md) for batch processing, capacity, waits, repair, starting and awaiting a replay, and view-change reactions.
70
70
 
71
71
  ## Common mistakes
72
72
 
@@ -100,7 +100,7 @@ For best-effort notifications rather than durable event processing, implement `i
100
100
 
101
101
  ## Inspect and recover
102
102
 
103
- With `store` a `BlockingEventStore`, `FailedPartitionsJavaBridge.getFor(store.unwrap().getFailedPartitions(), DispatchNotices.class)` (`io.cratis.chronicle.java`) lists the reactor's failed partitions. Fix the cause, then `FailedPartitionsJavaBridge.retry(store.unwrap().getFailedPartitions(), DispatchNotices.class, partition)`. Only to deliberately abandon the backlog, `ObserversJavaBridge.fastForward(store.unwrap().getObservers(), DispatchNotices.class)` moves the reactor to the tail; inspect the returned `FastForwardResult`. This skips work rather than retrying it. The class overloads resolve the declared ID and sequence; each call also accepts the observer ID as a string, with an event sequence ID as an extra last argument for `retry` and `fastForward`.
103
+ With `store` a `BlockingEventStore`, `FailedPartitionsJavaBridge.getFor(store.unwrap().getFailedPartitions(), DispatchNotices.class)` (`io.cratis.chronicle.java`) lists the reactor's failed partitions. Fix the cause, then `FailedPartitionsJavaBridge.retry(store.unwrap().getFailedPartitions(), DispatchNotices.class, partition)`. Only to deliberately abandon the backlog, `ObserversJavaBridge.fastForward(store.unwrap().getObservers(), DispatchNotices.class)` asks the kernel to move the reactor to the tail. An `Accepted` `FastForwardResult` means the request was queued and the reactor has not moved yet; check the failed partitions and effects afterwards. This skips work rather than retrying it. The class overloads resolve the declared ID and sequence; each call also accepts the observer ID as a string, with an event sequence ID as an extra last argument for `retry` and `fastForward`.
104
104
 
105
105
  ## Definition errors
106
106
 
@@ -18,7 +18,7 @@ Python has no usable Chronicle client: a Python program sends the intent through
18
18
  1. Declare one immutable, past-tense fact with just the data it carries; model an optional fact as its own event type rather than an optional member. Register its type in the writer's store. Start at the first generation; keep the type ID stable across renames.
19
19
  2. Select the intended namespace and its event log. Append the fact with the stable, non-personal source ID of the affected instance, not a newly generated ID for each write.
20
20
  3. Inspect the outcome. On acceptance, retain the assigned position. On refusal, distinguish schema or constraint violations, concurrency conflicts and other errors; do not report success. The kernel validates content against the type's registered schema and reports a mismatch as a schema constraint violation naming the failing path, not as an error; nothing is appended. If the decision depended on state that changed, decide again rather than resubmitting the stale fact.
21
- 4. A lost response is **not a refusal**. Reconcile the original attempt in the same history or retry with its original idempotency key if it was a keyed append. Correlation alone does not deduplicate. Observer timeout does not undo storage.
21
+ 4. A lost response is **not a refusal**. Reconcile the original attempt in the same history. Retry directly only if every entry of the original append was keyed, reusing its keys; an unkeyed entry is not deduplicated and is appended again if the first attempt committed. Correlation alone does not deduplicate. Observer timeout does not undo storage.
22
22
 
23
23
  ## Capability catalog
24
24
 
@@ -53,7 +53,7 @@ Not every SDK exposes every entry; your language reference states what is not su
53
53
  - **Tag enrichment (C# only):** use ambient scopes or registered enrichers for additive cross-cutting named tags, not payload mutation. Applied on every append path (including batches and units of work, resolved when staged) and merged without duplicates; enrichers are pure, synchronous and additive.
54
54
  - **Audience (C# only):** mark the event type to make an audience mandatory (a missing audience fails the append); mark a member to supply the value; an ambient audience reaches only outbox appends and types that require an audience; an audience filter is not authorization.
55
55
  - **Concurrency guards:** supply the expected history scope (per source for a batch) when an append depends on an earlier read; do not assume plain append protects that read (`cratis-chronicle-protect-decision`).
56
- - **Keyed append (C# only):** supply a stable operation key for one event or an ordered batch; retain the same key, content and order on retry. Distinguish already accepted from an idempotency conflict, including unverifiable content.
56
+ - **Keyed append (C# only):** supply a stable operation key and, on retry, reuse the same key, route and content. For one event, key the append. For a single-source batch, one batch key is expanded into a key per position, so also keep the batch's order. For a mixed-source batch, give every entry its own stable key. A per-entry key identifies its entry regardless of position, but still keep the original order on retry: if the first attempt did not commit, the retry decides the stored order. If any entry is unkeyed, reconcile before retrying, because unkeyed entries are not deduplicated. Distinguish already accepted from an idempotency conflict, including unverifiable content.
57
57
  - **Prepare:** capture serialization once for subsequent append; use a prepared batch when the exact enrolled entries must be preserved.
58
58
  - **Verify stored content:** compare a prepared payload at the suspected position; unavailable evidence after revision or erasure is neither equality nor proof of absence.
59
59
  - **Unit of work:** stage through the transactional sequence, then have one owner commit and check the final outcome or roll back before completion. Staging is not persistence; an immediate append is not rolled back with the unit.
@@ -31,7 +31,7 @@ const store = await client.getEventStore('Scheduling');
31
31
  const occupied = await store.readModels.findInstanceById(Occupancy, 'slot-42'); // null if absent
32
32
  ```
33
33
 
34
- A handler is a prototype method (not an arrow field), named after the event in lower camel case or explicitly bound with `@handles`. Synchronous and promised results work. Treat the payload and state as data, not class instances. The optional third parameter supplies `sequenceNumber` (bigint), `occurred`, `causedBy` and other recorded metadata. Return the whole replacement, the current value to ignore, or an absent result to remove (`undefined` or `null`; prefer `undefined` consistently). A later reservation can create the model again. Throw on an unexpected failure.
34
+ A handler is a prototype method (not an arrow field), named after the event in lower camel case or explicitly bound with `@handles`. Synchronous and promised results work. Treat the payload and state as data, not class instances. The optional third parameter supplies `sequenceNumber` (bigint), `occurred`, `causedBy` and other recorded metadata. Return the whole replacement, the current value to ignore, or `undefined` to remove. Never return `null`: it does not remove the model. Returning `null` passes it as current state to the next handler for the same event source in that delivery. If `null` is still the final result, a live reducer fails that event source instead of deleting the model, and `ReadModelScenario` keeps the null state; normal live delivery then skips the failed source until it recovers. When `undefined` is the final result of a successful delivery, the stored model is removed and a later reservation for the same source can recreate it. Throw on an unexpected failure.
35
35
 
36
36
  The decorator registers both classes for discovery. Without a bound model constructor the identifier falls back to the reducer class name and the SDK registers an open schema. For explicit wiring supply `clientArtifactsProvider` in the options factory with `eventTypes: [SlotReserved, ReservationEnded]`, `reducers: [SlotOccupancy]`, `readModels: [Occupancy]` and the provider's remaining artifact lists; use `discoveryPatterns: []` to avoid scanning. Normal store startup handles discovery and registration (`store.reducers.discover()` and `register()` for explicit lifecycle management).
37
37
 
@@ -20,7 +20,7 @@ If inspection points to a write, identify the exact target and effect, preserve
20
20
 
21
21
  - **Dashboard** — inspect namespace health before drilling into an individual observer or sequence.
22
22
  - **Sequences: query** — choose the sequence, sort results and narrow by event type, source ID, source type, stream type, correlation, tags or occurrence interval to locate an event.
23
- - **Saved queries and folders** — organize, save or delete reusable filters. `User` is private; `Everyone` shares visibility, not editing rights. Only the owner or an administrator may change or delete an item; save a copy to adapt someone else's query. Folder deletion can leave undeletable contents behind.
23
+ - **Saved queries and folders** — organize, save or delete reusable filters. `User` is private; `Everyone` shares visibility, not editing rights. Only the owner or an administrator may change or delete an item; save a copy to adapt someone else's query. The owner is set when the item is first saved: the `sub` claim of the principal as resolved after authentication (Chronicle fills a missing `sub` from the user ID), else the identity name, else `anonymous` — for unauthenticated callers and for authenticated principals with neither, who then all share that owner. A client cannot set it, and saving over an item or an administrator's edit keeps it, so ownership cannot be transferred. Owners are compared exactly, including case and trailing spaces. Deleting a folder selects, before asking for confirmation, each loaded query and stored folder in the current namespace and scope whose raw stored path equals the selected folder's displayed path or starts with it followed by `/`; after confirmation it sends a separate delete for each. Display equivalence alone does not match: deleting `A/B` includes `A/B/` but skips `A//B`. Refused items stay. The tree displays paths with blank segments dropped and segments trimmed, so a deleted folder still shows after refresh while any visible query or folder record in the same namespace and scope displays at or below it; for example, a surviving `A//B` brings `A/B` back.
24
24
  - **Export** — download every event the current query matches, not just the visible page, as one JSON file. Content is unmasked: narrow the query first and treat the file as sensitive.
25
25
  - **Event details / Compare revisions** — inspect stored content and compare raw revisions without modifying history.
26
26
  - **Append** — add a new event only for an intended fact. For an ambiguous append use `cratis-chronicle-record-event`, not revision.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-ci-pipeline-performance
3
- description: Use when a GitHub Actions workflow in a Cratis repository is slow, waits for runners, wastes runner minutes or keeps failing, rerunning or cancelling, or before adding a cache, shard, path filter, concurrency group, runner label or shared Cratis workflow to speed one up. Also when pull-request CI should run only the .NET tests a change can reach with `cratis affected` (rollout, committed coverage maps, full-run triggers and mapped paths). Not for checking whether an expected run passed (use `cratis-engineering-ci-gates`), application runtime performance (use `cratis-performance-review`) or release labels and notes (use `cratis-platform-prepare-release-pr`).
3
+ description: Use when a Cratis GitHub Actions workflow is slow, waits for runners, wastes runner minutes or keeps failing, rerunning or cancelling, or to stop Publish runs cancelling or dropping releases as merges cluster, or before adding a cache, shard, path filter, concurrency group, runner label or shared Cratis workflow. Also when pull-request CI should run only the .NET tests a change can reach with `cratis affected` (rollout, coverage maps, full-run triggers, mapped paths). Not for whether an expected run passed (use `cratis-engineering-ci-gates`), app runtime speed (use `cratis-performance-review`), release labels and notes (use `cratis-platform-prepare-release-pr`) or recovering a failed or missing release (use `cratis-release-notes`).
4
4
  license: LICENSE
5
5
  ---
6
6
 
@@ -31,7 +31,8 @@ Prefer thin callers of shared actions and workflows. Private repositories use sh
31
31
  | Did this change's run pass; watch it by head SHA | `cratis-engineering-ci-gates` |
32
32
  | The application, not the pipeline, is slow | `cratis-performance-review` |
33
33
  | Release label and publishable pull request description | `cratis-platform-prepare-release-pr` |
34
- | A release ran wrongly or was lost | `cratis-release-notes` |
34
+ | Publish runs cancel or replace each other and drop releases; diagnose and prevent it | This skill |
35
+ | Recover a release that already ran wrongly, failed or went missing | `cratis-release-notes` |
35
36
  | Release assurance | `cratis-governed-release-methodology` |
36
37
 
37
38
  Follow the `github-actions` rule (engineering profile) for timeouts, concurrency,
@@ -132,7 +133,7 @@ The CI mechanisms here are not application SDK APIs. Examples use illustrative n
132
133
  | Control | What, when |
133
134
  | --- | --- |
134
135
  | `concurrency.group` + `cancel-in-progress` | Cancel superseded verification; true only for pull requests |
135
- | `concurrency.queue: max` | Release and publish groups: keep every pending run in order; omit `cancel-in-progress` |
136
+ | `concurrency.queue: max` | Release and publish groups: keep up to 100 pending runs in order; omit `cancel-in-progress` |
136
137
  | `timeout-minutes` | Every job, sized to its tier, so a hang cannot hold a runner for hours |
137
138
  | `needs` + `if: always()` | The required aggregator inspects every direct dependency's result |
138
139
  | `on.<event>.paths` / `paths-ignore` | Only on workflows that are not required checks; required ones skip jobs instead |
@@ -98,10 +98,25 @@ concurrency:
98
98
  base branch (for example `refs/heads/main`). A newer merge's pending run then
99
99
  replaces the older pending one unless `queue: max` is set. Only a `closed` event
100
100
  of an unmerged pull request keeps `refs/pull/N/merge`, a group of its own.
101
- - A replaced pending run is lost work only when that run alone would have released
102
- something. Release tooling that aggregates everything since the last release
103
- loses nothing when a pending run is replaced; such a workflow may keep one
104
- pending slot, with a comment beside the `concurrency` block saying so.
101
+ - A replaced pending run is lost work unless the run that replaces it covers the
102
+ dropped run's full range and makes the same release decision. Only then may a
103
+ workflow keep the single default pending slot, with a comment beside the
104
+ `concurrency` block saying why. Otherwise keep `queue: max`.
105
+ - Existing `cratis/release-action` workflows that set `release-window` keep
106
+ `queue: max`; their pending runs are not interchangeable:
107
+ - A batched run collects the eligible merged pull requests into the default branch on
108
+ first-parent history after the latest stable release tag (or the latest
109
+ stable version tag when there is no stable release), up to and including the
110
+ commit that triggered it.
111
+ - A manual flush releases at once. A merge run that replaces it releases only
112
+ when the oldest included merge has reached the window, or when a `hotfix`
113
+ pull request is included and no `major` one is pending. Publication is
114
+ delayed; the window does not restart.
115
+ - A run whose target is already covered by the latest release reports
116
+ `nothing-pending`. When that tag cannot be reached along first-parent
117
+ history, or there is no tag and that history exceeds 250 commits, the action
118
+ falls back to single pull-request selection, which can release nothing.
119
+ - Use one group shared by every trigger so version claims run one at a time.
105
120
  - Groups are repository-scoped; this is not an organization-wide release lock.
106
121
  - Check the symptom in the report: many cancelled publish runs under one group
107
122
  point at a replaced pending slot.
@@ -121,8 +121,12 @@ Skip this section for platform or library code.
121
121
  - **Commands** (contract; `cratis-arc-declare-command`): the decision
122
122
  lives with the command. A business refusal is returned as a validation result,
123
123
  comes from a validator, or is an error the SDK marks as a validation failure;
124
- any other thrown error becomes an unexpected-error outcome, not a refusal. Data the decision needs is loaded in the command's provide
125
- step, not fetched inline in the handler.
124
+ any other thrown error becomes an unexpected-error outcome, not a refusal.
125
+ By default, data the decision needs arrives before the handler runs: as a
126
+ read-model parameter, as an aggregate the SDK injects, or from the command's
127
+ provide step. A handler may still call services or load state itself; the
128
+ language reference says what that leaves unguarded and which reads are
129
+ findings.
126
130
  - **Validation** (convention; `cratis-arc-validate-command`): validation
127
131
  rejects malformed or disallowed input; it does not make the business
128
132
  decision.
@@ -60,7 +60,7 @@ public record ReserveSeat(ShowId Show, SeatNumber Seat, GuestName Guest)
60
60
  ```
61
61
 
62
62
  - **Commands.** `[Command]` record with a public `Handle()` (`ARC0002`–`ARC0004`, `ARC0007`). A refusal is returned: a `ValidationResult` (`ValidationResult.Error(message, members)`), or `Result<TValue, ValidationResult>` from `Cratis.Monads`; rules on input go in a `CommandValidator<TCommand>`. An ordinary throw is an exception outcome, not a refusal; only an exception implementing `IValidationFailure` becomes a validation failure. Don't wrap a synchronous result in `Task` (`ARC0010`).
63
- - **Data for the decision** arrives as `Handle()` parameters: a read model resolved by the command's key, or a value returned from `Provide()` (`ARC0005` flags one `Handle()` never takes). A reader or token queried inside `Handle()` is a finding (`ARCCHR0040`, `ARCCHR0028`). A non-nullable read-model parameter means absence rejects (`ARC0006`); make it nullable when absence is a normal outcome.
63
+ - **Data for the decision** usually arrives as `Handle()` parameters: a read model, an `AggregateRoot` rehydrated for the command's event source, or a value returned from `Provide()` (`ARC0005` flags one `Handle()` never takes). `Handle()` may also call services, which stay outside the read guard, or load another aggregate by explicit id through `IAggregateRootFactory`, which guards only its own source. How a read model's key is chosen is under **Selecting the instance**. Under `On`, a raw Chronicle read or `GetDetached` in a command or its validator is a finding (`ARCCHR0028`); the analyzer does not follow helper calls, so check those by hand. Any method marked `[Unprotected("reason")]` silences `ARCCHR0028`, but at runtime only one on `Handle()` or `Provide()` lets raw reads in its body run, as advisory reads that guard nothing; the decision must not rely on them. In a validator the read is still refused. `AllowReads` is a finding even in an `[Unprotected]` body. A `Handle()` parameter of type `IDecisionReads` or `DecisionRead<T>` is a finding (`ARCCHR0040`). Replace a `DecisionRead<T>` with a plain read-model parameter only when that keeps the same key, route, optionality and protection: an application can register its own `DecisionRead<T>` factory, and outside `On` a `[ProtectedDecision]` command can need the token to keep its guard. Keep `IDecisionReads.Get<T>` for a key or stream route no read-model parameter can bind, such as another stream or source, with an `ARCCHR0040` suppression beside it giving a reason and a tracking-feature link. That suppression does not excuse `ARCCHR0028` or a read-protection downgrade. A reader moved into `Provide()` to avoid `ARCCHR0040` is a finding. A non-nullable read-model parameter means absence rejects (`ARC0006`); make it nullable when absence is a normal outcome.
64
64
  - **Exception exposure.** `Cratis:Arc:ExposeExceptionDetails` (`ArcOptions.ExposeExceptionDetails`) defaults to true only in Development; a change that enables it elsewhere blocks. An `IExceptionResponseMapper` returning `ExceptionResponse(statusCode, errorCode)` maps an exception to an HTTP status and error code, still redacted; it is not a refusal.
65
65
  - **Events.** `[EventType]` records (`CHR0021`), no nullable properties (`CHR0012`), no repeated type name as id (`ARCCHR0004`). The id defaults to the type name, so renaming an event without a declared id changes its identity. Reshaping: new shape `[EventType(generation: 2)]`, previous shape kept with `[EventTypeGenerationFor<TCurrent>(1)]`, plus an `EventTypeMigration<TUpgrade, TPrevious>` per step (`CHR0084`). A handler returns events; it never returns a nullable event (`ARCCHR0015`).
66
66
  - **Values.** `ConceptAs<T>` records (`ARC0009`). An event-source identity derives from `EventSourceId<T>`, not `ConceptAs<Guid>`. One `EventSourceId<T>` property is the command's event source; with several, implement `ICanProvideEventSourceId` (`ARCCHR0002`). Use Chronicle's `[Key]`, never the data-annotations one (`ARCCHR0008`), and not on an `EventSourceId<T>` (`CHR0026`). Search for `record \w+\((Guid|string|int|long) Value\)` with no base type and judge each.
@@ -78,9 +78,9 @@ public record ReserveSeat(ShowId Show, SeatNumber Seat, GuestName Guest)
78
78
  - **Downgrades and bypasses, each needing a reason:**
79
79
  - `<CratisReadProtection>Off` or `Measure`.
80
80
  - `[ReadProtection(ReadProtectionMode.Off)]` on a command.
81
- - `[Unprotected("reason")]` on a command, read-model type or parameter. On a method it covers only reads in the body, not parameters (`ARCCHR0034`). A bare `[Unprotected]` compiles, so the reason is the review check.
81
+ - `[Unprotected("reason")]` on a command, read-model type or parameter. On `Handle()` or `Provide()` it covers only reads in the body, not parameters (`ARCCHR0034`). A bare `[Unprotected]` compiles, so the reason is the review check.
82
82
  - Runtime configuration under `Cratis:Arc:ReadProtection`. `MaximumMode` can only lower the mode. `StartupAdmissionCheck` `Off` and `RequireGeneratedMetadata` `false` weaken checks.
83
- - **Selecting the instance.** `[LookUpBy(nameof(Property))]` or `[LookUpBy<TKeyProvider>]` on a read-model parameter, not a manual lookup (`ARCCHR0023`, `ARCCHR0031`).
83
+ - **Selecting the instance.** For an ordinary Chronicle-backed read-model parameter, declare at most one lookup form: `[LookUpBy<TKeyProvider>]` (a key provider, such as the caller); `[LookUpBy(nameof(Property))]` (a named command property); or `[LookUpBy(nameof(sibling), nameof(SiblingModel.Property))]` (a property of another protected read-model parameter in the same `Handle()`, `Provide()` or validator constructor, under `On`). With none, the key is the command's event-source key, except that under `On` a single command property of the model's key type is used instead (several such properties are an error). A declared per-stream model always binds to the command's route and refuses `[LookUpBy]`. Without the Chronicle integration, Arc's own command-key rules apply. A key from another property, the caller or a related model therefore needs binding, not a manual lookup (`ARCCHR0023`, `ARCCHR0031`). The only exception is the reasoned `IDecisionReads.Get<T>` case under **Data for the decision**.
84
84
  - **Explicit decisions.** `[ProtectedDecision]` opts a command into protected reads. Its validators must have a parameterless constructor and be constructed by Arc.
85
85
  - **Appends.** A command never injects `IEventLog` (`ARCCHR0007`). It returns events, or `CompleteStream` to close a stream. When returning is impossible, use `IEventLog.Transactional`. An immediate append is refused under `On` even inside `[Unprotected]` (`ARCCHR0012`).
86
86
 
@@ -66,7 +66,7 @@ With `cratis/release-action`, inspect the decision, then confirm the release and
66
66
  | `already-released` | A release already exists for this commit; check artifact delivery separately |
67
67
  | `batched` | Wait for the window, or a pending `major` is holding a hotfix batch |
68
68
  | `nothing-pending` | No eligible changes to release in the range |
69
- | `no-prerelease-version` | No version for the open pull request |
69
+ | `no-prerelease-version` | Expected for an open, non-draft pull request whose head and base branches are not named after a version; nothing publishes. A version-named head or base branch sets the prerelease version (`cratis-platform-prepare-release-pr`); otherwise a draft gets `<latest release>-pr<number>.<short sha>`, with the latest release read at run time. A pull request event run uses the draft state and head SHA recorded in that event, so a re-run misses a later push or draft change; that needs a new event such as `synchronize`. A branch `push` run does not produce it |
70
70
  | `placeholder-version` | Manual trigger with only the placeholder and no release decision |
71
71
 
72
72
  For label repair and concurrent-tag retries, read [Release labels and publication](references/pr-labels-and-release.md). Route batched or partial publication recovery to `cratis-release-notes`.
@@ -142,13 +142,15 @@ Use `(#n)` only for verified issues fully delivered and authorized to close; nev
142
142
 
143
143
  ### Release labels
144
144
 
145
+ These are the default meanings. The Cratis Go SDKs are still v0.x and label a breaking change `minor`; see [Release labels and publication](references/pr-labels-and-release.md).
146
+
145
147
  - `major` — something a consumer compiles against, runs or relies on breaks; needs a human's explicit confirmation of that release and a human merge, every time.
146
148
  - `minor` — a new capability a consumer can adopt; nothing existing changes.
147
149
  - `patch` — a fix or internal change with identical contracts.
148
150
  - `no-release` — nothing a consumer compiles against, runs or observes changes, such as documentation, CI, tooling or spec-only work; still passes every required check.
149
151
  - Exactly one — set it in the creating command; swap it in one `gh pr edit --remove-label <old> --add-label <new>` so the pull request never carries two or none.
150
- - `hotfix` — in batch mode only, bypasses the window for all eligible pending changes; add beside an intent label. An included `major` blocks automatic hotfix publication: the hotfix merge run fails with `error`, and later non-manual runs can remain `batched`.
151
- - Batched release — nets reverts and excludes `no-release` and Dependabot before considering hotfix; highest intent wins, unlabeled changes add notes but no bump, and multiple descriptions combine by summary and section while keeping whole bullets and issue references.
152
+ - `hotfix` — in batch mode only, bypasses the window for all eligible pending changes; add beside an intent label. While the pending batch holds both a hotfix and a `major`, automatic publication stops: the hotfix's own merge run fails with `error` naming the major pull request, and other automatic runs warn and stay `batched`. A retry re-evaluates the batch and can end differently, for example `nothing-pending`. A manual Publish run with an empty or `0.0.0` version skips the window and this hold, not the other batch checks.
153
+ - Batched release — nets only recognized reverts of earlier pull requests in the batch, and excludes `no-release` and Dependabot before considering hotfix; highest intent wins; an unlabeled change adds notes but no bump, with a warning naming it (if no pending change has an intent, the reason is `no-label` and the batch stays pending); multiple descriptions combine by summary and section while keeping whole bullets and issue references.
152
154
  - Cratis AI corpus — installed guidance is the product: `patch` corrects guidance, `minor` adds guidance or a required step, `no-release` covers tests, evaluations and CI; a release that changes hooks tells consumers to run `cratis ai update`.
153
155
 
154
156
  ### Local checker
@@ -168,41 +170,6 @@ Run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs` from the repository root
168
170
  - Exit `3` — unchecked: required rules were unavailable and no usable fallback existed.
169
171
  - Rule lookup — fetch from the repository's policy caller; on failure a floating ref can use bundled rules, while a fixed ref generally needs its matching cached rules. The checker refuses a Cratis target with no recognized caller.
170
172
 
171
- ### Policy workflow inputs
172
-
173
- Check the caller's workflow for which inputs its referenced policy supports.
174
-
175
- - `runs-on` — select a different runner when the normal runner cannot run policy.
176
- - `release-intent` — control the `main` release-label gate; use only when the repository deliberately differs.
177
- - `extra-allowed` — allow additional root Markdown file names, comma-separated.
178
- - `extra-allowed-paths` — allow additional documentation directory prefixes, comma-separated.
179
- - `agent-authors` — list agent logins (comma- or newline-separated) to warn when a valid trace is missing on checked pull requests.
180
- - `require-agent-trace` — make that warning a failure for listed authors, regardless of label.
181
-
182
- ### Release-action inputs and outputs
183
-
184
- For workflow maintainers; use the repository's existing publication workflow when delivering a pull request.
185
-
186
- - `github-token` — supply a token when the workflow token cannot read pull requests or write releases with the required scopes.
187
- - `version` — use an explicit version for an authorized manual release instead of deriving it from intent.
188
- - `release-notes` — supply the body for an explicit manual release when no pull request body will be read.
189
- - `tag-prefix` — align version tags with a repository's naming convention.
190
- - `major-labels` — map alternate labels to a breaking release.
191
- - `minor-labels` — map alternate labels to a compatible feature release.
192
- - `patch-labels` — map alternate labels to a fix release.
193
- - `no-release-labels` — map alternate labels to intentional non-publication.
194
- - `release-window` — opt into batching by setting the wait in minutes; use a scheduled trigger and serialize publication across triggers.
195
- - `hotfix-labels` — map alternate labels to bypass the release window.
196
- - `close-resolved-issues` — turn off issue closing when the workflow should only publish; enabled closing requires `issues: write`.
197
- - `should-publish` — gate downstream publication jobs on intent after the release job succeeds.
198
- - `version` (output) — version to publish under.
199
- - `tag` — release tag to verify against the intended commit.
200
- - `prerelease` — select prerelease artifact handling.
201
- - `isolated-for-pull-request` — select pull-request-only publication when indicated.
202
- - `previous-version` — identify the predecessor for release comparison, when known.
203
- - `pull-requests` — inspect the included pull request numbers in a batched decision.
204
- - `reason` — distinguish unexpected non-publication from an intentional skip or a pending batch.
205
-
206
173
  ### Shell guard
207
174
 
208
175
  With a policy caller, the installed shell guard runs the partial preflight on literal `gh pr create` and `gh pr edit` commands:
@@ -226,3 +193,4 @@ With a policy caller, the installed shell guard runs the partial preflight on li
226
193
  - Read [references/commits.md](references/commits.md) when choosing commit boundaries, writing a message, staging, deciding when to commit, or tempted to rewrite history.
227
194
  - Read [references/pr-description.md](references/pr-description.md) when writing or repairing a description, placing issue references, or keeping the notes true to the diff.
228
195
  - Read [references/pr-labels-and-release.md](references/pr-labels-and-release.md) when choosing or changing the release label, handling a `major`, or grouping work into one pull request.
196
+ - Read [references/workflow-inputs.md](references/workflow-inputs.md) when maintaining a policy caller or publication workflow and choosing its inputs or reading its outputs.
@@ -42,6 +42,8 @@ Keep reviewer information out of the release notes. Post it immediately in a pul
42
42
 
43
43
  A product change to a review feature can still be a valid note; a report on reviewing this change is not.
44
44
 
45
+ When you correct a description without its diff, fix only its form: reword claims as the change a consumer observes, move reviewer material to the review comment, and remove template placeholders. Treat the result as unverified and say so when you return it. Before submission, check every claim against the diff as described in Keep the release note true to the diff, and drop any the diff does not support. Never return a body that contains a placeholder for the author to fill in.
46
+
45
47
  ## Links and markup
46
48
 
47
49
  Release notes are read off-repository, so a relative link breaks.
@@ -16,11 +16,11 @@
16
16
 
17
17
  ## Default
18
18
 
19
- Follow the repository's own label scheme. Check whether it calls Cratis policy, runs `cratis/release-action`, or both. Policy checks the intent; it does not publish. When the repository derives releases from pull requests, the label on a merged change tells the action whether and how to bump the version.
19
+ Follow the repository's own label scheme. Check whether it calls Cratis policy, runs `cratis/release-action`, or both. Policy checks the intent; it does not publish. When the repository derives releases from pull requests, the label on a merged change tells the action whether and how to bump the version. The action bumps from the highest stable release; without one, from the highest version tag; without either, or if the lookup fails, from `0.0.0`. The label selects only the bump: `minor` and `patch` stay on that base's major and `major` advances it. No label targets an older major's maintenance line. `no-release` leaves that pull request's bump and notes out of any release, but in batch mode its merge can still trigger a release of other pending changes. Where a product supports an older major, ship the fix through that product's maintenance route; see `cratis-platform-prepare-release-pr` for product-specific release checks.
20
20
 
21
21
  ## The four labels
22
22
 
23
- Choose by what a consumer observes after upgrading, not by which folder changed.
23
+ Choose by what a consumer observes after upgrading, not by which folder changed. The table gives the default meanings; the Cratis Go SDKs are still v0.x and label a breaking change `minor` (see below).
24
24
 
25
25
  | Label | Consumer impact |
26
26
  | --- | --- |
@@ -30,6 +30,7 @@ Choose by what a consumer observes after upgrading, not by which folder changed.
30
30
  | `no-release` | Nothing they compile against, run or observe changes |
31
31
 
32
32
  - Set **exactly one**. In single-PR mode, conflicting intent stops the release decision with `reason=error`; a merged PR without intent yields `reason=no-label`. A caller can fail its Publish workflow on these reasons; the decision alone need not fail the run. The enabled policy intent check rejects both on applicable pull requests into `main`.
33
+ - The Cratis Go SDKs are still v0.x: label a breaking change `minor` and a compatible fix `patch`, and state the break explicitly in the description. Their `major` check fails while the repository's `GO_RELEASE_MAJOR_CEILING` variable is `0`, the default, because the bump would publish v1.0.0. Approval alone does not pass it: a maintainer sets the ceiling to `1` for an approved v1 launch. See `cratis-platform-prepare-release-pr` for product-specific release checks.
33
34
  - `no-release` is a decision, not an omission. It does not excuse the pull request from any required check: a workflow or spec change can break the pipeline for everyone without ever being released.
34
35
  - If a consumer could not tell the difference by upgrading, there is nothing to version. An unnecessary `patch` burns a version and buries the releases that matter. When genuinely unsure, ask.
35
36
  - Use only `no-release` for Dependabot pull requests. The policy intent check exempts them and the release action skips them. The `major`, `minor` or `patch` Dependabot adds describes the dependency's version, not this product's.
@@ -63,7 +64,7 @@ gh pr create --title "<title>" --body-file <pr-body> --label patch --assignee @m
63
64
  gh pr edit 123 --remove-label minor --add-label patch
64
65
  ```
65
66
 
66
- Fix a wrong label in one edit. Whether it starts a new policy run depends on the repository's subscribed events. Policy prefers live metadata but can fall back to the event payload. Before merging, require every applicable check on the exact pushed head, not only policy.
67
+ Fix a wrong label in one edit. Whether the edit starts a new policy run depends on the repository's subscribed events. The shared release-notes and release-intent checks read the pull request's current labels, so re-running them after the fix picks up the new label. When they cannot read the pull request, for example because the caller does not grant `pull-requests: read`, they use the triggering event's labels and a re-run does not see the fix. The Go SDKs' separate `major` check differs by repository: Arc.Go and Chronicle.Go use only the triggering event's labels and need a new pull request event, such as the label edit itself; Fundamentals.Go reads the current labels and fails if it cannot. A new event works for all three. Before merging, require every applicable check on the exact pushed head, not only policy.
67
68
 
68
69
  ## Confirm publication and recover failures
69
70
 
@@ -71,7 +72,7 @@ Check the decision reason, then verify the release tag points to the intended co
71
72
 
72
73
  - Wrong label on a merged single-PR release that did not publish: a `push`-triggered release can pick up the corrected label on retry because it looks up the pull request. A `pull_request` retry replays the original event. Use `cratis-release-notes` for authorized recovery if this is not a clean retry.
73
74
  - A concurrent run claimed the tag for a different commit: first confirm who owns the tag and whether the intended change already shipped. Retry a calculated-version run so it can choose a new version. Do not retry with the same fixed manual version; an authorized manual release needs an unused version.
74
- - Batches net reverts and exclude `no-release` and Dependabot before evaluating `hotfix`. An eligible hotfix bypasses the window for the whole pending batch; a pending `major` causes the hotfix merge run to fail and other automatic runs can leave the batch pending. Hand off major approval and batch or partial publication repair through `cratis-release-notes` rather than treating a label edit as recovery.
75
+ - Batches net a revert only when its description references an earlier pull request in the collected range with GitHub's revert text: a `Reverts Owner/Repo#n` line for this repository, or `This reverts commit <full sha>` naming that pull request's merge commit. A plain inverse change is not netted. Batches then exclude `no-release` and Dependabot before evaluating `hotfix`. An eligible hotfix bypasses the window for the whole pending batch. While the batch holds both a hotfix and a `major`, the hotfix's own merge run fails with `error` naming the major pull request, and other automatic runs warn and leave it `batched`. A retry re-evaluates the current batch, so it can end differently, for example `nothing-pending` once the range is released. A manual Publish run with an empty or `0.0.0` version skips the window and this hold, but the other batch checks still apply, such as `no-label`, `nothing-pending` or `already-released`. Hand off major approval and batch or partial publication repair through `cratis-release-notes` rather than treating a label edit as recovery.
75
76
 
76
77
  ## Group related work into one pull request
77
78