@cratis/pi 8.4.1 → 8.6.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 +2 -1
- package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +5 -3
- package/package/corpus/harnesses/copilot/instructions/react.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/reactors.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +2 -1
- package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +6 -3
- package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +5 -2
- package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +131 -9
- package/package/corpus/rules/ai-distribution.md +2 -1
- package/package/corpus/rules/exit-codes-and-wrappers.md +1 -1
- package/package/corpus/rules/glossary.md +5 -3
- package/package/corpus/rules/react.md +3 -1
- package/package/corpus/rules/reactors.md +3 -1
- package/package/corpus/rules/scripting.md +2 -1
- package/package/corpus/rules/specs.csharp.md +6 -3
- package/package/corpus/rules/vertical-slices.md +5 -2
- package/package/corpus/skills/cratis-application-growth/SKILL.md +1 -2
- package/package/corpus/skills/cratis-application-growth/references/csharp.md +1 -3
- package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +1 -2
- package/package/corpus/skills/cratis-application-growth/references/rename-window.md +1 -3
- package/package/corpus/skills/cratis-application-growth/references/service-and-delivery.md +3 -2
- package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +47 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp-query-security.md +18 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +12 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/typescript.md +2 -0
- package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -0
- package/package/corpus/skills/cratis-arc-connect-storage/references/elixir.md +9 -2
- package/package/corpus/skills/cratis-arc-declare-command/SKILL.md +2 -0
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-chronicle.md +47 -8
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-controller.md +3 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-history.md +6 -3
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +38 -11
- package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-abilities.md +2 -2
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp-recovery.md +6 -4
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +2 -2
- 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 +29 -7
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp-diagnose-tool-call.md +9 -7
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp.md +52 -1
- package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +4 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +36 -10
- package/package/corpus/skills/cratis-arc-expose-query/references/go.md +2 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +6 -3
- package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +1 -0
- package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +55 -6
- package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +9 -0
- package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-configuration.md +54 -0
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-deployment.md +98 -0
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-http.md +9 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp-identity.md +87 -4
- package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +9 -0
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp-extensions.md +4 -0
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +2 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +19 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +4 -2
- package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +2 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +33 -36
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-commands.md +18 -3
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-host.md +94 -19
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-identity.md +29 -5
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-instant-feedback.md +81 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-localization.md +80 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-navigation.md +103 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-queries.md +41 -2
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-structure.md +117 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript.md +8 -4
- package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-react-separate-view-model/references/typescript.md +27 -6
- package/package/corpus/skills/cratis-arc-testing-typescript/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp-rules.md +23 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +28 -2
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +1 -0
- package/package/corpus/skills/cratis-authproxy-configure/SKILL.md +136 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/admission.md +125 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/aspire.md +154 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/operations.md +122 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/services-and-routing.md +114 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/sessions-and-logout.md +126 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/sign-in-providers.md +116 -0
- package/package/corpus/skills/cratis-authproxy-configure/references/tenant-resolution.md +135 -0
- package/package/corpus/skills/cratis-choreography-run-workflow/SKILL.md +117 -0
- package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp-chronicle.md +164 -0
- package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp.md +354 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +6 -6
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +11 -3
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +50 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +17 -3
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/setup-and-target.md +8 -2
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp-services.md +13 -2
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +12 -0
- package/package/corpus/skills/cratis-chronicle-connect-application/references/kotlin.md +2 -0
- package/package/corpus/skills/cratis-chronicle-connect-application/references/python.md +2 -2
- package/package/corpus/skills/cratis-chronicle-connect-application/references/typescript.md +10 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +9 -2
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +35 -3
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/operations.md +70 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +6 -3
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/configuration.md +113 -16
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/container-and-kubernetes.md +293 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/kernel-options.md +16 -9
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +60 -7
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +124 -2
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/upgrade-and-recovery.md +36 -1
- package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +12 -0
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +15 -5
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +9 -8
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/go.md +2 -2
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +1 -1
- package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +15 -4
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-model-bound.md +4 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-reading.md +5 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +23 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +1 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +2 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +3 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +4 -3
- package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp-scopes.md +41 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +22 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +7 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +9 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/java.md +8 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/kotlin.md +9 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/typescript.md +7 -0
- 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 +28 -3
- package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +7 -6
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +41 -0
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir-integrations.md +3 -3
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/webhook-signature-wire-format.md +82 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +19 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-outputs.md +3 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-pages.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +37 -4
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/elixir.md +11 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +2 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -0
- package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +3 -3
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-coordination.md +31 -2
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-history.md +21 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +20 -2
- package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -0
- package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +2 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +3 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/java.md +10 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/kotlin.md +10 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +27 -5
- package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +18 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +21 -1
- package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +13 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +15 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +15 -0
- package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +16 -0
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +1 -1
- package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +4 -3
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/publish-pipelines.md +19 -4
- package/package/corpus/skills/cratis-code-review/SKILL.md +6 -2
- package/package/corpus/skills/cratis-code-review/references/csharp-diagnostics.md +28 -2
- package/package/corpus/skills/cratis-code-review/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +6 -38
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +2 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md +5 -4
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/workflow-inputs.md +39 -0
- package/package/corpus/skills/cratis-components-accessibility/SKILL.md +6 -8
- package/package/corpus/skills/cratis-components-accessibility/references/typescript.md +32 -14
- package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +4 -3
- package/package/corpus/skills/cratis-components-build-canvas/references/typescript-props.md +1 -1
- package/package/corpus/skills/cratis-components-build-canvas/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-components-choose-control/SKILL.md +13 -7
- package/package/corpus/skills/cratis-components-choose-control/references/from-primereact.md +116 -0
- package/package/corpus/skills/cratis-components-choose-control/references/menu.md +90 -0
- package/package/corpus/skills/cratis-components-choose-control/references/typescript-composition.md +48 -0
- package/package/corpus/skills/cratis-components-choose-control/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +2 -1
- package/package/corpus/skills/cratis-components-compose-toolbar/references/floating-toolbar.md +146 -0
- package/package/corpus/skills/cratis-components-diagnose-screen/SKILL.md +102 -0
- package/package/corpus/skills/cratis-components-display-list/SKILL.md +10 -10
- package/package/corpus/skills/cratis-components-display-list/references/typescript-custom-panel.md +74 -0
- package/package/corpus/skills/cratis-components-display-list/references/typescript-datatables.md +2 -7
- package/package/corpus/skills/cratis-components-display-list/references/typescript.md +3 -2
- package/package/corpus/skills/cratis-components-submit-form/SKILL.md +6 -6
- package/package/corpus/skills/cratis-components-submit-form/references/typescript-commanddialog.md +21 -1
- package/package/corpus/skills/cratis-components-submit-form/references/typescript-commandform.md +72 -2
- package/package/corpus/skills/cratis-components-submit-form/references/typescript.md +7 -5
- package/package/corpus/skills/cratis-components-theme-application/SKILL.md +17 -15
- package/package/corpus/skills/cratis-components-theme-application/references/localization.md +166 -0
- package/package/corpus/skills/cratis-components-theme-application/references/typescript.md +18 -14
- package/package/corpus/skills/cratis-components-theme-application/references/upgrade-from-previous-major.md +141 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +2 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-domain-philosophy.md +31 -3
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-fundamentals-helpers.md +119 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp.md +4 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/csharp-serialization.md +72 -1
- package/package/corpus/skills/cratis-fundamentals-concept/references/csharp.md +9 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/go.md +2 -1
- package/package/corpus/skills/cratis-fundamentals-concept/references/java-json.md +3 -2
- package/package/corpus/skills/cratis-fundamentals-concept/references/kotlin-json.md +3 -2
- package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-serialization.md +41 -2
- package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -7
- package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +2 -1
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +3 -3
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md +8 -0
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/go-dependency-injection.md +3 -0
- package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +6 -4
- package/package/corpus/skills/cratis-modeling-design-event-model/references/command-inventory.md +7 -1
- package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +13 -1
- package/package/corpus/skills/cratis-modeling-design-event-model/references/review-one-slice.md +6 -0
- package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +6 -6
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/csharp-aspire.md +116 -28
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md +2 -2
- package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +46 -0
- package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +4 -2
- package/package/corpus/skills/cratis-platform-build-application/SKILL.md +8 -0
- package/package/corpus/skills/cratis-platform-build-application/references/cratis-identity.md +71 -0
- package/package/corpus/skills/cratis-platform-build-application/references/studio-repository.md +96 -0
- package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +14 -8
- package/package/corpus/skills/cratis-platform-deliver-slice/references/csharp.md +167 -3
- package/package/corpus/skills/cratis-platform-deliver-slice/references/eventual-consistency.md +150 -0
- package/package/corpus/skills/cratis-platform-deliver-slice/references/typescript.md +14 -1
- package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +1 -1
- package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +8 -8
- package/package/corpus/skills/cratis-platform-prepare-release-pr/references/product-release-checks.md +16 -2
- package/package/corpus/skills/cratis-platform-start-application/SKILL.md +21 -0
- package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +77 -3
- package/package/corpus/skills/cratis-platform-upgrade-application/SKILL.md +118 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/csharp.md +117 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/java.md +53 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/kotlin.md +53 -0
- package/package/corpus/skills/cratis-platform-upgrade-application/references/typescript.md +71 -0
- package/package/corpus/skills/cratis-release-notes/SKILL.md +1 -1
- package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +6 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/csharp.md +34 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/read-the-evidence.md +84 -3
- package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +7 -11
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/commands.md +8 -4
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/projections.md +2 -0
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/structure-and-imports.md +29 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +2 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/references/mcp-tools.md +1 -1
- package/package/corpus/skills/cratis-screenplay-handoff-slice/references/csharp.md +13 -1
- package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-translation/references/boundary-diagnostics.md +1 -1
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +30 -51
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/cli.md +19 -2
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/smallest-model.md +87 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/studio.md +5 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/typescript.md +13 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/workspace-mcp.md +5 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +8 -12
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/running-mcp.md +12 -0
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/scenarios.md +2 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +2 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-colocated.md +101 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +4 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-decision-reads.md +1 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-events.md +7 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-integration.md +7 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-reactors.md +18 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-read-models.md +4 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +35 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +2 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +1 -1
- package/package/corpus/skills/cratis-specifications-isolate-behavior/references/csharp-running.md +10 -3
- package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript.md +22 -4
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -1
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/references/typescript.md +40 -0
- package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +6 -0
- package/package/corpus/skills/cratis-stage-render-slice/references/semantic-conformance.md +64 -0
- package/package/profile-catalog.json +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Sign-in providers
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- OpenID Connect providers
|
|
6
|
+
- OAuth providers such as GitHub
|
|
7
|
+
- One provider or several
|
|
8
|
+
- Register the callbacks at the provider
|
|
9
|
+
- Providers that let anyone register
|
|
10
|
+
- Sign in with a one-time code
|
|
11
|
+
- Anti-patterns
|
|
12
|
+
|
|
13
|
+
## OpenID Connect providers
|
|
14
|
+
|
|
15
|
+
Declare a provider that publishes an OpenID Connect discovery document under `Cratis:AuthProxy:Authentication:OidcProviders`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"Cratis": {
|
|
20
|
+
"AuthProxy": {
|
|
21
|
+
"Authentication": {
|
|
22
|
+
"OidcProviders": [
|
|
23
|
+
{
|
|
24
|
+
"Name": "Microsoft",
|
|
25
|
+
"Type": "Microsoft",
|
|
26
|
+
"Authority": "https://login.microsoftonline.com/<tenant-id>/v2.0",
|
|
27
|
+
"ClientId": "<client-id>",
|
|
28
|
+
"ClientSecret": "<client-secret>"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Property | Meaning |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `Name` | The name shown on the provider-selection page. It also gives the scheme name. |
|
|
40
|
+
| `Type` | `Microsoft`, `Google` or `Custom`. Use `Custom` for any other OpenID Connect provider, such as Keycloak. |
|
|
41
|
+
| `Authority` | The provider's authority URL. |
|
|
42
|
+
| `ClientId`, `ClientSecret` | The application registered at the provider. |
|
|
43
|
+
| `Scopes` | Scopes in addition to `openid`, `profile` and `email`. |
|
|
44
|
+
|
|
45
|
+
Supply `ClientSecret` from a secret store or an environment variable (`Cratis__AuthProxy__Authentication__OidcProviders__0__ClientSecret`), never from a committed file.
|
|
46
|
+
|
|
47
|
+
## OAuth providers such as GitHub
|
|
48
|
+
|
|
49
|
+
GitHub publishes no discovery document. Declare it under `Authentication:OAuthProviders` with its endpoints named:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"Name": "GitHub",
|
|
54
|
+
"Type": "GitHub",
|
|
55
|
+
"AuthorizationEndpoint": "https://github.com/login/oauth/authorize",
|
|
56
|
+
"TokenEndpoint": "https://github.com/login/oauth/access_token",
|
|
57
|
+
"UserInformationEndpoint": "https://api.github.com/user",
|
|
58
|
+
"ClientId": "<client-id>",
|
|
59
|
+
"ClientSecret": "<client-secret>",
|
|
60
|
+
"Scopes": [ "read:user", "user:email" ],
|
|
61
|
+
"ClaimMappings": {
|
|
62
|
+
"sub": "id",
|
|
63
|
+
"name": "name",
|
|
64
|
+
"preferred_username": "login",
|
|
65
|
+
"email": "email"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- `ClaimMappings` turns the provider's user-information JSON into claims: the key is the claim to create, the value is the JSON field to read.
|
|
71
|
+
- Add the `read:org` scope to a GitHub provider when admission depends on organization or team. See [admission.md](admission.md).
|
|
72
|
+
- An OAuth provider has no end-session endpoint, so sign-out clears the proxy session only. It also cannot prove when the person signed in, so fresh-authentication rules cannot be satisfied. See [sessions-and-logout.md](sessions-and-logout.md).
|
|
73
|
+
|
|
74
|
+
## One provider or several
|
|
75
|
+
|
|
76
|
+
OIDC and OAuth providers count together.
|
|
77
|
+
|
|
78
|
+
| Configured | An unauthenticated browser navigation |
|
|
79
|
+
|---|---|
|
|
80
|
+
| One provider | Is redirected straight to that provider. |
|
|
81
|
+
| Several providers | Gets the provider-selection page. |
|
|
82
|
+
|
|
83
|
+
Each provider has a login endpoint at `/.cratis/login/{scheme}`. The scheme is the provider `Name` in lowercase with spaces replaced by hyphens: `My Provider` becomes `my-provider`. Link to that endpoint to start sign-in with one specific provider.
|
|
84
|
+
|
|
85
|
+
## Register the callbacks at the provider
|
|
86
|
+
|
|
87
|
+
Register these addresses on the proxy's public host at the provider:
|
|
88
|
+
|
|
89
|
+
| Address | Purpose |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `https://<proxy-host>/signin-{scheme}` | The sign-in callback (redirect URI). |
|
|
92
|
+
| `https://<proxy-host>/.cratis/logout/callback` | The post-logout redirect URI. Only for an OIDC provider that advertises an end-session endpoint; without one, sign-out ends the proxy session only. |
|
|
93
|
+
|
|
94
|
+
A proxy that serves several hosts needs the callbacks registered for each host, or one host set aside for the handshake with `SignIn:CallbackHost`.
|
|
95
|
+
|
|
96
|
+
## Providers that let anyone register
|
|
97
|
+
|
|
98
|
+
A social provider signs in every account it has. Two settings limit who gets through:
|
|
99
|
+
|
|
100
|
+
- `RequireVerifiedEmail: true` on an OIDC provider refuses the sign-in unless the person carries exactly one e-mail address and the provider reports it as verified. It defaults to `false`.
|
|
101
|
+
- A required claim decides who is admitted after sign-in. See [admission.md](admission.md).
|
|
102
|
+
|
|
103
|
+
## Sign in with a one-time code
|
|
104
|
+
|
|
105
|
+
An OIDC provider entry with `Type: Code` signs a person in with an e-mail address and a short code. It needs no `Authority` or `ClientId`.
|
|
106
|
+
|
|
107
|
+
- The proxy issues and verifies the code. The application decides who may sign in, writes the mail and delivers it.
|
|
108
|
+
- Required settings on the provider's `Code` block: `RequestUrl` (the application endpoint the proxy posts a signed request to) and `Attestation` (how that request is signed).
|
|
109
|
+
- Use it when the people who sign in are already known to the application and a separate identity service only to send codes is not wanted.
|
|
110
|
+
|
|
111
|
+
## Anti-patterns
|
|
112
|
+
|
|
113
|
+
- A login page, password handling or token validation in the application. The proxy owns sign-in.
|
|
114
|
+
- Declaring GitHub under `OidcProviders`. It has no discovery document.
|
|
115
|
+
- A public social provider with no admission requirement on a public host. Everyone with an account gets in.
|
|
116
|
+
- A client secret in a committed configuration file.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Tenant resolution
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- How resolution works
|
|
6
|
+
- Choose a strategy
|
|
7
|
+
- Tenant registry
|
|
8
|
+
- Verify that the tenant exists
|
|
9
|
+
- When no tenant resolves
|
|
10
|
+
- Let a person choose among several tenants
|
|
11
|
+
- Anti-patterns
|
|
12
|
+
|
|
13
|
+
## How resolution works
|
|
14
|
+
|
|
15
|
+
`Cratis:AuthProxy:TenantResolutions` is an ordered list. The strategies run in order until one resolves a tenant.
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"Cratis": {
|
|
20
|
+
"AuthProxy": {
|
|
21
|
+
"TenantResolutions": [
|
|
22
|
+
{ "Strategy": "Specified", "Options": { "TenantId": "acme" } }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- The proxy removes any `x-cratis-tenant-id` the caller sent and writes the tenant it resolved itself. A caller cannot choose the tenant through a header.
|
|
30
|
+
- Arc reads `x-cratis-tenant-id` by default, so an Arc backend behind the proxy needs no tenant selector configuration. See `cratis-arc-isolate-tenant` for what the backend does with the tenant.
|
|
31
|
+
- The proxy also writes the same value to `Tenant-ID`. That copy is deprecated; read `x-cratis-tenant-id`.
|
|
32
|
+
- A tenant id may contain ASCII letters, ASCII digits and `-`, `.`, `_`, `~`, at most 256 characters. `.` and `..` on their own are not tenant ids. A value outside that rule does not resolve.
|
|
33
|
+
- In Cratis products the tenant is what people see as a workspace.
|
|
34
|
+
|
|
35
|
+
## Choose a strategy
|
|
36
|
+
|
|
37
|
+
| Situation | Strategy | Options and notes |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| One tenant per deployment | `Specified` | `TenantId`. The default for a single-tenant application. |
|
|
40
|
+
| A fixed list of customer domains | `Host` | Matches the request host against the tenant registry. |
|
|
41
|
+
| A subdomain per tenant, provisioned dynamically | `SubHost` | `ParentHost`. `acme.example.com` resolves to `acme`. No registry lookup, so add verification. |
|
|
42
|
+
| The identity provider knows the tenant | `Claim` | `ClaimType`. Matches the claim value against `SourceIdentifiers` in the registry. |
|
|
43
|
+
| The tenant is in the path | `Route` | `Pattern`, a regular expression with a named group `sourceIdentifier`, for example `^/tenant/(?<sourceIdentifier>[^/]+)`. Matches against `SourceIdentifiers`. |
|
|
44
|
+
| A person belongs to several tenants and picks one | `Selection` | `TenantsEndpoint`. See [below](#let-a-person-choose-among-several-tenants). |
|
|
45
|
+
| A fallback when nothing else resolves | `Default` | `TenantId`. Put it last. |
|
|
46
|
+
|
|
47
|
+
- `Claim` without `ClaimType` reads `http://schemas.microsoft.com/identity/claims/tenantid`, the Microsoft Entra tenant id. Set `ClaimType` for any other provider. The claim is read from the identity the proxy itself authenticated, never from a header the caller sent.
|
|
48
|
+
- `SubHost` resolves only a single label directly under `ParentHost`: `foo.bar.example.com` and `example.com` itself do not resolve.
|
|
49
|
+
- `SubHost` cannot be combined with `Session:CookieDomain`. The proxy refuses to start, because a session cookie shared across the domain would reach every tenant's host.
|
|
50
|
+
|
|
51
|
+
## Tenant registry
|
|
52
|
+
|
|
53
|
+
`Host`, `Claim` and `Route` map what they read to a tenant id through `Cratis:AuthProxy:Tenants`, keyed by tenant id:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"Cratis": {
|
|
58
|
+
"AuthProxy": {
|
|
59
|
+
"Tenants": {
|
|
60
|
+
"acme": {
|
|
61
|
+
"Domains": ["acme.example.com"],
|
|
62
|
+
"SourceIdentifiers": ["acme", "tenant-acme"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`Specified`, `Default` and `SubHost` do not use the registry.
|
|
71
|
+
|
|
72
|
+
## Verify that the tenant exists
|
|
73
|
+
|
|
74
|
+
`SubHost` accepts any single-label subdomain as a tenant id. Have the proxy ask the application whether the tenant exists before it forwards anything:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"Cratis": {
|
|
79
|
+
"AuthProxy": {
|
|
80
|
+
"TenantVerification": {
|
|
81
|
+
"UrlTemplate": "https://platform.example.com/api/tenants/{tenantId}"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- Any `2xx` status means the tenant exists and the request proceeds. Any other status or a network error serves the tenant-not-found page.
|
|
89
|
+
- `SubHost` can set its own `VerificationUrlTemplate` option, which replaces the global template for that strategy.
|
|
90
|
+
- Verification answers "does this tenant exist". It does not answer "may this person enter it". That decision is the application's: its identity details answer (`/.cratis/me`) is resolved per person and tenant, and with the default `Required` verification a refusal keeps the person out.
|
|
91
|
+
|
|
92
|
+
## When no tenant resolves
|
|
93
|
+
|
|
94
|
+
The table applies to a request that needs a tenant. The proxy's sign-in pages, invitation and registration paths and a service's `AnonymousPaths` proceed without one, and a deployment that redirects unresolved callers to an invitation lobby sends them there instead.
|
|
95
|
+
|
|
96
|
+
| Configuration | Signed-in person | Anonymous caller |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `TenantResolutions` has entries, none resolves | The no-organization page with `403` | `401` |
|
|
99
|
+
| `TenantResolutions` is empty | The request proceeds without a tenant | The request proceeds without a tenant |
|
|
100
|
+
|
|
101
|
+
An empty `TenantResolutions` is only possible when no service uses `Required` identity verification. `Required` is the default, and the proxy refuses to start with a `Required` service and no tenant resolution. A single-tenant application satisfies this with `Specified`.
|
|
102
|
+
|
|
103
|
+
## Let a person choose among several tenants
|
|
104
|
+
|
|
105
|
+
Use `Selection` when one account can belong to several tenants:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{ "Strategy": "Selection", "Options": { "TenantsEndpoint": "https://platform.example.com/api/tenants/selectable" } }
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`TenantsEndpoint` is an absolute URL the application serves. It returns the tenants of the signed-in person as a JSON array of `{ "id": "...", "name": "..." }`.
|
|
112
|
+
|
|
113
|
+
| The endpoint answers | Result |
|
|
114
|
+
|---|---|
|
|
115
|
+
| Exactly one tenant | The tenant is selected automatically. No page is shown. |
|
|
116
|
+
| Several tenants | A browser navigation gets the tenant-selection page. Any other caller gets `403`. |
|
|
117
|
+
| An empty list, `401` or `403` | The person has no tenant: see [When no tenant resolves](#when-no-tenant-resolves). |
|
|
118
|
+
| Unreachable, a timeout, another error or unparseable JSON | `503`. The person is not reported as having no tenant. |
|
|
119
|
+
|
|
120
|
+
The selection page links to `/.cratis/select-tenant?tenantId=<id>&returnUrl=<path>`. The proxy validates the chosen tenant against the endpoint before it stores the selection.
|
|
121
|
+
|
|
122
|
+
**In-app tenant switcher.** For a person with more than one tenant the proxy keeps a `.cratis-tenants` cookie: a URL-encoded JSON array of `{ id, name }` that script on the page can read.
|
|
123
|
+
|
|
124
|
+
1. Show the switcher only when the cookie lists more than one tenant. A person with one tenant never gets the cookie.
|
|
125
|
+
2. Switch by navigating the browser to `/.cratis/select-tenant?tenantId=<id>&returnUrl=<current path>`.
|
|
126
|
+
|
|
127
|
+
Every switch is validated against `TenantsEndpoint` again, so a stale cookie cannot grant a tenant the person has left. The selected tenant is also re-confirmed when `Session:TenantRevalidationInterval` (default 10 minutes) has lapsed.
|
|
128
|
+
|
|
129
|
+
## Anti-patterns
|
|
130
|
+
|
|
131
|
+
- Sending `x-cratis-tenant-id` from the frontend to switch tenant. The proxy removes it. Navigate to `/.cratis/select-tenant`.
|
|
132
|
+
- `SubHost` without tenant verification. Any subdomain then becomes a tenant id.
|
|
133
|
+
- Treating tenant verification as a membership check.
|
|
134
|
+
- Putting `Default` or `Specified` before another strategy. They always resolve, so nothing after them runs.
|
|
135
|
+
- Configuring tenant selection in the backend as well. Keep Arc's default header selector and choose the strategy in the proxy only.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cratis-choreography-run-workflow
|
|
3
|
+
description: "Use when a service that has deliberately chosen Orleans (mainly Cratis's own services, libraries and tools) needs a durable workflow that branches, waits for a person, an event or a deadline, or fans out over items, and must survive restarts: write, host and test a Choreography workflow. Not the default for applications: they build on Arc, Chronicle and Components and model a multi-step process, including waits and deadlines, with facts, reactors and a work-list read model (`cratis-chronicle-react-to-fact`). Not for resumable background steps (`cratis-orleans-jobs`)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Run a durable workflow
|
|
7
|
+
|
|
8
|
+
## Contents
|
|
9
|
+
|
|
10
|
+
- What a workflow is
|
|
11
|
+
- Is a workflow the right shape
|
|
12
|
+
- Default path
|
|
13
|
+
- Rules that keep a run correct
|
|
14
|
+
- Failure and undoing completed work
|
|
15
|
+
- Anti-patterns
|
|
16
|
+
- Verify
|
|
17
|
+
- Reference index
|
|
18
|
+
|
|
19
|
+
Choreography is the Orleans toolkit for Cratis's own services, libraries and tools, and this skill is installed by the engineering profiles. An application builds on Arc, Chronicle and Components and models a multi-step process, including waits and deadlines, with facts, reactors and a work-list read model (`cratis-chronicle-react-to-fact`); use that unless the team has deliberately chosen Orleans.
|
|
20
|
+
|
|
21
|
+
Choreography is C#-only. Read `references/csharp.md` for the code.
|
|
22
|
+
|
|
23
|
+
Read `references/<language>.md` for the project's SDK (`.csproj` → csharp); only the languages the project uses are installed.
|
|
24
|
+
|
|
25
|
+
## What a workflow is
|
|
26
|
+
|
|
27
|
+
A workflow is a business process written as data: a versioned graph of nodes, with edges between the named outlets of those nodes. The engine runs it. A run records the definition it was admitted with and every step it takes as a fact in its own journal, and it is rebuilt from that journal each time it is activated. That is why a run survives a restart, provided the journal is in durable storage.
|
|
28
|
+
|
|
29
|
+
| Node kind | What it does | Leaves through |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| Trigger | The entry point. Exactly one per graph; its output is the trigger's payload | `next` |
|
|
32
|
+
| Action | Performs a named capability in your code, normally by sending a command | `next`, or `failed` |
|
|
33
|
+
| Decision | A capability in your code that picks one of the node's own outlets | the outlets you name, or `failed` |
|
|
34
|
+
| Wait | Waits for a signal or for time to pass | `resumed` or `expired` (signal), `elapsed` (timer) |
|
|
35
|
+
| Approval | Waits for a person to approve or reject | `approved`, `rejected`, `expired` |
|
|
36
|
+
| ForEach | Fans out over a list, one branch per item, with bounded parallelism | `each` |
|
|
37
|
+
| Join | Gathers the branches of one ForEach: all, any or at least a number | `completed`, `partial` |
|
|
38
|
+
|
|
39
|
+
The graph never contains the work. An action or decision node names a capability and a version; a performer class in the service provides it. Only action and decision nodes are performed by your code; the engine handles the other kinds itself.
|
|
40
|
+
|
|
41
|
+
Each node carries a policy: how many attempts it gets, how long one attempt may take, the delay between attempts and how many times a branch may visit it. The default policy is a single attempt.
|
|
42
|
+
|
|
43
|
+
## Is a workflow the right shape
|
|
44
|
+
|
|
45
|
+
Use a workflow when the code is one of Cratis's own Orleans-based services and its process branches, waits for a person, an event or a deadline, or fans out over items. The table is for that engineering work only; an application always takes the facts, reactors and work-list path, whatever the shape of its process.
|
|
46
|
+
|
|
47
|
+
| The process is | Use |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| A straight chain of reactions, with no waiting | A reactor chain: `cratis-chronicle-react-to-fact` |
|
|
50
|
+
| A fixed set of steps that must all get done, with no decision, person or deadline in between | A job: `cratis-orleans-jobs` |
|
|
51
|
+
| One entity moving through its own lifecycle | A state machine: `cratis-orleans-jobs`, reference `csharp-state-machines.md` |
|
|
52
|
+
| A single call | The call |
|
|
53
|
+
|
|
54
|
+
A workflow costs a definition source, named capabilities and a journal. Do not pay that for a straight list of steps.
|
|
55
|
+
|
|
56
|
+
## Default path
|
|
57
|
+
|
|
58
|
+
The default is a Cratis service connected to Chronicle that keeps the journal in Chronicle: runs become events that can be read and audited, the engine maintains a run listing and an open-waits read model, and an appended event can start a run.
|
|
59
|
+
|
|
60
|
+
1. **Draw the graph.** Name every node, its kind and the outlets it can leave through. Give every signal wait and approval an expiry, and connect its `expired` outlet; a timer wait has a duration instead and leaves through `elapsed`. Connect `failed` wherever the process has an answer to a failure.
|
|
61
|
+
2. **Write one performer per capability.** A performer does one thing, normally sends one command, and reports an outcome. Make its effect safe to repeat (see the rules).
|
|
62
|
+
3. **Supply the definition.** A definition source says which workflows it owns and returns the active snapshot: workflow id, version, subject kind and graph. Performers and definition sources are discovered; you do not register them.
|
|
63
|
+
4. **Host the engine.** Switch workflows on in the Choreography host and add the Chronicle journal. Workflows are off by default.
|
|
64
|
+
5. **Trigger the run.** Declare the event that starts it, or start it from code. Give the trigger a deduplication key derived from the event or the business operation.
|
|
65
|
+
6. **Resume the run.** A person's decision resolves the approval wait on the run. A later fact resumes a signal wait when your code raises a signal with the run's correlation key.
|
|
66
|
+
7. **Follow it.** Read the run's snapshot for the authoritative status; use the run listing for screens.
|
|
67
|
+
|
|
68
|
+
Steps 1 to 3 and starting from code are in `references/csharp.md`. Step 4 with Chronicle, event triggers, schedules and signals are in `references/csharp-chronicle.md`.
|
|
69
|
+
|
|
70
|
+
**Alternative: no Chronicle.** The engine also keeps the journal in grain storage, one document per run. Use it when the service has no Chronicle, or for local work and tests with in-memory storage. Event triggers, schedules, signals and the run read models come from the Chronicle integration and are not available without it; runs are started from code and waits are resolved on the run.
|
|
71
|
+
|
|
72
|
+
## Rules that keep a run correct
|
|
73
|
+
|
|
74
|
+
- **A trigger is deduplicated.** The run id is derived from the workflow and the trigger's deduplication key, and a run lives in one scope. A repeated trigger with the same key in the same scope finds the existing run and starts nothing new. It must still pass admission against the current definition, so check the result every time. Derive the key from the event or the business operation; never from a random value or the current time.
|
|
75
|
+
- **A performer can run more than once.** The engine retries a failed attempt under the node's policy, and a restart can invoke a performer twice for one attempt. Every attempt of one node execution carries the same idempotency key. Deduplicate the external effect on the run's scope together with that key: this is the service's half of the guarantee. The key does not include the scope, so the same workflow and trigger key in two tenants give the same idempotency key; a receiver that deduplicates on the key alone drops the second tenant's effect.
|
|
76
|
+
- **Say so when the effect is unknown.** A performer that cannot tell whether its effect happened answers ambiguous. The node is not retried. Other work in the run carries on, and once nothing is in flight the run waits for reconciliation. A person can reconcile only a node in the root branch. An ambiguous node inside a ForEach branch cannot be reconciled, so the run stays in that state: never answer ambiguous inside a fan-out; report a failure there and let the `failed` path decide.
|
|
77
|
+
- **Subject kinds must match.** The trigger's subject kind must equal the definition's, or the run is not admitted. An admission that fails starts nothing and reports its rejections; check the result.
|
|
78
|
+
- **Each arrival is a visit.** There is no implicit merge. A node reached over two edges runs once per arrival, and the second arrival fails while the node allows one visit. Gather parallel paths with a ForEach and its Join; raise the visit limit only for an intended loop.
|
|
79
|
+
- **A ForEach needs exactly one Join and cannot be nested.** Each item must be an object with a unique, non-empty string `key`.
|
|
80
|
+
- **Data is small JSON.** Payloads, node outputs and signal payloads are JSON of at most 32 KiB. Pass identifiers and let the performer read the rest. Never put a secret in node configuration.
|
|
81
|
+
- **A running run keeps its definition.** Changing a workflow means returning a new version of the snapshot. Runs already admitted finish on the version they started with.
|
|
82
|
+
- **A signal is not remembered.** Raising a signal resolves the waits that are open and visible at that moment. A signal raised before its wait is visible resolves nothing. The number it returns counts the waits it found, not the runs that resumed; read the run's snapshot to confirm.
|
|
83
|
+
- **Tell the engine every scope.** A scope separates one tenant's runs from another's. After a full restart the engine only looks for waiting runs in scopes it knows, and it knows none by itself. On durable storage, name the single scope the service uses, or supply every tenant's scope; otherwise a waiting run in an untouched scope is never woken.
|
|
84
|
+
|
|
85
|
+
## Failure and undoing completed work
|
|
86
|
+
|
|
87
|
+
There is no rollback. Facts already recorded stay recorded.
|
|
88
|
+
|
|
89
|
+
- A node that fails for good leaves through `failed` when that outlet is connected, and the run continues from there. Two exceptions: an answer with an undeclared outlet or unusable output leaves through `fallback` first when that is connected, and a node reached more often than its visit limit is routed nowhere. Route `failed` to action nodes that undo the completed work, each sending one compensating command, or to an approval for a person to decide.
|
|
90
|
+
- A failure nothing handles fails the run when it happens in the root branch. Inside a ForEach branch it only ends that branch; the join counts it as a branch that did not succeed and leaves through `partial` when its mode is then not satisfied.
|
|
91
|
+
- An expired signal wait or approval leaves through `expired`. Treat it as a business outcome with its own path, not as an error.
|
|
92
|
+
|
|
93
|
+
## Anti-patterns
|
|
94
|
+
|
|
95
|
+
- Blocking, sleeping or keeping an in-memory timer in a reactor or a performer to wait for a deadline. Use a wait node.
|
|
96
|
+
- Modelling a wait as a job step that blocks.
|
|
97
|
+
- A performer that does several unrelated things. One capability, one effect, so a retry repeats only that effect.
|
|
98
|
+
- A deduplication key that differs between deliveries of the same trigger. Every redelivery then starts a new run.
|
|
99
|
+
- A performer whose effect is not safe to repeat.
|
|
100
|
+
- Leaving `expired` or `failed` unconnected where the business has an answer for that case.
|
|
101
|
+
- Reading the run listing to decide what a run does next. It can lag; the run's snapshot is authoritative.
|
|
102
|
+
- A performer that runs whatever a node's configuration names. Definitions are data; whoever can edit one could then run anything.
|
|
103
|
+
|
|
104
|
+
## Verify
|
|
105
|
+
|
|
106
|
+
1. Start a run on an in-memory host and poll its snapshot under a deadline until it reaches the expected status. Never sleep a fixed time.
|
|
107
|
+
2. Send the same trigger twice: one run, and each effect happens once.
|
|
108
|
+
3. Make a performer report a failure: once its attempts are used up the run takes the `failed` path you connected, or ends failed with the nodes behind it unreachable.
|
|
109
|
+
4. Let a signal wait or approval expire with a short expiry: the run takes the `expired` path. Let a timer wait run out: the run takes the `elapsed` path.
|
|
110
|
+
5. Against durable storage: start a run, restart the host while it waits, deliver the awaited signal or approval, and confirm one completed run and one external effect.
|
|
111
|
+
|
|
112
|
+
## Reference index
|
|
113
|
+
|
|
114
|
+
| Reference | Read when |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `references/csharp.md` | Writing the graph, performers and definition source, hosting the engine, starting and following a run, resolving an approval, or testing a workflow |
|
|
117
|
+
| `references/csharp-chronicle.md` | Keeping the journal in Chronicle, starting a run from an event, a schedule or a state machine, resuming with a signal, or reading the run listing |
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Workflows on Chronicle in C#
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Keep the journal in Chronicle
|
|
6
|
+
- Choose a trigger
|
|
7
|
+
- Start on an event
|
|
8
|
+
- Start on a schedule
|
|
9
|
+
- Start from a state machine
|
|
10
|
+
- Resume with a signal
|
|
11
|
+
- Look at runs
|
|
12
|
+
|
|
13
|
+
Reference `Cratis.Choreography.Chronicle` next to `Cratis.Choreography`. Names such as `OrderPlaced`, `OrderStateMachine`, `WorkflowNotAdmitted` and `orders.fulfil` are illustrative. Graphs, performers, definitions and starting from code are in `csharp.md`.
|
|
14
|
+
|
|
15
|
+
## Keep the journal in Chronicle
|
|
16
|
+
|
|
17
|
+
Add the Chronicle journal to the silo, in a host that already connects to Chronicle and hosts Choreography with workflows on:
|
|
18
|
+
|
|
19
|
+
```csharp
|
|
20
|
+
using Cratis.Choreography.Chronicle.Hosting;
|
|
21
|
+
using Cratis.Choreography.Hosting;
|
|
22
|
+
using Cratis.Choreography.Workflows;
|
|
23
|
+
using Cratis.Chronicle;
|
|
24
|
+
|
|
25
|
+
builder.AddCratisChoreography(new CratisChoreographyOptions
|
|
26
|
+
{
|
|
27
|
+
Workflows = true,
|
|
28
|
+
ConfigureWorkflows = workflows => workflows.Scopes.Add(WorkflowScope.Default.Value)
|
|
29
|
+
});
|
|
30
|
+
builder.Host.UseOrleans(silo => silo.AddEventSourcedWorkflows(options =>
|
|
31
|
+
{
|
|
32
|
+
options.EventStore = "orders";
|
|
33
|
+
options.NamespaceFor = scope =>
|
|
34
|
+
scope == WorkflowScope.Default ? EventStoreNamespaceName.Default : new EventStoreNamespaceName(scope.Value);
|
|
35
|
+
options.ScopeFor = @namespace =>
|
|
36
|
+
@namespace == EventStoreNamespaceName.Default ? WorkflowScope.Default : new WorkflowScope(@namespace.Value);
|
|
37
|
+
}));
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- `AddEventSourcedWorkflows` adds the workflow engine and replaces its journal with Chronicle's. Each run is an event source; its facts are appended to the event log and replayed when the run is activated.
|
|
41
|
+
- It registers with the Chronicle client: the run facts as event types, the run listing and open waits as read models, and one reactor per declared event trigger. Add it before the Chronicle client is first resolved.
|
|
42
|
+
- The runs need no grain storage, but the engine still keeps a small run index in the grain storage provider named `workflows` (`WellKnownGrainStorageProviders.Workflows`). `Workflows = true` on the Choreography host registers it.
|
|
43
|
+
- `AddEventSourcedWorkflows` configures only `EventSourcedWorkflowsOptions`. Set `WorkflowsOptions` through `CratisChoreographyOptions.ConfigureWorkflows`.
|
|
44
|
+
- `Scopes` names the scopes the engine looks in for waiting runs after a full restart; it knows none by itself, and the default scope is not added for you. The sample names the default scope, which is enough when every run is in the default namespace. When runs live in more namespaces, name the scope of every one, or register an `IWorkflowScopeSource` that returns them: see Scopes and tenants in `csharp.md`. A run waiting on a timer in a scope that is not named is never woken.
|
|
45
|
+
- There is also an `IServiceCollection` overload: `builder.Services.AddEventSourcedWorkflows(...)`.
|
|
46
|
+
|
|
47
|
+
| Option | Default | Meaning |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| `EventStore` | `Default` | The event store the facts are appended to |
|
|
50
|
+
| `NamespaceFor` | the scope's value | Maps a `WorkflowScope` onto an event store namespace |
|
|
51
|
+
| `ScopeFor` | the namespace's value | Maps a namespace back onto a scope |
|
|
52
|
+
| `ReadModels` | `true` | Maintain the run listing and the open waits |
|
|
53
|
+
| `OnEvent<TEvent>(...)` | none | Declare an event that admits a run |
|
|
54
|
+
| `Schedule(...)` | none | Declare a schedule that starts a run |
|
|
55
|
+
|
|
56
|
+
The default mapping uses the scope's value as the namespace name and the reverse, exactly as written. `WorkflowScope.Default` is `default` while Chronicle's default namespace is `Default`, so with the default mapping they are two different scopes: a run started from an event in the `Default` namespace is not found under `WorkflowScope.Default`. Either map the two onto each other in both functions, as the sample does, or never hardcode a scope and always take it from the namespace through `ScopeFor`. Set both functions whenever namespace names differ from scope values.
|
|
57
|
+
|
|
58
|
+
The node work of a run is started as jobs in the event store and in the namespace its scope maps to; `WorkflowsOptions.JobsScope` is not used.
|
|
59
|
+
|
|
60
|
+
## Choose a trigger
|
|
61
|
+
|
|
62
|
+
| Trigger | How |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| From code | `IWorkflows.Start(...)` |
|
|
65
|
+
| When an event is appended | `options.OnEvent<TEvent>(workflow, (@event, context) => trigger)`; returning `null` skips the event |
|
|
66
|
+
| When a state machine enters a state | `this.StartWorkflow(workflow)` from the state's `OnEnter` |
|
|
67
|
+
| On a schedule | `options.Schedule(new WorkflowSchedule(name, scope, workflow, cron))` |
|
|
68
|
+
|
|
69
|
+
These start runs. A signal does not start a run; it resumes one that is waiting. For every starting trigger, the deduplication key decides whether a run is started again, and the definition's subject kind must equal the trigger's.
|
|
70
|
+
|
|
71
|
+
## Start on an event
|
|
72
|
+
|
|
73
|
+
Prefer this to writing your own reactor that calls `IWorkflows.Start`: the reactor is registered for you and the event's namespace becomes the run's scope through `ScopeFor`.
|
|
74
|
+
|
|
75
|
+
```csharp
|
|
76
|
+
using Cratis.Choreography.Workflows;
|
|
77
|
+
using Cratis.Choreography.Workflows.Contracts;
|
|
78
|
+
using Cratis.Choreography.Workflows.Triggers;
|
|
79
|
+
|
|
80
|
+
options.OnEvent<OrderPlaced>("orders.fulfil", (@event, context) => new WorkflowTrigger(
|
|
81
|
+
WorkflowTriggerKind.Manual,
|
|
82
|
+
"orders-events",
|
|
83
|
+
$"order-placed:{context.SequenceNumber.Value}",
|
|
84
|
+
new("order", @event.OrderId),
|
|
85
|
+
WorkflowContractReference.Any,
|
|
86
|
+
"{}",
|
|
87
|
+
[],
|
|
88
|
+
@event.OrderId,
|
|
89
|
+
WorkflowCausationKey.None,
|
|
90
|
+
WorkflowActor.System,
|
|
91
|
+
context.Occurred));
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- Derive the deduplication key from the event, so a redelivered or replayed event finds its run instead of starting another.
|
|
95
|
+
- The eighth argument is the correlation key. A later signal reaches the run through it.
|
|
96
|
+
- The engine records the trigger kind in the run's history and does not act on it.
|
|
97
|
+
|
|
98
|
+
## Start on a schedule
|
|
99
|
+
|
|
100
|
+
```csharp
|
|
101
|
+
using Cratis.Choreography.Chronicle.Workflows;
|
|
102
|
+
|
|
103
|
+
options.Schedule(new WorkflowSchedule(
|
|
104
|
+
"nightly-reconcile", WorkflowScope.Default, "orders.reconcile", CronExpression.Parse("0 6 * * 1-5")));
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- A cron expression has five space-separated fields, evaluated in UTC: minute, hour, day of month, month and day of week (0-6, with 7 also Sunday). A field is `*`, a number, a range `a-b`, a step `*/n`, `a-b/n` or `a/n` (from `a` to the end of the field's range), or a comma-separated list of those. Names such as `MON` are not supported. The wrong number of fields, text that is not a number, a value outside the field's range or a step below one throws `InvalidCronExpression`; a number too large for an integer throws `OverflowException` instead.
|
|
108
|
+
- The schedule names its scope. `WorkflowScope.Default` here relies on the mapping shown under Keep the journal in Chronicle.
|
|
109
|
+
- The run's subject kind is `schedule`, so the workflow's definition must use `schedule` as its subject kind.
|
|
110
|
+
- The deduplication key is the schedule name and the minute it fell due, so several silos admit one run between them.
|
|
111
|
+
- Minutes that fell due while no silo was running are started when the first one is, up to ten minutes back. Older ones are skipped.
|
|
112
|
+
|
|
113
|
+
## Start from a state machine
|
|
114
|
+
|
|
115
|
+
```csharp
|
|
116
|
+
using Cratis.Choreography.Chronicle.Workflows;
|
|
117
|
+
using Cratis.Choreography.StateMachines;
|
|
118
|
+
|
|
119
|
+
public class Approved : State<OrderModel>
|
|
120
|
+
{
|
|
121
|
+
public override async Task<OrderModel> OnEnter(OrderModel state)
|
|
122
|
+
{
|
|
123
|
+
var admission = await this.StartWorkflow("orders.after-approval");
|
|
124
|
+
if (!admission.Admitted)
|
|
125
|
+
{
|
|
126
|
+
throw new WorkflowNotAdmitted(admission.Run, admission.Rejections);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return state;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- The machine's type name is the subject kind, so the definition's `Subject` must be exactly that name: `"OrderStateMachine"` when the machine is `OrderStateMachine`. A definition written for another trigger, such as `orders.fulfil` with the subject `order`, is refused; give the hook a workflow whose definition has the machine's type name as its subject. The machine's key is the subject id and the run's correlation.
|
|
135
|
+
- `StartWorkflow` returns the admission. Check `Admitted` every time and decide in the state what a refusal means; the sample throws. Never discard the result: a refused admission starts nothing.
|
|
136
|
+
- The default deduplication key is the machine type, the state and the machine's key: entering the state again finds the first run. Pass `deduplication` with a key that is distinct for every entry that should start a new run. `payload` and `scope` are optional.
|
|
137
|
+
- For an event-sourced state machine started without a `scope` argument, the subject id and correlation are the event source id, and the scope comes from the machine's namespace through `ScopeFor`. Passing `scope` switches that off: the subject id and correlation are then the machine's full key. A machine that is not event sourced uses the default scope unless you pass one.
|
|
138
|
+
- A state whose machine is not a grain throws `StateMachineIsNotAGrain`.
|
|
139
|
+
|
|
140
|
+
## Resume with a signal
|
|
141
|
+
|
|
142
|
+
A `Wait` node of kind `signal` holds the run until a signal arrives with the matching correlation and contract. Raise it from the code that learns the awaited thing happened, for example a reactor on the event:
|
|
143
|
+
|
|
144
|
+
```csharp
|
|
145
|
+
using Cratis.Choreography.Chronicle.Workflows;
|
|
146
|
+
using Cratis.Choreography.Workflows.Contracts;
|
|
147
|
+
|
|
148
|
+
var scope = options.Value.ScopeFor(context.Namespace);
|
|
149
|
+
var found = await signals.Signal(
|
|
150
|
+
scope, orderId, new WorkflowContractReference("payment-received", 1), "{}", "payments");
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
- `signals` is the injected `IWorkflowSignals`, `options` the injected `IOptions<EventSourcedWorkflowsOptions>` and `context` the reactor's `EventContext`.
|
|
154
|
+
- The scope must be the one the run was started in. A run started by an event trigger got its scope from the event's namespace through `ScopeFor`; derive the signal's scope the same way.
|
|
155
|
+
- It resolves, through the `resumed` outlet, every open signal wait in the scope whose correlation equals the one given and whose contract equals the one given or is `WorkflowContractReference.Any`.
|
|
156
|
+
- It returns how many matching waits it found in the read model and tried to resolve. That is not a count of resumed runs: a wait that has since closed, or a payload that is not valid JSON of at most 32 KiB, resolves nothing and is still counted. Do not treat a positive number as confirmation; read the run's snapshot.
|
|
157
|
+
- The waits are found in the open-waits read model, which can lag the run. A signal raised before its wait is visible there resolves nothing and is not remembered. A return value of zero means no wait was found; decide in the caller what that means for the process.
|
|
158
|
+
- Signals need `ReadModels` on.
|
|
159
|
+
|
|
160
|
+
## Look at runs
|
|
161
|
+
|
|
162
|
+
- The `WorkflowRun` read model lists each run's id, workflow, version, subject, correlation, status and activity times. The `OpenWorkflowWait` read model lists the waits that are open. Both are in `Cratis.Choreography.Chronicle.Workflows.Listing` and can lag; use them for screens.
|
|
163
|
+
- The run stays authoritative: `IWorkflows.GetRun(scope, run).GetSnapshot()` answers from the journal.
|
|
164
|
+
- The run's own events in the event log show every step it took, in order.
|