@cratis/pi 7.189.4 → 7.189.5
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/elixir.instructions.md +3 -2
- package/package/corpus/rules/elixir.md +3 -2
- package/package/corpus/skills/cratis-arc-elixir/references/event-model.md +1 -1
- package/package/corpus/skills/cratis-arc-elixir/references/pitfalls.md +1 -1
- package/package/corpus/skills/cratis-arc-elixir/references/product-sources.md +1 -1
- package/package.json +1 -1
|
@@ -57,8 +57,9 @@ Read the **cratis-arc-elixir** and **cratis-chronicle-client-elixir** skills bef
|
|
|
57
57
|
never carries a secret.
|
|
58
58
|
- **Every slice tells a whole story**: a state change has a command and the events it appends; a view
|
|
59
59
|
has a read model and consumes events (`consumes:` when it reads the event log); an automation reacts to
|
|
60
|
-
an event and records
|
|
61
|
-
third party
|
|
60
|
+
an event, runs a command and records the fact that command appends, so the event model shows what it
|
|
61
|
+
did. A reactor that calls a third party does not append events itself: it runs a `:system` command
|
|
62
|
+
(`Cratis.Arc.execute/3`) that records the outcome, and the command lives in the reactor's slice folder.
|
|
62
63
|
- **Order is the story**: a slice that uses events of several sub-features goes in a sub-feature after
|
|
63
64
|
them. Build with `arc: [event_model_strict: true]` so an incomplete model fails the build.
|
|
64
65
|
- **Third parties are integrations behind a behaviour**, with an in-memory stand-in for specs; only
|
|
@@ -56,8 +56,9 @@ Read the **cratis-arc-elixir** and **cratis-chronicle-client-elixir** skills bef
|
|
|
56
56
|
never carries a secret.
|
|
57
57
|
- **Every slice tells a whole story**: a state change has a command and the events it appends; a view
|
|
58
58
|
has a read model and consumes events (`consumes:` when it reads the event log); an automation reacts to
|
|
59
|
-
an event and records
|
|
60
|
-
third party
|
|
59
|
+
an event, runs a command and records the fact that command appends, so the event model shows what it
|
|
60
|
+
did. A reactor that calls a third party does not append events itself: it runs a `:system` command
|
|
61
|
+
(`Cratis.Arc.execute/3`) that records the outcome, and the command lives in the reactor's slice folder.
|
|
61
62
|
- **Order is the story**: a slice that uses events of several sub-features goes in a sub-feature after
|
|
62
63
|
them. Build with `arc: [event_model_strict: true]` so an incomplete model fails the build.
|
|
63
64
|
- **Third parties are integrations behind a behaviour**, with an in-memory stand-in for specs; only
|
|
@@ -57,7 +57,7 @@ The compiler reports what is incomplete (warnings; errors with `event_model_stri
|
|
|
57
57
|
| --- | --- |
|
|
58
58
|
| a state change without a command, or whose command appends no events | the command must build its event types in its own module |
|
|
59
59
|
| a view without a read model, or that consumes no events | add a reducer or projection, or `consumes:` |
|
|
60
|
-
| an automation that reacts to no event, or records none |
|
|
60
|
+
| an automation that reacts to no event, or records none | the reactor runs a command in its slice folder that appends the fact (`RecordSecretRetirement` appends `SecretRetiredInOry`); a slice with a reactor and its command is an automation showing reaction, command and event |
|
|
61
61
|
| a consumed event no slice produces | the event needs a command appending it |
|
|
62
62
|
| a fact used before it is produced | move the slice into a sub-feature after the ones it uses |
|
|
63
63
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
| Mistake | What happens | Do this |
|
|
30
30
|
| --- | --- | --- |
|
|
31
31
|
| A read model module in the parent namespace (`ApiCredentials.Listing` beside `ApiCredentials.Listing.Reducer`) | The view is grouped with the parent feature, not its slice | Put the query module inside the slice folder (`Listing.Queries`) |
|
|
32
|
-
| A reactor that returns nothing | The automation slice shows no events |
|
|
32
|
+
| A reactor that appends events itself or returns nothing | The automation slice shows no command or no events | Have the reactor run a command in its slice folder that appends the fact; Arc shows reaction, command and event |
|
|
33
33
|
| A view over a model another slice builds | Old Arc showed no events | Arc 1.4 reads them from the reducer; use `consumes:` for a model read from the event log |
|
|
34
34
|
| Reading the last module segment as the name | The model shows the `id:` | Name by `id:` and keep `display_names:` in mind |
|
|
35
35
|
| Slices that use events of several sub-features in the parent feature | A fact is drawn after what uses it; validation fails | Give them a sub-feature that follows the others |
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| Elixir requirement | `~> 1.18` | `mix.exs` |
|
|
10
10
|
| Chronicle dependency | `cratis_chronicle ~> 4.0` (modules are `Cratis.Chronicle.*`) | `Source/arc/mix.exs` |
|
|
11
11
|
| MongoDB driver | `mongodb_driver ~> 1.6` | `Source/arc_mongodb/mix.exs` |
|
|
12
|
-
| Release | Source preview.
|
|
12
|
+
| Release | Source preview. Every release is published to Hex automatically: depend on `{:cratis_arc, "~> 1.4"}` from Hex, never a path or git reference, and check hex.pm for the current version | repository, `gh release list` |
|
|
13
13
|
| Module namespace | Everything is `Cratis.Arc.*` (`use Cratis.Arc.Command, id: "..."`); sources are under `Source/arc/lib/cratis/arc/` | repository |
|
|
14
14
|
| Documented gaps | `Documentation/limits-and-gaps.md` | repository |
|
|
15
15
|
| Contract | The Arc HTTP contract | Cratis/Arc `Documentation/http-contract.md` |
|