@cratis/pi 8.0.2 → 8.2.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/harnesses/copilot/instructions/ai-distribution.instructions.md +9 -102
- package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +3 -5
- package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +8 -49
- package/package/corpus/harnesses/copilot/instructions/code-health.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +3 -84
- package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +6 -51
- package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +4 -81
- package/package/corpus/harnesses/copilot/instructions/codescene.instructions.md +5 -54
- package/package/corpus/harnesses/copilot/instructions/components.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +5 -22
- package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +7 -315
- package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/discoverability.instructions.md +3 -25
- package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +5 -151
- package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +5 -104
- package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +5 -63
- package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +8 -55
- package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +3 -33
- package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +6 -79
- package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +4 -27
- package/package/corpus/harnesses/copilot/instructions/framework-dotnet.instructions.md +4 -6
- package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +0 -2
- package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +0 -1
- package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +7 -138
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +19 -19
- package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +1 -4
- package/package/corpus/harnesses/copilot/instructions/go.instructions.md +2 -7
- package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +5 -6
- package/package/corpus/harnesses/copilot/instructions/java.instructions.md +7 -129
- package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +8 -165
- package/package/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +4 -1
- package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -98
- package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
- package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
- package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
- package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
- package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
- package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
- package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
- package/package/corpus/hooks/README.md +16 -8
- package/package/corpus/hooks/scripts/cratis-cleanup-worktrees.sh +109 -6
- package/package/corpus/hooks/scripts/cratis-guard-shell-writes.sh +1 -1
- package/package/corpus/hooks/scripts/quality-gates.json +3 -5
- package/package/corpus/rules/ai-distribution.md +9 -102
- package/package/corpus/rules/authoring-skills.md +3 -5
- package/package/corpus/rules/browser.md +8 -49
- package/package/corpus/rules/code-health-policy.txt +4 -24
- package/package/corpus/rules/code-health.md +1 -1
- package/package/corpus/rules/code-quality.csharp.md +3 -84
- package/package/corpus/rules/code-quality.md +6 -51
- package/package/corpus/rules/code-quality.typescript.md +4 -81
- package/package/corpus/rules/codescene.md +5 -54
- package/package/corpus/rules/components.md +1 -1
- package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
- package/package/corpus/rules/csharp.md +7 -315
- package/package/corpus/rules/dialogs.md +1 -1
- package/package/corpus/rules/discoverability.md +3 -25
- package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
- package/package/corpus/rules/documentation.md +5 -104
- package/package/corpus/rules/editing-cratis-docs.md +5 -63
- package/package/corpus/rules/efcore.md +8 -55
- package/package/corpus/rules/efcore.specs.md +3 -33
- package/package/corpus/rules/elixir.md +6 -79
- package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
- package/package/corpus/rules/framework-dotnet.md +4 -6
- package/package/corpus/rules/framework.md +0 -2
- package/package/corpus/rules/frontend-quality.md +0 -1
- package/package/corpus/rules/frontend-testing.md +1 -1
- package/package/corpus/rules/general.md +2 -2
- package/package/corpus/rules/github-actions.md +7 -138
- package/package/corpus/rules/glossary.md +19 -19
- package/package/corpus/rules/go-engineering.md +1 -4
- package/package/corpus/rules/go.md +2 -7
- package/package/corpus/rules/guards-and-fuses.md +5 -6
- package/package/corpus/rules/java.md +7 -129
- package/package/corpus/rules/kotlin.md +8 -165
- package/package/corpus/rules/local-work-artifacts.md +4 -1
- package/package/corpus/rules/orleans.md +5 -98
- package/package/corpus/rules/profiles.md +9 -63
- package/package/corpus/rules/scripting.md +1 -1
- package/package/corpus/rules/specs.csharp.md +8 -148
- package/package/corpus/rules/specs.elixir.md +4 -37
- package/package/corpus/rules/specs.typescript.md +3 -1
- package/package/corpus/rules/storybook.md +7 -70
- package/package/corpus/rules/typescript.md +8 -98
- package/package/corpus/rules/writing-correct-examples.md +3 -47
- package/package/corpus/rules/writing-cratis-docs.md +3 -65
- package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
- package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
- package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
- package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
- package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
- package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
- package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
- package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
- package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
- package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
- package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
- package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
- package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
- package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
- package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
- package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
- package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
- package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
- package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
- package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
- package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
- package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
- package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
- package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
- package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
- package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
- package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
- package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
- package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
- package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
- package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
- package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
- package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
- package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
- package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
- package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
- package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
- package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
- package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
- package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
- package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
- package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
- package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
- package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
- package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
- package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
- package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
- package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
- package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
- package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
- package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
- package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
- package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
- package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
- package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
- package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
- package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
- package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
- package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
- package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
- package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
- package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
- package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
- package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
- package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
- package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
- package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
- package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
- package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
- package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
- package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
- package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
- package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
- package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
- package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
- package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
- package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
- package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
- package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
- package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
- package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
- package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
- package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
- package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
- package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
- package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
- package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
- package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
- package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
- package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
- package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
- package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
- package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
- package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
- package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
- package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
- package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
- package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
- package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
- package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
- package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
- package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
- package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
- package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
- package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
- package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
- package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
- package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
- package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
- package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
- package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
- package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
- package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
- package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
- package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
- package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
- package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
- package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
- package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
- package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
- package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
- package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
- package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
- package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
- package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
- package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
- package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
- package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
- package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
- package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
- package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
- package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
- package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +11 -0
- package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
- package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
- package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
- package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
- package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
- package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
- package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
- package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
- package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
- package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
- package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
- package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
- package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
- package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
- package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
- package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
- package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
- package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
- package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
- package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
- package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
- package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
- package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
- package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
- package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
- package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
- package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
- package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
- package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
- package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
- package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
- package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
- package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
- package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
- package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
- package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
- package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
- package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
- package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
- package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
- package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
- package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
- package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
- package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
- package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
- package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
- package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
- package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
- package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
- package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
- package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
- package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
- package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
- package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
- package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
- package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
- package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
- package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
- package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
- package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
- package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
- package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
- package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
- package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
- package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
- package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
- package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
- package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
- package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
- package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
- package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
- package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
- package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
- package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
- package/package.json +1 -1
- /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
- /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
- /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/unintended-release-regression.md → unintended-release-regression.md} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Stream-id literals, composite ids and the reserved `All` name
|
|
2
2
|
|
|
3
|
+
When a caller needs to find the same stream after a lost reply, choose an explicit identifier before the first attempt. Choose a `generated identifier` only when a new identity per accepted operation is intended. For Stage, use its supported UUID or String strategies and check admission; unsupported generated types or result shapes remain gaps, not retry guarantees.
|
|
4
|
+
|
|
3
5
|
Rules for stream-id literals, composite ids and the reserved `All` stream name.
|
|
4
6
|
|
|
5
7
|
- Stream-id literals must be nonempty, well-formed NFC text (refused,
|
|
@@ -34,8 +34,8 @@ Start from the business instance, then choose its representation. A generated id
|
|
|
34
34
|
real instance; a readable constant can hide a collection. Write one sentence per identity
|
|
35
35
|
concept:
|
|
36
36
|
|
|
37
|
-
> `
|
|
38
|
-
> the state of this
|
|
37
|
+
> `EnrollmentId`: one stream per enrollment of one member in one course; it answers "what is
|
|
38
|
+
> the state of this enrollment?"
|
|
39
39
|
|
|
40
40
|
For every affected identifier:
|
|
41
41
|
1. Name the instance and its lifecycle.
|
|
@@ -59,8 +59,8 @@ capture that writes to the identifier and fill one row each:
|
|
|
59
59
|
|
|
60
60
|
| Event | Written by (command, reaction, capture) | How it changes or records this instance's history | Belongs? |
|
|
61
61
|
|---|---|---|---|
|
|
62
|
-
| `MemberEnrolled` | `
|
|
63
|
-
| `CourseSeatsAdjusted` | `AdjustSeats` (same identifier) | changes the course, not the
|
|
62
|
+
| `MemberEnrolled` | `EnrollMember` | records the enrollment decision | yes |
|
|
63
|
+
| `CourseSeatsAdjusted` | `AdjustSeats` (same identifier) | changes the course, not the enrollment | no: move to the course stream |
|
|
64
64
|
|
|
65
65
|
Then decide per identity, with a reason and the invariant a split would affect:
|
|
66
66
|
- **retain**: every event is a fact about this instance, however long the history;
|
|
@@ -142,7 +142,7 @@ test; they vary by business.
|
|
|
142
142
|
| Marina | berth (as a managed resource) | Does the berth itself make decisions (closed for repair, re-priced) or must occupancy be decided atomically (one vessel at a time)? | none for reserve and release facts: they may belong on the berth when it is the authoritative decision point (`consistency-and-concurrency.md` section 3); carry the booking id as a reference and keep the booking's own history on the booking |
|
|
143
143
|
| Memberships | membership | Is it one lifecycle (joined, renewed, lapsed, ended)? A thirty-year membership is still one stream | profile, preferences and login history bundled: three concerns with different decisions; split when they have independent lifecycles |
|
|
144
144
|
| Memberships | "all members" | none: it is a collection | model as a view |
|
|
145
|
-
| Course
|
|
145
|
+
| Course enrollment | enrollment | One member in one course, from enrollment to completion or withdrawal | a "course" stream that also carries every member's progress |
|
|
146
146
|
| Hire | hire agreement | From reservation to return, one customer and one item | an "active hires" stream beside a "completed hires" stream: lifecycle stages of one instance, not two identities |
|
|
147
147
|
|
|
148
148
|
A composite can be one stream when parent and children are decided together under shared
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Example: streams, constraints and a recorded rule
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Contents
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Course enrollment model
|
|
6
|
+
- What this example proves
|
|
7
|
+
|
|
8
|
+
## Course enrollment model
|
|
9
|
+
|
|
10
|
+
This design-mode course-enrollment example shows separate stream identities, cross-stream payload references, uniqueness constraints and an active-state view. It records rather than enforces the capacity rule. The payload-key fan-in remains refused even with `command reads protected`; read [consistency and concurrency](consistency-and-concurrency.md) before choosing an enforcement boundary.
|
|
11
|
+
|
|
12
|
+
The example is intentionally not binding-ready: `reads` and the `concurrency` block are PLAY0271; a `require` over the view is PLAY0268. Keep the `pii` marker for the email concept. Compliance markers are not the reason this example refuses binding.
|
|
6
13
|
|
|
7
14
|
```screenplay expect PLAY0516 test=unbound
|
|
8
15
|
// The capacity rule is NOT enforced in the model (see the slice description).
|
|
@@ -11,7 +18,7 @@ domain Acme.Academy
|
|
|
11
18
|
|
|
12
19
|
concept MemberId : Uuid // event source id of one member stream
|
|
13
20
|
concept CourseId : Uuid // event source id of one course stream
|
|
14
|
-
concept
|
|
21
|
+
concept EnrollmentId : Uuid // event source id of one enrollment stream
|
|
15
22
|
concept Email : String pii
|
|
16
23
|
pii reason "Identifies a person"
|
|
17
24
|
validate
|
|
@@ -22,7 +29,7 @@ policy IsAuthenticated
|
|
|
22
29
|
policy IsCoordinator
|
|
23
30
|
require role "Coordinator"
|
|
24
31
|
persona Coordinator
|
|
25
|
-
description "Schedules courses and manages
|
|
32
|
+
description "Schedules courses and manages enrollments. Cannot: change member contact details"
|
|
26
33
|
policy IsAuthenticated
|
|
27
34
|
policy IsCoordinator
|
|
28
35
|
|
|
@@ -82,7 +89,7 @@ module Membership
|
|
|
82
89
|
module Courses
|
|
83
90
|
description "Courses and who attends them"
|
|
84
91
|
authorize IsAuthenticated
|
|
85
|
-
feature
|
|
92
|
+
feature Enrollment
|
|
86
93
|
authorize IsCoordinator
|
|
87
94
|
slice StateChange OpenCourse
|
|
88
95
|
command OpenCourse
|
|
@@ -111,7 +118,7 @@ module Courses
|
|
|
111
118
|
then denied
|
|
112
119
|
|
|
113
120
|
slice StateView CourseAvailability
|
|
114
|
-
description "Open seats per course, built from
|
|
121
|
+
description "Open seats per course, built from enrollment and withdrawal facts. A lagging view: usable for display and as stated intent, not as a protected decision. It routes enrollment-stream facts to the course by a payload property (fan-in). A Chronicle protected decision read admits only a projection keyed directly by the event source id and refuses event-property routing, so this view cannot be guarded, and a concurrency scope on the course source would not see enrollment-stream appends. Consequence: two concurrent enrollments can both pass the capacity check and overbook the course. Redesign awaiting agreement (see consistency-and-concurrency.md section 3): record seat reservations as decisions on the course source (a seat-taken fact there, with enrollment reacting to it), or give each seat its own identity and claim it with a uniqueness constraint."
|
|
115
122
|
readmodel CourseAvailability
|
|
116
123
|
courseId CourseId
|
|
117
124
|
openSeats Int
|
|
@@ -123,7 +130,7 @@ module Courses
|
|
|
123
130
|
openSeats = seats
|
|
124
131
|
from MemberEnrolled key courseId
|
|
125
132
|
decrement openSeats
|
|
126
|
-
from
|
|
133
|
+
from EnrollmentWithdrawn key courseId
|
|
127
134
|
increment openSeats
|
|
128
135
|
specification CountingOpenSeats
|
|
129
136
|
given caller
|
|
@@ -149,10 +156,10 @@ module Courses
|
|
|
149
156
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
150
157
|
then denied
|
|
151
158
|
|
|
152
|
-
slice StateChange
|
|
153
|
-
description "
|
|
154
|
-
command
|
|
155
|
-
|
|
159
|
+
slice StateChange EnrollMember
|
|
160
|
+
description "Enforced at append: one active enrollment per member and course (composite unique constraint, released by withdrawal), and one MemberEnrolled per enrollment stream. A retry with the same enrollment ID after a lost reply cannot enroll twice; the composite constraint alone lets a source reclaim its own value. Constraint-index maintenance runs after commit; retry unchanged if Chronicle refuses the append while the index catches up. NOT enforced in the model today: 'enrollments never exceed the course capacity'. The rule depends on other streams' state: `reads` is PLAY0271 and `require` over a view is PLAY0268 at binding. The enrollment-to-course fan-in cannot be protected as modeled (see the CourseAvailability slice): concurrent enrollments can overbook. Target enforcement is an open decision (consistency-and-concurrency.md section 3); the model stays as stated intent, recorded in STATE.md."
|
|
161
|
+
command EnrollMember
|
|
162
|
+
enrollmentId EnrollmentId identifier
|
|
156
163
|
courseId CourseId
|
|
157
164
|
memberId MemberId
|
|
158
165
|
concurrency
|
|
@@ -164,13 +171,13 @@ module Courses
|
|
|
164
171
|
produces event MemberEnrolled
|
|
165
172
|
courseId CourseId = courseId // cross-stream references are payload
|
|
166
173
|
memberId MemberId = memberId
|
|
167
|
-
constraint
|
|
174
|
+
constraint OneActiveEnrollmentPerMemberAndCourse
|
|
168
175
|
unique courseId, memberId on MemberEnrolled
|
|
169
|
-
released by
|
|
176
|
+
released by EnrollmentWithdrawn
|
|
170
177
|
constraint EnrolOnce
|
|
171
178
|
unique event MemberEnrolled
|
|
172
|
-
screen
|
|
173
|
-
action
|
|
179
|
+
screen EnrollMember
|
|
180
|
+
action EnrollMember for screen
|
|
174
181
|
specification EnrollingAMember
|
|
175
182
|
given caller
|
|
176
183
|
authenticated
|
|
@@ -178,15 +185,15 @@ module Courses
|
|
|
178
185
|
given CourseOpened
|
|
179
186
|
for "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
180
187
|
seats = 12
|
|
181
|
-
when
|
|
182
|
-
|
|
188
|
+
when EnrollMember
|
|
189
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
183
190
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
184
191
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
185
192
|
then MemberEnrolled
|
|
186
193
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
187
194
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
188
195
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
189
|
-
specification
|
|
196
|
+
specification RefusingARetriedEnrollment
|
|
190
197
|
given caller
|
|
191
198
|
authenticated
|
|
192
199
|
role "Coordinator"
|
|
@@ -197,21 +204,21 @@ module Courses
|
|
|
197
204
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
198
205
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
199
206
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
200
|
-
when
|
|
201
|
-
|
|
207
|
+
when EnrollMember
|
|
208
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
202
209
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
203
210
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
204
211
|
then error "Constraint 'EnrolOnce' is violated: the event source already has the constrained event."
|
|
205
212
|
|
|
206
|
-
specification
|
|
213
|
+
specification RefusingAnEnrollmentWithoutTheCoordinatorRole
|
|
207
214
|
given caller
|
|
208
215
|
authenticated
|
|
209
|
-
when
|
|
210
|
-
|
|
216
|
+
when EnrollMember
|
|
217
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
211
218
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
212
219
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
213
220
|
then denied
|
|
214
|
-
specification
|
|
221
|
+
specification RefusingASecondActiveEnrollmentUnderANewId
|
|
215
222
|
given caller
|
|
216
223
|
authenticated
|
|
217
224
|
role "Coordinator"
|
|
@@ -222,11 +229,11 @@ module Courses
|
|
|
222
229
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
223
230
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
224
231
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
225
|
-
when
|
|
226
|
-
|
|
232
|
+
when EnrollMember
|
|
233
|
+
enrollmentId = "1e4c0f3b-7d5a-4a2f-9c8b-6f3e2d4c5b12"
|
|
227
234
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
228
235
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
229
|
-
then error "Constraint '
|
|
236
|
+
then error "Constraint 'OneActiveEnrollmentPerMemberAndCourse' is violated: another event source already holds the constrained value."
|
|
230
237
|
specification ReEnrollingAfterWithdrawal
|
|
231
238
|
given caller
|
|
232
239
|
authenticated
|
|
@@ -238,11 +245,11 @@ module Courses
|
|
|
238
245
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
239
246
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
240
247
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
241
|
-
given
|
|
248
|
+
given EnrollmentWithdrawn
|
|
242
249
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
243
250
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
244
|
-
when
|
|
245
|
-
|
|
251
|
+
when EnrollMember
|
|
252
|
+
enrollmentId = "1e4c0f3b-7d5a-4a2f-9c8b-6f3e2d4c5b12"
|
|
246
253
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
247
254
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
248
255
|
then MemberEnrolled
|
|
@@ -250,22 +257,22 @@ module Courses
|
|
|
250
257
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
251
258
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
252
259
|
|
|
253
|
-
slice StateChange
|
|
254
|
-
description "NOT enforced in the model today: a withdrawal must name an existing active
|
|
255
|
-
command
|
|
256
|
-
|
|
260
|
+
slice StateChange WithdrawEnrollment
|
|
261
|
+
description "NOT enforced in the model today: a withdrawal must name an existing active enrollment of the same course. `courseId` is only a routing reference supplied by the caller, so without this check a wrong course would restore a seat elsewhere, and a withdrawal of an enrollment that does not exist would invent a free seat. Stated as `reads` + `require` over ActiveEnrollmentEntry (PLAY0271/PLAY0268 at binding). Target enforcement: a protected decision read of the enrollment (it is keyed directly by the enrollment source id, so it qualifies). Requirements to test in the target: withdrawing an unknown enrollment is rejected; withdrawing with another course is rejected; a correct withdrawal restores one seat."
|
|
262
|
+
command WithdrawEnrollment
|
|
263
|
+
enrollmentId EnrollmentId identifier
|
|
257
264
|
courseId CourseId
|
|
258
|
-
reads
|
|
265
|
+
reads ActiveEnrollmentEntry as enrollment by enrollmentId // stated intent, unprotected
|
|
259
266
|
validate
|
|
260
|
-
require
|
|
261
|
-
message "The
|
|
262
|
-
produces event
|
|
267
|
+
require enrollment.courseId == courseId
|
|
268
|
+
message "The enrollment does not belong to that course" // NOT enforced today
|
|
269
|
+
produces event EnrollmentWithdrawn
|
|
263
270
|
courseId CourseId = courseId
|
|
264
271
|
constraint WithdrawOnce
|
|
265
|
-
unique event
|
|
266
|
-
screen
|
|
267
|
-
action
|
|
268
|
-
specification
|
|
272
|
+
unique event EnrollmentWithdrawn
|
|
273
|
+
screen WithdrawEnrollment
|
|
274
|
+
action WithdrawEnrollment for screen
|
|
275
|
+
specification WithdrawingAnEnrollment
|
|
269
276
|
given caller
|
|
270
277
|
authenticated
|
|
271
278
|
role "Coordinator"
|
|
@@ -273,17 +280,17 @@ module Courses
|
|
|
273
280
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
274
281
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
275
282
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
276
|
-
when
|
|
277
|
-
|
|
283
|
+
when WithdrawEnrollment
|
|
284
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
278
285
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
279
|
-
then
|
|
286
|
+
then EnrollmentWithdrawn
|
|
280
287
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
281
288
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
282
289
|
specification RefusingAWithdrawalWithoutTheCoordinatorRole
|
|
283
290
|
given caller
|
|
284
291
|
authenticated
|
|
285
|
-
when
|
|
286
|
-
|
|
292
|
+
when WithdrawEnrollment
|
|
293
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
287
294
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
288
295
|
then denied
|
|
289
296
|
specification RefusingASecondWithdrawal
|
|
@@ -294,41 +301,41 @@ module Courses
|
|
|
294
301
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
295
302
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
296
303
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
297
|
-
given
|
|
304
|
+
given EnrollmentWithdrawn
|
|
298
305
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
299
306
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
300
|
-
when
|
|
301
|
-
|
|
307
|
+
when WithdrawEnrollment
|
|
308
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
302
309
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
303
|
-
then error "The
|
|
310
|
+
then error "The enrollment does not belong to that course"
|
|
304
311
|
specification AppendingASecondWithdrawal
|
|
305
312
|
given MemberEnrolled
|
|
306
313
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
307
314
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
308
315
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
309
|
-
given
|
|
316
|
+
given EnrollmentWithdrawn
|
|
310
317
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
311
318
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
312
|
-
when append
|
|
319
|
+
when append EnrollmentWithdrawn
|
|
313
320
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
314
321
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
315
322
|
then error "Constraint 'WithdrawOnce' is violated: the event source already has the constrained event."
|
|
316
323
|
|
|
317
|
-
slice StateView
|
|
318
|
-
description "An active
|
|
319
|
-
readmodel
|
|
320
|
-
|
|
324
|
+
slice StateView ActiveEnrollment
|
|
325
|
+
description "An active enrollment is present until withdrawal; the facts stay in history."
|
|
326
|
+
readmodel ActiveEnrollmentEntry
|
|
327
|
+
enrollmentId EnrollmentId
|
|
321
328
|
courseId CourseId
|
|
322
329
|
memberId MemberId
|
|
323
|
-
query
|
|
324
|
-
by
|
|
325
|
-
projection
|
|
330
|
+
query ActiveEnrollmentById => ActiveEnrollmentEntry optional
|
|
331
|
+
by enrollmentId EnrollmentId
|
|
332
|
+
projection ActiveEnrollments => ActiveEnrollmentEntry
|
|
326
333
|
from MemberEnrolled
|
|
327
|
-
|
|
334
|
+
enrollmentId = $eventSourceId
|
|
328
335
|
courseId = courseId
|
|
329
336
|
memberId = memberId
|
|
330
|
-
remove with
|
|
331
|
-
specification
|
|
337
|
+
remove with EnrollmentWithdrawn
|
|
338
|
+
specification ShowingAnActiveEnrollment
|
|
332
339
|
given caller
|
|
333
340
|
authenticated
|
|
334
341
|
role "Coordinator"
|
|
@@ -336,26 +343,30 @@ module Courses
|
|
|
336
343
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
337
344
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
338
345
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
339
|
-
then query
|
|
346
|
+
then query ActiveEnrollmentById
|
|
340
347
|
arguments
|
|
341
|
-
|
|
348
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
342
349
|
result
|
|
343
350
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
344
351
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
345
|
-
specification
|
|
352
|
+
specification RefusingEnrollmentDetailToAnOrdinaryMember
|
|
346
353
|
given caller
|
|
347
354
|
authenticated
|
|
348
|
-
then query
|
|
355
|
+
then query ActiveEnrollmentById
|
|
349
356
|
arguments
|
|
350
|
-
|
|
357
|
+
enrollmentId = "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
351
358
|
then denied
|
|
352
|
-
specification
|
|
359
|
+
specification RemovingAWithdrawnEnrollment
|
|
353
360
|
given MemberEnrolled
|
|
354
361
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
355
362
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
356
363
|
memberId = "6f1c2a8e-0b1d-4d55-9a3e-2f6a7c1d0e11"
|
|
357
|
-
when append
|
|
364
|
+
when append EnrollmentWithdrawn
|
|
358
365
|
for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
359
366
|
courseId = "a4e7c1d2-3b5f-4a6e-9c8d-7f1e2d3c4b02"
|
|
360
|
-
then no readmodel
|
|
367
|
+
then no readmodel ActiveEnrollmentEntry for "0d3b9e2a-6c4f-4f1e-8b7a-5e2d1c3b4a01"
|
|
361
368
|
```
|
|
369
|
+
|
|
370
|
+
## What this example proves
|
|
371
|
+
|
|
372
|
+
The source documents the intended behavior. The recorded binding refusal means none of the included scenarios proves it. Verify the enforced claims and the capacity and withdrawal races against the target store.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-security-review
|
|
3
|
-
description: Use when auditing a Cratis application change for
|
|
3
|
+
description: Use when auditing a Cratis application change for authorization, untrusted input, secrets or permanent event-log exposure. Not for a general correctness review (use cratis-code-review).
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -47,78 +47,9 @@ command's properties as well as grepping them.
|
|
|
47
47
|
- Implementing personal-data protection or erasure: use
|
|
48
48
|
`cratis-chronicle-protect-personal-data` from `cratis/application`.
|
|
49
49
|
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
command's property values are written to the causation of every event it
|
|
54
|
-
appends, and causation is as permanent as the events. Prefer the marking on
|
|
55
|
-
the concept type so it travels everywhere the value appears. `[NotAudited]`
|
|
56
|
-
alone leaves the secret in plaintext on events; `[Encrypted]` alone leaves the
|
|
57
|
-
command input on the causation chain.
|
|
58
|
-
`ARCCHR0009` catches properties whose *names* read as secrets — so read the
|
|
59
|
-
properties whose names do not say what they hold, because the analyzer cannot.
|
|
60
|
-
- Flag personal data that does not use subject protection; encryption alone
|
|
61
|
-
does not enroll a value in erasure. Never combine
|
|
62
|
-
`[PII]` with `[Encrypted]` (`CHR0053`), and neither goes on an event-source id
|
|
63
|
-
(`CHR0034`, `CHR0052`).
|
|
64
|
-
- Credentials used for authentication (passwords, bearer or session tokens) are never stored; keep a hash or a reference. An operational secret the system must retain and use (a third-party API key, a company's bank account number) is stored only as an `[Encrypted]` + `[NotAudited]` concept, and never in a read model returned to clients in plaintext.
|
|
65
|
-
- Event-source ids are generated server-side, never accepted from an untrusted
|
|
66
|
-
client where the id grants access to a stream.
|
|
67
|
-
- Upcasting and event-type migration logic cannot introduce a property the
|
|
68
|
-
original contract did not carry.
|
|
69
|
-
- Uniqueness cannot be bypassed by concurrent writes — it is enforced by a
|
|
70
|
-
Chronicle constraint, not by a read-model pre-check.
|
|
71
|
-
- Cross-tenant writes cannot bypass a constraint that is scoped per namespace.
|
|
72
|
-
|
|
73
|
-
## Step 2 — Input validation and injection
|
|
74
|
-
|
|
75
|
-
- Every command property is validated before use — null, empty, range, format.
|
|
76
|
-
- No raw SQL concatenation; parameterized queries or EF Core only.
|
|
77
|
-
- No user-supplied value reaches `Path.Combine`, a `File.*` call, a shell
|
|
78
|
-
command, or process arguments.
|
|
79
|
-
- No user-supplied value becomes an event-store key without sanitization.
|
|
80
|
-
|
|
81
|
-
## Step 3 — Authentication and authorization
|
|
82
|
-
|
|
83
|
-
- Every exposed endpoint is either authorized or explicitly anonymous with a
|
|
84
|
-
stated reason.
|
|
85
|
-
- Authorization is expressed at the boundary — an attribute, a policy, a command
|
|
86
|
-
filter — never as an `if` on roles inside `Handle()`.
|
|
87
|
-
- Tenant isolation holds: no cross-namespace data is reachable without
|
|
88
|
-
authorization.
|
|
89
|
-
- Claims are verified before acting on identity-dependent command data. A client
|
|
90
|
-
must not be able to assert who it is through a command property.
|
|
91
|
-
- Note that an unauthorized command result maps to HTTP **403**, not 401 — a
|
|
92
|
-
reviewer reading logs for 401s will miss authorization failures.
|
|
93
|
-
- Review [Arc-specific security boundaries](references/arc-boundaries.md) when
|
|
94
|
-
the diff touches hosting, identity, policies, discovery, streams or system actors.
|
|
95
|
-
It ties the checks to Arc source; do not assume a clean analyzer run proves
|
|
96
|
-
those deployment boundaries.
|
|
97
|
-
|
|
98
|
-
## Step 4 — Data exposure
|
|
99
|
-
|
|
100
|
-
- No personal data is returned to a caller that did not supply it.
|
|
101
|
-
- Query results are scoped to the requesting tenant and user. A query that can
|
|
102
|
-
return all-tenant data is a finding even when no current caller reaches it.
|
|
103
|
-
- Response payloads carry only fields the client uses. Over-fetching is an
|
|
104
|
-
exposure surface, not only a performance one.
|
|
105
|
-
- A managed read-model document holds one subject's personal data. Mixing
|
|
106
|
-
several people's data in one document breaks erasure.
|
|
107
|
-
|
|
108
|
-
## Step 5 — Secrets and configuration
|
|
109
|
-
|
|
110
|
-
- No secret in source, in a configuration file, or in a specification fixture.
|
|
111
|
-
- Secrets come from environment variables or a secrets manager.
|
|
112
|
-
- No hard-coded connection string outside test code.
|
|
113
|
-
|
|
114
|
-
## Step 6 — Frontend
|
|
115
|
-
|
|
116
|
-
- No user-supplied value in `dangerouslySetInnerHTML`.
|
|
117
|
-
- No token or secret in `localStorage` — use an `httpOnly` cookie or in-memory
|
|
118
|
-
state.
|
|
119
|
-
- Command payloads carry only the minimum required fields.
|
|
120
|
-
- No client-side access control that is not also enforced server-side. A
|
|
121
|
-
disabled button is a usability affordance, never a control.
|
|
50
|
+
## Review the affected paths
|
|
51
|
+
|
|
52
|
+
Read [the review checklist](references/review-checklist.md) for event data, authorization, inputs, secrets and frontend exposure. Trace each affected request from its server-side authorization decision to any durable or externally visible copy of its data. For Arc endpoints, also read [Arc boundaries](references/arc-boundaries.md) to check each exposure surface.
|
|
122
53
|
|
|
123
54
|
## Step 7 — Report
|
|
124
55
|
|
|
@@ -3,10 +3,20 @@
|
|
|
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
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
- Leave forwarded identity off unless an authenticated ingress supplies it. In
|
|
7
|
+
unsigned mode, `TrustForwardedIdentityHeaders` trusts the ingress, not the
|
|
8
|
+
headers as proof. Verify the ingress strips and replaces caller-supplied
|
|
9
|
+
identity headers and prevents direct backend access. Custom handlers must
|
|
10
|
+
honor the trust switch and must not bypass signed-mode verification.
|
|
11
|
+
- For signed forwarding, check both `TrustForwardedIdentityHeaders` and
|
|
12
|
+
`ForwardedIdentity.Enabled`. Verify the expected signer keys and audience and
|
|
13
|
+
confirm missing, invalid, expired or replayed envelopes establish no forwarded
|
|
14
|
+
identity, without falling back to unsigned headers. Replay protection is
|
|
15
|
+
process-local; do not assume fleet-wide protection. If
|
|
16
|
+
`ForwardedIdentity.ClientCertificate.Required` is configured, confirm every
|
|
17
|
+
relevant listener requests a client certificate and Arc validates the immediate
|
|
18
|
+
TLS peer against the configured CA and DNS allowlist. Missing or untrusted
|
|
19
|
+
peers must not establish forwarded identity; HTTP headers are not peer proof.
|
|
10
20
|
- Application code must not read `.cratis-identity`. The backend derives identity
|
|
11
21
|
from the authenticated principal; the JS client only falls back to the legacy
|
|
12
22
|
cookie on 404, never on 401/403. Use `clearCache()` on logout. Browser identity
|
|
@@ -14,8 +24,8 @@
|
|
|
14
24
|
- Test all discovery routes outside Development. Default access is authenticated
|
|
15
25
|
there, or 404 when the host cannot authenticate. Explicit
|
|
16
26
|
`RequireAuthentication=false` opens discovery in every environment;
|
|
17
|
-
`Enabled=false` removes catalogs, not identity discovery.
|
|
18
|
-
|
|
27
|
+
`Enabled=false` removes catalogs, not identity discovery. Set `Enabled=false` and `IdentityDiscovery=false` when neither surface
|
|
28
|
+
is needed; `RequireAuthentication=false` is not a disable switch. `[ExcludeFromDiscovery]` hides documentation/catalogs,
|
|
19
29
|
not invocation or authorization.
|
|
20
30
|
- Check ARC0019/0020/0021: conflicting declarations, Microsoft attributes without
|
|
21
31
|
the ASP.NET integration, and schemes on the standalone host. Microsoft
|
|
@@ -23,8 +33,8 @@
|
|
|
23
33
|
on supported hosts. A method declaration **replaces** the type declaration.
|
|
24
34
|
Guest access requires every policy in the declaration to opt in
|
|
25
35
|
(`evaluatesAnonymous`), without roles/schemes.
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
Verify guest endpoints remain reachable through HTTP with the authenticated
|
|
37
|
+
fallback policy enabled. Keep an
|
|
28
38
|
intentional `IFallbackAuthorizationEvaluator` baseline; it is separate from
|
|
29
39
|
ASP.NET's `FallbackPolicy`.
|
|
30
40
|
- The embedded `/.cratis/event-model` viewer defaults to Debug **and** Development.
|
|
@@ -37,11 +47,12 @@
|
|
|
37
47
|
widen it with sensitive payloads or mistake this for a promise of no ids.
|
|
38
48
|
- Returned reactor commands marked `[ExecuteCommandsAsSystem]` use a narrow
|
|
39
49
|
disposed system scope.
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
Assert no caller principal carries into the system scope. Manually executing
|
|
51
|
+
commands still needs explicit actor ownership.
|
|
42
52
|
- Revocable observable data needs `IGuardObservableQueryEmission`; it applies to
|
|
43
53
|
plain HTTP snapshots/waits/long polls too. Suppression withholds data; denial
|
|
44
54
|
terminates/returns unauthorized. Never read the producer's ambient principal.
|
|
45
|
-
- Query health
|
|
46
|
-
|
|
47
|
-
discovery
|
|
55
|
+
- Query health is anonymous by default in Development and authenticated
|
|
56
|
+
elsewhere. Audit its own authentication and role settings separately from
|
|
57
|
+
discovery settings, including access to cross-user identifiers and connection
|
|
58
|
+
metadata over direct HTTP and the hubs.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Security review checklist
|
|
2
|
+
|
|
3
|
+
## Step 1 — Event sourcing: the permanent-record checks
|
|
4
|
+
|
|
5
|
+
- **Every `[Command]` property holding a secret or credential is marked `[NotAudited]`; a retained operational secret is also `[Encrypted]` on the event, and a credential reaches the event only as a hash or a reference.** A
|
|
6
|
+
command's property values are written to the causation of every event it
|
|
7
|
+
appends, and causation is as permanent as the events. Prefer the marking on
|
|
8
|
+
the concept type so it travels everywhere the value appears. `[NotAudited]`
|
|
9
|
+
alone leaves the secret in plaintext on events; `[Encrypted]` alone leaves the
|
|
10
|
+
command input on the causation chain.
|
|
11
|
+
`ARCCHR0009` catches properties whose *names* read as secrets — so read the
|
|
12
|
+
properties whose names do not say what they hold, because the analyzer cannot.
|
|
13
|
+
- Flag personal data that does not use subject protection; encryption alone
|
|
14
|
+
does not enroll a value in erasure. Never combine
|
|
15
|
+
`[PII]` with `[Encrypted]` (`CHR0053`), and neither goes on an event-source id
|
|
16
|
+
(`CHR0034`, `CHR0052`).
|
|
17
|
+
- Credentials used for authentication (passwords, bearer or session tokens) are never stored; keep a hash or a reference. An operational secret the system must retain and use (a third-party API key, a company's bank account number) is stored only as an `[Encrypted]` + `[NotAudited]` concept, and never in a read model returned to clients in plaintext.
|
|
18
|
+
- Event-source ids are generated server-side, never accepted from an untrusted
|
|
19
|
+
client where the id grants access to a stream.
|
|
20
|
+
- Upcasting and event-type migration logic cannot introduce a property the
|
|
21
|
+
original contract did not carry.
|
|
22
|
+
- Uniqueness cannot be bypassed by concurrent writes — it is enforced by a
|
|
23
|
+
Chronicle constraint, not by a read-model pre-check.
|
|
24
|
+
- Cross-tenant writes cannot bypass a constraint that is scoped per namespace.
|
|
25
|
+
|
|
26
|
+
## Step 2 — Input validation and injection
|
|
27
|
+
|
|
28
|
+
- Every command property is validated before use — null, empty, range, format.
|
|
29
|
+
- No raw SQL concatenation; parameterized queries or EF Core only.
|
|
30
|
+
- No user-supplied value reaches `Path.Combine`, a `File.*` call, a shell
|
|
31
|
+
command, or process arguments.
|
|
32
|
+
- No user-supplied value becomes an event-store key without sanitization.
|
|
33
|
+
|
|
34
|
+
## Step 3 — Authentication and authorization
|
|
35
|
+
|
|
36
|
+
- Every exposed endpoint is either authorized or explicitly anonymous with a
|
|
37
|
+
stated reason.
|
|
38
|
+
- Authorization is expressed at the boundary — an attribute, a policy, a command
|
|
39
|
+
filter — never as an `if` on roles inside `Handle()`.
|
|
40
|
+
- Tenant isolation holds: no cross-namespace data is reachable without
|
|
41
|
+
authorization.
|
|
42
|
+
- Claims are verified before acting on identity-dependent command data. A client
|
|
43
|
+
must not be able to assert who it is through a command property.
|
|
44
|
+
- Note that an unauthorized command result maps to HTTP **403**, not 401 — a
|
|
45
|
+
reviewer reading logs for 401s will miss authorization failures.
|
|
46
|
+
- Review [Arc-specific security boundaries](arc-boundaries.md) when
|
|
47
|
+
the diff touches hosting, identity, policies, discovery, streams or system actors.
|
|
48
|
+
It ties the checks to Arc source; do not assume a clean analyzer run proves
|
|
49
|
+
those deployment boundaries.
|
|
50
|
+
|
|
51
|
+
## Step 4 — Data exposure
|
|
52
|
+
|
|
53
|
+
- No personal data is returned to a caller that did not supply it.
|
|
54
|
+
- Query results are scoped to the requesting tenant and user. A query that can
|
|
55
|
+
return all-tenant data is a finding even when no current caller reaches it.
|
|
56
|
+
- Response payloads carry only fields the client uses. Over-fetching is an
|
|
57
|
+
exposure surface, not only a performance one.
|
|
58
|
+
- A managed read-model document holds one subject's personal data. Mixing
|
|
59
|
+
several people's data in one document breaks erasure.
|
|
60
|
+
|
|
61
|
+
## Step 5 — Secrets and configuration
|
|
62
|
+
|
|
63
|
+
- No secret in source, in a configuration file, or in a specification fixture.
|
|
64
|
+
- Secrets come from environment variables or a secrets manager.
|
|
65
|
+
- No hard-coded connection string outside test code.
|
|
66
|
+
|
|
67
|
+
## Step 6 — Frontend
|
|
68
|
+
|
|
69
|
+
- No user-supplied value in `dangerouslySetInnerHTML`.
|
|
70
|
+
- No token or secret in `localStorage` — use an `httpOnly` cookie or in-memory
|
|
71
|
+
state.
|
|
72
|
+
- Command payloads carry only the minimum required fields.
|
|
73
|
+
- No client-side access control that is not also enforced server-side. A
|
|
74
|
+
disabled button is a usability affordance, never a control.
|