@cratis/pi 7.49.0 → 7.51.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.
- package/package/corpus/agents/screenplay-modeler.md +5 -2
- package/package/corpus/agents/screenplay-reviewer.md +1 -0
- package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +93 -0
- package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +4 -0
- package/package/corpus/harnesses/copilot/instructions/react.instructions.md +1 -0
- package/package/corpus/hooks/README.md +23 -0
- package/package/corpus/hooks/scripts/cratis-pattern-scan.sh +1 -1
- package/package/corpus/hooks/scripts/cratis-patterns.json +8 -0
- package/package/corpus/hooks/scripts/cratis-quality-gate.sh +6 -0
- package/package/corpus/hooks/scripts/cratis-slice-scope-report.sh +54 -0
- package/package/corpus/prompts/review-skill.prompt.md +6 -8
- package/package/corpus/rules/authoring-skills.md +92 -0
- package/package/corpus/rules/general.md +1 -0
- package/package/corpus/rules/profiles.md +4 -0
- package/package/corpus/rules/react.md +1 -0
- package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +1 -1
- package/package/corpus/skills/cratis-application-slice-conformance/references/build-prompts.md +9 -1
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +4 -1
- package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +3 -0
- package/package/corpus/skills/cratis-application-slice-specifications/LICENSE +4 -0
- package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-application-slice-specifications/references/query-and-decision-scenarios.md +8 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +23 -29
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authentication.md +7 -7
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +34 -32
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authproxy.md +1 -1
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/frontend.md +2 -2
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/local-development.md +3 -3
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/observable-emission-guards.md +8 -6
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/tenancy.md +3 -3
- package/package/corpus/skills/cratis-arc-command/SKILL.md +23 -25
- package/package/corpus/skills/cratis-arc-command/references/command-result.md +1 -1
- package/package/corpus/skills/cratis-arc-command/references/decisions-and-routing.md +9 -9
- package/package/corpus/skills/cratis-arc-command/references/generated-values.md +11 -12
- package/package/corpus/skills/cratis-arc-command/references/handler-shapes.md +4 -4
- package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +3 -3
- package/package/corpus/skills/cratis-arc-command/references/read-model-injection.md +1 -3
- package/package/corpus/skills/cratis-arc-command/references/shop-generation.md +11 -14
- package/package/corpus/skills/cratis-arc-command-execution/LICENSE +6 -0
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +17 -19
- package/package/corpus/skills/cratis-arc-command-kotlin/SKILL.md +8 -7
- package/package/corpus/skills/cratis-arc-command-kotlin/references/read-model-naming.md +2 -2
- package/package/corpus/skills/cratis-arc-command-operation/SKILL.md +14 -15
- package/package/corpus/skills/cratis-arc-command-operation/references/execution-and-recovery.md +2 -2
- package/package/corpus/skills/cratis-arc-command-operation/references/testing.md +7 -8
- package/package/corpus/skills/cratis-arc-command-typescript/SKILL.md +14 -11
- package/package/corpus/skills/cratis-arc-command-typescript/references/chronicle-events.md +7 -7
- package/package/corpus/skills/cratis-arc-command-typescript/references/command-operations.md +4 -4
- package/package/corpus/skills/cratis-arc-command-typescript/references/hosting-and-storage.md +11 -7
- package/package/corpus/skills/cratis-arc-command-typescript/references/identity-and-introspection.md +4 -2
- package/package/corpus/skills/cratis-arc-command-typescript/references/observability-and-host-scopes.md +2 -2
- package/package/corpus/skills/cratis-arc-command-typescript/references/proxy-generation.md +3 -3
- package/package/corpus/skills/cratis-arc-command-typescript/references/slice-layout.md +1 -1
- package/package/corpus/skills/cratis-arc-command-typescript/verification.json +2 -2
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -14
- package/package/corpus/skills/cratis-arc-ef-core-migration/LICENSE +6 -0
- package/package/corpus/skills/cratis-arc-ef-core-migration/SKILL.md +9 -10
- package/package/corpus/skills/cratis-arc-go/SKILL.md +14 -15
- package/package/corpus/skills/cratis-arc-go/references/queries.md +2 -2
- package/package/corpus/skills/cratis-arc-hosting/SKILL.md +8 -8
- package/package/corpus/skills/cratis-arc-hosting/references/integrations-and-publish.md +11 -11
- package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +13 -13
- package/package/corpus/skills/cratis-arc-observable-query-http/verification.json +1 -1
- package/package/corpus/skills/cratis-arc-query-kotlin/SKILL.md +2 -3
- package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +11 -14
- package/package/corpus/skills/cratis-arc-query-typescript/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-query-typescript/references/storage-observation-and-compliance.md +2 -2
- package/package/corpus/skills/cratis-arc-react-page/LICENSE +4 -0
- package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +6 -0
- package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +1 -2
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +19 -22
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +10 -10
- package/package/corpus/skills/cratis-chronicle-client-dotnet/SKILL.md +36 -36
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/additional-surfaces.md +4 -2
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/client-construction.md +1 -1
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/compatibility-check.md +13 -13
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/discovery.md +10 -10
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/hosting.md +10 -10
- package/package/corpus/skills/cratis-chronicle-client-dotnet/references/pinned-generation-delivery.md +7 -5
- package/package/corpus/skills/cratis-chronicle-client-elixir/SKILL.md +59 -64
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/append-api.md +17 -17
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/compliance.md +5 -3
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/connections.md +15 -11
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/event-sources.md +3 -1
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/pitfalls.md +4 -4
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/projections.md +8 -4
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/upgrading.md +19 -19
- package/package/corpus/skills/cratis-chronicle-client-elixir/references/variants.md +3 -8
- package/package/corpus/skills/cratis-chronicle-client-elixir/verification.json +2 -2
- package/package/corpus/skills/cratis-chronicle-client-go/SKILL.md +16 -18
- package/package/corpus/skills/cratis-chronicle-client-go/references/projections.md +2 -2
- package/package/corpus/skills/cratis-chronicle-client-kotlin/SKILL.md +61 -58
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/connection-lifecycle.md +9 -10
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/discovery-and-registration.md +6 -6
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/event-sources.md +4 -2
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/java-api.md +4 -4
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/options.md +1 -1
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/spring-boot.md +24 -24
- package/package/corpus/skills/cratis-chronicle-client-kotlin/references/variants.md +6 -5
- package/package/corpus/skills/cratis-chronicle-client-typescript/SKILL.md +26 -20
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/read-models-and-projections.md +4 -4
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/testing.md +1 -1
- package/package/corpus/skills/cratis-chronicle-client-typescript/references/variants.md +4 -3
- package/package/corpus/skills/cratis-chronicle-client-typescript/verification.json +2 -2
- package/package/corpus/skills/cratis-chronicle-compliance/SKILL.md +9 -9
- package/package/corpus/skills/cratis-chronicle-decision-reads/SKILL.md +11 -10
- package/package/corpus/skills/cratis-chronicle-decision-reads/references/admission-and-ownership.md +1 -1
- package/package/corpus/skills/cratis-chronicle-decision-reads/references/choosing-how-a-rule-holds.md +5 -6
- package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +7 -7
- package/package/corpus/skills/cratis-chronicle-event-constraints/references/closing-streams.md +1 -1
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +12 -1
- package/package/corpus/skills/cratis-chronicle-event-specifications/SKILL.md +6 -6
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +12 -10
- package/package/corpus/skills/cratis-chronicle-event-type-migration/references/pinned-generations.md +2 -3
- package/package/corpus/skills/cratis-chronicle-hosting/SKILL.md +7 -7
- package/package/corpus/skills/cratis-chronicle-hosting/references/operations.md +5 -5
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +6 -6
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +5 -5
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -10
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +29 -29
- package/package/corpus/skills/cratis-chronicle-multi-tenancy/SKILL.md +9 -9
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -14
- package/package/corpus/skills/cratis-chronicle-projection/references/fluent-builder.md +3 -5
- package/package/corpus/skills/cratis-chronicle-projection/references/model-bound-attributes.md +2 -4
- package/package/corpus/skills/cratis-chronicle-projection/references/variants.md +1 -3
- package/package/corpus/skills/cratis-chronicle-reactor/LICENSE +4 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/slice-delivery-checklist.md +33 -0
- package/package/corpus/skills/cratis-chronicle-reactor/references/specifications.md +17 -1
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +16 -15
- package/package/corpus/skills/cratis-chronicle-read-model/references/queries.md +8 -8
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +14 -13
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +11 -12
- package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +6 -6
- package/package/corpus/skills/cratis-code-review/SKILL.md +13 -17
- package/package/corpus/skills/cratis-components-accessibility/SKILL.md +3 -3
- package/package/corpus/skills/cratis-components-common-controls/SKILL.md +15 -15
- package/package/corpus/skills/cratis-components-data-surfaces/SKILL.md +29 -29
- package/package/corpus/skills/cratis-components-schema-editor/SKILL.md +4 -4
- package/package/corpus/skills/cratis-components-schema-editor/references/tree-layout.md +1 -1
- package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +6 -6
- package/package/corpus/skills/cratis-components-styling/LICENSE +6 -0
- package/package/corpus/skills/cratis-components-styling/SKILL.md +5 -4
- package/package/corpus/skills/cratis-components-toolbar/SKILL.md +5 -5
- package/package/corpus/skills/cratis-developer-marketing/SKILL.md +2 -2
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +3 -3
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +1 -1
- package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +4 -4
- package/package/corpus/skills/cratis-event-model-diagram/LICENSE +5 -0
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +6 -1
- package/package/corpus/skills/cratis-event-model-diagram/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-fundamentals-concept/SKILL.md +19 -24
- package/package/corpus/skills/cratis-fundamentals-concept/references/shop-generation.md +10 -10
- package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-concepts.md +8 -8
- package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +10 -11
- package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +18 -18
- package/package/corpus/skills/cratis-fundamentals-telemetry/verification.json +1 -1
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +4 -4
- package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +19 -19
- package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +27 -27
- package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +12 -12
- package/package/corpus/skills/cratis-performance-review/SKILL.md +8 -10
- package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +24 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +19 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +1 -1
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +10 -12
- package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +9 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/document-intake.md +123 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/domain-analysis-template.md +1 -12
- package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +49 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +2 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +26 -1
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +17 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +5 -1
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +7 -3
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/provenance.md +2 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +50 -79
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +39 -4
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +15 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +31 -7
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +8 -2
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +4 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +8 -2
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md +102 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +3 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +29 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +2 -1
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/verified-sources.md +20 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +27 -54
- package/package/corpus/skills/cratis-screenplay-model-review/references/baseline-comparison.md +9 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +6 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-review/references/mode-compliance.md +5 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/model-inventory-report.md +48 -11
- package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +5 -2
- package/package/corpus/skills/cratis-screenplay-model-review/references/quick-self-check.md +20 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/stressor-analysis.md +22 -10
- package/package/corpus/skills/cratis-screenplay-model-review/references/verified-sources.md +15 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/walkthrough.md +135 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +5 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/core-rules-digest.md +7 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/per-turn-protocol.md +6 -2
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +16 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +21 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +1 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-fallback-record.md +7 -30
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/hand-written-changes.md +150 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +2 -2
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +1 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +17 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +6 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +9 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +6 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +23 -6
- package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +4 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +69 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +4 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract-exceptions.json +0 -7
- package/package/corpus/skills/cratis-security-review/SKILL.md +8 -10
- package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +18 -16
- package/package/corpus/skills/cratis-specification-by-example/SKILL.md +1 -1
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +26 -29
- package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md +8 -8
- package/package/corpus/skills/cratis-specifications-csharp/references/csharp-patterns.md +2 -2
- package/package/corpus/skills/cratis-specifications-csharp/references/integration-specs.md +6 -4
- package/package/corpus/skills/cratis-specifications-csharp/references/shared-lifecycle.md +6 -2
- package/package/corpus/skills/cratis-specifications-typescript/SKILL.md +2 -2
- package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -4
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +1 -1
- package/package/corpus/skills/guiding-refactoring-with-code-health/SKILL.md +1 -1
- package/package/corpus/skills/prioritizing-technical-debt/SKILL.md +1 -1
- package/package/corpus/skills/risk-based-testing-with-code-health/SKILL.md +3 -3
- package/package/corpus/skills/safeguarding-ai-generated-code/SKILL.md +1 -1
- package/package.json +1 -1
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md
CHANGED
|
@@ -186,6 +186,17 @@ name them as unfinished.
|
|
|
186
186
|
- Shape: the reported outcome is a **fact** (a refusal received is an event), specified in the
|
|
187
187
|
Translate or Automation slice; a missing answer is a time-based scenario. A rejection
|
|
188
188
|
(`then error`) is only for requests we refuse ourselves.
|
|
189
|
+
- **Shown:** a failure fact that someone must act on reaches a view the person reads (a status
|
|
190
|
+
literal and the reason, mapped from the failure event). Pin it with a view specification:
|
|
191
|
+
`given <OpeningFact>`, `given <FailureFact>`, then `then query` with the failed status and
|
|
192
|
+
the reason. A failure only an automation sees is covered by the review question in
|
|
193
|
+
`cratis-screenplay-automations-and-translations`. A failure a person must act on that no
|
|
194
|
+
screen shows is a gap.
|
|
195
|
+
- **Recoverable:** after the failure fact, the retry the business allows is accepted:
|
|
196
|
+
`given <FailureFact>`, `when <RetryCommand>`, `then <AttemptFact>`. It catches a once-only
|
|
197
|
+
constraint (`unique event`) that locks legitimate recovery out, and is the opposite case to
|
|
198
|
+
section 5 (duplicate action). `RetryingPaymentAfterADecline` in `invoicing-dues-example.md` is the
|
|
199
|
+
complete form. When the business forbids a retry, the case is a state violation with its message.
|
|
189
200
|
- n/a: no external system in the path.
|
|
190
201
|
|
|
191
202
|
## 10. Compensation
|
|
@@ -193,6 +204,12 @@ name them as unfinished.
|
|
|
193
204
|
- Shape: the reversal command's own specs, plus a spec proving the effect of the reversal:
|
|
194
205
|
a released claim (`ReservingABerthNightFreedByACancellation`) or a removed row
|
|
195
206
|
(`BerthBoardLifecycle3Cancelled`). Corrections are new facts, never edits of old ones.
|
|
207
|
+
- When undoing one fact obliges follow-up work (a refund after a paid booking is cancelled), the
|
|
208
|
+
follow-up is an Automation slice. Specify it there: `given <PriorFact>`, `when append
|
|
209
|
+
<CancellationFact>`, `then <RefundRequested>` (or the pending-work row), and the case where no
|
|
210
|
+
compensation is owed (cancelled before payment: no refund fact). Recipes:
|
|
211
|
+
`cratis-screenplay-automations-and-translations` `references/cases-to-specify.md`;
|
|
212
|
+
`RequestingARefundAfterAReversal` in `invoicing-dues-design.md` is the complete form.
|
|
196
213
|
- Often reveals a missing event: if nothing can undo a fact the business can reverse, ask.
|
|
197
214
|
|
|
198
215
|
## 11. Evolution compatibility
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-screenplay-slice-design
|
|
3
|
-
description: "Shape Screenplay slices from a discovered timeline: commands with reachable, authorized origins and traced inputs, rules placed by layer, a per-command refusal inventory, events-vs-views decisions, read models per screen component with queries that follow the business view, Level-1 screens, field lineage, state-transition tables, slice dependencies and the next slice. Use after discovery,
|
|
3
|
+
description: "Shape Screenplay slices from a discovered timeline: commands with reachable, authorized origins and traced inputs, rules placed by layer, a per-command refusal inventory, events-vs-views decisions, read models per screen component with queries that follow the business view, Level-1 screens, field lineage, state-transition tables, slice dependencies and the next slice. Use when designing slices after discovery, adding a capability or deciding command inputs, rule placement, read-model shape or screen data. Not for: stream boundaries or invariants across streams (use `cratis-screenplay-streams-and-consistency`), reactions and captures (use `cratis-screenplay-automations-and-translations`), which scenarios to write (use `cratis-screenplay-scenario-coverage`), or auditing a finished model (use `cratis-screenplay-model-review`)."
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md
CHANGED
|
@@ -67,6 +67,12 @@ Before placing a rule in a layer, list every value it reads and classify each on
|
|
|
67
67
|
- **state**: a `reads <View>` path, or the prior facts of the stream.
|
|
68
68
|
- **context**: the time the decision occurs, the caller, the tenant.
|
|
69
69
|
|
|
70
|
+
Decision state is the part of *state* a rule actually branches on. Derive it from the
|
|
71
|
+
specifications, not from the event's shape: a "given no prior activity" and "given already
|
|
72
|
+
{X}" pair means one flag for {X} (a presence check is a flag or a nullable instance); a
|
|
73
|
+
scenario that discriminates on a value means that value. A `reads` view carries exactly the facts the command's specifications branch on, one field
|
|
74
|
+
per fact. Add nothing because an event happens to carry it.
|
|
75
|
+
|
|
70
76
|
A value that fits none of the three is a gap: a missing input, a missing view or a hidden
|
|
71
77
|
dependency. Do not close it with prose in `description` or `handler`.
|
|
72
78
|
|
|
@@ -142,8 +142,16 @@ hop before editing:
|
|
|
142
142
|
An explicit mapping to a renamed-away target fails binding (V3, PLAY0273); a property AutoMap
|
|
143
143
|
used to fill and no longer matches is **not reported** - the field silently stays empty.
|
|
144
144
|
|
|
145
|
+
Before an add, check the element one hop further upstream than the stated source. If it already
|
|
146
|
+
carries the value, the requested chain stops too early: extend it to where the value really
|
|
147
|
+
starts (an input, a context value, a generated identifier, a view calculation).
|
|
148
|
+
|
|
145
149
|
Skip a hop and log why when the field already exists there (add) or is not found on that
|
|
146
|
-
element (rename); never skip silently.
|
|
150
|
+
element (rename); never skip silently. Skipping a hop is also safe when the value already
|
|
151
|
+
arrives there under its old name and an explicit mapping bridges it (hop 3 below). When a hop
|
|
152
|
+
that must carry the value cannot be applied (a persisted event, an accepted slice), do not apply
|
|
153
|
+
the rest as if it had been: stop and route the whole chain to the identity owner. The chain is
|
|
154
|
+
one logical edit. Report the walk hop by hop: element, field, `updated`
|
|
147
155
|
or `skipped` with the reason (already present; not on this element); name the chain from
|
|
148
156
|
the consuming element back to the source. Run V1 after the chain edit; if a hop cannot be applied, stop
|
|
149
157
|
and report that hop. Rename only through the identity-aware path when any hop is persisted
|
|
@@ -49,3 +49,9 @@ Source: https://github.com/Nebulit-GmbH/Eventmodelers-Build-Kits, by Martin Dilg
|
|
|
49
49
|
|---|---|---|
|
|
50
50
|
| `eventmodeling-identifying-inputs` | `references/command-inventory.md` *Values a rule reads*; `references/field-lineage.md` | adapted closely: list every value a rule reads and classify it as input, state or context; time, caller and tenant are context, never caller-supplied, and a date the person chooses stays an input; the worked reservation example restated in Screenplay; the upstream mechanism of putting time and the acting user on the command is not adopted |
|
|
51
51
|
| `eventmodeling-information-completeness` | `references/field-lineage.md` *Where information starts*, *Check as you edit* | adapted closely: every value starts at one specific place and is carried by name; an unknown origin is a gap, never labeled to close a row; checked as each field is edited |
|
|
52
|
+
| `eventmodeling-orchestrating-event-modeling` ("Place in narrative order, never type by type"; "Never stack read models at the end"; wide fan-in is the exception; every role has a screen) | `references/slicing.md` *Declare in story order*; `references/read-model-design.md` *Components*, *Fan-in per field*, *Checks before handing off* | copied and translated (story order, translated to declaration order and the `PLAY0516`/`PLAY0517` checks); adapted closely (mixed kinds of computation split by default, with a written reason to keep them; a persona reaches a screen, while a read-only persona stays legitimate) |
|
|
53
|
+
| `eventmodeling-identifying-outputs` (error states shown) and `eventmodeling-elaborating-scenarios` examples | `references/read-model-design.md` *Checks before handing off* | adapted closely: a failure a person must act on shows in a view, or its omission is a stated decision |
|
|
54
|
+
| `eventmodeling-validating-event-models` (deterministic read models, no side effects in a builder; command with several issuers) | `references/read-model-design.md` *Builder and freshness*; `references/review-questions.md` | adapted closely: a builder replays to the same view; several origins of one command are allowed when each makes the same decision (idea; the upstream single-issuer rule is not adopted) |
|
|
55
|
+
| `attributes` (chain edits start at the real origin; one logical edit) | `references/field-lineage.md` *Adding or renaming a field along a chain* | adapted closely |
|
|
56
|
+
| `add-next-slice` (a new screen matches its siblings) | `references/slicing.md` *The next slice* | adapted closely |
|
|
57
|
+
| `build-state-change` (axon, kurrent and umadb stacks): derive decision state from the specifications, one field per fact a scenario branches on | `references/command-inventory.md` *Values a rule reads* | copied and translated |
|
package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md
CHANGED
|
@@ -99,9 +99,10 @@ usually two views.
|
|
|
99
99
|
list whose status is set by booking, cancellation and maintenance events). Do not use that
|
|
100
100
|
as a reason to fold in fields without the same wide fan-in: a berth's name and pier (set by
|
|
101
101
|
one or two events) and its live availability (derived across its whole lifecycle) are two
|
|
102
|
-
kinds of computation even on one page.
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
kinds of computation even on one page. Mixed kinds of computation split by default. Keep one
|
|
103
|
+
view only with a written reason in the slice `documentation` that names the field with the
|
|
104
|
+
irreducible fan-in and why. Fan-in alone, within one kind of computation, splits only for a
|
|
105
|
+
named consequence (next section).
|
|
105
106
|
- A screen with several components has one `data` line per component, each
|
|
106
107
|
`data <RM> via query <Q>` from its own read model (several `data` lines per screen are
|
|
107
108
|
valid; `cratis-screenplay-read-surface`). A split component sits next to its own source
|
|
@@ -114,8 +115,10 @@ usually two views.
|
|
|
114
115
|
For each read-model field, count the events that set it. More than about three is a signal to
|
|
115
116
|
look at, not a rule: a status fed by a long lifecycle is normal. Ask whether the field mixes
|
|
116
117
|
concerns that should be separate views, and whether every contributing event is genuinely a
|
|
117
|
-
change to *this* value.
|
|
118
|
-
must change whenever unrelated facts change).
|
|
118
|
+
change to *this* value. Within one kind of computation, report a problem only when it has a
|
|
119
|
+
consequence (coupling, a view that must change whenever unrelated facts change). Fields set once
|
|
120
|
+
by one or two events that ride with a field derived across the whole lifecycle are mixed kinds,
|
|
121
|
+
and that case splits by default (Components).
|
|
119
122
|
|
|
120
123
|
## Builder and freshness
|
|
121
124
|
|
|
@@ -131,6 +134,12 @@ one read-model instance (compose queries across person-scoped views instead).
|
|
|
131
134
|
Every `from` event must set or affect a field (AutoMap counts); otherwise drop it or record why
|
|
132
135
|
it stays.
|
|
133
136
|
|
|
137
|
+
A builder is deterministic: replaying the same events gives the same view. A reducer body reads
|
|
138
|
+
only the event, the current state and the context members the reducer exposes (`context.Occurred`
|
|
139
|
+
for time, never the wall clock). It calls no service, reads no other view and causes no effect.
|
|
140
|
+
Work that needs any of those is an automation that records a fact, which the view then projects.
|
|
141
|
+
Stage admits only pure reducer bodies for the same reason (`cratis-screenplay-projections`).
|
|
142
|
+
|
|
134
143
|
## Query shape follows the business view
|
|
135
144
|
|
|
136
145
|
| The person... | Design-mode query | Executable/renderable scope |
|
|
@@ -295,8 +304,16 @@ module Berths
|
|
|
295
304
|
- Every consumer that needs state has its read model (a blank creation form and a direct reaction
|
|
296
305
|
with a documented no-pending-work reason need none); every read model has a consumer.
|
|
297
306
|
- Every field traced (`field-lineage.md`).
|
|
307
|
+
- Every failure, refusal-received or cancellation fact a person must act on shows in some view
|
|
308
|
+
(a status literal plus the reason), or the omission is a stated decision (see "Omissions are
|
|
309
|
+
decisions"). Pin it with a view specification (`cratis-screenplay-scenario-coverage`
|
|
310
|
+
`references/scenario-catalogue.md` section 9).
|
|
311
|
+
- Every persona's Reads line has a screen whose `data` shows it, and every persona's Does line
|
|
312
|
+
reaches a screen or form `action` for that decision. A persona with neither is missing screens
|
|
313
|
+
(add them) or is not part of this scope (revise its Does/Reads in discovery, or record why). A
|
|
314
|
+
read-only persona is legitimate.
|
|
298
315
|
- Executable scope: one identity per read model: explicit `key`, else agreeing
|
|
299
316
|
single-instance `by`, else unambiguous `*Id` only with an admitted list query and
|
|
300
317
|
no single-instance identifier. Queryless views need explicit `key`. The identifier
|
|
301
318
|
equals the projection's key (table above); check target renderer admission separately.
|
|
302
|
-
-
|
|
319
|
+
- Each design-only shape (one the renderer does not admit) is listed with the V3 diagnostic code it causes.
|
|
@@ -22,3 +22,7 @@ domain consequence.
|
|
|
22
22
|
- Where is each invariant enforced atomically, and what happens if two people try at once or a
|
|
23
23
|
command is retried (`cratis-screenplay-streams-and-consistency`)?
|
|
24
24
|
- Who may see these rows, and is that enforced by scope/`from`, not by a caller filter?
|
|
25
|
+
- Does a command have several origins (a screen action and a reaction, or two personas)? That is
|
|
26
|
+
allowed. Confirm that each origin makes the same decision under the same rules, refusals and
|
|
27
|
+
gate. If one origin needs a different rule or a trusted actor the other must not have, split
|
|
28
|
+
the command.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- Slices are the authoring unit
|
|
6
|
+
- Declare in story order
|
|
6
7
|
- Slice dependencies
|
|
7
8
|
- State-transition table (per entity)
|
|
8
9
|
- Generic edits
|
|
@@ -25,6 +26,70 @@ step at the end: design each behaviour as its slice, then audit the set.
|
|
|
25
26
|
Screenplay allows several commands or read models in one slice; prefer splitting unless the
|
|
26
27
|
behaviour is genuinely one (and say why in `documentation`).
|
|
27
28
|
|
|
29
|
+
## Declare in story order
|
|
30
|
+
|
|
31
|
+
Deciding which slices exist is separate from deciding the order you write them. Write them left
|
|
32
|
+
to right as the story happens, one slice at a time: the `StateChange` slice that records a fact,
|
|
33
|
+
then the `StateView` slice (read model, projection, query, screen) that the fact feeds, then the
|
|
34
|
+
next `StateChange`. Never write all commands, then all views, or any other batch by kind. The
|
|
35
|
+
board draws authored declaration and import order, so a batch by kind shows a row of commands
|
|
36
|
+
with the views bunched at the end, cut off from the facts they come from, and no slice reads as
|
|
37
|
+
one self-contained step of the story. A list grouped by slice type is for counting and review
|
|
38
|
+
(`cratis-screenplay-delivery-planning`), never the declaration order.
|
|
39
|
+
|
|
40
|
+
The compiler checks the result against the presentation timeline. `PLAY0516` (information)
|
|
41
|
+
marks a projection, reducer rule or named reaction trigger that uses an event from a slice drawn
|
|
42
|
+
to its right, or a `reads` of a view whose builder is drawn later. `PLAY0517` marks a mutually
|
|
43
|
+
dependent sibling group that no order can fix. Neither fails `--warnaserror`, so read them after
|
|
44
|
+
each batch:
|
|
45
|
+
|
|
46
|
+
- Move the producer first. MCP and C# workspaces offer a typed repair that moves a sibling or
|
|
47
|
+
pins an import. It changes no executable bytes or identities.
|
|
48
|
+
- A view that legitimately reflects a later fact (a waiting list that drops a request once it
|
|
49
|
+
is assigned) may stay where its screen beat is. Say why in the slice `documentation`.
|
|
50
|
+
- Feedback reads (a command reading a summary built from facts its own side produces) are
|
|
51
|
+
excluded by the compiler and need nothing.
|
|
52
|
+
|
|
53
|
+
A folder model needs an ordering root (a sole root, an importing `application.play`, or a unique
|
|
54
|
+
importing root). Without one the check is skipped, which does not mean clean
|
|
55
|
+
(`cratis-screenplay-toolchain`). The `remove with BerthAssigned` line below is the kept case:
|
|
56
|
+
the waiting list legitimately drops a request when the later slice assigns it.
|
|
57
|
+
|
|
58
|
+
```screenplay expect PLAY0516
|
|
59
|
+
domain Harbour.Moorings
|
|
60
|
+
|
|
61
|
+
concept BerthRequestId : Uuid
|
|
62
|
+
concept BoatName : String
|
|
63
|
+
concept BerthNumber : String
|
|
64
|
+
|
|
65
|
+
module Moorings
|
|
66
|
+
feature SeasonalBerths
|
|
67
|
+
slice StateChange RequestBerth
|
|
68
|
+
command RequestBerth
|
|
69
|
+
berthRequestId BerthRequestId identifier
|
|
70
|
+
boatName BoatName
|
|
71
|
+
produces event BerthRequested
|
|
72
|
+
boatName BoatName = boatName
|
|
73
|
+
slice StateView WaitingList
|
|
74
|
+
readmodel WaitingRequest
|
|
75
|
+
berthRequestId BerthRequestId
|
|
76
|
+
boatName BoatName
|
|
77
|
+
projection WaitingList => WaitingRequest
|
|
78
|
+
from BerthRequested
|
|
79
|
+
berthRequestId = $eventSourceId
|
|
80
|
+
remove with BerthAssigned
|
|
81
|
+
query WaitingRequests => WaitingRequest[]
|
|
82
|
+
screen WaitingListPage
|
|
83
|
+
data WaitingRequest via query WaitingRequests
|
|
84
|
+
action AssignBerth
|
|
85
|
+
slice StateChange AssignBerth
|
|
86
|
+
command AssignBerth
|
|
87
|
+
berthRequestId BerthRequestId identifier
|
|
88
|
+
berthNumber BerthNumber
|
|
89
|
+
produces event BerthAssigned
|
|
90
|
+
berthNumber BerthNumber = berthNumber
|
|
91
|
+
```
|
|
92
|
+
|
|
28
93
|
## Slice dependencies
|
|
29
94
|
|
|
30
95
|
Record, per slice, the events it consumes and which slice produces each. This is for
|
|
@@ -184,6 +249,10 @@ fully designed, read the slices in story order and choose, preferring in order:
|
|
|
184
249
|
or reverses (`CorrectLockerVolume`), never `Update<Entity>`;
|
|
185
250
|
4. a notification or follow-up the business expects.
|
|
186
251
|
|
|
252
|
+
If the new slice adds a screen in a model that already composes its UI (templates, layout), give
|
|
253
|
+
it the template its sibling screens use (`cratis-screenplay-ui-composition`). A new screen always
|
|
254
|
+
has `data` or an `action`, never a placeholder.
|
|
255
|
+
|
|
187
256
|
Apply this heuristic only when the brief authorizes selecting another capability; when the
|
|
188
257
|
requested scope is complete or no supported candidate remains, close the turn without inventing
|
|
189
258
|
work (scope ownership: `cratis-screenplay-modeling-lifecycle`). Prefer what continues the
|
|
@@ -21,7 +21,10 @@ The historical source below stays unchanged; it is not the current placement rec
|
|
|
21
21
|
The excerpt's Stage availability note is historical (Stage 4.24.x, Arc 22.25.0).
|
|
22
22
|
Stage 4.73.1's scaffold pins an Arc/Chronicle set (see the Stage skill's `references/rendered-application.md`), so protected-read APIs are available
|
|
23
23
|
to gap-fill (the compiled description below saying they are "not available in Stage-rendered apps" is superseded); this neither admits these `.play` rules nor proves target protection.
|
|
24
|
-
The original compiled excerpt is retained unchanged.
|
|
24
|
+
The original compiled excerpt is retained unchanged. Its `expect PLAY0516` is the story-order
|
|
25
|
+
information (`slicing.md` "Declare in story order"): the `LockerBoard` view consumes
|
|
26
|
+
`LockerAssigned` from the feature declared after it. A new model declares the producing feature
|
|
27
|
+
first and carries no such information.
|
|
25
28
|
|
|
26
29
|
```screenplay expect PLAY0516 test=unbound
|
|
27
30
|
domain Parcelpoint.Lockers
|
|
@@ -48,13 +48,6 @@
|
|
|
48
48
|
"value": "37",
|
|
49
49
|
"reason": "Measured historical CLI 3.43.0 transcript, whose bundled Screenplay 4.127.0 exposes 37 tools. Current compiler and bundle versions are in Documentation/compatibility.md; this count describes only that transcript. Remove when the transcript is removed or replaced."
|
|
50
50
|
},
|
|
51
|
-
{
|
|
52
|
-
"file": ".cratis/ai/skills/cratis-screenplay-model-review/SKILL.md",
|
|
53
|
-
"text": "| Screenplay | `v4.66.0` (`c89198b`) | MCP catalog (29 tools: `describe-application`, `search-declarations`, `dependencies`, `find-assertion-gaps`, `read-workspace`, `declaration-details`) in `Source/DotNET/Screenplay.Mcp/McpToolCatalog.cs`; diagnostics PLAY0029, PLAY0191, PLAY0268, PLAY0271, PLAY0350, PLAY0381, PLAY0469 in `Source/DotNET/Screenplay/Diagnostics/DiagnosticCodes.cs`; decision 0008 (one data subject per event) |",
|
|
54
|
-
"kind": "toolCount",
|
|
55
|
-
"value": "29",
|
|
56
|
-
"reason": "Source evidence explicitly pinned to v4.66.0. Remove when this older source vector is removed or replaced."
|
|
57
|
-
},
|
|
58
51
|
{
|
|
59
52
|
"file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
|
|
60
53
|
"text": "| PLAY0686 | Retired | Differing event pins travel as `storedName` in ESM v16. MCP's compatibility `eventPinWarnings` array is empty. Renderer admission is separate: a renderer that does not admit v16 must refuse the model rather than render it under the new name. |",
|
|
@@ -14,16 +14,14 @@ first.
|
|
|
14
14
|
|
|
15
15
|
## Verified product sources
|
|
16
16
|
|
|
17
|
-
| Package |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
| `Cratis.Arc.Chronicle` | `
|
|
20
|
-
| `Cratis.Chronicle` | `
|
|
21
|
-
| `Cratis.Chronicle` | `
|
|
22
|
-
| `Cratis.Arc.Core` |
|
|
17
|
+
| Package | Purpose |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `Cratis.Arc.Chronicle` | `[NotAudited]` in `Cratis.Arc.Chronicle.Commands`; the `ARCCHR0009` analyzer |
|
|
20
|
+
| `Cratis.Chronicle` | `[PII]`, `[Subject]`, redaction, namespace isolation |
|
|
21
|
+
| `Cratis.Chronicle` | `[Encrypted]` in `Cratis.Chronicle.ProtectedValues`; analyzers `CHR0052`, `CHR0053` |
|
|
22
|
+
| `Cratis.Arc.Core` | Authorization filters, `CommandResult.Unauthorized` |
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
> references/arc-boundaries.md. Arc depends on Chronicle 19.39.1; separately
|
|
26
|
-
> version-qualified Chronicle security claims retain their original verification.
|
|
24
|
+
Every Arc check is cited in references/arc-boundaries.md.
|
|
27
25
|
|
|
28
26
|
Reverify against the owning product repository before asserting a framework
|
|
29
27
|
guarantee this file does not already state.
|
|
@@ -101,7 +99,7 @@ command's properties as well as grepping them.
|
|
|
101
99
|
reviewer reading logs for 401s will miss authorization failures.
|
|
102
100
|
- Review [Arc-specific security boundaries](references/arc-boundaries.md) when
|
|
103
101
|
the diff touches hosting, identity, policies, discovery, streams or system actors.
|
|
104
|
-
It
|
|
102
|
+
It ties the checks to Arc source; do not assume a clean analyzer run proves
|
|
105
103
|
those deployment boundaries.
|
|
106
104
|
|
|
107
105
|
## Step 4 — Data exposure
|
|
@@ -3,57 +3,59 @@
|
|
|
3
3
|
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
4
4
|
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Source: Arc. Each source below is a path in the Arc repository.
|
|
7
7
|
|
|
8
8
|
- Enable `TrustForwardedIdentityHeaders` only behind an authenticating ingress
|
|
9
9
|
that strips caller identity headers, replaces them and prevents direct backend
|
|
10
10
|
access. Headers are unsigned, not proof of identity. Without the explicit
|
|
11
11
|
host-wide opt-in Arc ignores them. Custom handlers must honor the same flag.
|
|
12
|
-
[Secure defaults](https://github.com/Cratis/Arc/blob/
|
|
12
|
+
[Secure defaults](https://github.com/Cratis/Arc/blob/main/Documentation/upgrading/secure-defaults.mdx).
|
|
13
13
|
- Application code must not read `.cratis-identity`. The backend derives identity
|
|
14
14
|
from the authenticated principal; the JS client only falls back to the legacy
|
|
15
15
|
cookie on 404, never on 401/403. Use `clearCache()` on logout. Browser identity
|
|
16
16
|
remains display state, not server authorization.
|
|
17
|
-
[Backend provider](https://github.com/Cratis/Arc/blob/
|
|
18
|
-
[JS provider](https://github.com/Cratis/Arc/blob/
|
|
17
|
+
[Backend provider](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core/Identity/IdentityProvider.cs),
|
|
18
|
+
[JS provider](https://github.com/Cratis/Arc/blob/main/Source/JavaScript/Arc/identity/IdentityProvider.ts).
|
|
19
19
|
- Test all discovery routes outside Development. Default access is authenticated
|
|
20
20
|
there, or 404 when the host cannot authenticate. Explicit
|
|
21
21
|
`RequireAuthentication=false` opens discovery in every environment;
|
|
22
22
|
`Enabled=false` removes catalogs, not identity discovery. Disable both switches
|
|
23
23
|
when neither is needed. `[ExcludeFromDiscovery]` hides documentation/catalogs,
|
|
24
24
|
not invocation or authorization.
|
|
25
|
-
[Introspection](https://github.com/Cratis/Arc/blob/
|
|
25
|
+
[Introspection](https://github.com/Cratis/Arc/blob/main/Documentation/backend/csharp/introspection/index.md).
|
|
26
26
|
- Check ARC0019/0020/0021: conflicting declarations, Microsoft attributes without
|
|
27
27
|
the ASP.NET integration, and schemes on the standalone host. Microsoft
|
|
28
28
|
`[Authorize]` is enforced only by the ASP.NET host; policies/schemes fail closed
|
|
29
29
|
on supported hosts. A method declaration **replaces** the type declaration.
|
|
30
30
|
Guest access requires every policy in the declaration to opt in
|
|
31
|
-
(`evaluatesAnonymous`), without roles/schemes.
|
|
31
|
+
(`evaluatesAnonymous`), without roles/schemes.
|
|
32
|
+
Requires Arc 22.44.2 for guest endpoints to be
|
|
32
33
|
reachable through HTTP even with an authenticated fallback policy. Keep an
|
|
33
34
|
intentional `IFallbackAuthorizationEvaluator` baseline; it is separate from
|
|
34
35
|
ASP.NET's `FallbackPolicy`.
|
|
35
|
-
[Authorization descriptors](https://github.com/Cratis/Arc/blob/
|
|
36
|
-
[guest endpoint specs](https://github.com/Cratis/Arc/tree/
|
|
36
|
+
[Authorization descriptors](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core.CodeAnalysis/DiagnosticDescriptors.cs),
|
|
37
|
+
[guest endpoint specs](https://github.com/Cratis/Arc/tree/main/Source/DotNET).
|
|
37
38
|
- The embedded `/.cratis/event-model` viewer defaults to Debug **and** Development.
|
|
38
39
|
Explicit `Enabled=true` overrides that default: check that deployed hosts have
|
|
39
40
|
not enabled it, rather than claiming Production can never map it.
|
|
40
|
-
[Exposure implementation](https://github.com/Cratis/Arc/blob/
|
|
41
|
+
[Exposure implementation](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Screenplay.Embedded/Hosting/EventModelViewerExposure.cs).
|
|
41
42
|
- Generated identifiers are not secrets, authorization proofs or idempotency
|
|
42
|
-
keys. [Generated values](https://github.com/Cratis/Arc/blob/
|
|
43
|
+
keys. [Generated values](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core/Commands/ModelBound/GeneratedValueAttribute.cs).
|
|
43
44
|
- Arc telemetry records type/name/outcome metadata and correlation/tenant ids,
|
|
44
45
|
not command/query/event payload values or validation/exception messages. Do not
|
|
45
46
|
widen it with sensitive payloads or mistake this for a promise of no ids.
|
|
46
|
-
[Telemetry names](https://github.com/Cratis/Arc/blob/
|
|
47
|
+
[Telemetry names](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core/WellKnownTelemetryNames.cs).
|
|
47
48
|
- Returned reactor commands marked `[ExecuteCommandsAsSystem]` use a narrow
|
|
48
|
-
disposed system scope.
|
|
49
|
+
disposed system scope.
|
|
50
|
+
Requires Arc 22.72.0 so the system scope never carries the caller principal (earlier versions leaked it);
|
|
49
51
|
manually executing commands still needs explicit actor ownership.
|
|
50
|
-
[Executor](https://github.com/Cratis/Arc/blob/
|
|
52
|
+
[Executor](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Chronicle/Reactors/CommandSideEffectExecutor.cs).
|
|
51
53
|
- Revocable observable data needs `IGuardObservableQueryEmission`; it applies to
|
|
52
54
|
plain HTTP snapshots/waits/long polls too. Suppression withholds data; denial
|
|
53
55
|
terminates/returns unauthorized. Never read the producer's ambient principal.
|
|
54
|
-
[HTTP processing](https://github.com/Cratis/Arc/blob/
|
|
56
|
+
[HTTP processing](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core/Queries/ObservableQueryHttp.cs).
|
|
55
57
|
- Query health remains explicitly anonymous and returns connection health. Audit
|
|
56
58
|
exposure of connection user ids (tracked by Arc#2873), not just catalogs:
|
|
57
59
|
discovery restrictions are not blanket protection of `/.cratis/*`.
|
|
58
|
-
[QueryHealth](https://github.com/Cratis/Arc/blob/
|
|
59
|
-
[subscription client UserId](https://github.com/Cratis/Arc/blob/
|
|
60
|
+
[QueryHealth](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core/Queries/QueryHealth.cs),
|
|
61
|
+
[subscription client UserId](https://github.com/Cratis/Arc/blob/main/Source/DotNET/Arc.Core/Queries/QuerySubscriptionClientInfo.cs).
|
|
@@ -39,7 +39,7 @@ In a language without those analyzers the same rules hold; the reviewer enforces
|
|
|
39
39
|
them instead of the compiler. Reverify against the owning product repository
|
|
40
40
|
before claiming behavior for another version.
|
|
41
41
|
|
|
42
|
-
The `Cratis.Synopsis.Tool` dotnet tool (verified
|
|
42
|
+
The `Cratis.Synopsis.Tool` dotnet tool (verified) reads these
|
|
43
43
|
names statically, never running code, and writes one HTML or JSON behavior
|
|
44
44
|
document from C#, TypeScript, Gherkin and Screenplay specifications:
|
|
45
45
|
`dotnet tool install --global Cratis.Synopsis.Tool`, then `synopsis . --open`
|
|
@@ -20,29 +20,27 @@ MongoDB observations still need real infrastructure.
|
|
|
20
20
|
|
|
21
21
|
## Verified product sources
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| Package |
|
|
26
|
-
| --- | --- |
|
|
27
|
-
| `Cratis.Specifications.XUnit` | `
|
|
28
|
-
| `Cratis.Specifications` | `
|
|
29
|
-
| `Cratis.Arc.Testing` | `
|
|
30
|
-
| `Cratis.Chronicle.Testing` | `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`EventContext.From` UTC default
|
|
34
|
-
and require **19.46.0+**; see the ReactorScenario section in
|
|
23
|
+
Sources:
|
|
24
|
+
|
|
25
|
+
| Package | Purpose |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `Cratis.Specifications.XUnit` | `Specification` base, lifecycle discovery, `ShouldXxx` assertions, optional shared lifecycle |
|
|
28
|
+
| `Cratis.Specifications` | `Catch.Exception`, `SpecificationMethods` (dependency of the XUnit package) |
|
|
29
|
+
| `Cratis.Arc.Testing` | `CommandScenario<TCommand>` preserves explicit principal/override/policy services; see application-scenarios |
|
|
30
|
+
| `Cratis.Chronicle.Testing` | `EventScenario`, `ReadModelScenario<T>`, `ReactorScenario<T>` |
|
|
31
|
+
|
|
32
|
+
Requires Chronicle 19.46.0 for reactor read-model seeding/absence, synchronous handler exceptions and the
|
|
33
|
+
`EventContext.From` UTC default; see the ReactorScenario section in
|
|
35
34
|
[application-scenarios.md](references/application-scenarios.md).
|
|
36
35
|
|
|
37
|
-
Per-context in-process MongoDB host isolation is
|
|
38
|
-
`Cratis.Chronicle.XUnit.Integration`
|
|
36
|
+
Per-context in-process MongoDB host isolation is in
|
|
37
|
+
`Cratis.Chronicle.XUnit.Integration` (`ChronicleFixture.cs`,
|
|
39
38
|
`ChronicleClientFixture.cs`, `MongoDBContextStorage.cs`); it is opt-in and does
|
|
40
39
|
not isolate out-of-process/remote kernels. See [integration-specs.md](references/integration-specs.md).
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
`Cratis.Arc.Testing` **22.75.0** (introduced in **22.67.0**).
|
|
41
|
+
Requires `Cratis.Arc.Testing` 22.67.0 for generated-value scenario pinning.
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
Check the owning product repository before claiming support for
|
|
46
44
|
another version. Never translate an assertion or helper name from memory.
|
|
47
45
|
|
|
48
46
|
## Route near misses
|
|
@@ -89,18 +87,13 @@ one. Out-of-process integration specifications are an advanced case reserved for
|
|
|
89
87
|
boundaries the scenario helpers cannot reach — see
|
|
90
88
|
[integration-specs.md](references/integration-specs.md).
|
|
91
89
|
|
|
92
|
-
> **Historical validator-state order-sensitivity:** observed at 22.16-era Arc.
|
|
93
|
-
> Process-wide provider replacement was fixed in 22.23.2; later releases isolated
|
|
94
|
-
> scenario stores/services. Reproduce at 22.75.0 before applying the old
|
|
95
|
-
> direct-validator/small `[Collection]` workaround; it is not verified here.
|
|
96
|
-
|
|
97
90
|
⚠️ `EventScenario` wires a strategy that always answers `ConcurrencyScope.None`,
|
|
98
91
|
which the validator skips, so an append that lets the strategy choose the scope
|
|
99
92
|
never produces a concurrency violation. `ShouldHaveConcurrencyViolations()`
|
|
100
93
|
cannot pass for such an append and its negation passes vacuously — specify concurrency against the
|
|
101
94
|
real kernel with an out-of-process integration specification instead.
|
|
102
95
|
|
|
103
|
-
For a class-based `ReactorScenario<TReactor>` on
|
|
96
|
+
For a class-based `ReactorScenario<TReactor>` on a recent Chronicle (Requires Chronicle 19.46.0), seed each
|
|
104
97
|
handler read-model parameter with `Given.ForEventSourceId(id).ReadModel(instance)`
|
|
105
98
|
or declare intentional absence with `.NoReadModel<T>()`; `Given` events do not
|
|
106
99
|
build it, even if passive. Missing setup throws
|
|
@@ -109,16 +102,18 @@ resolved read-model key. See the ReactorScenario reference for diagnostics,
|
|
|
109
102
|
exception capture and UTC occurrence-time defaults.
|
|
110
103
|
|
|
111
104
|
Specification projects are named `<Source>.Specs`. Add a `PackageReference` to
|
|
112
|
-
`Cratis.Specifications.XUnit
|
|
105
|
+
`Cratis.Specifications.XUnit`, not just `Cratis.Specifications`; the C#
|
|
113
106
|
namespace stays `Cratis.Specifications`. The house runner is xUnit **2.x**
|
|
114
|
-
|
|
115
|
-
net48 was dropped
|
|
116
|
-
`Cratis.Specifications.NUnit`
|
|
107
|
+
not xUnit v3. Supported targets are net8.0/net9.0/net10.0;
|
|
108
|
+
net48 was dropped (retain 3.x for that target).
|
|
109
|
+
`Cratis.Specifications.NUnit` is an alternative with the same base pattern,
|
|
117
110
|
`[Test]` instead of `[Fact]`, and **public** test methods.
|
|
118
111
|
|
|
119
112
|
### Pin server-generated Handle values
|
|
120
113
|
|
|
121
|
-
|
|
114
|
+
Requires Arc 22.67.0 for generated-value pinning.
|
|
115
|
+
|
|
116
|
+
`CommandScenario<TCommand>` defaults to strict generation:
|
|
122
117
|
without a named pin or `AllowGeneration()`, `Execute` returns a command result
|
|
123
118
|
with `GeneratedValueNotPinned`, rather than throwing it. Import
|
|
124
119
|
`Cratis.Arc.Testing.Commands`; configure `PinGeneratedValue(name, concept)`
|
|
@@ -296,8 +291,10 @@ between collaborators. That is where defects hide.
|
|
|
296
291
|
|
|
297
292
|
## Verify
|
|
298
293
|
|
|
294
|
+
Requires `Cratis.Specifications` 4.0.0 for the analyzers.
|
|
295
|
+
|
|
299
296
|
CRSPEC0001–CRSPEC0007 ship as **warnings** in `Cratis.Specifications`, `.XUnit`,
|
|
300
|
-
and `.NUnit
|
|
297
|
+
and `.NUnit`. A warnings-as-errors build enforces them: `should_` names,
|
|
301
298
|
one specification per file (given contexts exempt), no facts on given contexts,
|
|
302
299
|
test attributes on `should_` methods, no explicit base lifecycle calls, public
|
|
303
300
|
specification classes, and no `Because` on given contexts. See
|
package/package/corpus/skills/cratis-specifications-csharp/references/application-scenarios.md
CHANGED
|
@@ -15,8 +15,6 @@ validation, constraints or projections matter; a pure decision (`Handle()`,
|
|
|
15
15
|
call. A library or framework repository reaches for a scenario only to test the
|
|
16
16
|
very engine it provides.
|
|
17
17
|
|
|
18
|
-
Arc scenarios verified at **v22.75.0** (Chronicle dependency 19.39.1).
|
|
19
|
-
Separate Chronicle-only scenario claims retain their version-qualified sources.
|
|
20
18
|
Read [query and decision scenarios](../../cratis-application-slice-specifications/references/query-and-decision-scenarios.md)
|
|
21
19
|
when using `QueryScenario<T>`, buffered emissions or `UseDecisionReads()`.
|
|
22
20
|
Guarded decisions need actual seeded events, not pinned models; their given
|
|
@@ -90,7 +88,7 @@ from `Cratis.Arc.Chronicle.Testing`.
|
|
|
90
88
|
pass against a read-model shape the projection never produces.
|
|
91
89
|
- **Validator and `Provide()` dependencies** are registered in
|
|
92
90
|
`_scenario.Services`; the concrete validator is discovered automatically.
|
|
93
|
-
- **Caller setup (Arc 22.75.1
|
|
91
|
+
- **Caller setup (Requires Arc 22.75.1):** register a substituted
|
|
94
92
|
`ICurrentPrincipalAccessor`, `ICurrentPrincipalOverride` or
|
|
95
93
|
`IAuthorizationPolicyRuntime` in `Services` before first execution. The scenario
|
|
96
94
|
preserves these registrations instead of replacing them with Arc defaults,
|
|
@@ -100,7 +98,7 @@ from `Cratis.Arc.Chronicle.Testing`.
|
|
|
100
98
|
|
|
101
99
|
### Pin generated values
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
Requires `Cratis.Arc.Testing` 22.67.0 or later.
|
|
104
102
|
For the `AllocateCartId` command from `cratis-arc-command`, whose
|
|
105
103
|
`Handle([GeneratedValue("cart")] CartId cartId)` returns that id, specify the
|
|
106
104
|
pipeline with a known concept pin. Import `Cratis.Arc.Commands` and
|
|
@@ -165,7 +163,7 @@ public class and_value_is_pinned : Specification
|
|
|
165
163
|
A direct-call decision spec supplies the known argument to `Handle()` itself.
|
|
166
164
|
|
|
167
165
|
Guide: [Pin generated values in command specs](/arc/backend/csharp/testing/generated-values/).
|
|
168
|
-
Source:
|
|
166
|
+
Source: `Source/DotNET/Testing/Commands/CommandScenarioGeneratedValueExtensions.cs`,
|
|
169
167
|
`ScenarioGeneratedValueFixture.cs`, `ScenarioGeneratedValues.cs` and
|
|
170
168
|
`GeneratedValuesCommandScenarioExtender.cs`;
|
|
171
169
|
`Source/DotNET/Testing.Specs/Commands/for_CommandScenario/generated_values/when_pinning_a_value.cs`.
|
|
@@ -274,7 +272,9 @@ async Task Because() =>
|
|
|
274
272
|
Construct with an `IServiceProvider` of substituted collaborators and assert on
|
|
275
273
|
those substitutes after `Given` fires the events.
|
|
276
274
|
|
|
277
|
-
### Read-model parameters
|
|
275
|
+
### Read-model parameters
|
|
276
|
+
|
|
277
|
+
Requires Chronicle 19.46.0 or later.
|
|
278
278
|
|
|
279
279
|
`Given` events invoke the reactor; they **do not build read models**, including
|
|
280
280
|
passive ones. In the present-state specification, seed a pre-built instance:
|
|
@@ -300,7 +300,7 @@ for that type when any exist. Fix the fixture/key rather than hiding missing
|
|
|
300
300
|
setup with `NoReadModel<T>()`. This guard applies to `EventStoreForTesting`, not
|
|
301
301
|
production resolution or an explicitly supplied store of another type.
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
A synchronous handler throw surfaces its own
|
|
304
304
|
exception, not reflection's `TargetInvocationException`, preserving the handler
|
|
305
305
|
stack. Capture with `await Catch.Exception(() => _scenario.Given.ForEventSource(_id).Events(...))`
|
|
306
306
|
and assert the handler's exception type.
|
|
@@ -310,7 +310,7 @@ previously local `Now`. Scenario contexts, `EventContext.Empty` and
|
|
|
310
310
|
`EmptyWithEventSourceId(...)` use this helper; explicit times retain their offset,
|
|
311
311
|
and the positional constructor has no such default.
|
|
312
312
|
|
|
313
|
-
Sources
|
|
313
|
+
Sources:
|
|
314
314
|
`Source/Clients/Testing/Reactors/{ReactorScenario,ReactorSourceGivenBuilder,ScenarioReactorMethodArgumentsResolver,ReadModelNotSeededForReactorScenario}.cs`
|
|
315
315
|
and `Source/Clients/DotNET/Events/EventContext.cs`. For exact signatures and
|
|
316
316
|
source-backed examples, read `cratis-chronicle-reactor/references/specifications.md`.
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
- One outcome per file
|
|
12
12
|
|
|
13
13
|
Detail for the plain `Cratis.Specifications` surface: phases, substitution,
|
|
14
|
-
assertions, and exception capture.
|
|
15
|
-
|
|
14
|
+
assertions, and exception capture. Sources: `Cratis.Specifications.XUnit`
|
|
15
|
+
(base and assertions) and its `Cratis.Specifications` dependency (`Catch`).
|
|
16
16
|
NSubstitute is a separate collaborator-substitution dependency.
|
|
17
17
|
|
|
18
18
|
## Phases
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
- Command execution overloads
|
|
8
8
|
- Assertion helpers
|
|
9
9
|
- Asynchronous follow-ups
|
|
10
|
-
- In-process MongoDB context isolation
|
|
10
|
+
- In-process MongoDB context isolation
|
|
11
11
|
- Rules
|
|
12
12
|
|
|
13
13
|
Reserve these for the host, transport, serialization, or real-infrastructure
|
|
@@ -19,7 +19,7 @@ They live under `when_<behavior>/` **inside the behavior's own folder**, not in
|
|
|
19
19
|
`for_<Type>/` unit folder: there is no isolated unit, the whole slice is under
|
|
20
20
|
test. Never mix unit and integration specifications in one folder.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Source: `Cratis.Chronicle.Testing` (`Cratis.Chronicle.XUnit.Integration` at the same tag).
|
|
23
23
|
|
|
24
24
|
## Structure
|
|
25
25
|
|
|
@@ -126,7 +126,9 @@ void Destroy() => _collector.Dispose();
|
|
|
126
126
|
`IEventAppendCollection` is part of the Chronicle testing API. The timeout is a
|
|
127
127
|
deadline, not a sleep — it turns a hang into a named failure.
|
|
128
128
|
|
|
129
|
-
## In-process MongoDB context isolation
|
|
129
|
+
## In-process MongoDB context isolation
|
|
130
|
+
|
|
131
|
+
Requires Chronicle 19.51.0 or later.
|
|
130
132
|
|
|
131
133
|
For an **in-process MongoDB** suite using `Cratis.Chronicle.XUnit.Integration`,
|
|
132
134
|
override `ChronicleFixture.UsesPerContextMongoDBHost` to return `true`. It defaults
|
|
@@ -141,7 +143,7 @@ databases in place; collection teardown drops only prefixes it issued. Starting
|
|
|
141
143
|
one host per context costs time. This does not isolate out-of-process or remote
|
|
142
144
|
kernels, which retain kernel reset.
|
|
143
145
|
|
|
144
|
-
Source
|
|
146
|
+
Source: Chronicle `Source/Clients/XUnit.Integration/ChronicleFixture.cs`,
|
|
145
147
|
`ChronicleClientFixture.cs`, `MongoDBContextStorage.cs`,
|
|
146
148
|
`ChronicleOrleansInProcessWebApplicationFactory.cs`, and
|
|
147
149
|
`Documentation/contributing/integration-tests.md` (per-context storage isolation).
|