@cratis/pi 7.61.0 → 7.63.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 (132) hide show
  1. package/package/corpus/agents/spec-writer.md +2 -2
  2. package/package/corpus/harnesses/copilot/instructions/application-profile.instructions.md +2 -2
  3. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +2 -2
  4. package/package/corpus/harnesses/copilot/instructions/specs.scenarios.csharp.instructions.md +7 -4
  5. package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +22 -13
  6. package/package/corpus/product-sync.json +11 -10
  7. package/package/corpus/prompts/add-business-rule.prompt.md +1 -1
  8. package/package/corpus/rules/application-profile.md +2 -2
  9. package/package/corpus/rules/glossary.md +2 -2
  10. package/package/corpus/rules/specs.scenarios.csharp.md +7 -4
  11. package/package/corpus/rules/vertical-slices.md +22 -13
  12. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
  13. package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +4 -3
  14. package/package/corpus/skills/cratis-application-slice-specifications/references/query-and-decision-scenarios.md +12 -3
  15. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +12 -7
  16. package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +11 -11
  17. package/package/corpus/skills/cratis-arc-command/SKILL.md +3 -2
  18. package/package/corpus/skills/cratis-arc-command/references/decisions-and-routing.md +95 -51
  19. package/package/corpus/skills/cratis-arc-command/references/fresh-identifiers.md +5 -2
  20. package/package/corpus/skills/cratis-arc-command/references/generated-values.md +27 -12
  21. package/package/corpus/skills/cratis-arc-command/references/read-model-injection.md +9 -5
  22. package/package/corpus/skills/cratis-arc-command/references/shop-generation.md +17 -6
  23. package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +99 -52
  24. package/package/corpus/skills/cratis-chronicle-decision-reads/SKILL.md +37 -15
  25. package/package/corpus/skills/cratis-chronicle-decision-reads/references/admission-and-ownership.md +3 -2
  26. package/package/corpus/skills/cratis-chronicle-decision-reads/references/choosing-how-a-rule-holds.md +277 -138
  27. package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +4 -4
  28. package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +6 -4
  29. package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +2 -1
  30. package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +6 -3
  31. package/package/corpus/skills/cratis-code-review/SKILL.md +6 -3
  32. package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +10 -2
  33. package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +49 -6
  34. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +43 -41
  35. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +11 -2
  36. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-interview.md +24 -0
  37. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +76 -10
  38. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -0
  39. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +1 -1
  40. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +39 -23
  41. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +35 -12
  42. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +51 -81
  43. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md +83 -0
  44. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +14 -4
  45. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/reaction-forms.md +59 -0
  46. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/record-capture-specifications.md +60 -0
  47. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +5 -1
  48. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +26 -28
  49. package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +82 -0
  50. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +82 -28
  51. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +113 -0
  52. package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +45 -12
  53. package/package/corpus/skills/cratis-screenplay-command-surface/references/text-and-match-rules.md +119 -0
  54. package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +14 -4
  55. package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +10 -3
  56. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +12 -12
  57. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +5 -3
  58. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +5 -1
  59. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -2
  60. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +1 -1
  61. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generated-recovery.md +51 -14
  62. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +5 -0
  63. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +2 -1
  64. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +6 -3
  65. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
  66. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +22 -28
  67. package/package/corpus/skills/cratis-screenplay-model-authoring/references/choosing-generation.md +20 -7
  68. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +12 -6
  69. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +9 -1
  70. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +58 -10
  71. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -2
  72. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +2 -5
  73. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +2 -2
  74. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +2 -2
  75. package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +2 -1
  76. package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +3 -2
  77. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
  78. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
  79. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -3
  80. package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +3 -1
  81. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +8 -3
  82. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +8 -0
  83. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +6 -4
  84. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +36 -29
  85. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +6 -0
  86. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +15 -4
  87. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +25 -20
  88. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +14 -3
  89. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +9 -3
  90. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +7 -3
  91. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +3 -1
  92. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -4
  93. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +4 -2
  94. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +4 -3
  95. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +8 -8
  96. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +49 -47
  97. package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +11 -1
  98. package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +48 -17
  99. package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +14 -1
  100. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +25 -21
  101. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +2 -2
  102. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +14 -6
  103. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +4 -3
  104. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +7 -0
  105. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +30 -22
  106. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +3 -1
  107. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +47 -2
  108. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +60 -0
  109. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +65 -5
  110. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +50 -22
  111. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-checks.md +93 -0
  112. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +117 -35
  113. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +46 -0
  114. package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +3 -1
  115. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +25 -10
  116. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +1800 -50
  117. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  118. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +5 -3
  119. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +6 -1
  120. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +8 -53
  121. package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +2 -2
  122. package/package/corpus/skills/cratis-screenplay-ui-composition/references/interaction-example.md +54 -0
  123. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +6 -3
  124. package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +3 -2
  125. package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +1 -1
  126. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -29
  127. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +36 -9
  128. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/choosing-generation.md +28 -8
  129. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/publication-and-recovery.md +31 -0
  130. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +8 -0
  131. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +4 -1
  132. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-chronicle-decision-reads
3
- description: Guard a state-dependent Chronicle decision with IDecisionReads, projection admission, ambient unit-of-work enrollment and commit conflict handling, and choose which mechanism makes a write-side rule hold (constraint, decision read, stream decision, aggregate, explicit scope, reactor repair or a plain read). Use when an append must remain valid for the facts read, when a rule must hold under concurrent writers, when choosing whole-source versus stream-scoped reads, or diagnosing DecisionReadRefused and scope conflicts. Do not use for ordinary query reads, append-time uniqueness alone, or defining an Arc command's ProtectedDecision API.
3
+ description: Choose which mechanism makes a write-side rule hold (constraint, Arc read protection with read-model parameters and validators, per-stream read model, stream decision, aggregate, explicit scope, reactor repair or an advisory read), and guard a Chronicle decision directly with IDecisionReads, projection admission, ambient unit-of-work enrollment and commit conflict handling. Use when an append must remain valid for the facts read, when a rule must hold under concurrent writers, when choosing whole-source versus stream-scoped reads, or diagnosing ReadChanged, DecisionReadRefused and scope conflicts. Do not use for ordinary query reads or append-time uniqueness alone; Arc command shapes belong to cratis-arc-command.
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -17,9 +17,22 @@ consistency boundary (DCB), not authorization or a replacement for unique constr
17
17
 
18
18
  Read [choosing how a rule holds](references/choosing-how-a-rule-holds.md) first
19
19
  when the question is which mechanism to use, or before writing code that reads
20
- state and then appends. It carries the routing steps, the matrix with what not to
21
- use, and the traps. A plain read, a validator read, `Result<,>` and
22
- `concurrency: true` are never the guard.
20
+ state and then appends. It carries the routing by rule shape, the matrix with what
21
+ not to use, the refusals, rollout with Measure, testing and the traps.
22
+
23
+ In an Arc application new code sets read protection `On`
24
+ (`<CratisReadProtection>On</CratisReadProtection>`); `Off` is the default when
25
+ nothing is set. Under `On` the read model is a parameter of `Handle()` or of the
26
+ `CommandValidator<T>` constructor, and the read guards the append; under `Off` and
27
+ `Measure` a validator over a plain read is a hint that guards nothing. A plain read under
28
+ `Off`, `Result<,>` and `concurrency: true` are never the guard.
29
+ `[ProtectedDecision]` with `DecisionRead<T>` is the older per-command opt-in; it
30
+ still works and is not obsolete.
31
+
32
+ Requires Arc 22.106.0 (read protection) with Chronicle client and kernel 19.71.0.
33
+ Check `dotnet list package --include-transitive`; older Arc has only the
34
+ per-command `[ProtectedDecision]` path, and the choosing reference names where it
35
+ differs.
23
36
 
24
37
  ## Verified product sources
25
38
 
@@ -60,10 +73,12 @@ for the covered APIs, scope lifetime, rollback and immediate-append boundary.
60
73
 
61
74
  ## Route the work
62
75
 
63
- - For Arc `[ProtectedDecision]`, Arc command/handler shapes and Arc `IStreamReads`,
64
- use **cratis-arc-command** and **cratis-arc-command-validation**; do not recreate
65
- their unit-of-work ownership in a handler. The Chronicle `DecisionRead<T>`
66
- below is not a license to invent an Arc wrapper shape.
76
+ - For Arc read protection, `[LookUpBy]`, `[Unprotected]`, `[ProtectedDecision]`,
77
+ command/handler shapes and Arc `IStreamReads`, use **cratis-arc-command** and
78
+ **cratis-arc-command-validation**; do not recreate their unit-of-work ownership in
79
+ a handler. The Chronicle `IDecisionReads` below is for code outside an Arc
80
+ command (endpoints, services, `Provide()` for a computed key), not a license to
81
+ invent an Arc wrapper shape.
67
82
  - For a unique value claimed atomically or a closed stream, use
68
83
  **cratis-chronicle-event-constraints**. A decision read guards one key's
69
84
  history, not a value across keys: it is the wrong tool for uniqueness.
@@ -81,8 +96,12 @@ for the covered APIs, scope lifetime, rollback and immediate-append boundary.
81
96
  `Admit<T>()` / `AdmitForStream<T>()` check shape **without I/O**, returning
82
97
  `DecisionReadAdmission(IsAdmitted, Reason)`. The model needs an `Id` property
83
98
  (string, or a Guid in lowercase hyphenated form) and an event-source-keyed flat
84
- projection. Reducers, including self-reducing models, are refused with
85
- `Reducer`; a missing `Id` or an unconvertible key refuses with `KeyConversion`. A successful shape check is not
99
+ projection, or an unfiltered reducer on the event log with no constructor
100
+ dependencies other than `ILogger<T>` (self-reducing models are exempt). Requires
101
+ Chronicle 19.68.0 for reducers. A filtered reducer refuses with `ReducerFilters`,
102
+ one with dependencies with `ReducerDependencies`, an event type at two generations
103
+ with `ReducerGeneration`, and a reducer in a stream-scoped read with
104
+ `StreamScopeNotSupported`. A missing `Id` or an unconvertible key refuses with `KeyConversion`. A successful shape check is not
86
105
  runtime read success: definitions, key conversion and fold completion are also
87
106
  checked while reading.
88
107
 
@@ -112,9 +131,12 @@ projection also needs an explicit stream id, not the default wildcard.
112
131
  `AdmitForStream<T>()` checks this shape; unsupported readers/kernels refuse with
113
132
  `StreamScopeNotSupported`. Do not fall back to an unguarded query on refusal.
114
133
 
115
- Requires Arc 22.81.0 for these stream overloads inside Arc commands to use
116
- command protection, caching and enrollment; older Arc refuses them. Check Arc
117
- as well as the Chronicle client/kernel pair before choosing this path.
134
+ In Arc, prefer a per-stream read model
135
+ (`[ReadModel, EventStream<TSource>("Transactions")]` on a command routed with
136
+ `[EventSource<TSource>("Transactions")]` and `[EventStreamId("{Month}")]`); use
137
+ the stream overloads of `IDecisionReads` in `Provide()` for another stream or
138
+ source. Requires Arc 22.81.0 for the stream overloads inside Arc commands to use
139
+ command protection, caching and enrollment; older Arc refuses them.
118
140
 
119
141
  ## Commit and inspect conflicts
120
142
 
@@ -158,8 +180,8 @@ deciding writer is guarded or the rule is a constraint.
158
180
  - The unit commits in the ASP.NET Core middleware: it commits after the response
159
181
  and reports no concurrency violation. Call
160
182
  `IUnitOfWorkCompletionFeature.CommitAsync()` before responding.
161
- - Protection is opt-in in Arc (`[ProtectedDecision]`), so an unmarked command with
162
- a read model is still unguarded.
183
+ - Arc under `Off` (the default when nothing is set): a command with a read model
184
+ is unguarded unless it carries `[ProtectedDecision]`. Set `On` for new code.
163
185
 
164
186
  ## Verify
165
187
 
@@ -10,12 +10,13 @@ and `UnitOfWorkLifecyclePolicy.cs`.
10
10
 
11
11
  ## Why a shape is refused
12
12
 
13
- Admission requires exactly one supported projection on the event log. It is not
13
+ Admission requires exactly one supported projection, or an unfiltered dependency-free reducer, on the event log. It is not
14
14
  an adapter for arbitrary read-model storage:
15
15
 
16
16
  | Reason | Shape to inspect |
17
17
  | --- | --- |
18
- | Reducer / AmbiguousProjection / NotEventLog | reduced model, several projections, or another sequence |
18
+ | Reducer / AmbiguousProjection / NotEventLog | a model with no admitted definition, several projections, or another sequence |
19
+ | ReducerFilters / ReducerDependencies / ReducerGeneration | a reducer with an event filter, constructor dependencies other than `ILogger<T>` (self-reducing models are exempt), or an event type at two generations |
19
20
  | Join / Hierarchy | joins, children or nested projections |
20
21
  | OpenEndedEventTypes / Derivatives / FromEventProperty | all-events, FromEvery, or event-property routing |
21
22
  | NotEventSourceKeyed / KeyConversion | keys not convertible to the admitted raw source key |