@cratis/pi 7.62.0 → 7.64.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 (105) hide show
  1. package/package/corpus/product-sync.json +9 -9
  2. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +1 -1
  3. package/package/corpus/skills/cratis-arc-command/references/generated-values.md +27 -12
  4. package/package/corpus/skills/cratis-arc-command/references/shop-generation.md +17 -6
  5. package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +10 -2
  6. package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +49 -6
  7. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +43 -41
  8. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +11 -2
  9. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-interview.md +24 -0
  10. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +76 -10
  11. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +5 -0
  12. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +1 -1
  13. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +39 -23
  14. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +35 -12
  15. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +51 -81
  16. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md +83 -0
  17. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/capture-map-and-example.md +14 -4
  18. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/reaction-forms.md +59 -0
  19. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/record-capture-specifications.md +60 -0
  20. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/specifying-triggers-and-clock.md +5 -1
  21. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +37 -30
  22. package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +100 -0
  23. package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +82 -0
  24. package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +82 -28
  25. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +113 -0
  26. package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +45 -12
  27. package/package/corpus/skills/cratis-screenplay-command-surface/references/text-and-match-rules.md +119 -0
  28. package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +26 -6
  29. package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +13 -3
  30. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +12 -12
  31. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +5 -3
  32. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +5 -1
  33. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +2 -2
  34. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +1 -1
  35. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generated-recovery.md +51 -14
  36. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +5 -0
  37. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +2 -1
  38. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +6 -3
  39. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +1 -1
  40. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +22 -28
  41. package/package/corpus/skills/cratis-screenplay-model-authoring/references/choosing-generation.md +20 -7
  42. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +13 -6
  43. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +9 -1
  44. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +58 -10
  45. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -2
  46. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +2 -5
  47. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +2 -2
  48. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +2 -2
  49. package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +2 -1
  50. package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +3 -2
  51. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
  52. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +1 -1
  53. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +2 -3
  54. package/package/corpus/skills/cratis-screenplay-read-surface/references/named-keys.md +3 -1
  55. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +8 -3
  56. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +8 -0
  57. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +6 -4
  58. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +48 -30
  59. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +10 -4
  60. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +15 -4
  61. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +25 -20
  62. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/public-event-coverage.md +14 -3
  63. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-examples.md +9 -3
  64. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +9 -4
  65. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +3 -1
  66. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +4 -4
  67. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +4 -2
  68. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +4 -3
  69. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +8 -8
  70. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +69 -47
  71. package/package/corpus/skills/cratis-screenplay-specifications/references/actions-beyond-commands.md +11 -1
  72. package/package/corpus/skills/cratis-screenplay-specifications/references/generated-fixtures.md +48 -17
  73. package/package/corpus/skills/cratis-screenplay-specifications/references/outcome-comparison.md +6 -0
  74. package/package/corpus/skills/cratis-screenplay-specifications/references/vocabulary.md +14 -1
  75. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +25 -21
  76. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +2 -2
  77. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +9 -3
  78. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +4 -3
  79. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +7 -0
  80. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +32 -22
  81. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +3 -1
  82. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +47 -2
  83. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +60 -0
  84. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +66 -6
  85. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +67 -23
  86. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-checks.md +93 -0
  87. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +117 -35
  88. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +61 -0
  89. package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +3 -1
  90. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +27 -10
  91. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +3489 -335
  92. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  93. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +5 -3
  94. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +6 -1
  95. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +8 -53
  96. package/package/corpus/skills/cratis-screenplay-ui-composition/references/file-references.md +2 -2
  97. package/package/corpus/skills/cratis-screenplay-ui-composition/references/interaction-example.md +54 -0
  98. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +6 -3
  99. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +30 -29
  100. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +39 -9
  101. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/choosing-generation.md +28 -8
  102. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/publication-and-recovery.md +31 -0
  103. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +8 -0
  104. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +4 -1
  105. package/package.json +1 -1
@@ -46,7 +46,7 @@
46
46
  ],
47
47
  "rules": []
48
48
  },
49
- "notes": "Source-checked Stage v4.103.0: exact ESM v1-v17 and v19, not v18 or v20. Snapshot/live collection queries, identity-mapping all projections, stored event names, event-id publication checks, release-baseline warnings, command clock/receipt-time generation, conditional and multi-command slices, generated text constraints, no-event and bounded redelivery specs, refusal branches. Query concept validation still uses primitive workaround; Stage#370 is not released. CLI v3.62.0 bundles Stage 4.99.0, not 4.103.0. No new render/browser/Docker probe."
49
+ "notes": "Source-checked Stage v4.103.0: exact ESM v1-v17 and v19, not v18 or v20 (v18 admitted from 4.106.0 and v20 from 4.109.0, taught with Requires lines; 4.104-4.108 not otherwise reviewed). Snapshot/live collection queries, identity-mapping all projections, stored event names, event-id publication checks, release-baseline warnings, command clock/receipt-time generation, conditional and multi-command slices, generated text constraints, no-event and bounded redelivery specs, refusal branches. Query concept validation still uses primitive workaround; Stage#370 released in 4.106.0. CLI v3.62.0 bundles Stage 4.99.0, not 4.103.0. Generated-values-only delta checked at v4.127.0: v21/all-Proven unpinned specs from 4.115.0, warning/info generated rules 4.117.0, checksum validation 4.118.0, pattern/random factories/Host/executor 4.119.0; generate rule still STAGE-ESM-028. Language admission reconciled at the same v4.127.0 tag: exact v1-v21 and v23-v25 pairs; v22/v26 and mixed pairs -016, protected reads -044, atomic mode -043, described bodies STAGE-IMPL-002 even Stub mode; v24 first admitted 4.124.0 (absent 4.123.0). Other deltas not reviewed; synced unchanged. No new render/browser/Docker probe."
50
50
  },
51
51
  {
52
52
  "id": "arc",
@@ -99,7 +99,7 @@
99
99
  "vertical-slices.md"
100
100
  ]
101
101
  },
102
- "notes": "Whole-product floor unchanged at 22.100.0. Focused read-protection coverage, Arc 22.106.0-22.108.0: ReadProtectionMode Off, Measure and On (MSBuild property, assembly and command attributes, runtime MaximumMode cap), read-model parameters of Handle and validator constructors guarded under On, [LookUpBy], [Unprotected(\"why\")], per-stream read models on routed commands, Measure report, ReadChanged and ReadIncomplete refusals, and CommandScenario selecting decision mode automatically. the caller severity threshold (X-Allowed-Severity, [BlockOnValidationSeverity]) and the Error floor for commands declared On (22.108.0). [ProtectedDecision] and DecisionRead<T> retained as the per-command opt-in. The other 22.101.0-22.108.0 changes were not reviewed. Prior notes: scoped completion and routing validation, generated-target freshness, observable scenarios, asynchronous execution scopes, read-model diagnostics, ordered reactor refusal handling and ICommandExceptionMapper. No new runtime probe."
102
+ "notes": "Whole-product floor unchanged at 22.100.0. Focused read-protection coverage, Arc 22.106.0-22.108.0: ReadProtectionMode Off, Measure and On (MSBuild property, assembly and command attributes, runtime MaximumMode cap), read-model parameters of Handle and validator constructors guarded under On, [LookUpBy], [Unprotected(\"why\")], per-stream read models on routed commands, Measure report, ReadChanged and ReadIncomplete refusals, and CommandScenario selecting decision mode automatically. the caller severity threshold (X-Allowed-Severity, [BlockOnValidationSeverity]) and the Error floor for commands declared On (22.108.0). [ProtectedDecision] and DecisionRead<T> retained as the per-command opt-in. The other 22.101.0-22.108.0 changes were not reviewed. Prior notes: scoped completion and routing validation, generated-target freshness, observable scenarios, asynchronous execution scopes, read-model diagnostics, ordered reactor refusal handling and ICommandExceptionMapper. Generated-values-only delta checked at v22.107.1: 22.104.0 enforces every concept-rule severity and carries Fundamentals 7.25.0; 22.107.0 recovers pattern/random/checksum and self-contained String generation rules, with v21 caps and fixture validation. No new runtime probe."
103
103
  },
104
104
  {
105
105
  "id": "ai",
@@ -171,9 +171,9 @@
171
171
  }
172
172
  ],
173
173
  "synced": {
174
- "version": "4.188.0",
174
+ "version": "4.199.0",
175
175
  "date": "2026-10-16",
176
- "by": "Cratis/AI#706"
176
+ "by": "Cratis/AI#735"
177
177
  },
178
178
  "covers": {
179
179
  "skills": [
@@ -201,7 +201,7 @@
201
201
  ],
202
202
  "rules": []
203
203
  },
204
- "notes": "Standalone 4.188.0 and byte-identical compiler contract pinned. Cratis/AI#706: application navigation regions (module inherit, extend or override), toolbar slice buttons, blueprint template references and sample data packs in cratis-screenplay-ui-composition (references/application-shell.md), with the canonical shell vector and the rejection codes PLAY0710-PLAY0722 and PLAY0740-PLAY0765. Examples moved to the executable-state rules since 4.164: translator reactions in an Automation slice beside the Translate slice (PLAY0694) and the first record of a capture key appended with `when added`. Earlier: Standalone 4.164.0 and byte-identical compiler contract pinned. Cratis/AI#663: one origin per capture (PLAY0687). #668: executable no-event/redelivery v17. #684: concept query-argument validation in every version and query-error assertions v18. #681: executable refusal branches and refusal values v19. #666: proposal summary/severity counts and exact structural source proposals. Generated-concept rules select v20 with PLAY0688/0689 proofs and derived-matches repair; generated secrets and preview strategies remain refused. Release-baseline from-esm admission reads storedName. Standalone binding is not renderer admission: Stage 4.103.0 admits v1-v17 and v19; CLI 3.62.0 bundles Screenplay 4.159.0 / Stage 4.99.0 and renders through v16. Prior evidence remains unless superseded; no new renderer, Docker or browser probe."
204
+ "notes": "Standalone 4.199.0 and byte-identical compiler contract pinned. Cratis/AI#735: chronological Date/DateTime ordering in command conditions and command/property literal validation (ESM v26), UTC tick precision and pre-rule offset validation; then matching remains ordinal. Source-checked Screenplay v4.199.0 commands, diagnostics, interoperability and specifications documentation plus decision 0087. Stage v4.127.1 still refuses v26 with STAGE-ESM-016 (stage-rendering.md and SemanticVersionFeatures.Supports); no render/runtime probe. Cratis/AI#576: prior mechanical compiler catch-up. Language batch #717/#722/#723/#724/#720/#728/#734 teaches atomic reaction batches (v22), described payload handlers (v23), portable linear matching, ordinal text rules (v24), protected command reads (v25), diagnostic arguments and event-source invokes mappings. Facts read at Screenplay v4.198.0 and introducing tags; Stage v4.127.0 admits exact v1-v21 and v23-v25 pairs but refuses v22/v26 and mixed pairs (STAGE-ESM-016), protected reads (044), atomic mode (043) and described handlers (STAGE-IMPL-002), even Stub mode. Stage text rules execute/render; no new renderer/runtime probe or Stage pin uplift. Cratis/AI#706: application navigation regions (module inherit, extend or override), toolbar slice buttons, blueprint template references and sample data packs in cratis-screenplay-ui-composition (references/application-shell.md), with the canonical shell vector and the rejection codes PLAY0710-PLAY0722 and PLAY0740-PLAY0765. Examples moved to the executable-state rules since 4.164: translator reactions in an Automation slice beside the Translate slice (PLAY0694) and the first record of a capture key appended with `when added`. Earlier: Standalone 4.164.0 and byte-identical compiler contract pinned. Cratis/AI#663: one origin per capture (PLAY0687). #668: executable no-event/redelivery v17. #684: concept query-argument validation in every version and query-error assertions v18. #681: executable refusal branches and refusal values v19. #666: proposal summary/severity counts and exact structural source proposals. Generated-concept rules select v20 with PLAY0688/0689 proofs and derived-matches repair; generated secrets and preview strategies remain refused. Release-baseline from-esm admission reads storedName. Standalone binding is not renderer admission: Stage 4.103.0 admits v1-v17 and v19; CLI 3.62.0 bundles Screenplay 4.159.0 / Stage 4.99.0 and renders through v16. Prior evidence remains unless superseded; no new renderer, Docker or browser probe."
205
205
  },
206
206
  {
207
207
  "id": "scene",
@@ -381,9 +381,9 @@
381
381
  }
382
382
  ],
383
383
  "synced": {
384
- "version": "7.23.0",
385
- "date": "2026-10-12",
386
- "by": "Cratis/AI#620"
384
+ "version": "7.25.0",
385
+ "date": "2026-10-15",
386
+ "by": "Cratis/AI#576"
387
387
  },
388
388
  "covers": {
389
389
  "skills": [
@@ -399,7 +399,7 @@
399
399
  "concepts.md"
400
400
  ]
401
401
  },
402
- "notes": "Floor uses direct source verification, not a peer-dependency minimum. Initial historical floor recorded on 2026-10-12 by Cratis/AI#619; date records this inventory, not a new product verification."
402
+ "notes": "Source-checked v7.25.0: IGeneratable/IGeneratableInContext, GenerationContext, UUID/ULID/TypeID/NanoID/bytes and finite GenerateValue.Pattern overloads with optional Checksum, inclusive Int64 Integer, and HasValidChecksum. Pattern date segments use captured UTC time; check digits add no entropy or authorization and do not automatically add validation. No Stage version uplift or generated-secret admission is implied."
403
403
  },
404
404
  {
405
405
  "id": "components",
@@ -44,7 +44,7 @@ This skill is a method: it names no API of its own. When the Screenplay skills a
44
44
  | --- | --- |
45
45
  | Where each rule lives (validator, `Provide()`, handler result, constraint, exception) | `rules/vertical-slices.md` "The decision matrix" |
46
46
  | A customization never makes a rejected model renderable; managed output is never hand-edited | Stage (`Customizations/` is the unmanaged seam; managed output is regenerated) |
47
- | A command `handler` never binds (PLAY0268), so that slice is gap-fill with the model as contract | Screenplay (diagnostic PLAY0268) |
47
+ | Attached command handlers remain unbound (PLAY0268); pending handlers with unconditional productions bind v23 as described commands, but reached bodies are Unsupported ImplementationBody and Stage refuses STAGE-IMPL-002 even in Stub mode | Screenplay and Stage; use the model as the gap-fill contract |
48
48
 
49
49
  ## Procedure
50
50
 
@@ -24,7 +24,10 @@ For the current threaded example, read [shop commands](shop-generation.md) and
24
24
  [shop concepts](../../cratis-fundamentals-concept/references/shop-generation.md).
25
25
  Those declarations show:
26
26
  CustomerId (`cus_` + ULID), context-aware TypeID OrderId, NanoID InviteCode and
27
- secret bytes ApiKey. They allocate responses, not events or persisted entities.
27
+ secret bytes ApiKey, readable InvoiceNumber (pattern/checksum) and Int64 pickup
28
+ TicketNumber (`Integer`). The latter helpers require Fundamentals 7.25.0; inspect
29
+ `dotnet list package --include-transitive` before use and retain existing factories
30
+ on older packages. They allocate responses, not events or persisted entities.
28
31
  For a real Chronicle stream identity use `EventSourceId<T>`; return `(id, event)`
29
32
  to append and return the stream ID, or use an explicit event-source wrapper.
30
33
 
@@ -32,14 +35,19 @@ Keep existing/client-chosen identifiers and references on command properties.
32
35
  Services and read models remain ordinary dependencies, not generated values.
33
36
  UUID generation does not establish authorization, secrecy, idempotency, storage
34
37
  freshness, or gapless/sequential numbering. Use the domain's authoritative
35
- allocation mechanism for invoice numbers, not a random UUID strategy.
38
+ allocation mechanism for gapless/sequential invoice numbers, not a random strategy.
39
+ A pattern supplies a readable reference, not an allocator or secret; check digits
40
+ catch typos, not forgery. The concept validator can call
41
+ `GenerateValue.HasValidChecksum(value, Checksum.Luhn)` alongside shape checks;
42
+ pinning bypasses generation, never validation. Keep short-code uniqueness separate.
36
43
 
37
44
  ## Resolution, validation and captures
38
45
 
39
46
  `GeneratedValueAttribute` targets parameters only. Use it on a command's public
40
47
  instance `Handle()`, not a property, constructor or `Provide()` parameter.
41
- The type must be non-nullable and implement `IGeneratable<TSelf>` for itself;
42
- a raw `Guid`, nullable concept or by-reference parameter is invalid. Use domain
48
+ The type must be non-nullable and implement `IGeneratable<TSelf>` or
49
+ `IGeneratableInContext<TSelf>` for itself; a raw `Guid`, nullable concept or
50
+ by-reference parameter is invalid. Use domain
43
51
  concepts; the runtime's type check is the self-generatable interface contract.
44
52
 
45
53
  `[GeneratedValue]` uses the parameter name. `[GeneratedValue("customerId")]` keeps the
@@ -52,10 +60,11 @@ invoking `Handle()`. Neither a provided value nor a DI registration overrides a
52
60
  generated parameter. Unmarked parameters retain their normal resolution.
53
61
 
54
62
  Discoverable concept validators run with the command's scoped provider and
55
- cancellation token. Errors produce `GeneratedValueRejected`, an exception
63
+ cancellation token. A failed rule produces `GeneratedValueRejected`, an exception
56
64
  outcome in `CommandResult`: a server-generation defect, not a request-validation
57
- 400. Warnings/information allow execution. Fix the strategy or invariant; do not
58
- turn the defect into a user rejection or disable validation to make it pass.
65
+ 400. Requires Arc 22.104.0 for rejection at every severity, including Warning and
66
+ Information; older runtimes let those severities execute. Fix the strategy or
67
+ invariant; do not turn the defect into a user rejection or disable validation.
59
68
 
60
69
  Validated values enter `CommandContext.GeneratedValues` in parameter-resolution
61
70
  order. Each capture has zero-based `Order`, `Name`, declared `Type` and `Value`;
@@ -73,7 +82,7 @@ handler-construction checks remain for declarations compiled without analyzers.
73
82
 
74
83
  | Diagnostic | Severity | Fix |
75
84
  | --- | --- | --- |
76
- | ARC0022 | Error | Use a non-nullable type implementing `IGeneratable<TSelf>` for itself; no raw `Guid` or by-reference parameter. |
85
+ | ARC0022 | Error | Use a non-nullable type implementing `IGeneratable<TSelf>` or `IGeneratableInContext<TSelf>` for itself; no raw `Guid` or by-reference parameter. |
77
86
  | ARC0023 | Error | Move the attribute to a non-static command `Handle()` parameter, not `Provide()`, a read model or controller. |
78
87
  | ARC0024 | Error | Give each generated parameter a non-empty unique name; comparison is case-sensitive. |
79
88
  | ARC0025 | Warning | Remove a redundant provided value of the generated type, or remove the attribute if `Provide()` should supply it. An unmarked parameter can still consume that provided type. |
@@ -126,7 +135,13 @@ Source: `Source/DotNET/Arc.Core/Commands/ModelBound/GeneratedValueAttribute.cs`,
126
135
  `Source/DotNET/Testing/Commands/CommandScenarioGeneratedValueExtensions.cs`.
127
136
 
128
137
  Contextual generation (received time and tenant) and Fundamentals' additional strategies need a newer Arc; [sources and Clock/Tenant
129
- setup](shop-generation.md). Arc does not supply a native freshness/collision
130
- allocator or a pattern contract. Screenplay separately admits concept `generate`
131
- strategies and freshness; see `cratis-screenplay-command-surface/references/generated-values-and-responses.md`
132
- for that language contract and Stage's explicit scopes, not native Arc freshness support.
138
+ setup](shop-generation.md). Generated parameter resolution is not a gapless or
139
+ short-code collision allocator. Fundamentals owns pattern/checksum factories;
140
+ Arc resolves these through the concept's generation interface, not strategy-specific
141
+ `[GeneratedValue]` options. Requires Arc.Screenplay 22.107.0 for pattern/random,
142
+ checksum and self-contained String-rule recovery; older adapters keep them in code.
143
+ Requires Stage 4.118.0 for checksum validation and 4.119.0 for pattern/random
144
+ rendering; older renderers refuse them. `generate rule` remains STAGE-ESM-028.
145
+ Screenplay separately admits concept `generate` strategies and freshness; see `cratis-screenplay-command-surface/references/generated-values-and-responses.md`
146
+ for that language contract and Stage's explicit scopes. Native Arc freshness is a
147
+ separate policy; a factory alone is not a storage guard.
@@ -13,8 +13,10 @@
13
13
 
14
14
  Use the [same shop concepts](../../cratis-fundamentals-concept/references/shop-generation.md):
15
15
  CustomerId is `cus_` + ULID; OrderId is context-aware TypeID; InviteCode is NanoID;
16
- ApiKey is secret `Bytes(32)` with `[NotAudited]`. The concept owns the factory,
17
- not a command property or a per-call random implementation.
16
+ ApiKey is secret `Bytes(32)` with `[NotAudited]`. InvoiceNumber is a date/checksum
17
+ pattern and TicketNumber an inclusive random Int64 pickup ticket. The concept owns
18
+ the factory, not a command property or a per-call random implementation.
19
+ Requires Fundamentals 7.25.0 for Pattern/Integer factories; check `dotnet list package --include-transitive`, upgrade or retain existing factories on older versions.
18
20
 
19
21
  The following complete command declarations depend on those Shop concepts and
20
22
  `Cratis.Arc.Core` / `Cratis.Arc.Chronicle`. They allocate response values only, not persisted entities or events;
@@ -87,16 +89,25 @@ and captured-time semantics, never one exact random suffix.
87
89
  - Existing/client-owned IDs stay command inputs; services/read models remain
88
90
  ordinary dependencies. Generation is not authorization or tenant isolation.
89
91
  - Randomness is not idempotency, storage freshness or a gapless invoice allocator.
90
- Arc#3129 freshness is not delivered by this parameter API; Stage's v15 explicit
91
- scopes are a separate realization.
92
+ Stage's explicit whole-source scopes protect generated destinations, not
93
+ every generated payload code; enforce payload uniqueness separately.
92
94
  - ApiKey is a credential, never a Chronicle stream ID: event-source IDs are plaintext
93
95
  metadata and cannot be encrypted. Identify the key with a separate `ApiKeyId` and keep
94
96
  ApiKey a secret value property. `[NotAudited]` protects
95
97
  causation only. Never log captures, return secrets on public endpoints, or
96
98
  append plaintext authentication credentials. Retain a hash; for retained
97
99
  operational secrets use `[Encrypted]` plus `[NotAudited]`.
98
- - Screenplay's generated context and secret execution remain unavailable. A
99
- compiled Arc factory does not imply that it can recover or render as `.play`.
100
+ - Readable patterns are not gapless/sequential invoice allocators or secrets;
101
+ check digits catch typos, not forgery. Short codes need uniqueness handling;
102
+ generation alone does not reserve a code.
103
+ - Screenplay admits attached generation rules with Now/Tenant context, but its
104
+ reference evaluator only consumes pinned results. Generated secrets remain
105
+ refused. A compiled Arc factory does not imply that it can recover or render
106
+ as `.play`. Read [generated-value recovery](../../cratis-screenplay-legacy-extraction/references/generated-recovery.md)
107
+ for Arc.Screenplay prerequisites and refusal boundaries, and
108
+ [Stage admission](../../cratis-stage-rendering-and-sandbox/references/admission.md)
109
+ for checksum and pattern/random rendering prerequisites. `generate rule`
110
+ remains STAGE-ESM-028.
100
111
 
101
112
  ## Sources
102
113
 
@@ -118,15 +118,23 @@ Sources and the complete shop example: [shop generation](references/shop-generat
118
118
  ## Choosing a strategy
119
119
 
120
120
  The shared shop uses CustomerId (`cus_` + ULID), context-aware OrderId (TypeID),
121
- InviteCode (NanoID), and secret ApiKey (`Bytes(32)`, `[NotAudited]` in its host).
121
+ InviteCode (NanoID), readable InvoiceNumber (pattern with checksum), random Int64
122
+ TicketNumber and secret ApiKey (`Bytes(32)`, `[NotAudited]` in its host).
122
123
  Read [choices, time/tenant context and protection](references/shop-generation.md).
123
124
  Requires Fundamentals 7.24.0 for these newer helpers; the earlier
124
125
  UUID examples remain supported.
126
+ Requires Fundamentals 7.25.0 for `GenerateValue.Pattern(pattern, checksum)`, its
127
+ `(pattern, context, checksum)` overload, `Integer(minimum, maximum)` and
128
+ `HasValidChecksum(value, checksum)` (`dotnet list package --include-transitive`);
129
+ older packages lack them. Read the shop reference for exact signatures and UTC
130
+ patterns before using them; do not hand-roll checksum or random-range algorithms.
125
131
 
126
132
  ## When not to generate
127
133
 
128
134
  Client-supplied identities stay inputs; random generation is not idempotency or
129
- gapless numbering. UUIDs are not credentials. Byte generation can create a secret
135
+ gapless/sequential numbering. Patterns are readable references, not allocators or
136
+ secrets; check digits catch typos, not forgery. Short codes need collision handling
137
+ and uniqueness/freshness enforcement appropriate to their role. UUIDs are not credentials. Byte generation can create a secret
130
138
  in Fundamentals, but audit suppression, authorized delivery and hash storage are separate
131
139
  host responsibilities; never treat randomness as protection.
132
140
 
@@ -15,12 +15,14 @@ A shop can use CustomerId (`cus_` + ULID) for
15
15
  recognizable time-ordered customer references, OrderId (TypeID) for typed order
16
16
  references, InviteCode (NanoID) for opaque invitation references, and ApiKey
17
17
  (`Bytes(32)`) for a 256-bit credential. UUID remains the ordinary identity choice;
18
- encoded bytes make an exact entropy budget explicit. Prefixes add no entropy.
18
+ encoded bytes make an exact entropy budget explicit. InvoiceNumber uses a readable
19
+ pattern with Luhn check digit; TicketNumber uses an inclusive random Int64 range
20
+ for pickup tickets. Prefixes, dates and checksums add no entropy.
19
21
  UUIDv7/ULID/TypeID reveal time and are not monotonic within a millisecond.
20
22
  An invitation reference here is not by itself permission to join the shop; if
21
23
  possession is the authorization mechanism, treat it as a protected credential too.
22
24
 
23
- This complete concept excerpt requires `Cratis.Fundamentals` 7.24.0 or later and,
25
+ This complete concept excerpt requires `Cratis.Fundamentals` 7.25.0 or later and,
24
26
  for the ApiKey audit attribute, `Cratis.Arc.Chronicle`. These are
25
27
  non-stream references; use `EventSourceId<string>` instead only if a concept
26
28
  actually identifies a Chronicle event source.
@@ -49,6 +51,17 @@ public record InviteCode(string Value) : ConceptAs<string>(Value), IGeneratable<
49
51
  public static InviteCode New() => new(GenerateValue.NanoId());
50
52
  }
51
53
 
54
+ public record InvoiceNumber(string Value) : ConceptAs<string>(Value), IGeneratableInContext<InvoiceNumber>
55
+ {
56
+ public static InvoiceNumber New(GenerationContext context) =>
57
+ new(GenerateValue.Pattern("INV-{yyyy}{MM}-#{7}", context, Checksum.Luhn));
58
+ }
59
+
60
+ public record TicketNumber(long Value) : ConceptAs<long>(Value), IGeneratable<TicketNumber>
61
+ {
62
+ public static TicketNumber New() => new(GenerateValue.Integer(100000, 999999));
63
+ }
64
+
52
65
  [NotAudited]
53
66
  public record ApiKey(string Value) : ConceptAs<string>(Value), IGeneratable<ApiKey>
54
67
  {
@@ -80,13 +93,39 @@ Do not present a tenant-prefixed custom string as standard TypeID.
80
93
 
81
94
  Use the context form only for time/tenant-dependent generation. If both interfaces
82
95
  are implemented, callers choose context; the interfaces themselves do not dispatch.
83
- Built-in context overloads reject default Now (`MissingGenerationTime`) and time
84
- before the Unix epoch. A fixed context fixes the timestamp, not random suffixes.
96
+ Time-ordered built-in context overloads reject default Now (`MissingGenerationTime`)
97
+ and time before the Unix epoch. A fixed context fixes the timestamp, not random suffixes.
98
+
99
+ Requires Cratis.Fundamentals 7.25.0 for `Pattern`, `Integer`, `Checksum` and
100
+ `HasValidChecksum` (`dotnet list package --include-transitive`); older packages
101
+ lack these helpers. Upgrade deliberately or retain the existing factory.
102
+
103
+ `GenerateValue.Pattern(string pattern, Checksum checksum = Checksum.None)` is the
104
+ date-free overload; `Pattern(string pattern, GenerationContext context,
105
+ Checksum checksum = Checksum.None)` uses `context.Now` in UTC for date segments.
106
+ A date pattern without context throws `PatternRequiresGenerationContext`;
107
+ default Now on the context overload throws `MissingGenerationTime`.
108
+ Use `#` for digits, `?` for uppercase letters, `*` for letters/digits, positive
109
+ ASCII classes and repeats up to 64. UTC segments are `{yyyy}`, `{yy}`, `{MM}`, `{dd}`.
110
+ The appended checksum uses every preceding ASCII digit, including date digits:
111
+ `Checksum.Luhn` and `Mod11` append one digit, `Mod97` two; Mod11 excludes payloads
112
+ that would need digit 10. Output including suffix is limited to 256 characters.
113
+
114
+ Generation does not add a validator. Use
115
+ `GenerateValue.HasValidChecksum(value, Checksum.Luhn)` in the concept's validator
116
+ when supplied/stored values must obey the arithmetic too; combine it with shape
117
+ validation. `Integer(long minimum, long maximum)` returns `long`, includes both
118
+ endpoints and supports the full Int64 range with unbiased secure randomness.
119
+ Enforce unique short payload codes at append: randomness alone does not reserve
120
+ one, and event-source freshness does not protect a different payload value.
85
121
 
86
122
  ## When not to generate
87
123
 
88
124
  - Client-minted customer/order IDs stay inputs. Do not replace them on retry.
89
- - Random values supply neither idempotency nor gapless invoice allocation.
125
+ - Random values and readable patterns supply neither idempotency nor gapless/sequential
126
+ invoice allocation. A legally gapless invoice number needs an allocator.
127
+ - Check digits detect transcription mistakes, not forgery or authorization; patterns
128
+ are not secrets. Low-entropy codes need explicit collision/uniqueness handling.
90
129
  - An ID is not an authentication token or authorization policy.
91
130
  - ApiKey is a **secret**, not an event-source ID: event-source IDs are plaintext metadata
92
131
  and cannot be encrypted. Use a separate `ApiKeyId` as the identity and keep ApiKey a
@@ -102,7 +141,11 @@ before the Unix epoch. A fixed context fixes the timestamp, not random suffixes.
102
141
 
103
142
  Fundamentals `Source/DotNET/Fundamentals/Concepts/GenerationContext.cs`,
104
143
  `IGeneratableInContext.cs`, `GenerateValue.TimeOrderedStrings.cs`,
105
- `GenerateValue.RandomStrings.cs`; `Documentation/csharp/generating-values.md`.
144
+ `GenerateValue.RandomStrings.cs`, `GenerateValue.Patterns.cs`,
145
+ `GenerateValue.Numbers.cs`, `Checksum.cs`; at Fundamentals v7.25.0,
146
+ `Documentation/csharp/generating-values/patterns.md`,
147
+ `Documentation/csharp/generating-values/reference.md` and
148
+ `Documentation/csharp/generating-values/context.md`.
106
149
  Arc `Source/DotNET/Chronicle/Commands/NotAuditedAttribute.cs`,
107
150
  `CommandCausationValues.cs` (command/type/property exclusion only, never
108
151
  payload encryption or log protection);
@@ -12,37 +12,41 @@ guarantees. Then write it as `Automation` and `Translate` slices that say truthf
12
12
  protected, what is only recorded, and who acts. Grammar depth is in
13
13
  `cratis-screenplay-captures-and-reactions`; this skill owns the decisions.
14
14
 
15
- **Translation crosses an application boundary:** inbound turns outside data or foreign
16
- public events into private local facts; outbound publishes private facts as one local public
17
- event type. Declare `direction inbound|outbound` when public metadata is used; omission
18
- preserves inbound for translations without a declared direction. Private-to-private follow-up is an
19
- Automation (`produces` or `invokes`), even when a Chronicle reactor realizes it.
20
- Read [public events and direction](references/public-events-and-direction.md) for released
21
- ESM v9 forms, event-target folds, publication specifications and the Unsupported capture limit.
15
+ **Translation crosses an application boundary:** private-to-private follow-up is
16
+ Automation, even if a reactor realizes it. Keep captures in Translate and reactions
17
+ to their local facts in separate Automation slices. Read
18
+ [public events and direction](references/public-events-and-direction.md) when
19
+ choosing direction, folding events or specifying publication: it owns the ESM v9
20
+ forms, PLAY0616 and directionless Translate's PLAY0694 split boundary.
21
+ Requires Screenplay 4.176.0 or later (`screenplay --version`) for PLAY0694; older compilers leave that directionless shape unchecked.
22
22
  One `source events` capture reads one origin (event store); split several origins.
23
23
  Requires Screenplay 4.155.0 (`screenplay --version`) for PLAY0687; older tools leave it unchecked.
24
24
 
25
- Work in the model first. Code appears only where it is truly needed: the external call, the
26
- source adapter, the trusted actor, and everything Stage cannot render (below). Session and
27
- verdict discipline: `cratis-screenplay-modeling-lifecycle`; tools, versions and verdicts V1 to V5:
28
- `cratis-screenplay-toolchain`. When you add or change a reaction or capture, resolve its input,
29
- identity, effect and pending-work contract at that point; do not postpone it to the final review.
25
+ Model behavior first; code implements external calls, adapters, actors and refused
26
+ target scope. Follow `cratis-screenplay-modeling-lifecycle` for session discipline
27
+ and `cratis-screenplay-toolchain` for verdicts. Settle input, identity, effect and
28
+ pending-work contracts when changing each reaction/capture, not at final review.
30
29
 
31
30
  ## Tool and realization facts (read before promising anything)
32
- - Reactions, clocks, triggers, captures and Automation/Translate slices compile (V1) and bind (V3)
33
- as ESM v6: the standalone tool and a CLI whose bundled compiler admits v6. A compiler that
34
- stops before v6 reports PLAY0268 at binding: report "V3 blocked: PLAY0268 (ESM v6)" and
35
- name the tool, never remove them.
36
- - The pinned standalone tool runs admitted scenarios through `screenplay test` or MCP
37
- `run-specifications`; source validation and render publication do not run V4.
38
- - A renderer can refuse Automation/Translate members (STAGE-ESM-024) it does not realize.
39
- Deliver that scope as authorized gap-fill
40
- (`references/realization-and-gap-fill.md`).
41
- - Reaction `runs as system role "<Role>"` declares an invocation actor (ESM v10).
42
- Without it the invoke has no caller. A compiler or renderer that stops before v10
43
- rejects the syntax (PLAY0137) or refuses it at render admission (CLI-RENDER-004). The CLI/Stage pair (toolchain
44
- `references/renderable-subset.md`) renders role/authenticated reaction identity; claim-reading/opaque gates retain STAGE-ESM-034. Checked model/diagnostics: captures-and-reactions
45
- `references/invocation-identity.md`.
31
+ - V1, V3, V4 and target rendering are separate; name the compiler and never remove
32
+ a refused construct. Run `screenplay test` or MCP `run-specifications` for V4.
33
+ - Read [realization and gap-fill](references/realization-and-gap-fill.md) before
34
+ promising Automation/Translate delivery (STAGE-ESM-024).
35
+ - Invokes have no caller without `runs as`. Read captures-and-reactions
36
+ [invocation identity](../cratis-screenplay-captures-and-reactions/references/invocation-identity.md)
37
+ for the ESM v10 actor and role/authenticated versus claim/opaque admission.
38
+
39
+ ## Atomic production boundaries and source identity
40
+
41
+ Start new models with application-root `reaction batches atomic` (ESM v22 or later).
42
+ Each trigger occurrence's direct productions and each selected refusal branch are
43
+ separate all-or-none batches; invoked commands remain independent. Absence retains
44
+ legacy per-fact behavior even at later versions. Assert no failed-batch facts and
45
+ unchanged views, not only `then error`. Stage refuses v22 (STAGE-ESM-016) and
46
+ atomic mode in admitted v23/v24 models (STAGE-ESM-043); keep the semantics as gap-fill.
47
+ Read [atomic batches and source mappings](../cratis-screenplay-captures-and-reactions/references/atomic-batches-and-source-mappings.md)
48
+ when choosing these boundaries or mapping an invoked identifier from `$eventSourceId`
49
+ (or `$eventContext.eventSourceId`) instead of copying it into event payload.
46
50
 
47
51
  ## Effect guarantees and recovery traps
48
52
  | Guarantee | What it promises | What can show it |
@@ -102,19 +106,9 @@ of each, and how each record finds our entity (the correlation strategy); and fo
102
106
  occurrence, the effect and who acts. Cite existing answers instead of asking again. Missing
103
107
  correlation is the most common cause of failed integrations: surface it first.
104
108
 
105
- **Critical questions** (ask one group at a time; follow up from the answer; accept "unsure" as an
106
- open question, not an invented answer):
107
- 1. **Sources.** "Which systems send us facts? For each: name, record types, channel (webhook, poll,
108
- topic, file), format, who authenticates it?" Follow-up per system: "Does the record carry our
109
- entity id, or do we need to remember their id against ours?"
110
- 2. **Mapping.** "For the hardest record: does it map directly to one fact of ours, need several
111
- facts, or need data we already hold?" Follow-up if not direct: "What do we look up, and what
112
- happens when the record arrives before that data exists?"
113
- 3. **Automations.** "What happens on its own after <fact>? Can it fail, wait, or need a person? What
114
- do people see meanwhile? Who is allowed to do it?" Follow-up: "What makes it stop? What if it ran
115
- twice?"
116
- 4. **Recovery.** "Which records or steps can we not accept, and who fixes them, how, and how does
117
- processing resume?"
109
+ Read [integration interview prompts](references/integration-interview.md) when
110
+ sources, mapping, automation ownership or recovery are unsettled. Ask one group at
111
+ a time; treat "unsure" as an open question.
118
112
 
119
113
  **Unattended:** assume visibly. Record each assumption as a labelled open decision in `STATE.md`
120
114
  (`.ai-work/screenplay/<model-slug>/STATE.md`), mark the dependent slice open, never write a mapping
@@ -155,7 +149,8 @@ or actor that nobody confirmed. Read `references/worked-integration.md` when you
155
149
  7. **Translate outside facts** (`references/translation-patterns.md`): enter only via `capture` or a
156
150
  translator reaction, in a `Translate` slice; correlate first; keep the external fact distinct from
157
151
  ours; trace source fields *and* every required target field; decide dedup, ordering and recovery
158
- ownership. A worker after translation needs a distinct local decision, obligation or effect.
152
+ ownership. A reaction to a capture's local fact is a separate Automation, not a
153
+ second job inside Translate. A worker after translation needs a distinct local decision, obligation or effect.
159
154
  8. **Specify and audit.** Work through `references/cases-to-specify.md` per declaration and hand the
160
155
  named cases to `cratis-screenplay-scenario-coverage`. Produce the audit in `references/audit-format.md`.
161
156
 
@@ -167,9 +162,16 @@ or actor that nobody confirmed. Read `references/worked-integration.md` when you
167
162
  - Clock triggers take no values (PLAY0450) and no `by` on reads (PLAY0443). `for each <View>` is
168
163
  reserved, not available.
169
164
  - Capture `when` cannot mix `and` and `or` (PLAY0089). A capture without `key` does not bind.
165
+ - For `source events`, `key` is a required property on every `from` event (PLAY0700);
166
+ specs supply `given <Event>` / `when append <Event>`, not capture records (PLAY0701).
167
+ - First sight is `added` only. Use `when added` separately for initial facts; seed
168
+ record updates with `given capture` of the same key. Read captures-and-reactions
169
+ `references/record-capture-specifications.md` for the prerequisite and child/nested rules.
170
170
  - Current V1 warns on undeclared capture/removal events (PLAY0166); V3 remains a
171
171
  separate binder check.
172
- - A trigger with `reads` that `produces` directly fails binding: decide in a command. `reads` never protects.
172
+ - A trigger with `reads` that `produces` directly fails binding: decide in a command.
173
+ Command reads can protect with `command reads protected` and admitted shapes (v25);
174
+ trigger reads cannot. Stage refuses protected reads (STAGE-ESM-044); target protection remains a separate check.
173
175
  - An authorized command exercised in a spec without `given caller` is PLAY0389 at binding.
174
176
  - A list query (`=> Item[]`) binds (a snapshot list is not rendered, `STAGE-ESM-010`);
175
177
  a clock sweep that iterates items needs a code body the reference does not run
@@ -30,7 +30,9 @@ One spec in the slice does not cover the others.
30
30
  ## Translations
31
31
  | Case | Question | Typical shape |
32
32
  |---|---|---|
33
- | happy path | record arrives, our fact recorded | `when capture` -> `then <External>` + `then <Ours>` |
33
+ | first sight | new record key arrives | record `when capture`, `when added` append -> `then <Fact>` and any separate Automation follow-up |
34
+ | update | a field changes for a known key | `given capture` same key's previous record + `when capture`; field-change append holds |
35
+ | consumed public event | capture has `source events` | `given <FromEvent>` / `when append <FromEvent>`, never capture-record fixtures (PLAY0701) |
34
36
  | arrives before our entity | the reference is unknown to us | decide: park, reject, or record an orphan fact for follow-up |
35
37
  | duplicate delivery | same record again | `given capture` (same record) + `when capture`: nothing new; or constraint rejection on our fact |
36
38
  | out of order | an older record after a newer one | `given capture` newer + `when capture` older; expected outcome stated |
@@ -66,4 +68,11 @@ One spec in the slice does not cover the others.
66
68
  tool's compiler stops before v6 does it report a false PLAY0285 on a cascade:
67
69
  then keep the cascade out of the command spec, specify it in the Automation slice
68
70
  (`when append <Trigger>`) and record the expectation. See `cratis-screenplay-scenario-coverage`.
69
- - `given capture` never persists between specs: state the baseline in each spec that needs it.
71
+ - `given capture` never persists between specs: state the baseline in each record
72
+ update spec. First records (root, child, nested) are added only; field-change
73
+ `and`/`or` and transitions need previous state. Expressions/maps/unguarded record
74
+ appends are unchanged. See captures-and-reactions `references/record-capture-specifications.md`.
75
+ - For `source events`, use prior typed events instead of `given capture`; cover
76
+ first added, per-key overlays, unchanged input, independent keys and optional
77
+ foreign `for` unrelated to the content key. Reference execution does not prove
78
+ capture redelivery deduplication or observer ordering.
@@ -0,0 +1,24 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Integration interview prompts
5
+
6
+ Ask one group at a time, following up from the answer. Accept "unsure" as an open
7
+ question, not an invented answer.
8
+
9
+ 1. **Sources.** "Which systems send us facts? For each: name, record types, channel
10
+ (webhook, poll, topic, file), format, who authenticates it?" Follow-up per system:
11
+ "Does the record carry our entity id, or do we need to remember their id against ours?"
12
+ 2. **Mapping.** "For the hardest record: does it map directly to one fact of ours, need
13
+ several facts, or need data we already hold?" Follow-up if not direct: "What do we
14
+ look up, and what happens when the record arrives before that data exists?"
15
+ 3. **Automations.** "What happens on its own after <fact>? Can it fail, wait, or need a
16
+ person? What do people see meanwhile? Who is allowed to do it?" Follow-up: "What
17
+ makes it stop? What if it ran twice?"
18
+ 4. **Recovery.** "Which records or steps can we not accept, and who fixes them, how,
19
+ and how does processing resume?"
20
+
21
+ Skip questions already answered by the brief or model. Missing correlation is the
22
+ most common cause of failed integrations: surface it first. Unattended work records
23
+ assumptions as labeled open decisions in `.ai-work/screenplay/<model-slug>/STATE.md`
24
+ and marks dependent slices open, never inventing mappings or actors.
@@ -1,7 +1,7 @@
1
1
  <!-- Copyright (c) Cratis. All rights reserved. -->
2
2
  <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
3
 
4
- # Public events and translation direction (released ESM v9)
4
+ # Public events and translation direction
5
5
 
6
6
  ## Contents
7
7
 
@@ -100,26 +100,92 @@ module Integration
100
100
  direction inbound
101
101
  event ShipmentDispatched from "shipping"
102
102
  orderId OrderId
103
- event OrderDispatched
103
+ carrier String
104
+ event ShipmentDelivered from "shipping"
104
105
  orderId OrderId
106
+ status String
107
+ event OrderDispatched
108
+ carrier String
109
+ event OrderDeliveryRecorded
110
+ carrier String
111
+ status String
105
112
  capture ShipmentTracking
106
113
  source events
107
114
  from ShipmentDispatched
115
+ from ShipmentDelivered
108
116
  key orderId
109
117
  append OrderDispatched
110
- orderId = $.orderId
118
+ when added
119
+ carrier = $.carrier
120
+ append OrderDeliveryRecorded
121
+ when status
122
+ carrier = $.carrier
123
+ status = $.status
124
+ specification RecordingTheFirstDispatch
125
+ when append ShipmentDispatched
126
+ orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
127
+ carrier = "DHL"
128
+ then OrderDispatched
129
+ for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
130
+ carrier = "DHL"
131
+ specification FoldingEarlierDispatchIntoDelivery
132
+ given ShipmentDispatched
133
+ orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
134
+ carrier = "DHL"
135
+ when append ShipmentDelivered
136
+ orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
137
+ status = "delivered"
138
+ then OrderDeliveryRecorded
139
+ for "3fa85f64-5717-4562-b3fc-2c963f66afa6"
140
+ carrier = "DHL"
141
+ status = "delivered"
142
+ specification IgnoringAnUnchangedDispatch
143
+ given ShipmentDispatched
144
+ orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
145
+ carrier = "DHL"
146
+ when append ShipmentDispatched
147
+ orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
148
+ carrier = "DHL"
149
+ then no events
111
150
  ```
112
151
 
113
- This compiles and binds as ESM v9. Evaluating the events-source capture returns
114
- typed Unsupported: the event-payload-to-working-record contract is not admitted.
115
- Do not equate binding with a passing capture specification or invent that mapping.
116
- Keep correlation and resulting private events in the model and report the runtime gap.
152
+ Requires Screenplay 4.171.0 or later (`screenplay --version`) for event-capture
153
+ reference execution and PLAY0700/0701; older runners do not deliver these inputs
154
+ to captures. Run `screenplay <model> --warnaserror`, then `screenplay test <model>`:
155
+ zero diagnostics and all three capture specifications passed are the pass signals.
156
+
157
+ Present the consumed public event itself: `given <Event>` / `when append <Event>`.
158
+ Fields are typed by its local declaration. `given capture` / `when capture` is
159
+ PLAY0701, with a repair only for exactly one `from` event (several are ambiguous).
160
+ `for` is optional on foreign fixtures: when supplied, it is opaque nonempty text
161
+ identifying the foreign source, not the capture key. A content key such as `orderId`
162
+ must be required on every `from` event (PLAY0700); `$eventSourceId` and other context
163
+ keys are refused. An empty or whitespace-only text key fails execution, even in a
164
+ given before the action; non-text/non-numeric keys are Unsupported.
165
+
166
+ Givens fold in authored order without appending. Each event overlays its top-level
167
+ properties onto state for that typed key: absent properties retain earlier values;
168
+ objects/lists replace whole values. First sight is `added` only, unchanged overlays
169
+ append nothing, and field/`and`/`or`/transition guards require a modification. An
170
+ append without `when` holds on any change, not on every delivery. Maps apply to
171
+ before and after states; `$.field` reads the mapped merged state. An expression
172
+ guard evaluates the after state only on a change. Root `when removed` never holds.
173
+
174
+ Captures run after reactions to the same input settle; each capture append settles
175
+ its own cascade before the next. Mixed capture/reaction assertions may need
176
+ `then events in any order`: reference order does not prove independent observer
177
+ order. Only `$context.occurred` (from `given clock`) is admitted; other context
178
+ members fail binding. `children`/`nested` over events remain Unsupported, as do
179
+ composite/list values used as scalars or watched by guards. Reference state never
180
+ persists between specifications and does not prove redelivery deduplication,
181
+ source acknowledgement, retry safety or context propagation. A passing reference
182
+ scenario is not renderer admission; Stage must refuse forms Chronicle cannot realize.
117
183
 
118
184
  ## Admission and evidence
119
185
 
120
- ESM v9 shipped and is selected only by use of public events,
121
- origins, direction, event-target builders or events-source captures. At 4.135.0,
122
- publication reference scenarios execute; imported shapes still refuse binding.
186
+ ESM v9 is selected by use of public events, origins, direction, event-target
187
+ builders or events-source captures. Publication and admitted event-capture
188
+ reference scenarios execute; imported shapes still refuse binding.
123
189
  Stage 4.52.0 (previous CLI 3.46.1, history) audited only through v7. The CLI/Stage pair (toolchain `references/renderable-subset.md`)
124
190
  reaches construct admission through its bundled ceiling but still refuses publication (STAGE-ESM-032), foreign
125
191
  events/events-source captures (STAGE-ESM-033); source admission is not rendering.