@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
|
@@ -24,7 +24,8 @@ A concept names a value; this skill decides **who chooses a new value, how it is
|
|
|
24
24
|
| --- | --- |
|
|
25
25
|
| A reference to existing state (the order to cancel) | A command input. Never generate a replacement: the caller's choice is the point. |
|
|
26
26
|
| New and owned by the application (the identity of what is being created, a code, a token) | Generate it on the server through the concept's own factory. |
|
|
27
|
-
| Derived from an input, the same every time | A name-based UUID or a digest, never a random value. |
|
|
27
|
+
| Derived from an input, the same every time | A name-based UUID or a digest, never a random value, and only from stable, non-sensitive input: anyone who knows the namespace and the input can recompute it. When the input is personal data or a secret and the value is an event-source identity, allocate an opaque identity once, store it, reuse it for that entity, and keep the input in protected event content (a property marked as personal data). An event-source identity is stored in plain text and is never protected by Chronicle's personal-data handling, even where an SDK accepts a personal-data marker on its type. |
|
|
28
|
+
| The identity of something a retried request creates | The identity chosen on the first attempt, never a fresh value per attempt. Reach it by one of: the caller sends the same identity on every retry; it is derived only from stable, non-sensitive input; or the server allocates an opaque identity once under a caller-supplied operation key and every attempt uses the stored one. For the last, claim the key atomically (for example a conditional insert that, on conflict, rereads the stored identity) and append only with the identity that won; an unchecked read followed by an unconditional write lets overlapping attempts store different identities and both append, because the empty-source check covers only the source being appended to. Append the create requiring the whole event source to be empty, because the automatic guard covers only server-generated values. A retry after an attempt that committed is then rejected with a concurrency violation and appends nothing; a retry after an attempt that did not commit appends. A keyed append (C# only) reports a retry as already appended only when the key and the whole event match (type, generation, content, event source, stream and subject), and as already appended after erasure when that event was since erased; a different event under the same key is refused as a key conflict. Keyed appends are refused inside a unit of work, so they cannot carry the events a command returns or stages: append immediately, supply the empty-source scope on that append yourself, and never put personal data in the key. Add a unique constraint on a natural key only when that key must stay unique across identities. |
|
|
28
29
|
| A gap-free number (invoice numbers) | A coordinated counter. No generator produces consecutive values. |
|
|
29
30
|
|
|
30
31
|
Whether an identity is an event-source identity or a plain one is a declaration choice (`cratis-fundamentals-concept`); generation is the same for both.
|
|
@@ -42,9 +43,9 @@ Whether an identity is an event-source identity or a plain one is a declaration
|
|
|
42
43
|
## Default path
|
|
43
44
|
|
|
44
45
|
1. Make the identity concept self-generating with a random UUID. Choose another strategy only for a stated need in "Choose a strategy".
|
|
45
|
-
2. Ask for the new value as a server-generated handler parameter and return it as the command response. (C# only; where the SDK has none, call the concept's factory inside the handler and return the value.)
|
|
46
|
-
3.
|
|
47
|
-
4. Check: the request contract has no field for
|
|
46
|
+
2. Ask for the new value as a server-generated handler parameter and return it as the command response. (C# only; where the SDK has none, call the concept's factory inside the handler and return the value.) When a retry must reach the same identity, do not generate a fresh value per attempt: reach it as "Who chooses the value" describes for retried creates, and take a caller-supplied identity as a command input.
|
|
47
|
+
3. For a generated value, pin it by name in specs and assert that the response and the appended event use it. (C# only; where pins do not exist, read the value from the response and assert its format.) For an identity a retry reuses, send the same request twice without a pin that forces the same identity (allow generation instead where the handler has a generated parameter), and assert that the first appended the expected create on the expected event source and that the second appended nothing.
|
|
48
|
+
4. Check: the request contract has no field for a server-generated value, a caller-supplied identity is a command input the server never replaces, and the spec asserts the exact value or the format.
|
|
48
49
|
|
|
49
50
|
Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Node server `package.json` → typescript, `*.kt` → kotlin, `*.java` → java, `go.mod` → go, `mix.exs` → elixir); only the project's languages are installed.
|
|
50
51
|
|
|
@@ -58,7 +59,7 @@ Python has no application SDK: call the owning service's command through its HTT
|
|
|
58
59
|
| UUID column that should append to indexes | Time-ordered UUID (v7) | Reveals creation time |
|
|
59
60
|
| Sortable string identity | ULID | 80 random bits; reveals creation time |
|
|
60
61
|
| Identity that names its kind in logs and URLs | TypeID with a prefix | Time-ordered; prefix rules apply |
|
|
61
|
-
| Same input must give the same identity | Name-based UUID (v5) | Guessable by anyone who knows namespace and name |
|
|
62
|
+
| Same input must give the same identity | Name-based UUID (v5) | Guessable by anyone who knows namespace and name; only from stable, non-sensitive input. For an event-source identity whose input is personal data or a secret, allocate an opaque identity once and keep the input in protected event content |
|
|
62
63
|
| Compact URL-safe string | NanoID with defaults | 21 characters, 126 random bits |
|
|
63
64
|
| Code people read or type | Pattern, or NanoID with a look-alike-free alphabet | Few random bits: back it with a uniqueness check; never an identity |
|
|
64
65
|
| Numeric ticket | Integer in an inclusive range | Not a sequence, low entropy |
|
|
@@ -116,7 +117,7 @@ Not every SDK ships every item below. Your language reference names the exact AP
|
|
|
116
117
|
|
|
117
118
|
## Done when
|
|
118
119
|
|
|
119
|
-
- Every new identity, code or token is produced by its concept's factory with a strategy chosen from the table above
|
|
120
|
+
- Every new identity, code or token the server chooses is produced by its concept's factory with a strategy chosen from the table above; caller-selected references and caller-supplied identities are inputs the server never replaces, and a retried create reuses its first attempt's identity.
|
|
120
121
|
- No value that must be unguessable comes from a non-cryptographic source.
|
|
121
|
-
- Specs fix
|
|
122
|
+
- Specs fix each generated value (or the clock and tenant) and assert the exact value or its format; a create a retry may repeat is tested, without a pin that forces the reused identity, to append once on the expected source and nothing the second time.
|
|
122
123
|
- Each shared concept sits at the lowest level that contains every slice using its meaning.
|
|
@@ -47,6 +47,7 @@ public record OrderId(Guid Value) : EventSourceId<Guid>(Value), IGeneratable<Ord
|
|
|
47
47
|
- Implement one contract, not both. When both exist, callers, Arc included, use the context form and never call the plain one; the two do not fall back to each other.
|
|
48
48
|
- Generic code calls the contract: `static T Create<T>() where T : IGeneratable<T> => T.New();`.
|
|
49
49
|
- A value derived from an input (a name-based UUID, a digest) gets an input-taking factory such as `For(input)` or `From(input)`, never `New()`.
|
|
50
|
+
- Placement: a concept only one slice uses stays in that slice's folder and namespace; it need not sit in the slice's main file. Once it is shared (see "Where a shared value lives" in this skill's `SKILL.md`), move it to the lowest level that all its users share. Give a concept its own file named after it, such as `OrderId.cs`; its `ConceptValidator<T>` may share that file.
|
|
50
51
|
- Outside a command handler (a reactor, a seeding job) call `OrderId.New()` directly. Inside a model-bound command handler, ask for a generated parameter instead (see Generate in a command handler).
|
|
51
52
|
|
|
52
53
|
## Generators
|
|
@@ -189,7 +190,7 @@ A generated parameter is `GeneratedValueFreshness.Guarded` by default, and `Crat
|
|
|
189
190
|
- Supplying another scope for a guarded target (a narrowed scope, a tail revision, `ConcurrencyScope.None`; a whole-source `BeforeFirst` merges) fails with `ConflictingConcurrencyScopes` before anything is appended.
|
|
190
191
|
- A custom `IUnitOfWork` that cannot register enrollment contributors makes commands with guarded parameters fail with `FreshIdentifierGuardRequiresEnrollmentContributors`.
|
|
191
192
|
- Let a rejection from `eventLog.Transactional.AppendMany` escape `Handle()`; catching it can commit earlier events.
|
|
192
|
-
- Nested commands
|
|
193
|
+
- Nested commands: a nested handler's own scope cannot narrow an outer generated id's whole-source guard. Its returned events commit when the outer command's pipeline completes normally, so inspect the nested result and propagate a rejection. An explicit aggregate `Commit()` inside a nested handler is the exception: where permitted it completes the shared transaction at once, and a later outer rejection does not roll those events back. It is refused with `NestedEarlyCompletionUnderReadProtection` when the nested command or its parent enforces read protection. Do not commit an aggregate inside a nested command. `cratis-arc-declare-command`, `references/csharp-chronicle.md`, section "Transaction boundary", teaches the boundary.
|
|
193
194
|
- Once a guarded target is enrolled, the requirement stays on the unit after that invocation ends, so a later unscoped write to the same source inherits it. A value generated by a finished nested invocation but never targeted adds no requirement.
|
|
194
195
|
- The guard stops identity reuse, not duplicates under different ids. Protect a natural key with a Chronicle constraint.
|
|
195
196
|
|
|
@@ -40,7 +40,7 @@ Do not use it when the consumer needs one chosen service. Inject that service's
|
|
|
40
40
|
- **Reflected members:** a provider without generated records (the plain providers of an explicit universe, or the reflection fallback) contributes every non-interface, non-abstract type its assemblies define. That includes non-public and generic classes, which an instance set cannot resolve, so filter such a set or register what it must resolve.
|
|
41
41
|
- **Closed generic contracts:** generated records key a generic contract only by its open definition, and lookups match keys exactly. A set or query for a closed contract, such as the handlers of one message type, therefore holds only implementations that were also reflected: those the conventions bind and those from reflected providers. Others, for example an ignore-convention class registered by hand, are silently missing. For a complete set, query the open definition and keep the types assignable to the closed contract.
|
|
42
42
|
- **Set semantics:** a contract is never a member of its own set, each implementation appears once, and the order means nothing.
|
|
43
|
-
- **Contributing assemblies:** an assembly
|
|
43
|
+
- **Contributing assemblies:** an assembly compiled with the generator registers its own provider, which adds its types to all types and the assembly to the contributing assemblies. A project's generator also adds binding-only implementations from some referenced assemblies whose names start with `Cratis` (ordinary runtime references, not analyzers, build tasks, aliased references or assemblies that depend on Roslyn): the public classes it binds by convention or as themselves. Contract and full-name lookups find these, but they enter all types and the contributing assemblies only through a provider of their own assembly, and an ignore-convention class appears only through that provider. Being found is not being resolvable: an instance set resolves each implementation as itself, so one that is bound only under its interface makes enumeration fail. Implementations from any other referenced assembly do not enter generated discovery, and adding a package prefix does not change that. An external interface or base class that a local implementation fulfils is still indexed as its contract and found by full name. To include another assembly's implementations, compile it with the generator or register a hand-written provider that supplies its types. Every contributor must be loaded, or reachable through the references of loaded assemblies, when the universe is built.
|
|
44
44
|
- **Universe lifetime:** the default universe is built once for each distinct set of generated providers and shared by every container in the process. If registering discovery again finds new providers, a new universe is built. An existing universe never grows.
|
|
45
45
|
- **Instance set enumeration:** the type list is fixed when the set is created. The set keeps the service provider that resolved it: the root container for a singleton consumer, or the operation's scope for a consumer resolved in that scope, even a transient one. Each enumeration resolves every type again, as itself, from that provider. Resolve a scope-bound consumer inside the operation's scope and finish enumerating before the scope ends. Without a marker an implementation is transient, so every enumeration creates new instances; when an operation must reuse them, materialize the set once. Enumeration fails if a discovered type has no registration as itself.
|
|
46
46
|
- **Lifetimes:** no marker means transient, the singleton marker means one instance per container, and the scoped marker means one instance per scope. Put the marker on the implementation class itself, because a marker on a base class is not inherited. A singleton consumer's instance set resolves from the root container, so it must not enumerate scoped implementations: scope validation rejects them, and without validation they are silently shared.
|
|
@@ -71,11 +71,11 @@ Consume:
|
|
|
71
71
|
- **Instance set:** enumerates a resolved instance of every implementation of a closed contract. This is the default for acting on all implementations.
|
|
72
72
|
- **Type set:** enumerates the implementation types of a closed contract without constructing them. Use it for metadata, or when a long-lived consumer must resolve each type from the scope of the current operation.
|
|
73
73
|
- **Known instance set:** a fixed set (empty, or given instances) that replaces discovery in a unit spec.
|
|
74
|
-
- **Type universe: all types:** every
|
|
74
|
+
- **Type universe: all types:** every type a provider defines, including non-implementations. Binding-only implementations from referenced Cratis assemblies are not in it. Use it for custom scans the contract queries cannot express.
|
|
75
75
|
- **Type universe: find multiple:** returns the implementations of a contract given as a type: an interface, a base class or an open generic definition. An open generic definition matches implementations of every closed form; query it and filter by assignability for a complete closed generic set.
|
|
76
76
|
- **Type universe: find single:** takes the same kinds of contract and returns the one implementation, or nothing when none exists. It fails with *multiple types found* when there is more than one. Use it for an optional single provider.
|
|
77
77
|
- **Type universe: find by full name:** finds a type by its namespace-qualified name, without the assembly name. It fails with *unable to resolve type by name* when no type has that name, and with an invalid-operation error when several discovered types share it. Use it to turn a stored or transmitted type name back into a type.
|
|
78
|
-
- **Type universe: assemblies:** the assemblies that
|
|
78
|
+
- **Type universe: assemblies:** the assemblies that providers supplied. An assembly that contributes only binding-only implementations is not listed. Use it in diagnostics.
|
|
79
79
|
- **Type universe: discovery mode:** one of *generated*, the normal case; *explicit*, when the caller supplied assembly providers; *reflected*, a fallback used only when no generated provider exists, which does not happen while Fundamentals itself is referenced; and *unknown*, when a custom universe implementation does not report a mode.
|
|
80
80
|
|
|
81
81
|
Register in the host:
|
package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
- Enumeration throws
|
|
8
8
|
- A plain injected collection is empty
|
|
9
9
|
- The naming convention bound the wrong class, or none
|
|
10
|
+
- A service has the wrong lifetime
|
|
10
11
|
- The generator fails the build
|
|
11
12
|
- Several hosts or serializers disagree
|
|
12
13
|
|
|
@@ -29,6 +30,9 @@ First establish whether the type is missing from the universe, then whether it i
|
|
|
29
30
|
- **The universe was captured too early:** `Types.Instance`, or a `Types` you constructed before the providers were registered, misses later providers. Use the container's `ITypes`, or `TypesServiceCollectionExtensions.CurrentTypeUniverse()`.
|
|
30
31
|
- **Trimmed or ahead-of-time publish:** an assembly that only discovery reaches, and that no compiled code references, can be trimmed away. Discovery cannot recover it. Keep it with `<TrimmerRootAssembly Include="Contoso.Plugins" />` or a `DynamicDependency` attribute.
|
|
31
32
|
- **Explicit universe:** only the assemblies its providers supply are present. `PackageReferencedAssemblies` includes only names that start with a configured prefix (`Cratis` by default). Call `AddAssemblyPrefixesToInclude` before the universe is built.
|
|
33
|
+
- **A type from another library:** generated discovery includes another assembly's implementations only through a provider: its own generated provider, when it was compiled with the generator, or a hand-written one. Without one, a referenced assembly whose name starts with `Cratis` adds only binding-only implementations through your project's provider: the public classes the conventions bind. Contract and full-name lookups find them, but an `[IgnoreConvention]` class from it is missing, its types are not in `All`, and the assembly is not listed in `Assemblies`. Aliased references, analyzer or build-task assets and assemblies that depend on Roslyn add nothing. `AddAssemblyPrefixesToInclude` changes none of this, because it configures only `PackageReferencedAssemblies`. To include another library:
|
|
34
|
+
- **Default universe (Arc, or a plain host that calls `AddTypeDiscovery()` without providers):** pass a hand-written provider to `GeneratedTypeDiscoveryRegistry.Register` before type discovery and the conventions run. `AddCratisArc` on an application builder runs them at once; the `IHostBuilder` overload runs them when the host builds its services. A universe built from explicit providers ignores the registry. Register the implementations as themselves unless the provider supplies self bindings (see Explicit universe and custom providers in [csharp.md](csharp.md)).
|
|
35
|
+
- **Plain host only:** call `PackageReferencedAssemblies.Instance.AddAssemblyPrefixesToInclude("Contoso")` before anything initializes that provider, pass `[ProjectReferencedAssemblies.Instance, PackageReferencedAssemblies.Instance]` to `AddTypeDiscovery`, and register the implementations as themselves. The prefix matches the runtime library (package) name, and the provider loads the assembly by that name. Confirm that `DiscoveryMode` is `Explicit` and that `Assemblies` lists the assembly; if it does not, use a hand-written provider. Arc works from the default universe it captures during setup, so this route does not work there.
|
|
32
36
|
|
|
33
37
|
## Enumeration throws
|
|
34
38
|
|
|
@@ -64,6 +68,10 @@ Binding happens only when all of these hold:
|
|
|
64
68
|
|
|
65
69
|
With a second implementation there is no binding at all. Either mark the extra implementations `[IgnoreConvention]` or register the intended one explicitly. An existing registration always wins, because the convention skips services that are already registered. Make explicit registrations before the convention setup runs: before `AddCratisArc`, or before `AddBindingsByConvention` in a plain host.
|
|
66
70
|
|
|
71
|
+
## A service has the wrong lifetime
|
|
72
|
+
|
|
73
|
+
When a class carries both `[Singleton]` and `[Scoped]`, singleton wins wherever Cratis derives the lifetime from the markers, for convention binding and self binding alike, and nothing reports the conflict at build time or at startup. Keep only the marker you intend, or remove both for a transient service. A hand-written provider's binding records are different: each is registered with the lifetime the record declares, whatever markers the class carries. The markers apply only to registrations Cratis adds: a service type the application has already registered keeps that registration and its lifetime. The markers themselves are in Lifetimes and markers in [csharp.md](csharp.md).
|
|
74
|
+
|
|
67
75
|
## The generator fails the build
|
|
68
76
|
|
|
69
77
|
The generator skips types nested inside a generic type, and it carries through the experimental-diagnostic identifiers of referenced types. If the generated provider fails on either case, the analyzer that ran is not the one from the `Cratis.Fundamentals` package the project references. Align the two first, for example by removing a stale generator project reference. Never edit or suppress errors in the generated provider.
|
|
@@ -122,8 +122,8 @@ Inject `ITypes` (namespace `Cratis.Types`) for queries that the sets cannot expr
|
|
|
122
122
|
| `FindMultiple<T>()`, `FindMultiple(Type)` | Implementations of an interface or base class. Pass an open generic definition such as `typeof(IHandle<>)` to match every closed form. |
|
|
123
123
|
| `FindSingle<T>()`, `FindSingle(Type)` | The one implementation, or `null` when there is none. Throws `MultipleTypesFound` when there are several. |
|
|
124
124
|
| `FindTypeByFullName(string)` | A type by namespace-qualified name, without the assembly name. Throws `UnableToResolveTypeByName` when no type has that name. |
|
|
125
|
-
| `All` | Every
|
|
126
|
-
| `Assemblies` | The
|
|
125
|
+
| `All` | Every type a provider defines. Excludes binding-only implementations from referenced `Cratis` assemblies, which contract and full-name lookups still find. |
|
|
126
|
+
| `Assemblies` | The assemblies that providers supplied. An assembly that contributes only binding-only implementations is not listed. |
|
|
127
127
|
| `DiscoveryMode` | `TypeDiscoveryMode.Generated`, `Explicit`, `Reflected` or `Unknown`. |
|
|
128
128
|
|
|
129
129
|
Outside a container, call `TypesServiceCollectionExtensions.CurrentTypeUniverse()`. It returns the same instance that `AddTypeDiscovery()` registers. Avoid `Types.Instance`, which is a snapshot taken the first time anything touches it, and avoid `new Types()`, which repeats the build.
|
|
@@ -159,6 +159,9 @@ Arc's generator can write the registrations from `NewX` constructors, with `//cr
|
|
|
159
159
|
## Edge cases
|
|
160
160
|
|
|
161
161
|
- **Your own container:** implement `di.ScopeFactory` (`NewScope(ctx) (di.Scope, error)`), where a `di.Scope` has `Resolve(ctx, di.Key) (any, error)` and `Close(ctx) error`. Arc and Chronicle accept it, and `di.Resolve[T]` validates what it returns. Optionally implement `di.Catalog` (`Contains(di.Key) bool`) so missing services are reported at startup, not at first use.
|
|
162
|
+
- **An application that uses `fx`, `dig` or `samber/do`:** Fundamentals publishes no adapter module for another container. Its repository holds example recipes for these three, which are unpublished: copy the pattern into the application and never add the recipes module as a dependency.
|
|
163
|
+
- **`fx` (prefer this):** keep the Fundamentals container and let `fx` own only its shutdown. Give `fx.Provide` a constructor that takes `fx.Lifecycle` and the configured `*container.Registry`, and returns `(di.Provider, error)`. It calls `registry.Build` with every option the application needs, including `container.WithContextGuard(capture)` when scopes are guarded (a bare `registry.Build()` drops the guard without an error), returns the build error before touching the lifecycle, and only then appends `fx.Hook{OnStop: provider.Close}` and returns the provider. Lifetimes, ownership and cleanup stay as this reference describes. Resolve services from an `OnStart` hook, never while `fx` constructs its graph, and append the hooks that use those services after the provider's hook, so they stop before the provider closes.
|
|
164
|
+
- **`dig` or `samber/do` as the engine:** each bridge creates its own, separate `dig` container or `do` injector and resolves only the bindings passed to it. Copying a recipe does not expose what the application has already registered in its own container: pass the bridge a binding only for a service that outlives the bridge. The bridges accept only borrowed singletons, built with `di.NewBinding(di.Singleton, di.Borrowed, factory, deps...)`, and reject owned, scoped and transient bindings. They never close a resource: cleanup stays with whoever already owns the service, after everything that resolves from the bridge has stopped, so never close a forwarded service a second time. They have no context guards. Such a bridge passes `ditest.RunResolver` only, not `ditest.RunProvider`. When services need scopes, ownership or cleanup, host the Fundamentals container instead.
|
|
162
165
|
- **Checking a registration:** the registry and the provider implement `Contains(di.KeyFor[T]())`. `key, err := di.KeyOf(reflectType)` builds a key from a runtime type.
|
|
163
166
|
- **Verifying a custom provider:** in a `_test.go` file, run `ditest.RunProvider` and `ditest.RunDeclaredGraph` from `github.com/cratis/fundamentals.go/dependencyinjection/ditest` with a function that builds your provider from a `ditest.Config`. `ditest.RunResolver` checks lookup only.
|
|
164
167
|
- **Writing a generator:** `dependencyinjection/bindingtypes` plans registrations from type-checked packages (`ReadDirectives`, `Analyze(pkgs, Config) Plan`) without running code or writing files. An application uses Arc's generator, which is built on it.
|
|
@@ -89,7 +89,7 @@ Every building block, with when to reach for it. "Code:" names the skill that re
|
|
|
89
89
|
- **Productions** — none, one fact, several facts, conditional facts (only when a condition holds) or facts on several event sources from one decision.
|
|
90
90
|
- **Stream routing** — a command can direct its facts to a named event source type and stream.
|
|
91
91
|
- **Custom body** — when values or rules cannot be stated declaratively; it fills fact values and does not replace the declared productions.
|
|
92
|
-
- **External system work** — an operation only documents the dependency and never executes; a system ability invoked from a reaction
|
|
92
|
+
- **External system work** — an operation only documents the dependency and never executes; a system ability invoked from a reaction executes where the target admits it.
|
|
93
93
|
|
|
94
94
|
### Consistency choices
|
|
95
95
|
|
|
@@ -97,6 +97,7 @@ Every building block, with when to reach for it. "Code:" names the skill that re
|
|
|
97
97
|
- **UI that follows changes** — an observable query.
|
|
98
98
|
- **Unique value or once-only fact** — a constraint: a unique value across event sources (one or several properties, shared by several event types, released by a later fact, case-insensitive, custom message) or one occurrence of an event type per source. Code-first only: keeping every value a source claimed, and scoping to a source type, stream type or stream. Code: `cratis-chronicle-constrain-append`.
|
|
99
99
|
- **Rule over prior state while writers race** — a decision read folds decision state from facts and guards the append: a competing matching append makes it fail with nothing written. Code-first only: a concurrency scope narrowing or widening the guard (source, source type, stream type, stream ID, event types). Code: `cratis-chronicle-protect-decision`.
|
|
100
|
+
- **Values that must agree on one screen** — views and instances of a view advance independently; project them into one instance, read once. After a write: `cratis-platform-deliver-slice`, `references/eventual-consistency.md`.
|
|
100
101
|
- **Rule across two keys** (a course's capacity and a student's limit) — one decision read per key and one atomic append with a fact on each history that changes.
|
|
101
102
|
- **Editing conflict** — guard with the version the person saw, not a fresh read that hides the intervening change. Code-first only.
|
|
102
103
|
- **Limit per period or process within one source** — read and guard only that stream (stream type plus stream ID) instead of the whole history; also how to keep a hot, long history cheap. Code-first only.
|
|
@@ -121,7 +122,7 @@ Every building block, with when to reach for it. "Code:" names the skill that re
|
|
|
121
122
|
- **Effects** — record a fact that needs no state read, invoke a command when a decision remains (it can refuse), or ask an outside system's ability and branch on its answer, failure or declared outcome.
|
|
122
123
|
- **Run-as identity** — a reaction that invokes an authorization-gated command states the system identity and roles it acts with.
|
|
123
124
|
- **Refusal handling** — per refusal kind (validation, constraint, a named constraint, authorization, or any validation or constraint refusal): acknowledge and move on, or record a fact.
|
|
124
|
-
- **To-do list** — a read model of pending work the automation drains
|
|
125
|
+
- **To-do list** — a read model of pending work the automation drains. The closing fact removes an item once projected, so the list only nominates candidates; the command rechecks current state before acting.
|
|
125
126
|
- **Repeated delivery** — the same fact can arrive again; the second delivery must not repeat the business effect. Code: `cratis-chronicle-react-to-fact`.
|
|
126
127
|
- **Background work that is not a fact** — an application trigger stores durable work outside the event log, delivered at least once; an effect receipt makes a repeat return its recorded outcome instead of appending. Not a projection input.
|
|
127
128
|
|
|
@@ -133,8 +134,9 @@ Every building block, with when to reach for it. "Code:" names the skill that re
|
|
|
133
134
|
|
|
134
135
|
### Long-running behavior
|
|
135
136
|
|
|
136
|
-
- **
|
|
137
|
-
- **
|
|
137
|
+
- **Process over time** — Cratis has no saga, process manager or workflow building block for applications. Model a fact per step, reactions between them and a to-do list of open work. A wait for an approval, an answer or a deadline is an open to-do item: the approval, the answer or a recorded expiry is the fact that advances the process and, once projected, removes the item. The list nominates candidates; each command rechecks current state before acting. Code: `cratis-chronicle-react-to-fact`.
|
|
138
|
+
- **Lifecycle status** — show where one item is as a status on its read model, projected from the facts. It never decides whether a command is allowed.
|
|
139
|
+
- **Screenplay state machines and workflows** — tooling behavior, not an application design choice: [model-first](references/model-first.md) says what a model can state and what Stage renders. Prefer the process shape above.
|
|
138
140
|
|
|
139
141
|
### Specifications
|
|
140
142
|
|
package/package/corpus/skills/cratis-modeling-design-event-model/references/command-inventory.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Inventory entries, refusals and transitions
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Entry paths
|
|
6
|
+
- Refusal inventory
|
|
7
|
+
- Transition table
|
|
8
|
+
|
|
3
9
|
Read this at the inventory step. Three tables expose how a command is reached, how it can fail, and what it does in each state of the item it changes. A blank cell is an open question, not a default.
|
|
4
10
|
|
|
5
11
|
## Entry paths
|
|
@@ -14,7 +20,7 @@ Every command needs at least one reachable, authorized entry. A command nothing
|
|
|
14
20
|
| `ReopenTicket` | Resolved-tickets list, row action | Agent | Selected row | None |
|
|
15
21
|
| `CloseTicket` | Resolved-tickets list, row action | Team lead | Selected row | None |
|
|
16
22
|
|
|
17
|
-
Done when every command has a row, every entry is a screen, form, reaction
|
|
23
|
+
Done when every command has a row, every entry is a screen, form, reaction or translation that exists in the model, and the caller's identity and roles satisfy the command's authorization. A reaction entry states the identity it runs as.
|
|
18
24
|
|
|
19
25
|
## Refusal inventory
|
|
20
26
|
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Specify an accepted Screenplay handoff
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Skill order
|
|
6
|
+
- What a model cannot author or execute
|
|
7
|
+
- Record values and protection
|
|
8
|
+
- Workflow nodes
|
|
9
|
+
- Render, run and recover
|
|
10
|
+
- Specification assertions
|
|
11
|
+
- Organize and track the model
|
|
12
|
+
|
|
3
13
|
Read this when the Screenplay opt-in applies. A Screenplay model can author less than code-first delivery and Stage can render less than the model can say; check both limits before promising a slice, and deliver a slice that needs something listed here as unsupported code-first.
|
|
4
14
|
|
|
5
15
|
## Skill order
|
|
@@ -31,6 +41,8 @@ Deliver these code-first; do not approximate them in the model.
|
|
|
31
41
|
|
|
32
42
|
## Workflow nodes
|
|
33
43
|
|
|
44
|
+
This section and the next describe what the Screenplay and Stage tooling does with lifecycle constructs; they are not a recommended application design. For an application process, including waits, approvals and deadlines, model facts, reactions and a to-do list read model whose items the closing fact removes once projected, with each command rechecking current state. Use a state machine or workflow only when the owner has explicitly chosen the model's lifecycle constructs.
|
|
45
|
+
|
|
34
46
|
A workflow runs for one subject, identified by its read model's key. Each node leaves through named outlets; connect each outlet to the next node.
|
|
35
47
|
|
|
36
48
|
| Node | Use it to | Outlets |
|
|
@@ -53,7 +65,7 @@ Passing source validation, a specification or a sandbox run does not prove a con
|
|
|
53
65
|
- **Runs in the sandbox but does not render:** decisions, approvals, foreach, joins and ability calls from actions or state entries, subject to runtime admission. Stage also refuses to render an action that computes a value or invokes a command with more than its identifier, a guard on anything but a text, number or flag member of the followed read model, or a state-entry command whose other properties do not match that model by name and type.
|
|
54
66
|
- **Refused by the runtime:** schedule triggers, anything other than exactly one trigger per workflow, nested foreach, a foreach without exactly one join, a join without a foreach, and an edge with an invalid outlet. A lifecycle refusal in the sandbox does not block the rest of the model.
|
|
55
67
|
- **Command bodies:** Stage renders attached handler bodies written in C# only.
|
|
56
|
-
- **Durability:** the generated application journals workflow run facts in Chronicle, but keeps the index it uses to find active runs in memory by default. Retained Chronicle data alone does not resume runs
|
|
68
|
+
- **Durability:** the generated application journals workflow run facts in Chronicle, but keeps the index it uses to find active runs in memory by default. Retained Chronicle data alone does not resume runs. Verify a run survives a host restart before calling it durable; a passing render or sandbox run says nothing about recovery.
|
|
57
69
|
- Give the generated state machine one required text `Status` member on its read model with the state names as values. If the renderer cannot identify a single status member or the value matches no state, activation falls back to the initial state.
|
|
58
70
|
|
|
59
71
|
## Specification assertions
|
package/package/corpus/skills/cratis-modeling-design-event-model/references/review-one-slice.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Review one slice
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Follow a value, including its address
|
|
6
|
+
- Read back the examples
|
|
7
|
+
- Bound a change
|
|
8
|
+
|
|
3
9
|
Use one instance to follow a decision into its result. A walkthrough may span several slices: the agent opens a ticket, then sees it in the open-tickets list. A specification proves **one** slice: the opening example expects an addressed fact; the list example starts with that fact and expects a row. Neither needs to test the other's decision again.
|
|
4
10
|
|
|
5
11
|
## Follow a value, including its address
|
|
@@ -95,18 +95,18 @@ Stage-rendered repository (which already contains `Source/Composition`).
|
|
|
95
95
|
outside the AppHost stay harmless.
|
|
96
96
|
4. Keep each service's event-store name and read-model database name in the service's
|
|
97
97
|
own settings, so it behaves the same inside and outside the AppHost.
|
|
98
|
-
5.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
that does not use its jobs, event-sourced state machines or workflows.
|
|
98
|
+
5. Give every service its own HTTP address before starting two hosts. If a
|
|
99
|
+
scaffold-generated host still fails because port 11111 or 30000 is taken, that is a
|
|
100
|
+
scaffold issue, not application configuration: see Avoid host-process port
|
|
101
|
+
collisions in your SDK reference.
|
|
103
102
|
6. Run the AppHost. Its dependency wait is not a readiness gate without a health check.
|
|
104
103
|
If startup requires a ready kernel, probe `/health/ready` over HTTPS with a certificate
|
|
105
104
|
the AppHost trusts. Verify every service reaches the kernel address Aspire assigned;
|
|
106
105
|
an unexpected `localhost:35000` usually means an override is missing or read from the wrong key.
|
|
107
106
|
|
|
108
107
|
The AppHost integration is C#-only; see Aspire AppHost in your SDK reference for the
|
|
109
|
-
complete setup, including host-process isolation,
|
|
108
|
+
complete setup, including the AppHost project, host-process isolation, frontends as
|
|
109
|
+
resources, local sign-in through AuthProxy, readiness, persistence and external storage.
|
|
110
110
|
|
|
111
111
|
Hosts that read `Cratis` configuration from settings files and double-underscore
|
|
112
112
|
variables take these variables as they are; any other service reads them (or names
|
package/package/corpus/skills/cratis-multi-service-local-orchestration/references/csharp-aspire.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- The AppHost
|
|
6
|
+
- The AppHost project
|
|
6
7
|
- Service settings
|
|
7
8
|
- Avoid host-process port collisions
|
|
8
9
|
- What each line is for
|
|
10
|
+
- Frontends as resources
|
|
11
|
+
- Sign-in and tenancy locally
|
|
9
12
|
- Variations
|
|
10
13
|
- Chronicle hosting API catalog
|
|
11
14
|
|
|
@@ -14,7 +17,7 @@
|
|
|
14
17
|
The default: one development-image kernel whose bundled MongoDB replica set also serves
|
|
15
18
|
the services' read models. This is the shape Stage renders into `Source/Composition`.
|
|
16
19
|
Install `Cratis.Chronicle.Aspire` in the AppHost only, and reference each service project
|
|
17
|
-
from the AppHost. Resolve
|
|
20
|
+
from the AppHost. Resolve port collisions below before running both projects.
|
|
18
21
|
|
|
19
22
|
```csharp
|
|
20
23
|
// Source/Composition/Program.cs
|
|
@@ -56,6 +59,20 @@ The example declares the services' HTTP endpoints instead of importing launch
|
|
|
56
59
|
profiles. If existing launch profiles or Kestrel settings already define the
|
|
57
60
|
endpoints, configure those to avoid collisions rather than adding duplicates.
|
|
58
61
|
|
|
62
|
+
## The AppHost project
|
|
63
|
+
|
|
64
|
+
The AppHost project declares the Aspire AppHost SDK with an explicit version and
|
|
65
|
+
references `Aspire.Hosting.AppHost`, `Cratis.Chronicle.Aspire` and every service project.
|
|
66
|
+
The `cratis-aspire` template keeps the SDK and `Aspire.Hosting.AppHost` on the same
|
|
67
|
+
Aspire version; do the same. Other `Aspire.Hosting.*` integration packages take a version
|
|
68
|
+
compatible with it, which for some integrations is a prerelease of that version.
|
|
69
|
+
|
|
70
|
+
- Creating or repairing an AppHost by hand: take the SDK declaration and the Aspire
|
|
71
|
+
version from a freshly scaffolded AppHost (`dotnet new cratis-aspire`), not from an
|
|
72
|
+
older repository.
|
|
73
|
+
- Moving to a newer Aspire: change the SDK version and the `Aspire.Hosting.AppHost`
|
|
74
|
+
version together, then move each integration package to a version compatible with it.
|
|
75
|
+
|
|
59
76
|
## Service settings
|
|
60
77
|
|
|
61
78
|
Each service names its own store and read-model database in its own settings, and keeps
|
|
@@ -79,34 +96,16 @@ database stays the store name because the kernel writes the store's read models
|
|
|
79
96
|
|
|
80
97
|
## Avoid host-process port collisions
|
|
81
98
|
|
|
82
|
-
`AddProject` launches host processes
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
those ports. Give each service a distinct HTTP address, and in the service's unmanaged
|
|
86
|
-
`Customizations/Program.cs` implement the scaffold's `ConfigureServices` partial hook to
|
|
87
|
-
assign distinct silo and gateway ports. For Billing, for example (Ordering can keep
|
|
88
|
-
its default pair if free):
|
|
89
|
-
|
|
90
|
-
```csharp
|
|
91
|
-
using Orleans.Configuration;
|
|
92
|
-
|
|
93
|
-
public partial class Program
|
|
94
|
-
{
|
|
95
|
-
static partial void ConfigureServices(WebApplicationBuilder builder) =>
|
|
96
|
-
builder.Services.PostConfigure<EndpointOptions>(endpoints =>
|
|
97
|
-
{
|
|
98
|
-
endpoints.SiloPort = 11112;
|
|
99
|
-
endpoints.GatewayPort = 30001;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
```
|
|
99
|
+
`AddProject` launches host processes on the machine, so they share its ports. Give each
|
|
100
|
+
service a distinct HTTP address in its launch profile or `applicationUrl`; two services
|
|
101
|
+
left on the same address fail on the second start.
|
|
103
102
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
An application built on Arc, Chronicle and Components needs no other listening port. If
|
|
104
|
+
a scaffold-generated host still reports port 11111 or 30000 in use when a second host
|
|
105
|
+
starts, the scaffold registered infrastructure the application does not configure. Treat
|
|
106
|
+
it as a scaffold issue and report it; do not add port settings for it to the application.
|
|
107
|
+
Until it is resolved, run those services as isolated containers, each with its own
|
|
108
|
+
network namespace and without publishing those ports, as in the Compose reference.
|
|
110
109
|
|
|
111
110
|
## What each line is for
|
|
112
111
|
|
|
@@ -134,6 +133,90 @@ before a full re-render.
|
|
|
134
133
|
- **Non-.NET services** are added as containers or executables with the same two
|
|
135
134
|
variables and `WaitFor(chronicle)`.
|
|
136
135
|
|
|
136
|
+
## Frontends as resources
|
|
137
|
+
|
|
138
|
+
The default for a system with several frontends or an ingress: the AppHost starts each
|
|
139
|
+
service's Vite dev server too, so one command runs everything. A single service can
|
|
140
|
+
keep running its dev server by hand.
|
|
141
|
+
|
|
142
|
+
Add the `Aspire.Hosting.JavaScript` package to the AppHost, then one resource per frontend:
|
|
143
|
+
|
|
144
|
+
```csharp
|
|
145
|
+
var orderingFrontend = builder.AddViteApp("ordering-frontend", "../Ordering")
|
|
146
|
+
.WithYarn()
|
|
147
|
+
.WithViteConfig(".frontend/vite.config.ts")
|
|
148
|
+
.WithEndpoint("http", endpoint => endpoint.Port = 9000);
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- **The directory** is the folder holding the frontend's `package.json`, relative to the
|
|
152
|
+
AppHost project. Aspire runs its `dev` script.
|
|
153
|
+
- **`WithYarn()`** selects the package manager and installs packages before the dev
|
|
154
|
+
server starts; without it Aspire uses npm. Use the package manager the repository uses.
|
|
155
|
+
- **`WithViteConfig`** names the configuration file whenever Vite would not find it on
|
|
156
|
+
its own: a file in another folder, or one in the root of that directory under a
|
|
157
|
+
non-default name. The path is relative to that directory.
|
|
158
|
+
- **`AddViteApp` already declares the `http` endpoint** and starts the dev server on the
|
|
159
|
+
port Aspire assigns, by appending `--port` (and `--config`) to the `dev` script. The
|
|
160
|
+
script must therefore forward the appended arguments to Vite: it ends in the `vite`
|
|
161
|
+
command, or in another script that does. That port replaces any `server.port` in the
|
|
162
|
+
Vite configuration.
|
|
163
|
+
- **Pin the port** with `WithEndpoint("http", ...)` when the frontend's address must be
|
|
164
|
+
the same on every run; give every frontend a distinct port.
|
|
165
|
+
- **Point the dev server's API proxy at its own service.** The Vite configuration's
|
|
166
|
+
proxy targets are separate from Aspire, and the Stage scaffold writes
|
|
167
|
+
`http://localhost:5000` for all of them. With the ports in The AppHost (5101, 5102),
|
|
168
|
+
API requests then reach nothing or the wrong service. Keep the service's resource in a
|
|
169
|
+
variable, pass its endpoint to the frontend, and read it in the Vite configuration:
|
|
170
|
+
|
|
171
|
+
```csharp
|
|
172
|
+
orderingFrontend.WithEnvironment("ORDERING_URL", ordering.GetEndpoint("http"));
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
const serviceUrl = process.env.ORDERING_URL ?? 'http://localhost:5000';
|
|
177
|
+
// use serviceUrl as the target of every proxy entry
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The fallback keeps the dev server usable when started by hand. Done when a query from
|
|
181
|
+
the frontend at its Aspire address returns that service's data.
|
|
182
|
+
|
|
183
|
+
## Sign-in and tenancy locally
|
|
184
|
+
|
|
185
|
+
Add Cratis AuthProxy to the AppHost when local runs need real sign-in or tenant
|
|
186
|
+
resolution; until then, run the services without it. The `cratis-authproxy-configure`
|
|
187
|
+
skill owns the wiring: read its `references/aspire.md` for the AppHost methods and
|
|
188
|
+
`references/sign-in-providers.md` for the identity provider.
|
|
189
|
+
|
|
190
|
+
What this topology adds:
|
|
191
|
+
|
|
192
|
+
- Pass the resources already declared here: the service's project resource to
|
|
193
|
+
`WithBackend` and its Vite resource to `WithFrontend`, under the same service name.
|
|
194
|
+
AuthProxy then takes both addresses from Aspire.
|
|
195
|
+
- AuthProxy runs as a container, so the frontend address it receives uses the name
|
|
196
|
+
Aspire gives containers for the host machine, not `localhost`. Vite refuses requests
|
|
197
|
+
for host names it does not know: add `host.docker.internal` and `aspire.dev.internal`
|
|
198
|
+
to `server.allowedHosts` in each fronted Vite configuration, and set `server.host` to
|
|
199
|
+
`true` so the dev server accepts connections from outside the loopback interface.
|
|
200
|
+
- Add `WaitFor` on the proxy for each backend and frontend it fronts, and for an identity
|
|
201
|
+
provider that runs as a container resource in the AppHost.
|
|
202
|
+
- Declare how the browser selects a service. Pairing resources does not route
|
|
203
|
+
navigation: AuthProxy sends unrouted requests to a service only when it is the sole
|
|
204
|
+
service and declares neither hosts nor a path prefix, or when one unrouted service is
|
|
205
|
+
marked as the default. With Ordering and Billing behind one proxy, give each its own
|
|
206
|
+
host with `WithHosts`, for example `ordering.localhost` and `billing.localhost`; a
|
|
207
|
+
host declared without a port matches every port. Each frontend then stays
|
|
208
|
+
at the root of its origin, where its assets, router and generated Arc proxies already
|
|
209
|
+
expect to be.
|
|
210
|
+
- `WithPathPrefix` is not a drop-in alternative. The frontend as scaffolded still requests
|
|
211
|
+
`/api/...` at the root of the origin, which misses the service's prefix. Use it only
|
|
212
|
+
when all of these match the prefix: the frontend's asset base, the router's base name,
|
|
213
|
+
`apiBasePath` on the Arc provider, and the backend, which either serves itself under
|
|
214
|
+
the prefix or has the proxy strip it (`stripPathPrefix: true`).
|
|
215
|
+
- Open the application through AuthProxy at the host or path declared for the service
|
|
216
|
+
(the proxy's plain address only for a sole or default service). Requests sent straight
|
|
217
|
+
to the frontend's or the service's own address do not pass through sign-in or tenant
|
|
218
|
+
resolution.
|
|
219
|
+
|
|
137
220
|
## Variations
|
|
138
221
|
|
|
139
222
|
- **Reference only**, when every service is .NET and none sets
|
|
@@ -162,6 +245,10 @@ before a full re-render.
|
|
|
162
245
|
.WithHttpsHealthCheck("/health/ready", endpointName: "readiness");
|
|
163
246
|
```
|
|
164
247
|
|
|
248
|
+
The PFX must exist when the AppHost starts: a missing file stops the AppHost with
|
|
249
|
+
`CertificateFileDoesNotExist`, which names the configured path and the path it resolved
|
|
250
|
+
to. A relative path resolves against the AppHost project directory.
|
|
251
|
+
|
|
165
252
|
Keep `WaitFor(chronicle)` on the services. Use a dedicated HTTPS endpoint rather than
|
|
166
253
|
probing the `grpc` endpoint as HTTP: its Aspire metadata is HTTP but the kernel listener
|
|
167
254
|
is TLS. If the AppHost reports an unhealthy probe, check the mapped HTTPS address, CA
|
|
@@ -197,6 +284,7 @@ before a full re-render.
|
|
|
197
284
|
- `WithSqlite(connectionString)`: select SQLite kernel storage; mount its file location if it must persist.
|
|
198
285
|
- `WithTlsCertificate(path, password)`: mount a server PFX for a trusted TLS listener; omit the password for an unprotected PFX.
|
|
199
286
|
- `WithEncryptionCertificate(path, password)`: mount a PFX for the kernel's encryption certificate configuration; omit the password for an unprotected PFX.
|
|
287
|
+
- Both certificate methods resolve a relative path against the AppHost project directory and stop the AppHost with `CertificateFileDoesNotExist` when no file is there.
|
|
200
288
|
- `WithHashiCorpVault(endpoint, token)`: use a Vault resource endpoint for compliance encryption keys, with a token provided securely.
|
|
201
289
|
- `WithAzureKeyVault(uri)`: use Azure Key Vault for compliance encryption keys with the kernel's Azure identity.
|
|
202
290
|
- `IChronicleAspireBuilder.ResourceBuilder`: use the underlying Aspire builder when the callback has no wrapper for a container setting.
|
package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md
CHANGED
|
@@ -167,8 +167,8 @@ volumes:
|
|
|
167
167
|
`service_healthy`; the client would also reconnect on its own.
|
|
168
168
|
- **Ports.** Publish only the kernel's 35000 and the services' HTTP ports, bound
|
|
169
169
|
to `127.0.0.1`, because the development image accepts well-known credentials.
|
|
170
|
-
Leave the kernel
|
|
171
|
-
|
|
170
|
+
Leave every other port unpublished, including the kernel's silo and gateway ports;
|
|
171
|
+
containers have separate network namespaces, so equal defaults do not collide.
|
|
172
172
|
- **Image choice.** The development image bundles MongoDB and suits a kernel alone;
|
|
173
173
|
with external storage use the development-slim image. The production image has
|
|
174
174
|
no development client. Plan for configured storage, a certificate for TLS listeners
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
- Kernel spans
|
|
9
9
|
- Metric names
|
|
10
10
|
- Kernel metrics
|
|
11
|
+
- Memory metrics
|
|
12
|
+
- Open incident queries
|
|
11
13
|
- Federation metrics
|
|
12
14
|
- Observer failure logs
|
|
13
15
|
- Local viewer
|
|
@@ -133,6 +135,50 @@ Abnormal-only gauges report an observer only while it needs attention, report ze
|
|
|
133
135
|
- **For current state, use the open-incidents gauge**: `chronicle-alerts-open-incidents` under the default `Legacy` names (Prometheus: `chronicle_alerts_open_incidents`), `alert.open_incidents` under `Convention`. Filter on the incident's severity tag (`Severity` under `Legacy`, values `Warning` or `Critical`); it is not the `severity` label of your alert rule. Page only on `Critical`; treat `Warning` as a warning. Aggregate with `max`, never `sum`, because more than one instance can briefly report the same series. Only the instance that owns the snapshot reports the availability gauge, so evaluate it across all instances: fire when `max(chronicle_alerts_open_incidents_available) == 0 or absent(chronicle_alerts_open_incidents_available)`. An empty incidents gauge does not mean no incidents.
|
|
134
136
|
- **Look up the exported names in the backend before writing rules.** Legacy names gain `_total` through the Prometheus translation, and a name-prefix selector such as `{__name__=~"chronicle_observer_partitions_quarantined.*"}` also matches older kernels' long names.
|
|
135
137
|
|
|
138
|
+
## Memory metrics
|
|
139
|
+
|
|
140
|
+
The kernel reports its own memory under `cratis.chronicle.memory.*` on the `Cratis.Chronicle` meter, whatever `MetricNames` says. The process instruments register when the kernel starts. The `budget.*` instruments register only when the kernel first uses the memory budget, so their absence on a kernel that has not yet needed the budget is not a fault. As with every kernel metric, they are exported only when a metrics OTLP endpoint is configured. Use them, together with `observer.resident`, to size the kernel container from its measured peak; the sizing procedure is in `cratis-chronicle-deploy-kernel`, `references/container-and-kubernetes.md`. Names below drop the `cratis.chronicle.memory.` prefix; sizes are bytes.
|
|
141
|
+
|
|
142
|
+
| Name | Meaning |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `working_set` | Physical memory of the process, managed and unmanaged |
|
|
145
|
+
| `available` | Memory the garbage collector considers available to the process, as limited by the machine, the container or a heap hard limit; it is not necessarily the container limit |
|
|
146
|
+
| `load` | Memory in use on the machine or in the container, as the garbage collector sees it |
|
|
147
|
+
| `committed` | Memory the garbage collector holds from the system |
|
|
148
|
+
| `heap_size`, `fragmentation` | Managed heap size and its fragmented bytes after the last collection |
|
|
149
|
+
| `generation_size`, `generation_fragmentation` | The same two per heap generation; attribute `generation` is `gen0`, `gen1`, `gen2`, `loh` or `poh` |
|
|
150
|
+
| `allocated` | Counter of bytes allocated on the managed heap; its rate is the allocation rate |
|
|
151
|
+
| `collections`, `gen2_collections` | Counters of garbage collections per `generation` (`gen0`, `gen1`, `gen2`), and of full collections |
|
|
152
|
+
| `pause_duration`, `pause_time_ratio` | Counter of seconds paused for garbage collection (its rate is pause time per second); percentage of time paused |
|
|
153
|
+
| `budget.capacity`, `budget.reserved` | Total bytes the memory budget allows at the moment, before reservations are subtracted, and bytes reserved. `reserved` can exceed `capacity` (capacity follows memory pressure and can drop, and a reservation is let through after the maximum wait); there is then no room left, not negative room |
|
|
154
|
+
| `budget.waiting`, `budget.queued`, `budget.overcommitted` | Reservations waiting now; counters of reservations that had to wait, and of those let through after the maximum wait |
|
|
155
|
+
| `budget.wait_time` | Histogram of how long a reservation waited before it was let through, milliseconds; recorded when the wait ends, so it says nothing about reservations still waiting |
|
|
156
|
+
|
|
157
|
+
- **Live against retained memory**: `committed` is what the collector holds for the whole heap, every generation including `loh` and `poh`. Compare it with `heap_size` minus `fragmentation`, read after full collections (`gen2_collections` advancing): that difference approximates memory the collector holds beyond live objects. Do not compare `committed` with `gen2` alone, because live objects in the large-object or pinned-object heap would then look like retained memory. To find where growth is, watch `generation_size` per generation across full collections; a generation that keeps growing points to a leak.
|
|
158
|
+
- **Queuing for memory**: `budget.waiting` is the current queue; staying above zero means large reductions are waiting for room now. `budget.wait_time` covers only waits that ended in the reservation being let through, so rising values show how long past reductions queued, and a rising `budget.overcommitted` shows waits that hit the maximum. Raise the container memory limit, or tune the memory budget (options in `cratis-chronicle-deploy-kernel`, `references/configuration.md`).
|
|
159
|
+
|
|
160
|
+
## Open incident queries
|
|
161
|
+
|
|
162
|
+
The open-incidents gauge is the default for alert rules. Use the kernel's alert incident queries when a dashboard or paging tool needs the incidents themselves: which observer and partition, which condition, since when. They are read-only queries on the kernel's HTTP API. When kernel authentication is disabled, they are open to any caller that can reach the API. When it is enabled, the caller must be authenticated, and for an ordinary event store the `chronicle.alerts.read` capability is evaluated for the event store, and the namespace when given, that the query asks about. By default a missing grant on an ordinary event store is audited, not refused; it is refused once store entitlements are enforced. Queries against the System event store do not use this capability; they follow the kernel's separate access policy for that store. The same three queries exist on the kernel's gRPC alerts service; the Go client's helpers for them are in `cratis-chronicle-inspect-observer`.
|
|
163
|
+
|
|
164
|
+
| Route | Arguments | Fields in `data` |
|
|
165
|
+
| --- | --- | --- |
|
|
166
|
+
| `/api/alerts/get-open-incidents` | `eventStore` (required); optional `namespace`, `observerId`, `condition`, `minimumSeverity`, `limit`, `afterRaisedSequenceNumber`, `afterIncidentId` | `status`, `items`, `next` |
|
|
167
|
+
| `/api/alerts/get-open-incident` | `eventStore` and `incidentId` (required); optional `namespace` | `status`, `incident` |
|
|
168
|
+
| `/api/alerts/get-open-incident-counts` | `eventStore` (required); optional `namespace` | `status`, `counts` |
|
|
169
|
+
|
|
170
|
+
The HTTP response is the Arc query result envelope; the fields in the last column are inside its `data`, not at the top level.
|
|
171
|
+
|
|
172
|
+
- **Scope**: `eventStore` is the affected event store and is always required; there is no query across stores. Omitting `namespace` covers every namespace of that store. Over HTTP, names match case-sensitively; the gRPC service first resolves a supplied namespace to its stored casing.
|
|
173
|
+
- **Filters**: `minimumSeverity` keeps incidents at or above that severity (`Critical` ranks above `Warning`). `condition` takes the condition name, for example `partition-retries-exhausted`.
|
|
174
|
+
- **Incident**: its id, target (including the partition for partition conditions), condition, severity, evidence, raise and last-change times, and raise and last-transition sequence numbers.
|
|
175
|
+
- **Counts** cover every matching open incident, grouped by namespace, condition and severity; they are not counts of a page.
|
|
176
|
+
- **Read `status` first.** Only with `Ready` does an empty result, or an absent `incident`, mean that no matching incident was materialized when the query ran; a cleared incident is also absent. Readiness is sampled and tolerates work in flight, so an incident raised a moment ago can still be missing. `CatchingUp` and `Degraded` results can be partial or stale. A storage failure fails the query; it never returns an empty result.
|
|
177
|
+
- **Paging**: pages are ordered by raise sequence number, then incident id. `limit` defaults to 100 (also when `0`), is capped at 500, and a negative value is rejected. When `next` is present, send its `raisedSequenceNumber` as `afterRaisedSequenceNumber` and its `incidentId` as `afterIncidentId`, with scope and filters unchanged. Always send both: without `afterIncidentId` the sequence number is ignored and paging starts over.
|
|
178
|
+
- **No snapshot** spans pages, or a page and the counts. An incident raised again after clearing gets a new raise position, so it can appear again or disappear during a traversal; treat a full traversal as approximate.
|
|
179
|
+
|
|
180
|
+
Anti-patterns: polling these queries instead of alerting on the gauge; treating an empty non-`Ready` result as "no incidents"; using them as a history of failures, since cleared incidents are not returned and the kernel sends no notification.
|
|
181
|
+
|
|
136
182
|
## Federation metrics
|
|
137
183
|
|
|
138
184
|
Producer counters use the `Cratis.Chronicle.Federation` meter and the `chronicle.federation.link` dimension (`unknown` when a denial cannot be attributed). Use them to distinguish delivery pressure from throttling, authorization and data-protection decisions.
|
|
@@ -39,10 +39,12 @@ Work is **at least once**. Resume can repeat work since the last durable checkpo
|
|
|
39
39
|
| One in-memory piece of background work that must not block a grain's turn and may be lost with the grain | Worker |
|
|
40
40
|
| One grain whose behaviour depends on which state it is in | State machine |
|
|
41
41
|
| A grain whose state follows Chronicle events | Event-sourced state machine |
|
|
42
|
-
|
|
|
42
|
+
| An internal process that branches, waits durably, or needs explicit per-item branches and a join | Choreography workflow - use the `cratis-choreography-run-workflow` skill |
|
|
43
43
|
| Request-scoped logic or a simple entity | A plain Orleans grain |
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Fan-out alone does not call for a workflow: use a job when every item is a planned step that must finish. Nor does a Chronicle event: a reactor handles a straightforward reaction. Give an internal workflow a durable journal, such as Chronicle. Do not model a wait as a blocked step.
|
|
46
|
+
|
|
47
|
+
These blocks are for Cratis engineering services already on Orleans. Applications model a multi-step process, waits and deadlines included, as facts, reactors and a work-list read model.
|
|
46
48
|
|
|
47
49
|
## How a job runs
|
|
48
50
|
|