@cratis/pi 8.5.0 → 8.7.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/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/specs.csharp.instructions.md +6 -3
- package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +5 -2
- 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/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 +0 -2
- 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 +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +19 -0
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp-query-security.md +15 -0
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +12 -3
- package/package/corpus/skills/cratis-arc-declare-command/SKILL.md +2 -0
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp-chronicle.md +46 -7
- 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 +4 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +31 -4
- package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +24 -2
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp.md +49 -0
- package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +3 -1
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +27 -4
- package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +1 -0
- package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +49 -2
- 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 +84 -2
- package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +2 -0
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +2 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +18 -1
- package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +2 -0
- package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +18 -16
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-commands.md +8 -3
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-host.md +84 -16
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-identity.md +22 -2
- 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 +40 -1
- 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 +7 -3
- 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-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-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 +2 -2
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +28 -0
- 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/typescript.md +10 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +8 -1
- 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 +2 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/configuration.md +27 -0
- 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 +13 -6
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +45 -0
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +91 -1
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/upgrade-and-recovery.md +9 -0
- package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +12 -0
- package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +11 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +14 -3
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-model-bound.md +3 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-reading.md +3 -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 +2 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +1 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -0
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp-scopes.md +40 -3
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +20 -2
- 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/references/csharp.md +24 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +41 -0
- 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 +17 -0
- 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.md +35 -2
- 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 +1 -0
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -0
- package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
- 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-code-review/references/csharp-diagnostics.md +28 -2
- package/package/corpus/skills/cratis-code-review/references/csharp.md +1 -1
- 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/references/typescript-commandform.md +72 -2
- package/package/corpus/skills/cratis-components-submit-form/references/typescript.md +5 -3
- 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 +70 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/csharp.md +8 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/go.md +1 -0
- package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-serialization.md +33 -0
- package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +2 -1
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md +5 -0
- 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-diagnose-slice/SKILL.md +1 -1
- 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-screenplay-accept-model/references/csharp.md +29 -0
- package/package/corpus/skills/cratis-screenplay-accept-model/references/read-the-evidence.md +82 -1
- package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/structure-and-imports.md +10 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -4
- 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/typescript.md +13 -0
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/workspace-mcp.md +5 -0
- 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 +3 -1
- 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 +1 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-integration.md +4 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-reactors.md +3 -3
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +34 -1
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +2 -0
- 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/profile-catalog.json +15 -0
- package/package.json +1 -1
package/package/corpus/skills/cratis-modeling-design-event-model/references/command-inventory.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Inventory entries, refusals and transitions
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Entry paths
|
|
6
|
+
- Refusal inventory
|
|
7
|
+
- Transition table
|
|
8
|
+
|
|
3
9
|
Read this at the inventory step. Three tables expose how a command is reached, how it can fail, and what it does in each state of the item it changes. A blank cell is an open question, not a default.
|
|
4
10
|
|
|
5
11
|
## Entry paths
|
|
@@ -14,7 +20,7 @@ Every command needs at least one reachable, authorized entry. A command nothing
|
|
|
14
20
|
| `ReopenTicket` | Resolved-tickets list, row action | Agent | Selected row | None |
|
|
15
21
|
| `CloseTicket` | Resolved-tickets list, row action | Team lead | Selected row | None |
|
|
16
22
|
|
|
17
|
-
Done when every command has a row, every entry is a screen, form, reaction
|
|
23
|
+
Done when every command has a row, every entry is a screen, form, reaction or translation that exists in the model, and the caller's identity and roles satisfy the command's authorization. A reaction entry states the identity it runs as.
|
|
18
24
|
|
|
19
25
|
## Refusal inventory
|
|
20
26
|
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Specify an accepted Screenplay handoff
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Skill order
|
|
6
|
+
- What a model cannot author or execute
|
|
7
|
+
- Record values and protection
|
|
8
|
+
- Workflow nodes
|
|
9
|
+
- Render, run and recover
|
|
10
|
+
- Specification assertions
|
|
11
|
+
- Organize and track the model
|
|
12
|
+
|
|
3
13
|
Read this when the Screenplay opt-in applies. A Screenplay model can author less than code-first delivery and Stage can render less than the model can say; check both limits before promising a slice, and deliver a slice that needs something listed here as unsupported code-first.
|
|
4
14
|
|
|
5
15
|
## Skill order
|
|
@@ -31,6 +41,8 @@ Deliver these code-first; do not approximate them in the model.
|
|
|
31
41
|
|
|
32
42
|
## Workflow nodes
|
|
33
43
|
|
|
44
|
+
This section and the next describe what the Screenplay and Stage tooling does with lifecycle constructs; they are not a recommended application design. For an application process, including waits, approvals and deadlines, model facts, reactions and a to-do list read model whose items the closing fact removes once projected, with each command rechecking current state. Use a state machine or workflow only when the owner has explicitly chosen the model's lifecycle constructs.
|
|
45
|
+
|
|
34
46
|
A workflow runs for one subject, identified by its read model's key. Each node leaves through named outlets; connect each outlet to the next node.
|
|
35
47
|
|
|
36
48
|
| Node | Use it to | Outlets |
|
|
@@ -53,7 +65,7 @@ Passing source validation, a specification or a sandbox run does not prove a con
|
|
|
53
65
|
- **Runs in the sandbox but does not render:** decisions, approvals, foreach, joins and ability calls from actions or state entries, subject to runtime admission. Stage also refuses to render an action that computes a value or invokes a command with more than its identifier, a guard on anything but a text, number or flag member of the followed read model, or a state-entry command whose other properties do not match that model by name and type.
|
|
54
66
|
- **Refused by the runtime:** schedule triggers, anything other than exactly one trigger per workflow, nested foreach, a foreach without exactly one join, a join without a foreach, and an edge with an invalid outlet. A lifecycle refusal in the sandbox does not block the rest of the model.
|
|
55
67
|
- **Command bodies:** Stage renders attached handler bodies written in C# only.
|
|
56
|
-
- **Durability:** the generated application journals workflow run facts in Chronicle, but keeps the index it uses to find active runs in memory by default. Retained Chronicle data alone does not resume runs
|
|
68
|
+
- **Durability:** the generated application journals workflow run facts in Chronicle, but keeps the index it uses to find active runs in memory by default. Retained Chronicle data alone does not resume runs. Verify a run survives a host restart before calling it durable; a passing render or sandbox run says nothing about recovery.
|
|
57
69
|
- Give the generated state machine one required text `Status` member on its read model with the state names as values. If the renderer cannot identify a single status member or the value matches no state, activation falls back to the initial state.
|
|
58
70
|
|
|
59
71
|
## Specification assertions
|
package/package/corpus/skills/cratis-modeling-design-event-model/references/review-one-slice.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Review one slice
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Follow a value, including its address
|
|
6
|
+
- Read back the examples
|
|
7
|
+
- Bound a change
|
|
8
|
+
|
|
3
9
|
Use one instance to follow a decision into its result. A walkthrough may span several slices: the agent opens a ticket, then sees it in the open-tickets list. A specification proves **one** slice: the opening example expects an addressed fact; the list example starts with that fact and expects a row. Neither needs to test the other's decision again.
|
|
4
10
|
|
|
5
11
|
## Follow a value, including its address
|
|
@@ -95,18 +95,18 @@ Stage-rendered repository (which already contains `Source/Composition`).
|
|
|
95
95
|
outside the AppHost stay harmless.
|
|
96
96
|
4. Keep each service's event-store name and read-model database name in the service's
|
|
97
97
|
own settings, so it behaves the same inside and outside the AppHost.
|
|
98
|
-
5.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
that does not use its jobs, event-sourced state machines or workflows.
|
|
98
|
+
5. Give every service its own HTTP address before starting two hosts. If a
|
|
99
|
+
scaffold-generated host still fails because port 11111 or 30000 is taken, that is a
|
|
100
|
+
scaffold issue, not application configuration: see Avoid host-process port
|
|
101
|
+
collisions in your SDK reference.
|
|
103
102
|
6. Run the AppHost. Its dependency wait is not a readiness gate without a health check.
|
|
104
103
|
If startup requires a ready kernel, probe `/health/ready` over HTTPS with a certificate
|
|
105
104
|
the AppHost trusts. Verify every service reaches the kernel address Aspire assigned;
|
|
106
105
|
an unexpected `localhost:35000` usually means an override is missing or read from the wrong key.
|
|
107
106
|
|
|
108
107
|
The AppHost integration is C#-only; see Aspire AppHost in your SDK reference for the
|
|
109
|
-
complete setup, including host-process isolation,
|
|
108
|
+
complete setup, including the AppHost project, host-process isolation, frontends as
|
|
109
|
+
resources, local sign-in through AuthProxy, readiness, persistence and external storage.
|
|
110
110
|
|
|
111
111
|
Hosts that read `Cratis` configuration from settings files and double-underscore
|
|
112
112
|
variables take these variables as they are; any other service reads them (or names
|
package/package/corpus/skills/cratis-multi-service-local-orchestration/references/csharp-aspire.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- The AppHost
|
|
6
|
+
- The AppHost project
|
|
6
7
|
- Service settings
|
|
7
8
|
- Avoid host-process port collisions
|
|
8
9
|
- What each line is for
|
|
10
|
+
- Frontends as resources
|
|
11
|
+
- Sign-in and tenancy locally
|
|
9
12
|
- Variations
|
|
10
13
|
- Chronicle hosting API catalog
|
|
11
14
|
|
|
@@ -14,7 +17,7 @@
|
|
|
14
17
|
The default: one development-image kernel whose bundled MongoDB replica set also serves
|
|
15
18
|
the services' read models. This is the shape Stage renders into `Source/Composition`.
|
|
16
19
|
Install `Cratis.Chronicle.Aspire` in the AppHost only, and reference each service project
|
|
17
|
-
from the AppHost. Resolve
|
|
20
|
+
from the AppHost. Resolve port collisions below before running both projects.
|
|
18
21
|
|
|
19
22
|
```csharp
|
|
20
23
|
// Source/Composition/Program.cs
|
|
@@ -56,6 +59,20 @@ The example declares the services' HTTP endpoints instead of importing launch
|
|
|
56
59
|
profiles. If existing launch profiles or Kestrel settings already define the
|
|
57
60
|
endpoints, configure those to avoid collisions rather than adding duplicates.
|
|
58
61
|
|
|
62
|
+
## The AppHost project
|
|
63
|
+
|
|
64
|
+
The AppHost project declares the Aspire AppHost SDK with an explicit version and
|
|
65
|
+
references `Aspire.Hosting.AppHost`, `Cratis.Chronicle.Aspire` and every service project.
|
|
66
|
+
The `cratis-aspire` template keeps the SDK and `Aspire.Hosting.AppHost` on the same
|
|
67
|
+
Aspire version; do the same. Other `Aspire.Hosting.*` integration packages take a version
|
|
68
|
+
compatible with it, which for some integrations is a prerelease of that version.
|
|
69
|
+
|
|
70
|
+
- Creating or repairing an AppHost by hand: take the SDK declaration and the Aspire
|
|
71
|
+
version from a freshly scaffolded AppHost (`dotnet new cratis-aspire`), not from an
|
|
72
|
+
older repository.
|
|
73
|
+
- Moving to a newer Aspire: change the SDK version and the `Aspire.Hosting.AppHost`
|
|
74
|
+
version together, then move each integration package to a version compatible with it.
|
|
75
|
+
|
|
59
76
|
## Service settings
|
|
60
77
|
|
|
61
78
|
Each service names its own store and read-model database in its own settings, and keeps
|
|
@@ -79,34 +96,16 @@ database stays the store name because the kernel writes the store's read models
|
|
|
79
96
|
|
|
80
97
|
## Avoid host-process port collisions
|
|
81
98
|
|
|
82
|
-
`AddProject` launches host processes
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
those ports. Give each service a distinct HTTP address, and in the service's unmanaged
|
|
86
|
-
`Customizations/Program.cs` implement the scaffold's `ConfigureServices` partial hook to
|
|
87
|
-
assign distinct silo and gateway ports. For Billing, for example (Ordering can keep
|
|
88
|
-
its default pair if free):
|
|
89
|
-
|
|
90
|
-
```csharp
|
|
91
|
-
using Orleans.Configuration;
|
|
92
|
-
|
|
93
|
-
public partial class Program
|
|
94
|
-
{
|
|
95
|
-
static partial void ConfigureServices(WebApplicationBuilder builder) =>
|
|
96
|
-
builder.Services.PostConfigure<EndpointOptions>(endpoints =>
|
|
97
|
-
{
|
|
98
|
-
endpoints.SiloPort = 11112;
|
|
99
|
-
endpoints.GatewayPort = 30001;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
```
|
|
99
|
+
`AddProject` launches host processes on the machine, so they share its ports. Give each
|
|
100
|
+
service a distinct HTTP address in its launch profile or `applicationUrl`; two services
|
|
101
|
+
left on the same address fail on the second start.
|
|
103
102
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
An application built on Arc, Chronicle and Components needs no other listening port. If
|
|
104
|
+
a scaffold-generated host still reports port 11111 or 30000 in use when a second host
|
|
105
|
+
starts, the scaffold registered infrastructure the application does not configure. Treat
|
|
106
|
+
it as a scaffold issue and report it; do not add port settings for it to the application.
|
|
107
|
+
Until it is resolved, run those services as isolated containers, each with its own
|
|
108
|
+
network namespace and without publishing those ports, as in the Compose reference.
|
|
110
109
|
|
|
111
110
|
## What each line is for
|
|
112
111
|
|
|
@@ -134,6 +133,90 @@ before a full re-render.
|
|
|
134
133
|
- **Non-.NET services** are added as containers or executables with the same two
|
|
135
134
|
variables and `WaitFor(chronicle)`.
|
|
136
135
|
|
|
136
|
+
## Frontends as resources
|
|
137
|
+
|
|
138
|
+
The default for a system with several frontends or an ingress: the AppHost starts each
|
|
139
|
+
service's Vite dev server too, so one command runs everything. A single service can
|
|
140
|
+
keep running its dev server by hand.
|
|
141
|
+
|
|
142
|
+
Add the `Aspire.Hosting.JavaScript` package to the AppHost, then one resource per frontend:
|
|
143
|
+
|
|
144
|
+
```csharp
|
|
145
|
+
var orderingFrontend = builder.AddViteApp("ordering-frontend", "../Ordering")
|
|
146
|
+
.WithYarn()
|
|
147
|
+
.WithViteConfig(".frontend/vite.config.ts")
|
|
148
|
+
.WithEndpoint("http", endpoint => endpoint.Port = 9000);
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- **The directory** is the folder holding the frontend's `package.json`, relative to the
|
|
152
|
+
AppHost project. Aspire runs its `dev` script.
|
|
153
|
+
- **`WithYarn()`** selects the package manager and installs packages before the dev
|
|
154
|
+
server starts; without it Aspire uses npm. Use the package manager the repository uses.
|
|
155
|
+
- **`WithViteConfig`** names the configuration file whenever Vite would not find it on
|
|
156
|
+
its own: a file in another folder, or one in the root of that directory under a
|
|
157
|
+
non-default name. The path is relative to that directory.
|
|
158
|
+
- **`AddViteApp` already declares the `http` endpoint** and starts the dev server on the
|
|
159
|
+
port Aspire assigns, by appending `--port` (and `--config`) to the `dev` script. The
|
|
160
|
+
script must therefore forward the appended arguments to Vite: it ends in the `vite`
|
|
161
|
+
command, or in another script that does. That port replaces any `server.port` in the
|
|
162
|
+
Vite configuration.
|
|
163
|
+
- **Pin the port** with `WithEndpoint("http", ...)` when the frontend's address must be
|
|
164
|
+
the same on every run; give every frontend a distinct port.
|
|
165
|
+
- **Point the dev server's API proxy at its own service.** The Vite configuration's
|
|
166
|
+
proxy targets are separate from Aspire, and the Stage scaffold writes
|
|
167
|
+
`http://localhost:5000` for all of them. With the ports in The AppHost (5101, 5102),
|
|
168
|
+
API requests then reach nothing or the wrong service. Keep the service's resource in a
|
|
169
|
+
variable, pass its endpoint to the frontend, and read it in the Vite configuration:
|
|
170
|
+
|
|
171
|
+
```csharp
|
|
172
|
+
orderingFrontend.WithEnvironment("ORDERING_URL", ordering.GetEndpoint("http"));
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
const serviceUrl = process.env.ORDERING_URL ?? 'http://localhost:5000';
|
|
177
|
+
// use serviceUrl as the target of every proxy entry
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The fallback keeps the dev server usable when started by hand. Done when a query from
|
|
181
|
+
the frontend at its Aspire address returns that service's data.
|
|
182
|
+
|
|
183
|
+
## Sign-in and tenancy locally
|
|
184
|
+
|
|
185
|
+
Add Cratis AuthProxy to the AppHost when local runs need real sign-in or tenant
|
|
186
|
+
resolution; until then, run the services without it. The `cratis-authproxy-configure`
|
|
187
|
+
skill owns the wiring: read its `references/aspire.md` for the AppHost methods and
|
|
188
|
+
`references/sign-in-providers.md` for the identity provider.
|
|
189
|
+
|
|
190
|
+
What this topology adds:
|
|
191
|
+
|
|
192
|
+
- Pass the resources already declared here: the service's project resource to
|
|
193
|
+
`WithBackend` and its Vite resource to `WithFrontend`, under the same service name.
|
|
194
|
+
AuthProxy then takes both addresses from Aspire.
|
|
195
|
+
- AuthProxy runs as a container, so the frontend address it receives uses the name
|
|
196
|
+
Aspire gives containers for the host machine, not `localhost`. Vite refuses requests
|
|
197
|
+
for host names it does not know: add `host.docker.internal` and `aspire.dev.internal`
|
|
198
|
+
to `server.allowedHosts` in each fronted Vite configuration, and set `server.host` to
|
|
199
|
+
`true` so the dev server accepts connections from outside the loopback interface.
|
|
200
|
+
- Add `WaitFor` on the proxy for each backend and frontend it fronts, and for an identity
|
|
201
|
+
provider that runs as a container resource in the AppHost.
|
|
202
|
+
- Declare how the browser selects a service. Pairing resources does not route
|
|
203
|
+
navigation: AuthProxy sends unrouted requests to a service only when it is the sole
|
|
204
|
+
service and declares neither hosts nor a path prefix, or when one unrouted service is
|
|
205
|
+
marked as the default. With Ordering and Billing behind one proxy, give each its own
|
|
206
|
+
host with `WithHosts`, for example `ordering.localhost` and `billing.localhost`; a
|
|
207
|
+
host declared without a port matches every port. Each frontend then stays
|
|
208
|
+
at the root of its origin, where its assets, router and generated Arc proxies already
|
|
209
|
+
expect to be.
|
|
210
|
+
- `WithPathPrefix` is not a drop-in alternative. The frontend as scaffolded still requests
|
|
211
|
+
`/api/...` at the root of the origin, which misses the service's prefix. Use it only
|
|
212
|
+
when all of these match the prefix: the frontend's asset base, the router's base name,
|
|
213
|
+
`apiBasePath` on the Arc provider, and the backend, which either serves itself under
|
|
214
|
+
the prefix or has the proxy strip it (`stripPathPrefix: true`).
|
|
215
|
+
- Open the application through AuthProxy at the host or path declared for the service
|
|
216
|
+
(the proxy's plain address only for a sole or default service). Requests sent straight
|
|
217
|
+
to the frontend's or the service's own address do not pass through sign-in or tenant
|
|
218
|
+
resolution.
|
|
219
|
+
|
|
137
220
|
## Variations
|
|
138
221
|
|
|
139
222
|
- **Reference only**, when every service is .NET and none sets
|
|
@@ -162,6 +245,10 @@ before a full re-render.
|
|
|
162
245
|
.WithHttpsHealthCheck("/health/ready", endpointName: "readiness");
|
|
163
246
|
```
|
|
164
247
|
|
|
248
|
+
The PFX must exist when the AppHost starts: a missing file stops the AppHost with
|
|
249
|
+
`CertificateFileDoesNotExist`, which names the configured path and the path it resolved
|
|
250
|
+
to. A relative path resolves against the AppHost project directory.
|
|
251
|
+
|
|
165
252
|
Keep `WaitFor(chronicle)` on the services. Use a dedicated HTTPS endpoint rather than
|
|
166
253
|
probing the `grpc` endpoint as HTTP: its Aspire metadata is HTTP but the kernel listener
|
|
167
254
|
is TLS. If the AppHost reports an unhealthy probe, check the mapped HTTPS address, CA
|
|
@@ -197,6 +284,7 @@ before a full re-render.
|
|
|
197
284
|
- `WithSqlite(connectionString)`: select SQLite kernel storage; mount its file location if it must persist.
|
|
198
285
|
- `WithTlsCertificate(path, password)`: mount a server PFX for a trusted TLS listener; omit the password for an unprotected PFX.
|
|
199
286
|
- `WithEncryptionCertificate(path, password)`: mount a PFX for the kernel's encryption certificate configuration; omit the password for an unprotected PFX.
|
|
287
|
+
- Both certificate methods resolve a relative path against the AppHost project directory and stop the AppHost with `CertificateFileDoesNotExist` when no file is there.
|
|
200
288
|
- `WithHashiCorpVault(endpoint, token)`: use a Vault resource endpoint for compliance encryption keys, with a token provided securely.
|
|
201
289
|
- `WithAzureKeyVault(uri)`: use Azure Key Vault for compliance encryption keys with the kernel's Azure identity.
|
|
202
290
|
- `IChronicleAspireBuilder.ResourceBuilder`: use the underlying Aspire builder when the callback has no wrapper for a container setting.
|
package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md
CHANGED
|
@@ -167,8 +167,8 @@ volumes:
|
|
|
167
167
|
`service_healthy`; the client would also reconnect on its own.
|
|
168
168
|
- **Ports.** Publish only the kernel's 35000 and the services' HTTP ports, bound
|
|
169
169
|
to `127.0.0.1`, because the development image accepts well-known credentials.
|
|
170
|
-
Leave the kernel
|
|
171
|
-
|
|
170
|
+
Leave every other port unpublished, including the kernel's silo and gateway ports;
|
|
171
|
+
containers have separate network namespaces, so equal defaults do not collide.
|
|
172
172
|
- **Image choice.** The development image bundles MongoDB and suits a kernel alone;
|
|
173
173
|
with external storage use the development-slim image. The production image has
|
|
174
174
|
no development client. Plan for configured storage, a certificate for TLS listeners
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
- Kernel spans
|
|
9
9
|
- Metric names
|
|
10
10
|
- Kernel metrics
|
|
11
|
+
- Memory metrics
|
|
12
|
+
- Open incident queries
|
|
11
13
|
- Federation metrics
|
|
12
14
|
- Observer failure logs
|
|
13
15
|
- Local viewer
|
|
@@ -133,6 +135,50 @@ Abnormal-only gauges report an observer only while it needs attention, report ze
|
|
|
133
135
|
- **For current state, use the open-incidents gauge**: `chronicle-alerts-open-incidents` under the default `Legacy` names (Prometheus: `chronicle_alerts_open_incidents`), `alert.open_incidents` under `Convention`. Filter on the incident's severity tag (`Severity` under `Legacy`, values `Warning` or `Critical`); it is not the `severity` label of your alert rule. Page only on `Critical`; treat `Warning` as a warning. Aggregate with `max`, never `sum`, because more than one instance can briefly report the same series. Only the instance that owns the snapshot reports the availability gauge, so evaluate it across all instances: fire when `max(chronicle_alerts_open_incidents_available) == 0 or absent(chronicle_alerts_open_incidents_available)`. An empty incidents gauge does not mean no incidents.
|
|
134
136
|
- **Look up the exported names in the backend before writing rules.** Legacy names gain `_total` through the Prometheus translation, and a name-prefix selector such as `{__name__=~"chronicle_observer_partitions_quarantined.*"}` also matches older kernels' long names.
|
|
135
137
|
|
|
138
|
+
## Memory metrics
|
|
139
|
+
|
|
140
|
+
The kernel reports its own memory under `cratis.chronicle.memory.*` on the `Cratis.Chronicle` meter, whatever `MetricNames` says. The process instruments register when the kernel starts. The `budget.*` instruments register only when the kernel first uses the memory budget, so their absence on a kernel that has not yet needed the budget is not a fault. As with every kernel metric, they are exported only when a metrics OTLP endpoint is configured. Use them, together with `observer.resident`, to size the kernel container from its measured peak; the sizing procedure is in `cratis-chronicle-deploy-kernel`, `references/container-and-kubernetes.md`. Names below drop the `cratis.chronicle.memory.` prefix; sizes are bytes.
|
|
141
|
+
|
|
142
|
+
| Name | Meaning |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `working_set` | Physical memory of the process, managed and unmanaged |
|
|
145
|
+
| `available` | Memory the garbage collector considers available to the process, as limited by the machine, the container or a heap hard limit; it is not necessarily the container limit |
|
|
146
|
+
| `load` | Memory in use on the machine or in the container, as the garbage collector sees it |
|
|
147
|
+
| `committed` | Memory the garbage collector holds from the system |
|
|
148
|
+
| `heap_size`, `fragmentation` | Managed heap size and its fragmented bytes after the last collection |
|
|
149
|
+
| `generation_size`, `generation_fragmentation` | The same two per heap generation; attribute `generation` is `gen0`, `gen1`, `gen2`, `loh` or `poh` |
|
|
150
|
+
| `allocated` | Counter of bytes allocated on the managed heap; its rate is the allocation rate |
|
|
151
|
+
| `collections`, `gen2_collections` | Counters of garbage collections per `generation` (`gen0`, `gen1`, `gen2`), and of full collections |
|
|
152
|
+
| `pause_duration`, `pause_time_ratio` | Counter of seconds paused for garbage collection (its rate is pause time per second); percentage of time paused |
|
|
153
|
+
| `budget.capacity`, `budget.reserved` | Total bytes the memory budget allows at the moment, before reservations are subtracted, and bytes reserved. `reserved` can exceed `capacity` (capacity follows memory pressure and can drop, and a reservation is let through after the maximum wait); there is then no room left, not negative room |
|
|
154
|
+
| `budget.waiting`, `budget.queued`, `budget.overcommitted` | Reservations waiting now; counters of reservations that had to wait, and of those let through after the maximum wait |
|
|
155
|
+
| `budget.wait_time` | Histogram of how long a reservation waited before it was let through, milliseconds; recorded when the wait ends, so it says nothing about reservations still waiting |
|
|
156
|
+
|
|
157
|
+
- **Live against retained memory**: `committed` is what the collector holds for the whole heap, every generation including `loh` and `poh`. Compare it with `heap_size` minus `fragmentation`, read after full collections (`gen2_collections` advancing): that difference approximates memory the collector holds beyond live objects. Do not compare `committed` with `gen2` alone, because live objects in the large-object or pinned-object heap would then look like retained memory. To find where growth is, watch `generation_size` per generation across full collections; a generation that keeps growing points to a leak.
|
|
158
|
+
- **Queuing for memory**: `budget.waiting` is the current queue; staying above zero means large reductions are waiting for room now. `budget.wait_time` covers only waits that ended in the reservation being let through, so rising values show how long past reductions queued, and a rising `budget.overcommitted` shows waits that hit the maximum. Raise the container memory limit, or tune the memory budget (options in `cratis-chronicle-deploy-kernel`, `references/configuration.md`).
|
|
159
|
+
|
|
160
|
+
## Open incident queries
|
|
161
|
+
|
|
162
|
+
The open-incidents gauge is the default for alert rules. Use the kernel's alert incident queries when a dashboard or paging tool needs the incidents themselves: which observer and partition, which condition, since when. They are read-only queries on the kernel's HTTP API. When kernel authentication is disabled, they are open to any caller that can reach the API. When it is enabled, the caller must be authenticated, and for an ordinary event store the `chronicle.alerts.read` capability is evaluated for the event store, and the namespace when given, that the query asks about. By default a missing grant on an ordinary event store is audited, not refused; it is refused once store entitlements are enforced. Queries against the System event store do not use this capability; they follow the kernel's separate access policy for that store. The same three queries exist on the kernel's gRPC alerts service; the Go client's helpers for them are in `cratis-chronicle-inspect-observer`.
|
|
163
|
+
|
|
164
|
+
| Route | Arguments | Fields in `data` |
|
|
165
|
+
| --- | --- | --- |
|
|
166
|
+
| `/api/alerts/get-open-incidents` | `eventStore` (required); optional `namespace`, `observerId`, `condition`, `minimumSeverity`, `limit`, `afterRaisedSequenceNumber`, `afterIncidentId` | `status`, `items`, `next` |
|
|
167
|
+
| `/api/alerts/get-open-incident` | `eventStore` and `incidentId` (required); optional `namespace` | `status`, `incident` |
|
|
168
|
+
| `/api/alerts/get-open-incident-counts` | `eventStore` (required); optional `namespace` | `status`, `counts` |
|
|
169
|
+
|
|
170
|
+
The HTTP response is the Arc query result envelope; the fields in the last column are inside its `data`, not at the top level.
|
|
171
|
+
|
|
172
|
+
- **Scope**: `eventStore` is the affected event store and is always required; there is no query across stores. Omitting `namespace` covers every namespace of that store. Over HTTP, names match case-sensitively; the gRPC service first resolves a supplied namespace to its stored casing.
|
|
173
|
+
- **Filters**: `minimumSeverity` keeps incidents at or above that severity (`Critical` ranks above `Warning`). `condition` takes the condition name, for example `partition-retries-exhausted`.
|
|
174
|
+
- **Incident**: its id, target (including the partition for partition conditions), condition, severity, evidence, raise and last-change times, and raise and last-transition sequence numbers.
|
|
175
|
+
- **Counts** cover every matching open incident, grouped by namespace, condition and severity; they are not counts of a page.
|
|
176
|
+
- **Read `status` first.** Only with `Ready` does an empty result, or an absent `incident`, mean that no matching incident was materialized when the query ran; a cleared incident is also absent. Readiness is sampled and tolerates work in flight, so an incident raised a moment ago can still be missing. `CatchingUp` and `Degraded` results can be partial or stale. A storage failure fails the query; it never returns an empty result.
|
|
177
|
+
- **Paging**: pages are ordered by raise sequence number, then incident id. `limit` defaults to 100 (also when `0`), is capped at 500, and a negative value is rejected. When `next` is present, send its `raisedSequenceNumber` as `afterRaisedSequenceNumber` and its `incidentId` as `afterIncidentId`, with scope and filters unchanged. Always send both: without `afterIncidentId` the sequence number is ignored and paging starts over.
|
|
178
|
+
- **No snapshot** spans pages, or a page and the counts. An incident raised again after clearing gets a new raise position, so it can appear again or disappear during a traversal; treat a full traversal as approximate.
|
|
179
|
+
|
|
180
|
+
Anti-patterns: polling these queries instead of alerting on the gauge; treating an empty non-`Ready` result as "no incidents"; using them as a history of failures, since cleared incidents are not returned and the kernel sends no notification.
|
|
181
|
+
|
|
136
182
|
## Federation metrics
|
|
137
183
|
|
|
138
184
|
Producer counters use the `Cratis.Chronicle.Federation` meter and the `chronicle.federation.link` dimension (`unknown` when a denial cannot be attributed). Use them to distinguish delivery pressure from throttling, authorization and data-protection decisions.
|
|
@@ -39,10 +39,12 @@ Work is **at least once**. Resume can repeat work since the last durable checkpo
|
|
|
39
39
|
| One in-memory piece of background work that must not block a grain's turn and may be lost with the grain | Worker |
|
|
40
40
|
| One grain whose behaviour depends on which state it is in | State machine |
|
|
41
41
|
| A grain whose state follows Chronicle events | Event-sourced state machine |
|
|
42
|
-
|
|
|
42
|
+
| An internal process that branches, waits durably, or needs explicit per-item branches and a join | Choreography workflow - use the `cratis-choreography-run-workflow` skill |
|
|
43
43
|
| Request-scoped logic or a simple entity | A plain Orleans grain |
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Fan-out alone does not call for a workflow: use a job when every item is a planned step that must finish. Nor does a Chronicle event: a reactor handles a straightforward reaction. Give an internal workflow a durable journal, such as Chronicle. Do not model a wait as a blocked step.
|
|
46
|
+
|
|
47
|
+
These blocks are for Cratis engineering services already on Orleans. Applications model a multi-step process, waits and deadlines included, as facts, reactors and a work-list read model.
|
|
46
48
|
|
|
47
49
|
## How a job runs
|
|
48
50
|
|
|
@@ -57,6 +57,11 @@ the application.
|
|
|
57
57
|
records and runners. It holds the work and the organization's knowledge, never the event model. An agent
|
|
58
58
|
reaches it through the Direct MCP server.
|
|
59
59
|
|
|
60
|
+
Code Studio generates is committed to a repository Studio keeps, without pull requests, until the
|
|
61
|
+
application's repository (its own, or else the project's) is a connected one. Even then nothing is pushed
|
|
62
|
+
until a person selects Publish: read [Where Studio commits generated code](references/studio-repository.md)
|
|
63
|
+
when Studio produces the code or no pull request appears.
|
|
64
|
+
|
|
60
65
|
The three combine. A common arrangement is: model on a Studio board, export the slice's context to the
|
|
61
66
|
local repository, implement there, and let Direct record the journey and its gates.
|
|
62
67
|
|
|
@@ -181,6 +186,9 @@ Five servers can be present. They answer different questions; pick by the questi
|
|
|
181
186
|
| Chronicle | The Chronicle MCP server, a separate product next to a running store | Inspect a running event store while diagnosing; use observational tools by default | Implicit mutations: stopping, resuming or deleting a job requires the mutation profile and a specific request | `cratis-chronicle-mcp-inspection` |
|
|
182
187
|
| The application's own | An Arc application that opts chosen commands and queries in as MCP tools (C#-only) | Giving agents governed access to the product's own operations, when the product owner wants that | Inspecting the application during development; use `cratis arc` for that | `cratis-arc-expose-mcp-operation` |
|
|
183
188
|
|
|
189
|
+
Cratis Identity signs people in to the Cratis tools; it is not sign-in or user management for your
|
|
190
|
+
application. Read [Cratis Identity](references/cratis-identity.md) when someone proposes it for that.
|
|
191
|
+
|
|
184
192
|
Rules that hold for all of them:
|
|
185
193
|
|
|
186
194
|
- A server acts with a person's or a token's authority. Read first; make a change only when the request
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Cratis Identity: when it is the right component
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- What it is
|
|
6
|
+
- An application does not need it
|
|
7
|
+
- When it is in the picture
|
|
8
|
+
- Local development profile
|
|
9
|
+
- Anti-patterns
|
|
10
|
+
|
|
11
|
+
Read this when someone proposes Cratis Identity for an application's sign-in or user management, or when a
|
|
12
|
+
tool signs in "through Cratis Identity" and you must know what that means for the application.
|
|
13
|
+
|
|
14
|
+
## What it is
|
|
15
|
+
|
|
16
|
+
Cratis Identity is the OAuth authorization server for the Cratis products and the programs that call them:
|
|
17
|
+
the `cratis` CLI and MCP clients reaching Studio or Direct. It signs a person in, asks them to approve the
|
|
18
|
+
client and choose a tenant, and issues short-lived access tokens bound to one resource.
|
|
19
|
+
|
|
20
|
+
It keeps the accounts people use to sign in to the Cratis products. It is not your application's user store,
|
|
21
|
+
user-management screen or sign-in service.
|
|
22
|
+
|
|
23
|
+
## An application does not need it
|
|
24
|
+
|
|
25
|
+
The default for an application built on Cratis:
|
|
26
|
+
|
|
27
|
+
- People sign in through AuthProxy with the organization's own identity provider. See
|
|
28
|
+
`cratis-authproxy-configure` (`references/sign-in-providers.md`).
|
|
29
|
+
- The application reads who the caller is, and adds its own details about that person, through Arc. See
|
|
30
|
+
`cratis-arc-host-application` (`references/csharp-identity.md`) and `cratis-arc-react-bind-slice`
|
|
31
|
+
(`references/typescript-identity.md`).
|
|
32
|
+
- What a person may do is decided in the application. See `cratis-arc-authorize-request`.
|
|
33
|
+
|
|
34
|
+
Users, roles and memberships the business cares about are application data: model them as slices like any
|
|
35
|
+
other behaviour.
|
|
36
|
+
|
|
37
|
+
Do not add a Cratis Identity package to an application or host your own Cratis Identity for it.
|
|
38
|
+
|
|
39
|
+
## When it is in the picture
|
|
40
|
+
|
|
41
|
+
| Situation | What to do |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| An agent or the CLI uses the Studio or Direct MCP server | The tool signs the person in through Cratis Identity. Nothing is configured in the application |
|
|
44
|
+
| A program must call a route of a Cratis product with a token Cratis Identity issued | That product's AuthProxy has a bearer route naming Cratis Identity as issuer. See `cratis-arc-authorize-request` (`references/authproxy.md`) for bearer routes |
|
|
45
|
+
| Your own programs (a CLI, an agent, another service) call your application's API | A bearer route with **your** authorization server as issuer. Same reference |
|
|
46
|
+
|
|
47
|
+
An access token Cratis Identity issued, accepted on a bearer route, says who the person is, which tenant they
|
|
48
|
+
chose and which scopes the client was granted. It never decides what the person may do: the receiving
|
|
49
|
+
application still checks that against its own roles and the tenant.
|
|
50
|
+
|
|
51
|
+
A personal access token is different. On a route that accepts them, AuthProxy only recognizes the token's
|
|
52
|
+
shape and forwards it: there is no authenticated person and no tenant yet. The backend must authenticate the
|
|
53
|
+
token itself and authorize the request, including tenant and resource access.
|
|
54
|
+
|
|
55
|
+
AuthProxy also has a `CratisIdentity` sign-in provider type. It is for a deployment that signs people in
|
|
56
|
+
through a Cratis Identity realm; an application with its own identity provider uses the provider types in
|
|
57
|
+
`cratis-authproxy-configure` instead.
|
|
58
|
+
|
|
59
|
+
## Local development profile
|
|
60
|
+
|
|
61
|
+
Cratis Identity has an opt-in local development profile, used when working on Cratis products so a local
|
|
62
|
+
tool can sign in to a local Studio or Direct MCP server. It runs only in the Development environment, uses a
|
|
63
|
+
loopback issuer with its own keys, and its tokens are accepted by no deployed service. It is never a way to
|
|
64
|
+
reach or stand in for a deployed environment.
|
|
65
|
+
|
|
66
|
+
## Anti-patterns
|
|
67
|
+
|
|
68
|
+
- Using Cratis Identity as the application's user database or user-management feature.
|
|
69
|
+
- Pointing an application's sign-in at Cratis Identity because the Cratis tools use it.
|
|
70
|
+
- Treating a scope in a token as permission; scopes say what the client may attempt, the application decides.
|
|
71
|
+
- Enabling the local development profile outside a developer machine.
|
package/package/corpus/skills/cratis-platform-build-application/references/studio-repository.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Where Studio commits generated code
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- The default: a repository Studio keeps
|
|
6
|
+
- Connect the team's repository
|
|
7
|
+
- One application in its own repository or folder
|
|
8
|
+
- Which arrangement when
|
|
9
|
+
- Anti-patterns
|
|
10
|
+
|
|
11
|
+
Read this when Studio generates the code (step 4 of the route) and you must know where that code lands, or
|
|
12
|
+
why no pull request appears. It does not apply when you render or write code in a local repository yourself.
|
|
13
|
+
|
|
14
|
+
## The default: a repository Studio keeps
|
|
15
|
+
|
|
16
|
+
Every Studio project has a repository. Until a person connects one, it is a local repository kept by Studio.
|
|
17
|
+
Generating code works there: the work is committed to a work-session branch and merged into the project's
|
|
18
|
+
default branch when a person accepts it. Studio cannot publish branches or open pull requests from it.
|
|
19
|
+
|
|
20
|
+
Use it to try a model. Connect a repository before a team relies on the generated code.
|
|
21
|
+
|
|
22
|
+
What decides is the repository the application uses, not the project alone. An application follows the
|
|
23
|
+
project's repository unless it has a separate one (see below): an application with its own GitHub repository
|
|
24
|
+
publishes even when the project is local only, and an application set to a local repository does not publish
|
|
25
|
+
even when the project is connected. Check the application's setting first, then the project's.
|
|
26
|
+
|
|
27
|
+
## Connect the team's repository
|
|
28
|
+
|
|
29
|
+
Two steps, each with its own permission. One person who holds both can do both:
|
|
30
|
+
|
|
31
|
+
1. **Once per GitHub account that holds code.** A maintainer of the Studio organization connects GitHub
|
|
32
|
+
under Organization settings, Integrations, Source Control. This installs the Studio GitHub App on the
|
|
33
|
+
GitHub organization or account that holds the code, so that maintainer must be allowed to install GitHub
|
|
34
|
+
Apps there, or must ask its GitHub owner to approve the installation. Code in several GitHub
|
|
35
|
+
organizations or accounts needs one connection each. Which repositories an installation can reach is
|
|
36
|
+
decided on GitHub.
|
|
37
|
+
2. **Per project.** A person who may change the project's settings opens Project Settings, Source control,
|
|
38
|
+
chooses GitHub as the provider, then the installation and the repository, and selects Connect repository.
|
|
39
|
+
|
|
40
|
+
Connecting does not make generation publish by itself. A generation run commits to a work-session branch
|
|
41
|
+
and stops at **Ready to publish**; nothing is on GitHub yet. A person reviews the work in Studio and selects
|
|
42
|
+
**Publish**. Only then does Studio push the branch and, by default, open a pull request. Never report
|
|
43
|
+
generated work as pushed, or a pull request as open, before a person has published it.
|
|
44
|
+
|
|
45
|
+
An application whose publication mode (Application Settings) is "Push a branch only" gets the branch and no
|
|
46
|
+
pull request when it is published: the work stays ready for review until a person completes or abandons it
|
|
47
|
+
in Studio. The mode applies to new work sessions only. The same connection lets a board keep
|
|
48
|
+
its model in step with the repository (`cratis-screenplay-onboard-workspace`, `references/studio.md`).
|
|
49
|
+
|
|
50
|
+
Studio works through the GitHub App installation. It keeps no personal access token and no Git credentials of
|
|
51
|
+
its own, so never ask a person for a token to give to Studio.
|
|
52
|
+
|
|
53
|
+
When a repository is missing from the list, check in this order before asking for anything on GitHub:
|
|
54
|
+
|
|
55
|
+
1. Is the right installation selected? An organization can have several, each for another GitHub account.
|
|
56
|
+
2. Did Studio list the installation's repositories at all? The picker shows the same "no repositories"
|
|
57
|
+
message when the listing failed as when it returned nothing, so the message alone proves neither. Studio
|
|
58
|
+
refuses to list for an installation that is not connected to this Studio organization, whatever GitHub
|
|
59
|
+
allows. Confirm that the installation is listed under this organization's Source Control and that the
|
|
60
|
+
person may change the project's settings. Connecting GitHub again does not help when the installation
|
|
61
|
+
belongs to another Studio organization: Studio will not take it over.
|
|
62
|
+
3. Only when the listing succeeded and the repository is absent: a GitHub owner widens the installation's
|
|
63
|
+
repository access on GitHub.
|
|
64
|
+
|
|
65
|
+
When the project reports that the installation must be reapproved
|
|
66
|
+
or is no longer available, that is also fixed on GitHub (or by reconnecting), not in the model or the code.
|
|
67
|
+
|
|
68
|
+
Disconnecting returns the project to its local repository; what was already pushed stays on GitHub.
|
|
69
|
+
|
|
70
|
+
## One application in its own repository or folder
|
|
71
|
+
|
|
72
|
+
A project's applications use the project's repository by default. Per application, in Application Settings:
|
|
73
|
+
|
|
74
|
+
- **Base path** (Repository tab): the folder inside the repository where the application lives. Set it when
|
|
75
|
+
several applications share one repository.
|
|
76
|
+
- **A separate repository** (Source control tab): give one application its own repository. Studio refuses
|
|
77
|
+
the change while the application has active work sessions; complete or abandon them first.
|
|
78
|
+
|
|
79
|
+
## Which arrangement when
|
|
80
|
+
|
|
81
|
+
| Situation | Arrangement |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| Trying a model, no team review yet | The repository Studio keeps (no connection) |
|
|
84
|
+
| A team reviews and merges generated code | Connect GitHub and choose the project's repository. The default for real work |
|
|
85
|
+
| Several applications in one repository | One project repository, a base path per application |
|
|
86
|
+
| One application is owned or released apart from the others | A separate repository for that application |
|
|
87
|
+
| The code is hosted on GitLab or Azure DevOps | Edge case, not fully supported yet. The repository can be named in the project from a connection the organization made, but Studio cannot push generated code, open merge requests, sync boards or run builds there. Say so; do not plan on pull requests from Studio |
|
|
88
|
+
|
|
89
|
+
## Anti-patterns
|
|
90
|
+
|
|
91
|
+
- Expecting a pull request from an application whose repository is local, whose publication mode is
|
|
92
|
+
branch only, or whose generated work no person has published yet. Judging this from the project's setting without checking the application's.
|
|
93
|
+
- Handing Studio a personal access token, or storing one in the repository, to make publishing work.
|
|
94
|
+
- Changing the repository or base path of an application while it has open work sessions.
|
|
95
|
+
- Asking a GitHub owner for wider repository access before checking that the right installation is selected
|
|
96
|
+
and that Studio could list its repositories.
|
|
@@ -19,8 +19,8 @@ description: Use when implementing one accepted slice by hand in a Cratis applic
|
|
|
19
19
|
## What a slice is
|
|
20
20
|
|
|
21
21
|
A slice is one behaviour of the event model delivered as one vertical unit: the backend that decides or
|
|
22
|
-
serves it, the specifications that prove it, and any client or screen that uses it. Its type
|
|
23
|
-
what you build.
|
|
22
|
+
serves it, the specifications that prove it, and any client or screen that uses it. Its type, chosen
|
|
23
|
+
in the model (`cratis-modeling-design-event-model`), decides what you build.
|
|
24
24
|
|
|
25
25
|
| Type | At runtime | You build | Skills |
|
|
26
26
|
| --- | --- | --- | --- |
|
|
@@ -54,7 +54,8 @@ Read `references/<language>.md` for the project's SDK (`.csproj` → csharp, Nod
|
|
|
54
54
|
earlier batches can stay committed after a later failure; verify what committed before retrying.
|
|
55
55
|
- **Read model.** Projections and reducers are observers. They update the stored read model after the
|
|
56
56
|
append, so a query made immediately afterwards can return older state. An observable query pushes the
|
|
57
|
-
change to an open screen when it lands.
|
|
57
|
+
change to an open screen when it lands. What each kind of reader can rely on after a write is in
|
|
58
|
+
[eventual consistency](references/eventual-consistency.md).
|
|
58
59
|
- **Reactor.** It runs after commit and can receive the same event again. Report unexpected handler
|
|
59
60
|
or follow-up failures so the observer can recover, and make effects idempotent for redelivery and
|
|
60
61
|
replay. Follow-up commands go through the same authorization and validation as a caller's; see Reactions
|
|
@@ -104,9 +105,13 @@ compilation when the SDK needs them.
|
|
|
104
105
|
follow the order in your language reference. **Gate:** the generated commands and queries match
|
|
105
106
|
the backend's names and shapes; run the SDK's drift check where available.
|
|
106
107
|
4. **Frontend, if present.** Submit the command once and show the state from the query rather than also
|
|
107
|
-
inserting the row into local state
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
inserting the row into local state; the one exception, a gesture that must show its result in the same
|
|
109
|
+
frame, is in `cratis-arc-react-bind-slice`, `references/typescript-instant-feedback.md`. Wire the screen
|
|
110
|
+
using the project's stack. For React (`cratis-arc-react-bind-slice`): export the screen from the slice
|
|
111
|
+
folder, mount it in the feature's composition page, and add a route for the feature only when it has
|
|
112
|
+
none yet, as with a new feature or one getting its first screen. Where each React file goes is in that
|
|
113
|
+
skill's `references/typescript-structure.md`. Another stack follows its own language reference. **Gate:** applicable
|
|
114
|
+
frontend lint and build checks pass, plus frontend specifications where screen behaviour changed.
|
|
110
115
|
5. **See it work.** In the bound running application, exercise the slice once with fresh data as an
|
|
111
116
|
authorized caller. Check exact appends for a State Change, fresh query results for a State View, and
|
|
112
117
|
the start-up check below for a reactor. If the slice has a live screen, observe the change without
|
|
@@ -128,8 +133,9 @@ its SDK does not support.
|
|
|
128
133
|
slice sit together or mirror the same path, as Layout in your language reference shows.
|
|
129
134
|
- Shared concept — an identifier or value type that several slices use lives at feature level, not inside
|
|
130
135
|
one slice.
|
|
131
|
-
- Composition page — the feature page that mounts each slice's screen
|
|
132
|
-
|
|
136
|
+
- Composition page (React) — the feature page that mounts each slice's screen; it is the only code that
|
|
137
|
+
knows every slice of the feature, and the feature, not the slice, has the route. Another stack places
|
|
138
|
+
screens and routes as its own language reference shows.
|
|
133
139
|
|
|
134
140
|
**Deciding (State Change)**
|
|
135
141
|
|