@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
|
@@ -9,7 +9,8 @@ paths:
|
|
|
9
9
|
|
|
10
10
|
- Author shared corpus changes in `Cratis/AI`, generalized and free of private facts; never copy one consumer's `.cratis/ai` or native assistant folders into another repository, and keep consumer settings, private skills and repository knowledge local.
|
|
11
11
|
- Never hand-edit installed managed files, generated adapters or a marketplace wrapper, because the next update overwrites or flags them; install, update, roll back and remove through the channel that installed them (`cratis ai install`, `update`, `uninstall`), previewing with `--dry-run`.
|
|
12
|
-
- Use `cratis ai update --force` only after reviewing the modified managed files it will overwrite; `cratis ai status` exits nonzero when a managed file was modified, so CI can gate on it.
|
|
12
|
+
- Use `cratis ai update --force` only after reviewing the modified managed files it will overwrite; `cratis ai status` exits nonzero when a managed file was modified, so CI can gate on it. In CI, install a pinned `Cratis.Cli` .NET tool with a .NET SDK that supports the package's target framework (currently .NET 11), with the .NET and ASP.NET Core runtimes it needs; a runtime-only image cannot run `dotnet tool install`. On macOS or Linux (x64 or arm64) you can instead use the matching pinned, self-contained native release binary, which needs no .NET runtime; there is no native Windows binary.
|
|
13
|
+
- When stdin is redirected, pass `--profiles` and `--harnesses` to `cratis ai install` (`--languages` is optional), or it exits 5 before downloading the corpus. `cratis ai update` takes no selection options and reuses `.cratis/ai.json`; run `install` again to change the selection. Both take whatever the corpus source currently holds and the installed revision pins nothing; to reproduce a reviewed revision, point `--source` or `CRATIS_AI_SOURCE` at a fresh, full `Cratis/AI` checkout of that commit with no extra files, including ignored ones such as a `.env`, and supply it on every run. The CLI reads the selected corpus files from disk, not from Git's tracked tree, so extra files in selected directories are installed even when ignored and a clean `git status` is not enough; it asks Git only for `HEAD` to record the revision, and the source is not saved for later runs.
|
|
13
14
|
- Never merge, overwrite or remove project context (repository documentation, `.cratis/ai/rules/project.md`, local bootstraps, user prompts) while installing, updating, rolling back or uninstalling, and never delete a project-owned prompt because an old corpus supplied one.
|
|
14
15
|
- Treat `mcp-servers.json` as launch capability, not permission: enable an optional server only once authorized, and opt out with `mcpServers.<id>.enabled: false` in `.cratis/ai.json`.
|
|
15
16
|
- Audit by reporting missing, stale, modified and dangling paths separately with the smallest repair, and change nothing unless asked; never remove user-owned or legacy adapters as a side effect of a canary.
|
package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md
CHANGED
|
@@ -14,7 +14,7 @@ paths:
|
|
|
14
14
|
An exit code is the verdict; a wrapper that loses it turns a red run green.
|
|
15
15
|
|
|
16
16
|
- Exit our checkers `0` for ran clean, `1` for found defects and `2` for could not run, and report `2` as "not run", never as clean or as defects. Interpret an external tool by its documented codes; never map failure, interruption or unknown to success.
|
|
17
|
-
- Preserve the child's status before filtering output: `pipefail`, or `PIPESTATUS` captured immediately, in Bash; `$LASTEXITCODE` immediately after a native command in PowerShell. Accumulate failures across a loop instead of trusting its last iteration.
|
|
17
|
+
- Preserve the child's status before filtering output: `pipefail`, or `PIPESTATUS` captured immediately, in Bash; `$LASTEXITCODE` immediately after a native command in PowerShell. Accumulate failures across a loop instead of trusting its last iteration. Under `-e` (GitHub Actions' `shell: bash` enables `errexit` and `pipefail`, and `set -uo pipefail` does not turn it off), capture an external command's code with `status=0; tool || status=$?` before branching on it, because a failing `tool; status=$?` exits before the capture. Bash ignores `-e` inside a function or compound command on the left of `||`, so such a wrapper must propagate each failure explicitly or a failed step falls through to a later success and reads as `0`: `step || return $?` inside a function, `( step || exit $?; … ) || status=$?` for a subshell group.
|
|
18
18
|
- Ship a `--self-test` that plants known violations and fails unless it detects every one, because a checker that cannot fail proves nothing (non-vacuity: `guards-and-fuses`).
|
|
19
19
|
- Never add `|| true`, discard stderr or swallow an error to quiet a gate, because that silently stops checking.
|
|
20
20
|
- Keep wrappers thin and name the failing subject (path, id, rule) in the failure line, so the failure is actionable without a rerun.
|
|
@@ -11,7 +11,7 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
11
11
|
|
|
12
12
|
## Events & streams
|
|
13
13
|
|
|
14
|
-
- **Event** — an immutable, past-tense **fact** that something happened; declared with `[EventType]` in .NET.
|
|
14
|
+
- **Event** — an immutable, past-tense **fact** that something happened; declared with `[EventType]` in .NET. A stored payload is replaced with a marker only by an explicit redaction request: a redaction (of one event, or of an event source's events) replaces the stored payload in the target event sequence only, not in copies made earlier such as backups, exports or events already forwarded to an inbox; system event store events cannot be redacted. An explicit revision corrects content and keeps the original. Both keep the event's sequence number; a redacted event leaves a marker with the reason. A compensation is a new event linked to the one it offsets.
|
|
15
15
|
- **Event source** — the entity or process whose changes are recorded; one event source can have multiple named streams.
|
|
16
16
|
- **Event source id** — the append routing identity of an event source, carried in event context. Do not duplicate it in the payload just to identify the current source. A related source ID can be part of the fact.
|
|
17
17
|
- **Event stream** — an ordered part of an event source’s history within an event sequence. A stream type names the part; a stream ID selects an instance of that part.
|
|
@@ -19,7 +19,8 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
19
19
|
- **Event log** — the default event sequence where domain events are appended.
|
|
20
20
|
- **Outbox / inbox** — cross-service event sequences: a producer appends its public contract event to the outbox; a consumer observes the inbox.
|
|
21
21
|
- **Public event** — an event type that is part of the contract an event store exposes to other services (`.NET`: `[Public]` or `[EventStore]` on the type, or `[EventStore]` on its assembly; otherwise private). The outbox rejects private events and the event log rejects public events.
|
|
22
|
-
- **EventContext** — metadata traveling with an event
|
|
22
|
+
- **EventContext** — metadata traveling with an event: event source id, sequence number, occurred, correlation id and causation chain, caused-by identity, tags, event type with the delivered generation, stream type and id, event store and namespace, and subject. Which further members exist depends on the SDK: .NET also exposes the generation the event was appended in and, only when the event is a compensation, the sequence number it compensates for; other SDKs may omit either or report them differently, so check the SDK before relying on them. Read these from the context instead of copying them into the event; `cratis-chronicle-react-to-fact` (`references/csharp.md`) lists the .NET context members.
|
|
23
|
+
- **Integration event** — an event that crosses a system boundary. With Chronicle outbox/inbox subscriptions, outbound it is the public contract event a producer appends to its outbox, and a consumer's reactors, reducers and projections may observe that contract directly on the inbox; other outbound delivery, such as a webhook, need not go through an outbox. Inbound raw data from an outside system, recorded as received in that system's terms as an event type of its own, stays at the boundary: only the Translation slice observes it, and everything else consumes the facts we own that the translation records.
|
|
23
24
|
|
|
24
25
|
## Read side
|
|
25
26
|
|
|
@@ -29,6 +30,7 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
29
30
|
- **Reactor** — observes recorded events to trigger effects such as notifications, commands or follow-up events. See `cratis-chronicle-react-to-fact` for the client’s registration and delivery conventions.
|
|
30
31
|
- **Observer** — a projection, reducer or reactor consuming an event sequence and maintaining subscription, replay and quarantine state. A projection's replay and catch-up are one globally ordered step, a new failure stops that catch-up, a full replay leaves the observer inactive, and completing it does not resume an observer from quarantine; do not generalize this ordering to reducers.
|
|
31
32
|
- **Sink** — where Chronicle sends projection or reducer state: a store such as MongoDB (the default document store) or an EF Core-backed SQL sink, or an event-sequence sink that publishes the state as new events.
|
|
33
|
+
- **To-do list** — a read model of pending work that an Automation drains: an opening event adds the item, every event that closes the work removes it, and on each pass the reactor sends one command per eligible item (for example, one whose deadline has passed), not per listed item. The list can lag, so it only nominates candidates; the command rechecks current state.
|
|
32
34
|
- **AutoMap** — Chronicle's on-by-default mapping of matching event→read-model property names; omit `.AutoMap()` unless explicitly re-enabling mapping after `.NoAutoMap()`.
|
|
33
35
|
- **Graph** — a named property graph that events build through a graph projection: nodes, edges and their properties. Derived state like a read model; nothing writes to it directly.
|
|
34
36
|
- **Node** — a graph element with a label, one unique key and primitive properties. The label is the type name.
|
|
@@ -51,7 +53,7 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
51
53
|
|
|
52
54
|
## Structure & types
|
|
53
55
|
|
|
54
|
-
- **Slice** — the vertical unit of one behavior (command
|
|
56
|
+
- **Slice** — the vertical unit of one behavior, grouping only the artifacts that behavior needs (any of command, events, projection, read model, query, component, specs; a listing slice may have a read model, query and projection but no command or new event), created/changed/deleted together. Its folder is named for the capability (`Registration`, `Listing`), not for the command type; when present, a command is named in the imperative and an event in the past tense.
|
|
55
57
|
- **Slice types** — **State Change** (command → events), **State View** (events → read model), **Automation** (events → side effect, including a follow-up command or event — a Screenplay `produces` / `invokes`), **Translation** (data from *outside* the model's own facts → our own facts: an external system's or another service's data recorded as events we own, keeping the external fact distinct from the local one; a Screenplay `Translate` slice with `direction outbound` is the other direction, publishing our private facts as one public contract event). A reactor that turns our own event into a follow-up event or command is an Automation, not a Translation.
|
|
56
58
|
- **Concept** — a named type wrapping exactly one scalar domain value (`ConceptAs<T>` in C#, TypeScript, Kotlin and Java; a defined type in Go; `use Cratis.Chronicle.Concept` in Elixir); the bare scalar on every wire and in every store.
|
|
57
59
|
- **Event-source identity** — the concept type that addresses one Chronicle event history (`EventSourceId<T>` in C#); only such identities use it, every other identity is a plain concept.
|
|
@@ -12,8 +12,10 @@ paths:
|
|
|
12
12
|
|
|
13
13
|
- Call the backend through generated proxies, never raw `fetch`, since copied routes and types drift. Compose slices on a page only through their exported components, never their internals, so each slice stays removable. See `cratis-arc-react-bind-slice`.
|
|
14
14
|
- Call hooks unconditionally; gate a query with `Query.when(condition).use(args)`, since a skipped hook breaks React's hook order.
|
|
15
|
-
- Render unauthorized, refused and failed results apart from pending and empty, since an empty list hides a refusal. Show a neutral failure message, never exception text or stack traces, which expose internals. Let observable queries show accepted writes; a locally patched list drifts from the read model.
|
|
15
|
+
- Render unauthorized, refused and failed results apart from pending and empty, since an empty list hides a refusal. Show a neutral failure message, never exception text or stack traces, which expose internals. Let observable queries show accepted writes; a locally patched list drifts from the read model. Edge case: for a gesture that must show its result in the same frame, such as a drop or a paste, see `cratis-arc-react-bind-slice` (`references/typescript-instant-feedback.md`). A command built there with `new` instead of `use()` does not get the host's locale: before executing, call `setRequestDefaults({ locale: arc.localeStore, httpHeadersCallback: arc.httpHeadersCallback })` on it with `arc` from `useContext(ArcContext)`.
|
|
16
16
|
- Bind live collections with the observable query's `.use()` hook; Suspense and raw `subscribe` do not apply delta updates. Render `useSuspense()` inside a `QueryBoundary`, which supplies the fallback and catches failures.
|
|
17
17
|
- On sign-in, sign-out or account switch, change the credentials first, then `refresh()` the identity (`clearIdentity()` on sign-out) and call `reconnectQueries()` before caller-scoped data renders: the identity calls touch only the identity, while reconnecting drops cached results and live connections that still belong to the old caller. Reserve a full page load for identity-provider redirects or an intentional app reset. See `cratis-arc-react-bind-slice`.
|
|
18
|
+
- Set the UI language with the `locale` prop on `<Arc>`, never a hand-written `Accept-Language` header: the header replaces the language Arc sends, and a native WebSocket or EventSource handshake cannot carry it, so a live stream carries its language in its URL. With a locale set, that is the active language by default; a header override replaces it only when it is one valid language tag, and a preference list is left out of the URL, so the stream stops following the UI language. See `cratis-arc-react-bind-slice` (`references/typescript-localization.md`).
|
|
19
|
+
- Read a command form's values through the form's own instance (`useCommandInstance()` beneath the form) and submit through the form: its own submit, or, for a plain `CommandForm` only, the form handle's `execute()` (`formRef`) for a button outside it. Submit a `CommandStepper` only through its own Submit: its `formRef` reaches the inner form and skips the stepper's before-execute step and confirmation. Calling the instance's `execute()` skips the form's custom field errors and result callbacks; calling the command's `use()` beside the form creates a second instance that can submit different values from those on screen. See `cratis-components-submit-form`.
|
|
18
20
|
- Keep view models plain classes. Mark one with constructor parameters `@injectable()` and type each dependency as a class or explicit token, never a bare interface, which compiles away and cannot be resolved. Release subscriptions in `detached()`, or they outlive the view. Wrap a child that reads view-model state itself in `observer` from `@cratis/arc.react.mvvm`, or it will not re-render. Keep `@cratis/eslint-plugin-arc` recommended rules on; they reject hooks in view models and direct `mobx-react` imports. See `cratis-arc-react-separate-view-model`.
|
|
19
21
|
- Ask confirmation through the shared confirmation hook or `IDialogs`, never `window.confirm`, and act only on `DialogResult.Yes` or `Ok`, since dismissal resolves to `Cancelled`. Start a busy indicator without awaiting it, since its promise settles only on close, and close it in `finally`, since users cannot dismiss it. See `cratis-components-coordinate-feedback`.
|
|
@@ -20,8 +20,10 @@ profile: application
|
|
|
20
20
|
- Start a new effect-producing reactor at the tail, or have it ignore older facts; its first catch-up is not a replay, so replay exclusion does not stop it.
|
|
21
21
|
- Exclude effect-producing handlers from replay, and still make every effect idempotent: exclusion does not stop retries or redelivery. Key each external call by the stable delivery identity plus an effect name, never an attempt number, for the receiver to deduplicate.
|
|
22
22
|
- Return follow-up events or commands instead of appending to the event log yourself, so they belong to the delivery. Derive them from the event and stable state, never a fresh ID or the clock, so a redelivery produces the same output.
|
|
23
|
-
- Never swallow a failed effect; let it fail the partition so it retries visibly. Do not throw to reject malformed or refused input: record a failure fact, because failed
|
|
23
|
+
- Never swallow a failed effect; let it fail the partition so it retries visibly. Do not throw to reject malformed or refused input: record a failure fact, because a failed partition stalls every later event for that event source, and once its retries are used up on the same event it is quarantined: automatic retries stop. It moves on through an authorized manual retry, which is still accepted but keeps the spent budget, by clearing that partition's quarantine, or, on a replayable reactor, by a successful replay that covers the failed event. Other event sources can keep flowing while the observer stays active. A batch handler that throws fails every partition in the batch, so report the failure for the affected partition when the rest can succeed. Failed partitions quarantine the observer as a whole only when a kernel failure threshold is enabled and reached, and both thresholds are off by default; a reactor partition whose latest failure is a timeout does not count toward them; the observer can still be quarantined for other reasons, such as a catch-up that cannot start.
|
|
24
|
+
- A handler may await the work of the delivery it is handling, but must not hold that delivery open for a future business fact, an approval or a deadline. Handle a later fact in its own handler; for a deadline, an approval or any process that pauses, keep a work-list item open and continue in the reactor for the fact that ends the wait (`cratis-chronicle-react-to-fact`, "Multi-step processes"). Never sleep, block or keep an in-memory timer to wait for one: a handler that does not answer in time times out. Live delivery records that as a failed partition; catch-up and replay can run the timed-out step again first, so the handler may run more than once before the failure is recorded. Once it is recorded, automatic recovery retries only while that partition has retries left, and an in-memory timer is lost on restart.
|
|
24
25
|
- Keep reactors stateless and shared dependencies thread-safe; partitions can run concurrently.
|
|
26
|
+
- Never assume a projection or reducer has handled the event the reactor is handling: every observer advances on its own, so a stored read model may not include that event yet. Decide from the event itself or on-demand state (`cratis-platform-deliver-slice`, `references/eventual-consistency.md`).
|
|
25
27
|
- Do not delete, revoke, bill or notify because a stored read model lacks something: it lags the log and reads empty while rebuilding, so decide from the events or on-demand state. Cap the subjects one unattended pass may act on and refuse an implausible count, so one bad input cannot sweep everything.
|
|
26
28
|
- Guard against reacting to what the reactor itself produced, or one input loops.
|
|
27
29
|
- Commands a reactor returns run without the caller's identity and run again on redelivery: make them idempotent, and when they need authorization run them as a system identity holding only the roles they need (`cratis-arc-authorize-request`).
|
|
@@ -15,8 +15,9 @@ paths:
|
|
|
15
15
|
|
|
16
16
|
# Scripts and tooling
|
|
17
17
|
|
|
18
|
+
- These rules choose the language of scripts and tooling you add to a repository. When asked to fix an existing script, workflow step or snippet, fix it in its own language and do not rewrite it in another language unless asked, because the person asked for that script. The only exception is porting Python that is not part of a Python package, including inline Python in a shell step, described below. In Bash, check exit codes explicitly; use strict mode (`set -euo pipefail`) only where it keeps the script's intended behaviour, and do not change the caller's shell options in sourced or interactive snippets.
|
|
18
19
|
- Write repository scripts, CI helpers and tooling in Node with only `node:` built-ins (`.mjs`, or `.ts` limited to erasable syntax: no enums or parameter properties), because Node and the .NET SDK are the only runtimes every Cratis build machine and runner has.
|
|
19
20
|
- Use a C# file-based app (`dotnet run --file tool.cs`, pinned `#:package`) only when the script needs .NET, Cratis libraries or product types, and never in hooks or per-call hot paths, because of its startup cost.
|
|
20
21
|
- Write hooks under `.cratis/ai/hooks` in Bash 3.2-compatible shell or Node, because macOS ships Bash 3.2. Read a hook's small stdin payload with `IFS= read -r -d '' x || true`, not `$(</dev/stdin)`.
|
|
21
|
-
- Add no Python scripts or `python3` workflow steps
|
|
22
|
+
- Add no Python scripts or `python`/`python3` workflow steps except in a Python package and its build tooling, such as a Python client package and the steps that generate, test and publish it, even when the rest of the repository is not Python. Keep a Python package's existing Python scripts in Python and its existing shell steps in shell unless asked to rewrite them. Port any other existing Python script to Node in the change that substantially edits it. This includes inline Python in a shell step: port only the inline Python and leave the surrounding shell as it is.
|
|
22
23
|
- As an agent, edit files with the edit or write tools, query JSON with `gh --jq` or `jq`, and run ad-hoc logic with `node -e` or `node --input-type=module`. Never use `python3 -c` or rewrite files by script, because a scripted rewrite escapes per-edit review.
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "**/for_*/**/*.cs, **/when_*/**/*.cs"
|
|
2
|
+
applyTo: "**/for_*/**/*.cs, **/when_*/**/*.cs, **/when_*.cs, **/given/**/*.cs"
|
|
3
3
|
paths:
|
|
4
4
|
- "**/for_*/**/*.cs"
|
|
5
5
|
- "**/when_*/**/*.cs"
|
|
6
|
+
- "**/when_*.cs"
|
|
7
|
+
- "**/given/**/*.cs"
|
|
6
8
|
---
|
|
7
9
|
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
8
10
|
|
|
9
11
|
# C# specs
|
|
10
12
|
|
|
11
|
-
- Name spec projects `<Source>.Specs`. Start a new one on `Cratis.Specifications.XUnit.v3`; keep an existing project's runner with its matching adapter package, which wires the lifecycle into that runner.
|
|
13
|
+
- Name spec projects `<Source>.Specs`. In a separate spec project, mirror the slice's relative path under the project root, `<Source>.Specs/<Feature>/<Slice>/`, and put the spec folders there (for example `for_<Unit>/` or `when_<behaviour>/`). Start a new one on `Cratis.Specifications.XUnit.v3`; keep an existing project's runner with its matching adapter package, which wires the lifecycle into that runner.
|
|
14
|
+
- Keep an existing co-located layout: where the application project already compiles specs beside its slices, extend it and add no separate spec project, not even for running-kernel specs. Its setup is the project's own, not universal: some exclude only the spec folders from non-Debug builds and run through the application's entry point, others also exclude flat `when_*.cs` files and run with `dotnet test`. Read the project's exclusion patterns and run command, place spec files only where the exclusion reaches, and use the suite's established filter to keep infrastructure out of ordinary runs.
|
|
12
15
|
- Write `Establish` for setup, `Because` for the one action and `should_*` facts marked with the runner's fact attribute (none on the native runner). `Given`/`When` are aliases: one name per phase per class. A `given/` context holds `Establish` only; `all_dependencies` creates the substitutes. Lifecycle runs base-first, so never call a base lifecycle method.
|
|
13
16
|
- Keep the shared lifecycle: facts share one instance and may run concurrently, so they only read, even through a helper (no assignment, `Add`, `Returns`, `Dispose` or second action); every mutation goes in `Establish` or `Because`. Use `[PerFactSpecificationLifecycle]` only when isolation genuinely requires it.
|
|
14
17
|
- Return `Task`, never `async void`, from facts and lifecycle methods, and await every `Task`-returning `Should*`: a discarded assertion can never fail.
|
|
@@ -19,4 +22,4 @@ paths:
|
|
|
19
22
|
- Reuse `GlobalUsings.Specs.cs` without repeating its imports; alias a type a namespace shadows (CS0118) with a `using` placed last.
|
|
20
23
|
- Run a built suite without rebuilding and check its exit status and teardown result, not only passing facts. After changing a widely substituted interface, build the whole spec project; after a runner migration, account for every previously discovered case and skip.
|
|
21
24
|
|
|
22
|
-
Mechanism, packages and runner options: `cratis-specifications-isolate-behavior`; scenarios: `cratis-specifications-exercise-backend
|
|
25
|
+
Mechanism, packages and runner options: `cratis-specifications-isolate-behavior`; scenarios: `cratis-specifications-exercise-backend`, whose `references/csharp-colocated.md` covers specs kept beside the slice; run commands and filters: `run-tests`.
|
|
@@ -17,9 +17,9 @@ paths:
|
|
|
17
17
|
|
|
18
18
|
Group by behavior, not by technical layer. Each slice has exactly one type:
|
|
19
19
|
|
|
20
|
-
- **State Change**: a command is accepted or refused
|
|
20
|
+
- **State Change**: a command is accepted or refused. An accepted command appends events or, in an application that is not event sourced, writes through the application's store, and may change nothing when it repeats work already done. A refused command never applies the requested change.
|
|
21
21
|
- **State View**: events build a read model that queries expose.
|
|
22
|
-
- **Automation**: reacts to a committed event with a follow-up command or an outside call.
|
|
22
|
+
- **Automation**: reacts to a committed event with a follow-up command or an outside call. Without events, trigger the side effect explicitly, and only after the command's write is confirmed committed: a store call that returned inside an open transaction is not yet committed. That is separate from the inline operations a command returns as part of its own write.
|
|
23
23
|
- **Translation**: turns input from outside our own facts into our facts.
|
|
24
24
|
|
|
25
25
|
Non-negotiables:
|
|
@@ -27,8 +27,11 @@ Non-negotiables:
|
|
|
27
27
|
- **Layout.** `<Module>/<Feature>/<Slice>/` under one slice root: the source or package root, or the single artifact folder (such as `Features/`) an SDK's discovery and generator scan so the host stays outside it. Add no other wrapper or technical-layer folder; a single-capability application starts at `<Feature>/<Slice>/`. The namespace, package or module mirrors the path.
|
|
28
28
|
- **Renaming is a migration.** A namespace or package rename can change stored observer identities and Arc routes; never treat it as a plain file move.
|
|
29
29
|
- **One slice is one unit.** Its command, events, read model, reaction and screen live in its folder and ship with its specifications. Declare its backend artifacts in one `<Slice>` file unless the language needs a file per public type, so the slice reads and changes as one. Report a partly done slice as partial; never stub it.
|
|
30
|
+
- **One command per slice by default.** Give each command its own slice folder unless the model puts several commands in one state-change slice. On .NET, when command names are left out of Arc routes, a second HTTP-mapped command in the same namespace, counted after the skipped route segments, puts the type name back into the conventional route of each, which changes the URL of a command that had no name in it. Protocol-only commands do not count. An explicit route stays as written but still counts as a command in its namespace. Other backends route differently, so check the generated routes before adding a command.
|
|
30
31
|
- **Slices do not call each other.** Read another slice's published state or react to its fact; never invoke its handler or service. Compose through the command pipeline and propagate refusal.
|
|
31
32
|
- **Concepts stay home.** Keep a concept in its slice until another slice shares the meaning, then move it one level up (`cratis-fundamentals-name-value`).
|
|
33
|
+
- **Events have a home too.** Declare an event once, in the slice that owns the fact, which is not always the only slice that appends it. Other slices that append, project or react to it import it, never copy it. When no single slice owns the fact, move it to the feature root or another shared scope and keep its event type ID unchanged.
|
|
34
|
+
- **Screens connect through the feature.** A slice's screen never imports a sibling slice's screen. It takes what it needs as callback props, and the feature's composition page connects them (`cratis-arc-react-bind-slice`, `references/typescript-structure.md`).
|
|
32
35
|
- **Facts.** Append observed transitions, not repeated polls, to the history the fact belongs to. Guard a decision against concurrent writers, because a plain append does not protect what was read (`cratis-chronicle-protect-decision`). Keep confidential inputs out of causation.
|
|
33
36
|
- **Facts are not views.** Never append an event for a total, count or status label that existing facts and the clock already determine, such as overdue or past due: store the deadline, project the rest and compare at the query or screen. Record an expiry or status change as a fact only when the business treats it as a transition that changes rights or releases something, such as an expired invitation freeing its email address for reuse, and append it once, when the transition is decided. Record a fact once, either per item or as one event carrying the list, never both, and record the one decision that changed rather than a whole settings object. A refused command appends nothing unless the business must audit or react to the refusal. Keep the event source ID and the time it was recorded out of the payload; both travel with the event (`cratis-modeling-design-event-model`).
|
|
34
37
|
- **Projections fold; reactors act.** A projection has no effects, because rebuilds replay it. A reactor reads state through read models and acts by returning commands or events or by an outside call, never by reading or appending to the event log itself.
|
|
@@ -117,7 +117,7 @@ linked_targets_word() {
|
|
|
117
117
|
}
|
|
118
118
|
unset CDPATH
|
|
119
119
|
cwd_available=1
|
|
120
|
-
cd -- "$1" 2>/dev/null || cwd_available=0
|
|
120
|
+
cd -P -- "$1" 2>/dev/null || cwd_available=0
|
|
121
121
|
physical_cwd="$(pwd -P && printf '.')" || { printf 'E\n'; exit 0; }
|
|
122
122
|
physical_cwd="${physical_cwd%$'\n.'}"
|
|
123
123
|
if [ "$cwd_available" = 0 ]; then
|
|
@@ -200,6 +200,12 @@ function enqueue(text, k) {
|
|
|
200
200
|
queue[++queued] = text
|
|
201
201
|
QUEUE_COUNT[queued] = ncd
|
|
202
202
|
for (k = 1; k <= ncd; k++) QUEUE_DIR[queued, k] = cwd_at(k)
|
|
203
|
+
for (k = 1; k <= nlink_possible; k++) QUEUE_LINK[queued, k] = wrapped_link_dir(LINK_POSSIBLE[k])
|
|
204
|
+
QUEUE_LINKS[queued] = nlink_possible
|
|
205
|
+
}
|
|
206
|
+
function wrapped_link_dir(dir, j) {
|
|
207
|
+
for (j = 1; j <= nwrap; j++) dir = literal_directory(WRAP_DIR[j], dir)
|
|
208
|
+
return dir
|
|
203
209
|
}
|
|
204
210
|
function base(word) { word = tolower(word); sub(/.*\//, "", word); return word }
|
|
205
211
|
|
|
@@ -778,9 +784,108 @@ function nonreader(A, M, n, i, w, first, read, nexti) {
|
|
|
778
784
|
}
|
|
779
785
|
return 1
|
|
780
786
|
}
|
|
781
|
-
|
|
787
|
+
# Relative operands resolve against every directory the command may run in. A cd or pushd that
|
|
788
|
+
# fails leaves the shell where it was, so every directory reached so far stays a candidate. The
|
|
789
|
+
# candidates are tracked lexically, as the shell's logical cd does; a physical directory change
|
|
790
|
+
# (cd -P, set -P, an env -C value with ..) can diverge from that, so it is not modeled but refused.
|
|
791
|
+
function add_link_dir(dir) {
|
|
792
|
+
if (dir !~ /^\// || (dir in LINK_SEEN)) return
|
|
793
|
+
if (nlink_dir >= 17) { link_overflow = 1; return }
|
|
794
|
+
LINK_SEEN[dir] = 1; LINK_DIR[++nlink_dir] = dir
|
|
795
|
+
}
|
|
796
|
+
function add_link_candidate(CAND, CAND_SEEN, count, dir) {
|
|
797
|
+
if (dir in CAND_SEEN) return count
|
|
798
|
+
if (count >= 16) { link_candidates_overflow = 1; return count }
|
|
799
|
+
CAND_SEEN[dir] = 1; CAND[++count] = dir
|
|
800
|
+
return count
|
|
801
|
+
}
|
|
802
|
+
function note_link_wrap(w) {
|
|
803
|
+
LINK_WRAP[++nlink_wrap] = w
|
|
804
|
+
if (w ~ /(^|\/)\.\.(\/|$)/) link_physical = 1
|
|
805
|
+
}
|
|
806
|
+
function note_link_dirs( d) {
|
|
807
|
+
for (d = 1; d <= ncd; d++) add_link_dir(CWD[d])
|
|
808
|
+
for (d = 1; d <= nlink_possible; d++) add_link_dir(LINK_POSSIBLE[d])
|
|
809
|
+
nlink_wrap = 0
|
|
810
|
+
}
|
|
811
|
+
# The first unquoted redirection operator in a word (set LINK_OP_AT and LINK_OP_LEN); quoted characters
|
|
812
|
+
# before it, such as a quoted digit, stay a separate argument while the operator still redirects.
|
|
813
|
+
function link_operator(w, m, i, c) {
|
|
814
|
+
if (length(m) != length(w)) return 0
|
|
815
|
+
for (i = 1; i <= length(w); i++) {
|
|
816
|
+
c = substr(w, i, 1)
|
|
817
|
+
if ((c != "<" && c != ">" && c != "&") || tolower(substr(m, i, 1)) != "u") continue
|
|
818
|
+
if (!match(substr(w, i), /^(<>|>>|>\||&>>|&>|<|>)/)) continue
|
|
819
|
+
if (tolower(substr(m, i, RLENGTH)) !~ /^u+$/) continue
|
|
820
|
+
LINK_OP_AT = i; LINK_OP_LEN = RLENGTH
|
|
821
|
+
return 1
|
|
822
|
+
}
|
|
823
|
+
return 0
|
|
824
|
+
}
|
|
825
|
+
function add_link_word(OP, ABS, nop, w) {
|
|
826
|
+
if (relative_link_word(w)) OP[++nop] = w
|
|
827
|
+
else ABS[++ABS[0]] = w
|
|
828
|
+
return nop
|
|
829
|
+
}
|
|
830
|
+
function relative_link_word(w) {
|
|
831
|
+
if (w ~ /^--/) return 0
|
|
832
|
+
if (w ~ /^-./) w = substr(w, 3)
|
|
833
|
+
return w != "" && w !~ /^\//
|
|
834
|
+
}
|
|
835
|
+
# Redirections open in the caller's directory before env changes it, so they resolve against the
|
|
836
|
+
# directories reached so far. Command operands resolve where the command runs: with env -C, each
|
|
837
|
+
# value on its own and the chain, since implementations differ on whether repeated values chain or
|
|
838
|
+
# the last one wins. Absolute operands resolve the same everywhere and are checked once.
|
|
839
|
+
function check_links(A, n, d, j, k, w, m, before, pending_redirect, chained, nabs, nop, nredir, ABS, OP, REDIR, ncall, CALLER, CALLER_SEEN, nrun, RUN, RUN_SEEN) {
|
|
782
840
|
if (ENVIRON["GS_CWD"] == "") return
|
|
783
|
-
|
|
841
|
+
# A plain command name is found on PATH, not in the working directory. Every other word is an
|
|
842
|
+
# operand of the run directory; one that follows an unquoted redirection operator is opened by
|
|
843
|
+
# the shell in the caller's directory as well.
|
|
844
|
+
k = (A[1] ~ /^[[:alnum:]_.+-]+$/ && A[1] !~ /^-/) ? 2 : 1
|
|
845
|
+
for (; k <= n; k++) {
|
|
846
|
+
nop = add_link_word(OP, ABS, nop, A[k])
|
|
847
|
+
if (k > 1 && pending_redirect && relative_link_word(A[k])) REDIR[++nredir] = A[k]
|
|
848
|
+
pending_redirect = 0
|
|
849
|
+
# Split the word at each unquoted operator: the text before it is an argument (or a file
|
|
850
|
+
# descriptor), the text after it is opened by the shell in the caller's directory.
|
|
851
|
+
w = A[k]; m = WM[k]
|
|
852
|
+
while (link_operator(w, m)) {
|
|
853
|
+
before = substr(w, 1, LINK_OP_AT - 1)
|
|
854
|
+
if (before != "" && before !~ /^[0-9]+$/) nop = add_link_word(OP, ABS, nop, before)
|
|
855
|
+
w = substr(w, LINK_OP_AT + LINK_OP_LEN); m = substr(m, LINK_OP_AT + LINK_OP_LEN)
|
|
856
|
+
if (w == "") { pending_redirect = 1; break }
|
|
857
|
+
nop = add_link_word(OP, ABS, nop, w)
|
|
858
|
+
if (relative_link_word(w)) REDIR[++nredir] = w
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
nabs = ABS[0] + 0; delete ABS[0]
|
|
862
|
+
if (nabs > 0) check_links_in(ABS, nabs, LINK_DIR[1])
|
|
863
|
+
if (nop + nredir == 0) return
|
|
864
|
+
if (link_physical) {
|
|
865
|
+
report("a physical directory change hides where symbolic links resolve", "run the read from its own directory with literal paths, without cd -P, set -P or env -C ..")
|
|
866
|
+
return
|
|
867
|
+
}
|
|
868
|
+
link_candidates_overflow = link_overflow
|
|
869
|
+
for (d = 1; d <= nlink_dir && !link_candidates_overflow; d++) {
|
|
870
|
+
if (nredir > 0) ncall = add_link_candidate(CALLER, CALLER_SEEN, ncall, LINK_DIR[d])
|
|
871
|
+
if (nop == 0) continue
|
|
872
|
+
if (nlink_wrap == 0) { nrun = add_link_candidate(RUN, RUN_SEEN, nrun, LINK_DIR[d]); continue }
|
|
873
|
+
chained = LINK_DIR[d]
|
|
874
|
+
for (j = 1; j <= nlink_wrap; j++) {
|
|
875
|
+
nrun = add_link_candidate(RUN, RUN_SEEN, nrun, literal_directory(LINK_WRAP[j], LINK_DIR[d]))
|
|
876
|
+
chained = literal_directory(LINK_WRAP[j], chained)
|
|
877
|
+
nrun = add_link_candidate(RUN, RUN_SEEN, nrun, chained)
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
if (link_candidates_overflow) {
|
|
881
|
+
report("too many possible working directories to check symbolic links", "run the read from its own directory with literal paths, without chained cd, pushd or env -C")
|
|
882
|
+
return
|
|
883
|
+
}
|
|
884
|
+
for (d = 1; d <= ncall; d++) check_links_in(REDIR, nredir, CALLER[d])
|
|
885
|
+
for (d = 1; d <= nrun; d++) check_links_in(OP, nop, RUN[d])
|
|
886
|
+
}
|
|
887
|
+
function check_links_in(A, n, dir, k, cmd, line, kind) {
|
|
888
|
+
cmd = "bash -c " shell_quote(ENVIRON["GS_LINK_PROGRAM"]) " guard-links " shell_quote(dir)
|
|
784
889
|
for (k = 1; k <= n; k++) cmd = cmd " " shell_quote(A[k])
|
|
785
890
|
while ((cmd | getline line) > 0) {
|
|
786
891
|
kind = substr(line, 1, 2) == "P:" ? sensitive_path(substr(line, 3)) : "an unresolved link target"
|
|
@@ -791,7 +896,7 @@ function check_links(A, n, k, cmd, line, kind) {
|
|
|
791
896
|
function end_cmd( k, m, w, j, hit, exempt, path_git, paths_only, test_filter) {
|
|
792
897
|
flush_word()
|
|
793
898
|
if (nw > 0) {
|
|
794
|
-
|
|
899
|
+
note_link_dirs()
|
|
795
900
|
commands++
|
|
796
901
|
delete PROBE_WORDS; PROBE_COUNT = nw
|
|
797
902
|
for (k = 1; k <= nw; k++) PROBE_WORDS[k] = W[k]
|
|
@@ -839,6 +944,7 @@ function end_cmd( k, m, w, j, hit, exempt, path_git, paths_only, test_filter)
|
|
|
839
944
|
V[++m] = w; VM[m] = WM[k]; VT[m] = WT[k]
|
|
840
945
|
}
|
|
841
946
|
if (m > 0) { check_inputs(V, 1, m); analyze(V, 1, m) }
|
|
947
|
+
if (nw > 0) check_links(W, nw)
|
|
842
948
|
nwrap = 0
|
|
843
949
|
delete W; delete WP; delete WM; delete WU; delete WT; delete V; delete VM; delete VT; nw = 0
|
|
844
950
|
}
|
|
@@ -946,6 +1052,8 @@ function read_heredocs(s, i, n, h, e, line, cmp, body) {
|
|
|
946
1052
|
function tokenize(s, i, n, c, c2, j, dash, delim) {
|
|
947
1053
|
delete CWD; ncd = QUEUE_COUNT[qi]
|
|
948
1054
|
for (i = 1; i <= ncd; i++) CWD[i] = QUEUE_DIR[qi, i]
|
|
1055
|
+
for (i = 1; i <= ncd; i++) add_link_possible(CWD[i])
|
|
1056
|
+
for (i = 1; i <= QUEUE_LINKS[qi]; i++) add_link_possible(QUEUE_LINK[qi, i])
|
|
949
1057
|
effective_dir = CWD[1]; cwd_depth = 0; cwd_conditional = 0; nwrap = 0
|
|
950
1058
|
clear_pipeline(); pipe_input = 0; filter_compound = 0
|
|
951
1059
|
n = length(s); i = 1; nw = 0; word = ""; wmask = ""; inword = 0; wquoted = 0; wplain = 0; wunquoted = 0; wtranslated = 0; nheredoc = 0; hd_shell = 0; hd_interp = 0; quote_boundary = 0
|
|
@@ -2016,16 +2124,28 @@ function pop_cwd_scope( k) {
|
|
|
2016
2124
|
function change_directory(A, s, n, b, k, j, w, dir, count, nextdir, seen) {
|
|
2017
2125
|
if (b == "popd") return
|
|
2018
2126
|
k = s + 1
|
|
2019
|
-
while (k <= n && A[k] ~
|
|
2127
|
+
while (k <= n && A[k] ~ /^-[[:alnum:]@]+$/ && A[k] !~ /^-[0-9]+$/) { if (A[k] !~ /^-[L]+$/) link_physical = 1; k++ }
|
|
2128
|
+
if (k <= n && A[k] == "--") k++
|
|
2020
2129
|
w = k <= n ? A[k] : ENVIRON["HOME"]
|
|
2130
|
+
if (w !~ /^(\/|\.\.?(\/|$)|~|[-+])/ && (ENVIRON["CDPATH"] != "" || cdpath_set)) link_physical = 1
|
|
2021
2131
|
for (k = 1; k <= ncd; k++) {
|
|
2022
2132
|
if (cwd_conditional && !(CWD[k] in seen)) { seen[CWD[k]] = 1; nextdir[++count] = CWD[k] }
|
|
2023
2133
|
dir = literal_directory(w, CWD[k])
|
|
2024
2134
|
if (!(dir in seen)) { seen[dir] = 1; nextdir[++count] = dir }
|
|
2135
|
+
if (count >= 64) { report("too many possible working directories", "run the command from its own directory without chained cd or pushd"); break }
|
|
2025
2136
|
}
|
|
2026
2137
|
delete CWD; ncd = count
|
|
2027
2138
|
for (j = 1; j <= ncd; j++) CWD[j] = nextdir[j]
|
|
2028
2139
|
effective_dir = CWD[1]
|
|
2140
|
+
count = nlink_possible
|
|
2141
|
+
for (k = 1; k <= count; k++) add_link_possible(literal_directory(w, LINK_POSSIBLE[k]))
|
|
2142
|
+
}
|
|
2143
|
+
# Any cd or pushd may fail and leave the shell where it was, so every combination of the
|
|
2144
|
+
# changes so far is a directory a later read may run in.
|
|
2145
|
+
function add_link_possible(dir) {
|
|
2146
|
+
if (dir in LINK_POSSIBLE_SEEN) return
|
|
2147
|
+
if (nlink_possible >= 17) { link_overflow = 1; return }
|
|
2148
|
+
LINK_POSSIBLE_SEEN[dir] = 1; LINK_POSSIBLE[++nlink_possible] = dir
|
|
2029
2149
|
}
|
|
2030
2150
|
function clear_pipeline() {
|
|
2031
2151
|
if (cwd_depth > 0 && PIPE_SCOPE[cwd_depth]) return
|
|
@@ -2314,9 +2434,9 @@ function analyze(A, s, n, w, b, k, names, p, config, get, show, first) {
|
|
|
2314
2434
|
w = A[s]
|
|
2315
2435
|
if (is_assign(w)) { if (protected_config(w)) config_report(); s++ }
|
|
2316
2436
|
else if (w ~ /^[0-9]*[<>]/) s += (w ~ /^[0-9]*[<>]+&?-?$/) ? 2 : 1
|
|
2317
|
-
else if (w == "-C" || w == "--chdir") { WRAP_DIR[++nwrap] = A[s + 1]; s += 2 }
|
|
2318
|
-
else if (w ~ /^--chdir=/) { WRAP_DIR[++nwrap] = substr(w, 9); s++ }
|
|
2319
|
-
else if (w ~ /^-C./) { WRAP_DIR[++nwrap] = substr(w, 3); s++ }
|
|
2437
|
+
else if (w == "-C" || w == "--chdir") { WRAP_DIR[++nwrap] = A[s + 1]; note_link_wrap(A[s + 1]); s += 2 }
|
|
2438
|
+
else if (w ~ /^--chdir=/) { WRAP_DIR[++nwrap] = substr(w, 9); note_link_wrap(substr(w, 9)); s++ }
|
|
2439
|
+
else if (w ~ /^-C./) { WRAP_DIR[++nwrap] = substr(w, 3); note_link_wrap(substr(w, 3)); s++ }
|
|
2320
2440
|
else if (w == "-u" || w == "-S" || w == "--unset" || w == "--split-string") s += 2
|
|
2321
2441
|
else if (substr(w, 1, 1) == "-") s++
|
|
2322
2442
|
else break
|
|
@@ -2433,8 +2553,10 @@ BEGIN {
|
|
|
2433
2553
|
nstem = split(".env .pem .key .p12 .pfx .jks .keystore .kdbx id_rsa id_ed25519 id_ecdsa id_dsa .netrc .npmrc .pgpass .pypirc .git-credentials .kube/ kubeconfig credentials credential secrets.yaml secrets.yml .docker/ /environ run/secrets", STEM, " ")
|
|
2434
2554
|
CMD = ENVIRON["GS_COMMAND"]
|
|
2435
2555
|
for (pass = 1; pass <= 2; pass++) {
|
|
2436
|
-
delete queue; delete QUEUE_DIR; delete QUEUE_COUNT; queued = 0; qi = 0; delete seen; reports = ""
|
|
2556
|
+
delete queue; delete QUEUE_DIR; delete QUEUE_COUNT; delete QUEUE_LINK; delete QUEUE_LINKS; queued = 0; qi = 0; delete seen; reports = ""
|
|
2437
2557
|
delete CWD; ncd = 1; nwrap = 0; CWD[1] = ENVIRON["GS_CWD_FALLBACK"]; effective_dir = CWD[1]
|
|
2558
|
+
delete LINK_DIR; delete LINK_SEEN; nlink_dir = 0; nlink_wrap = 0
|
|
2559
|
+
delete LINK_POSSIBLE; delete LINK_POSSIBLE_SEEN; nlink_possible = 0; link_overflow = 0; link_physical = 0; cdpath_set = CMD ~ /CDPATH=/ || CMD ~ /(export|declare|typeset|readonly|local|read|printf[ \t]+-v)[^;&|\n]*CDPATH/; add_link_possible(CWD[1])
|
|
2438
2560
|
nheredoc = 0; hd_shell = 0; hd_interp = 0; INLINE = 0; INLINE_HIT = interpreter_hit(CMD) != ""; commands = 0; complex = 0; simple_ok = 1; TAINT = ""
|
|
2439
2561
|
enqueue(CMD)
|
|
2440
2562
|
while (qi < queued) { qi++; tokenize(queue[qi]) }
|
|
@@ -8,7 +8,8 @@ paths:
|
|
|
8
8
|
|
|
9
9
|
- Author shared corpus changes in `Cratis/AI`, generalized and free of private facts; never copy one consumer's `.cratis/ai` or native assistant folders into another repository, and keep consumer settings, private skills and repository knowledge local.
|
|
10
10
|
- Never hand-edit installed managed files, generated adapters or a marketplace wrapper, because the next update overwrites or flags them; install, update, roll back and remove through the channel that installed them (`cratis ai install`, `update`, `uninstall`), previewing with `--dry-run`.
|
|
11
|
-
- Use `cratis ai update --force` only after reviewing the modified managed files it will overwrite; `cratis ai status` exits nonzero when a managed file was modified, so CI can gate on it.
|
|
11
|
+
- Use `cratis ai update --force` only after reviewing the modified managed files it will overwrite; `cratis ai status` exits nonzero when a managed file was modified, so CI can gate on it. In CI, install a pinned `Cratis.Cli` .NET tool with a .NET SDK that supports the package's target framework (currently .NET 11), with the .NET and ASP.NET Core runtimes it needs; a runtime-only image cannot run `dotnet tool install`. On macOS or Linux (x64 or arm64) you can instead use the matching pinned, self-contained native release binary, which needs no .NET runtime; there is no native Windows binary.
|
|
12
|
+
- When stdin is redirected, pass `--profiles` and `--harnesses` to `cratis ai install` (`--languages` is optional), or it exits 5 before downloading the corpus. `cratis ai update` takes no selection options and reuses `.cratis/ai.json`; run `install` again to change the selection. Both take whatever the corpus source currently holds and the installed revision pins nothing; to reproduce a reviewed revision, point `--source` or `CRATIS_AI_SOURCE` at a fresh, full `Cratis/AI` checkout of that commit with no extra files, including ignored ones such as a `.env`, and supply it on every run. The CLI reads the selected corpus files from disk, not from Git's tracked tree, so extra files in selected directories are installed even when ignored and a clean `git status` is not enough; it asks Git only for `HEAD` to record the revision, and the source is not saved for later runs.
|
|
12
13
|
- Never merge, overwrite or remove project context (repository documentation, `.cratis/ai/rules/project.md`, local bootstraps, user prompts) while installing, updating, rolling back or uninstalling, and never delete a project-owned prompt because an old corpus supplied one.
|
|
13
14
|
- Treat `mcp-servers.json` as launch capability, not permission: enable an optional server only once authorized, and opt out with `mcpServers.<id>.enabled: false` in `.cratis/ai.json`.
|
|
14
15
|
- Audit by reporting missing, stale, modified and dangling paths separately with the smallest repair, and change nothing unless asked; never remove user-owned or legacy adapters as a side effect of a canary.
|
|
@@ -13,7 +13,7 @@ paths:
|
|
|
13
13
|
An exit code is the verdict; a wrapper that loses it turns a red run green.
|
|
14
14
|
|
|
15
15
|
- Exit our checkers `0` for ran clean, `1` for found defects and `2` for could not run, and report `2` as "not run", never as clean or as defects. Interpret an external tool by its documented codes; never map failure, interruption or unknown to success.
|
|
16
|
-
- Preserve the child's status before filtering output: `pipefail`, or `PIPESTATUS` captured immediately, in Bash; `$LASTEXITCODE` immediately after a native command in PowerShell. Accumulate failures across a loop instead of trusting its last iteration.
|
|
16
|
+
- Preserve the child's status before filtering output: `pipefail`, or `PIPESTATUS` captured immediately, in Bash; `$LASTEXITCODE` immediately after a native command in PowerShell. Accumulate failures across a loop instead of trusting its last iteration. Under `-e` (GitHub Actions' `shell: bash` enables `errexit` and `pipefail`, and `set -uo pipefail` does not turn it off), capture an external command's code with `status=0; tool || status=$?` before branching on it, because a failing `tool; status=$?` exits before the capture. Bash ignores `-e` inside a function or compound command on the left of `||`, so such a wrapper must propagate each failure explicitly or a failed step falls through to a later success and reads as `0`: `step || return $?` inside a function, `( step || exit $?; … ) || status=$?` for a subshell group.
|
|
17
17
|
- Ship a `--self-test` that plants known violations and fails unless it detects every one, because a checker that cannot fail proves nothing (non-vacuity: `guards-and-fuses`).
|
|
18
18
|
- Never add `|| true`, discard stderr or swallow an error to quiet a gate, because that silently stops checking.
|
|
19
19
|
- Keep wrappers thin and name the failing subject (path, id, rule) in the failure line, so the failure is actionable without a rerun.
|
|
@@ -10,7 +10,7 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
10
10
|
|
|
11
11
|
## Events & streams
|
|
12
12
|
|
|
13
|
-
- **Event** — an immutable, past-tense **fact** that something happened; declared with `[EventType]` in .NET.
|
|
13
|
+
- **Event** — an immutable, past-tense **fact** that something happened; declared with `[EventType]` in .NET. A stored payload is replaced with a marker only by an explicit redaction request: a redaction (of one event, or of an event source's events) replaces the stored payload in the target event sequence only, not in copies made earlier such as backups, exports or events already forwarded to an inbox; system event store events cannot be redacted. An explicit revision corrects content and keeps the original. Both keep the event's sequence number; a redacted event leaves a marker with the reason. A compensation is a new event linked to the one it offsets.
|
|
14
14
|
- **Event source** — the entity or process whose changes are recorded; one event source can have multiple named streams.
|
|
15
15
|
- **Event source id** — the append routing identity of an event source, carried in event context. Do not duplicate it in the payload just to identify the current source. A related source ID can be part of the fact.
|
|
16
16
|
- **Event stream** — an ordered part of an event source’s history within an event sequence. A stream type names the part; a stream ID selects an instance of that part.
|
|
@@ -18,7 +18,8 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
18
18
|
- **Event log** — the default event sequence where domain events are appended.
|
|
19
19
|
- **Outbox / inbox** — cross-service event sequences: a producer appends its public contract event to the outbox; a consumer observes the inbox.
|
|
20
20
|
- **Public event** — an event type that is part of the contract an event store exposes to other services (`.NET`: `[Public]` or `[EventStore]` on the type, or `[EventStore]` on its assembly; otherwise private). The outbox rejects private events and the event log rejects public events.
|
|
21
|
-
- **EventContext** — metadata traveling with an event
|
|
21
|
+
- **EventContext** — metadata traveling with an event: event source id, sequence number, occurred, correlation id and causation chain, caused-by identity, tags, event type with the delivered generation, stream type and id, event store and namespace, and subject. Which further members exist depends on the SDK: .NET also exposes the generation the event was appended in and, only when the event is a compensation, the sequence number it compensates for; other SDKs may omit either or report them differently, so check the SDK before relying on them. Read these from the context instead of copying them into the event; `cratis-chronicle-react-to-fact` (`references/csharp.md`) lists the .NET context members.
|
|
22
|
+
- **Integration event** — an event that crosses a system boundary. With Chronicle outbox/inbox subscriptions, outbound it is the public contract event a producer appends to its outbox, and a consumer's reactors, reducers and projections may observe that contract directly on the inbox; other outbound delivery, such as a webhook, need not go through an outbox. Inbound raw data from an outside system, recorded as received in that system's terms as an event type of its own, stays at the boundary: only the Translation slice observes it, and everything else consumes the facts we own that the translation records.
|
|
22
23
|
|
|
23
24
|
## Read side
|
|
24
25
|
|
|
@@ -28,6 +29,7 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
28
29
|
- **Reactor** — observes recorded events to trigger effects such as notifications, commands or follow-up events. See `cratis-chronicle-react-to-fact` for the client’s registration and delivery conventions.
|
|
29
30
|
- **Observer** — a projection, reducer or reactor consuming an event sequence and maintaining subscription, replay and quarantine state. A projection's replay and catch-up are one globally ordered step, a new failure stops that catch-up, a full replay leaves the observer inactive, and completing it does not resume an observer from quarantine; do not generalize this ordering to reducers.
|
|
30
31
|
- **Sink** — where Chronicle sends projection or reducer state: a store such as MongoDB (the default document store) or an EF Core-backed SQL sink, or an event-sequence sink that publishes the state as new events.
|
|
32
|
+
- **To-do list** — a read model of pending work that an Automation drains: an opening event adds the item, every event that closes the work removes it, and on each pass the reactor sends one command per eligible item (for example, one whose deadline has passed), not per listed item. The list can lag, so it only nominates candidates; the command rechecks current state.
|
|
31
33
|
- **AutoMap** — Chronicle's on-by-default mapping of matching event→read-model property names; omit `.AutoMap()` unless explicitly re-enabling mapping after `.NoAutoMap()`.
|
|
32
34
|
- **Graph** — a named property graph that events build through a graph projection: nodes, edges and their properties. Derived state like a read model; nothing writes to it directly.
|
|
33
35
|
- **Node** — a graph element with a label, one unique key and primitive properties. The label is the type name.
|
|
@@ -50,7 +52,7 @@ One precise line per load-bearing term, so the same word means the same thing ev
|
|
|
50
52
|
|
|
51
53
|
## Structure & types
|
|
52
54
|
|
|
53
|
-
- **Slice** — the vertical unit of one behavior (command
|
|
55
|
+
- **Slice** — the vertical unit of one behavior, grouping only the artifacts that behavior needs (any of command, events, projection, read model, query, component, specs; a listing slice may have a read model, query and projection but no command or new event), created/changed/deleted together. Its folder is named for the capability (`Registration`, `Listing`), not for the command type; when present, a command is named in the imperative and an event in the past tense.
|
|
54
56
|
- **Slice types** — **State Change** (command → events), **State View** (events → read model), **Automation** (events → side effect, including a follow-up command or event — a Screenplay `produces` / `invokes`), **Translation** (data from *outside* the model's own facts → our own facts: an external system's or another service's data recorded as events we own, keeping the external fact distinct from the local one; a Screenplay `Translate` slice with `direction outbound` is the other direction, publishing our private facts as one public contract event). A reactor that turns our own event into a follow-up event or command is an Automation, not a Translation.
|
|
55
57
|
- **Concept** — a named type wrapping exactly one scalar domain value (`ConceptAs<T>` in C#, TypeScript, Kotlin and Java; a defined type in Go; `use Cratis.Chronicle.Concept` in Elixir); the bare scalar on every wire and in every store.
|
|
56
58
|
- **Event-source identity** — the concept type that addresses one Chronicle event history (`EventSourceId<T>` in C#); only such identities use it, every other identity is a plain concept.
|
|
@@ -11,8 +11,10 @@ paths:
|
|
|
11
11
|
|
|
12
12
|
- Call the backend through generated proxies, never raw `fetch`, since copied routes and types drift. Compose slices on a page only through their exported components, never their internals, so each slice stays removable. See `cratis-arc-react-bind-slice`.
|
|
13
13
|
- Call hooks unconditionally; gate a query with `Query.when(condition).use(args)`, since a skipped hook breaks React's hook order.
|
|
14
|
-
- Render unauthorized, refused and failed results apart from pending and empty, since an empty list hides a refusal. Show a neutral failure message, never exception text or stack traces, which expose internals. Let observable queries show accepted writes; a locally patched list drifts from the read model.
|
|
14
|
+
- Render unauthorized, refused and failed results apart from pending and empty, since an empty list hides a refusal. Show a neutral failure message, never exception text or stack traces, which expose internals. Let observable queries show accepted writes; a locally patched list drifts from the read model. Edge case: for a gesture that must show its result in the same frame, such as a drop or a paste, see `cratis-arc-react-bind-slice` (`references/typescript-instant-feedback.md`). A command built there with `new` instead of `use()` does not get the host's locale: before executing, call `setRequestDefaults({ locale: arc.localeStore, httpHeadersCallback: arc.httpHeadersCallback })` on it with `arc` from `useContext(ArcContext)`.
|
|
15
15
|
- Bind live collections with the observable query's `.use()` hook; Suspense and raw `subscribe` do not apply delta updates. Render `useSuspense()` inside a `QueryBoundary`, which supplies the fallback and catches failures.
|
|
16
16
|
- On sign-in, sign-out or account switch, change the credentials first, then `refresh()` the identity (`clearIdentity()` on sign-out) and call `reconnectQueries()` before caller-scoped data renders: the identity calls touch only the identity, while reconnecting drops cached results and live connections that still belong to the old caller. Reserve a full page load for identity-provider redirects or an intentional app reset. See `cratis-arc-react-bind-slice`.
|
|
17
|
+
- Set the UI language with the `locale` prop on `<Arc>`, never a hand-written `Accept-Language` header: the header replaces the language Arc sends, and a native WebSocket or EventSource handshake cannot carry it, so a live stream carries its language in its URL. With a locale set, that is the active language by default; a header override replaces it only when it is one valid language tag, and a preference list is left out of the URL, so the stream stops following the UI language. See `cratis-arc-react-bind-slice` (`references/typescript-localization.md`).
|
|
18
|
+
- Read a command form's values through the form's own instance (`useCommandInstance()` beneath the form) and submit through the form: its own submit, or, for a plain `CommandForm` only, the form handle's `execute()` (`formRef`) for a button outside it. Submit a `CommandStepper` only through its own Submit: its `formRef` reaches the inner form and skips the stepper's before-execute step and confirmation. Calling the instance's `execute()` skips the form's custom field errors and result callbacks; calling the command's `use()` beside the form creates a second instance that can submit different values from those on screen. See `cratis-components-submit-form`.
|
|
17
19
|
- Keep view models plain classes. Mark one with constructor parameters `@injectable()` and type each dependency as a class or explicit token, never a bare interface, which compiles away and cannot be resolved. Release subscriptions in `detached()`, or they outlive the view. Wrap a child that reads view-model state itself in `observer` from `@cratis/arc.react.mvvm`, or it will not re-render. Keep `@cratis/eslint-plugin-arc` recommended rules on; they reject hooks in view models and direct `mobx-react` imports. See `cratis-arc-react-separate-view-model`.
|
|
18
20
|
- Ask confirmation through the shared confirmation hook or `IDialogs`, never `window.confirm`, and act only on `DialogResult.Yes` or `Ok`, since dismissal resolves to `Cancelled`. Start a busy indicator without awaiting it, since its promise settles only on close, and close it in `finally`, since users cannot dismiss it. See `cratis-components-coordinate-feedback`.
|
|
@@ -19,8 +19,10 @@ profile: application
|
|
|
19
19
|
- Start a new effect-producing reactor at the tail, or have it ignore older facts; its first catch-up is not a replay, so replay exclusion does not stop it.
|
|
20
20
|
- Exclude effect-producing handlers from replay, and still make every effect idempotent: exclusion does not stop retries or redelivery. Key each external call by the stable delivery identity plus an effect name, never an attempt number, for the receiver to deduplicate.
|
|
21
21
|
- Return follow-up events or commands instead of appending to the event log yourself, so they belong to the delivery. Derive them from the event and stable state, never a fresh ID or the clock, so a redelivery produces the same output.
|
|
22
|
-
- Never swallow a failed effect; let it fail the partition so it retries visibly. Do not throw to reject malformed or refused input: record a failure fact, because failed
|
|
22
|
+
- Never swallow a failed effect; let it fail the partition so it retries visibly. Do not throw to reject malformed or refused input: record a failure fact, because a failed partition stalls every later event for that event source, and once its retries are used up on the same event it is quarantined: automatic retries stop. It moves on through an authorized manual retry, which is still accepted but keeps the spent budget, by clearing that partition's quarantine, or, on a replayable reactor, by a successful replay that covers the failed event. Other event sources can keep flowing while the observer stays active. A batch handler that throws fails every partition in the batch, so report the failure for the affected partition when the rest can succeed. Failed partitions quarantine the observer as a whole only when a kernel failure threshold is enabled and reached, and both thresholds are off by default; a reactor partition whose latest failure is a timeout does not count toward them; the observer can still be quarantined for other reasons, such as a catch-up that cannot start.
|
|
23
|
+
- A handler may await the work of the delivery it is handling, but must not hold that delivery open for a future business fact, an approval or a deadline. Handle a later fact in its own handler; for a deadline, an approval or any process that pauses, keep a work-list item open and continue in the reactor for the fact that ends the wait (`cratis-chronicle-react-to-fact`, "Multi-step processes"). Never sleep, block or keep an in-memory timer to wait for one: a handler that does not answer in time times out. Live delivery records that as a failed partition; catch-up and replay can run the timed-out step again first, so the handler may run more than once before the failure is recorded. Once it is recorded, automatic recovery retries only while that partition has retries left, and an in-memory timer is lost on restart.
|
|
23
24
|
- Keep reactors stateless and shared dependencies thread-safe; partitions can run concurrently.
|
|
25
|
+
- Never assume a projection or reducer has handled the event the reactor is handling: every observer advances on its own, so a stored read model may not include that event yet. Decide from the event itself or on-demand state (`cratis-platform-deliver-slice`, `references/eventual-consistency.md`).
|
|
24
26
|
- Do not delete, revoke, bill or notify because a stored read model lacks something: it lags the log and reads empty while rebuilding, so decide from the events or on-demand state. Cap the subjects one unattended pass may act on and refuse an implausible count, so one bad input cannot sweep everything.
|
|
25
27
|
- Guard against reacting to what the reactor itself produced, or one input loops.
|
|
26
28
|
- Commands a reactor returns run without the caller's identity and run again on redelivery: make them idempotent, and when they need authorization run them as a system identity holding only the roles they need (`cratis-arc-authorize-request`).
|
|
@@ -14,8 +14,9 @@ paths:
|
|
|
14
14
|
|
|
15
15
|
# Scripts and tooling
|
|
16
16
|
|
|
17
|
+
- These rules choose the language of scripts and tooling you add to a repository. When asked to fix an existing script, workflow step or snippet, fix it in its own language and do not rewrite it in another language unless asked, because the person asked for that script. The only exception is porting Python that is not part of a Python package, including inline Python in a shell step, described below. In Bash, check exit codes explicitly; use strict mode (`set -euo pipefail`) only where it keeps the script's intended behaviour, and do not change the caller's shell options in sourced or interactive snippets.
|
|
17
18
|
- Write repository scripts, CI helpers and tooling in Node with only `node:` built-ins (`.mjs`, or `.ts` limited to erasable syntax: no enums or parameter properties), because Node and the .NET SDK are the only runtimes every Cratis build machine and runner has.
|
|
18
19
|
- Use a C# file-based app (`dotnet run --file tool.cs`, pinned `#:package`) only when the script needs .NET, Cratis libraries or product types, and never in hooks or per-call hot paths, because of its startup cost.
|
|
19
20
|
- Write hooks under `.cratis/ai/hooks` in Bash 3.2-compatible shell or Node, because macOS ships Bash 3.2. Read a hook's small stdin payload with `IFS= read -r -d '' x || true`, not `$(</dev/stdin)`.
|
|
20
|
-
- Add no Python scripts or `python3` workflow steps
|
|
21
|
+
- Add no Python scripts or `python`/`python3` workflow steps except in a Python package and its build tooling, such as a Python client package and the steps that generate, test and publish it, even when the rest of the repository is not Python. Keep a Python package's existing Python scripts in Python and its existing shell steps in shell unless asked to rewrite them. Port any other existing Python script to Node in the change that substantially edits it. This includes inline Python in a shell step: port only the inline Python and leave the surrounding shell as it is.
|
|
21
22
|
- As an agent, edit files with the edit or write tools, query JSON with `gh --jq` or `jq`, and run ad-hoc logic with `node -e` or `node --input-type=module`. Never use `python3 -c` or rewrite files by script, because a scripted rewrite escapes per-edit review.
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "**/for_*/**/*.cs, **/when_*/**/*.cs"
|
|
2
|
+
applyTo: "**/for_*/**/*.cs, **/when_*/**/*.cs, **/when_*.cs, **/given/**/*.cs"
|
|
3
3
|
paths:
|
|
4
4
|
- "**/for_*/**/*.cs"
|
|
5
5
|
- "**/when_*/**/*.cs"
|
|
6
|
+
- "**/when_*.cs"
|
|
7
|
+
- "**/given/**/*.cs"
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
# C# specs
|
|
9
11
|
|
|
10
|
-
- Name spec projects `<Source>.Specs`. Start a new one on `Cratis.Specifications.XUnit.v3`; keep an existing project's runner with its matching adapter package, which wires the lifecycle into that runner.
|
|
12
|
+
- Name spec projects `<Source>.Specs`. In a separate spec project, mirror the slice's relative path under the project root, `<Source>.Specs/<Feature>/<Slice>/`, and put the spec folders there (for example `for_<Unit>/` or `when_<behaviour>/`). Start a new one on `Cratis.Specifications.XUnit.v3`; keep an existing project's runner with its matching adapter package, which wires the lifecycle into that runner.
|
|
13
|
+
- Keep an existing co-located layout: where the application project already compiles specs beside its slices, extend it and add no separate spec project, not even for running-kernel specs. Its setup is the project's own, not universal: some exclude only the spec folders from non-Debug builds and run through the application's entry point, others also exclude flat `when_*.cs` files and run with `dotnet test`. Read the project's exclusion patterns and run command, place spec files only where the exclusion reaches, and use the suite's established filter to keep infrastructure out of ordinary runs.
|
|
11
14
|
- Write `Establish` for setup, `Because` for the one action and `should_*` facts marked with the runner's fact attribute (none on the native runner). `Given`/`When` are aliases: one name per phase per class. A `given/` context holds `Establish` only; `all_dependencies` creates the substitutes. Lifecycle runs base-first, so never call a base lifecycle method.
|
|
12
15
|
- Keep the shared lifecycle: facts share one instance and may run concurrently, so they only read, even through a helper (no assignment, `Add`, `Returns`, `Dispose` or second action); every mutation goes in `Establish` or `Because`. Use `[PerFactSpecificationLifecycle]` only when isolation genuinely requires it.
|
|
13
16
|
- Return `Task`, never `async void`, from facts and lifecycle methods, and await every `Task`-returning `Should*`: a discarded assertion can never fail.
|
|
@@ -18,4 +21,4 @@ paths:
|
|
|
18
21
|
- Reuse `GlobalUsings.Specs.cs` without repeating its imports; alias a type a namespace shadows (CS0118) with a `using` placed last.
|
|
19
22
|
- Run a built suite without rebuilding and check its exit status and teardown result, not only passing facts. After changing a widely substituted interface, build the whole spec project; after a runner migration, account for every previously discovered case and skip.
|
|
20
23
|
|
|
21
|
-
Mechanism, packages and runner options: `cratis-specifications-isolate-behavior`; scenarios: `cratis-specifications-exercise-backend
|
|
24
|
+
Mechanism, packages and runner options: `cratis-specifications-isolate-behavior`; scenarios: `cratis-specifications-exercise-backend`, whose `references/csharp-colocated.md` covers specs kept beside the slice; run commands and filters: `run-tests`.
|
|
@@ -16,9 +16,9 @@ paths:
|
|
|
16
16
|
|
|
17
17
|
Group by behavior, not by technical layer. Each slice has exactly one type:
|
|
18
18
|
|
|
19
|
-
- **State Change**: a command is accepted or refused
|
|
19
|
+
- **State Change**: a command is accepted or refused. An accepted command appends events or, in an application that is not event sourced, writes through the application's store, and may change nothing when it repeats work already done. A refused command never applies the requested change.
|
|
20
20
|
- **State View**: events build a read model that queries expose.
|
|
21
|
-
- **Automation**: reacts to a committed event with a follow-up command or an outside call.
|
|
21
|
+
- **Automation**: reacts to a committed event with a follow-up command or an outside call. Without events, trigger the side effect explicitly, and only after the command's write is confirmed committed: a store call that returned inside an open transaction is not yet committed. That is separate from the inline operations a command returns as part of its own write.
|
|
22
22
|
- **Translation**: turns input from outside our own facts into our facts.
|
|
23
23
|
|
|
24
24
|
Non-negotiables:
|
|
@@ -26,8 +26,11 @@ Non-negotiables:
|
|
|
26
26
|
- **Layout.** `<Module>/<Feature>/<Slice>/` under one slice root: the source or package root, or the single artifact folder (such as `Features/`) an SDK's discovery and generator scan so the host stays outside it. Add no other wrapper or technical-layer folder; a single-capability application starts at `<Feature>/<Slice>/`. The namespace, package or module mirrors the path.
|
|
27
27
|
- **Renaming is a migration.** A namespace or package rename can change stored observer identities and Arc routes; never treat it as a plain file move.
|
|
28
28
|
- **One slice is one unit.** Its command, events, read model, reaction and screen live in its folder and ship with its specifications. Declare its backend artifacts in one `<Slice>` file unless the language needs a file per public type, so the slice reads and changes as one. Report a partly done slice as partial; never stub it.
|
|
29
|
+
- **One command per slice by default.** Give each command its own slice folder unless the model puts several commands in one state-change slice. On .NET, when command names are left out of Arc routes, a second HTTP-mapped command in the same namespace, counted after the skipped route segments, puts the type name back into the conventional route of each, which changes the URL of a command that had no name in it. Protocol-only commands do not count. An explicit route stays as written but still counts as a command in its namespace. Other backends route differently, so check the generated routes before adding a command.
|
|
29
30
|
- **Slices do not call each other.** Read another slice's published state or react to its fact; never invoke its handler or service. Compose through the command pipeline and propagate refusal.
|
|
30
31
|
- **Concepts stay home.** Keep a concept in its slice until another slice shares the meaning, then move it one level up (`cratis-fundamentals-name-value`).
|
|
32
|
+
- **Events have a home too.** Declare an event once, in the slice that owns the fact, which is not always the only slice that appends it. Other slices that append, project or react to it import it, never copy it. When no single slice owns the fact, move it to the feature root or another shared scope and keep its event type ID unchanged.
|
|
33
|
+
- **Screens connect through the feature.** A slice's screen never imports a sibling slice's screen. It takes what it needs as callback props, and the feature's composition page connects them (`cratis-arc-react-bind-slice`, `references/typescript-structure.md`).
|
|
31
34
|
- **Facts.** Append observed transitions, not repeated polls, to the history the fact belongs to. Guard a decision against concurrent writers, because a plain append does not protect what was read (`cratis-chronicle-protect-decision`). Keep confidential inputs out of causation.
|
|
32
35
|
- **Facts are not views.** Never append an event for a total, count or status label that existing facts and the clock already determine, such as overdue or past due: store the deadline, project the rest and compare at the query or screen. Record an expiry or status change as a fact only when the business treats it as a transition that changes rights or releases something, such as an expired invitation freeing its email address for reuse, and append it once, when the transition is decided. Record a fact once, either per item or as one event carrying the list, never both, and record the one decision that changed rather than a whole settings object. A refused command appends nothing unless the business must audit or react to the refusal. Keep the event source ID and the time it was recorded out of the payload; both travel with the event (`cratis-modeling-design-event-model`).
|
|
33
36
|
- **Projections fold; reactors act.** A projection has no effects, because rebuilds replay it. A reactor reads state through read models and acts by returning commands or events or by an outside call, never by reading or appending to the event log itself.
|