@cratis/pi 7.6.5 → 7.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/agents/backend-developer.md +14 -0
- package/package/corpus/agents/code-reviewer.md +16 -0
- package/package/corpus/agents/coordinator.md +17 -0
- package/package/corpus/agents/frontend-developer.md +17 -0
- package/package/corpus/agents/orchestrator.md +18 -0
- package/package/corpus/agents/planner.md +24 -0
- package/package/corpus/agents/screenplay-modeler.md +57 -0
- package/package/corpus/agents/screenplay-renderer.md +42 -0
- package/package/corpus/agents/screenplay-reviewer.md +45 -0
- package/package/corpus/agents/slice-implementer.md +32 -5
- package/package/corpus/agents/spec-writer.md +16 -3
- package/package/corpus/prompts/add-reactor.prompt.md +5 -3
- package/package/corpus/prompts/new-vertical-slice.prompt.md +16 -5
- package/package/corpus/prompts/write-specs.prompt.md +12 -6
- package/package/corpus/rules/application-profile.md +7 -3
- package/package/corpus/rules/general.md +8 -3
- package/package/corpus/rules/glossary.md +1 -1
- package/package/corpus/rules/profiles.md +42 -4
- package/package/corpus/rules/reactors.md +30 -22
- package/package/corpus/rules/vertical-slices.md +3 -1
- package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +13 -0
- package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +2 -0
- package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +173 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +66 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +49 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +23 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +91 -0
- package/package/corpus/skills/cratis-application-slice-conformance/verification.json +14 -0
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +57 -1
- package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +16 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +68 -8
- package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +199 -0
- package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +10 -0
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +38 -10
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +58 -6
- package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +47 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md +11 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +13 -0
- package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +13 -0
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +35 -16
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +28 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +166 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +31 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +139 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +69 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +88 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +64 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +37 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +34 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +208 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +126 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +93 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/worked-integration.md +98 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +267 -50
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +185 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +60 -12
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +42 -12
- package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +30 -0
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +229 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +37 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +64 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +62 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +222 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +66 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +152 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +111 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +37 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +119 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/worked-session.md +87 -0
- package/package/corpus/skills/cratis-screenplay-discovery/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +140 -77
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +51 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +114 -28
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +50 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +28 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +31 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +239 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/chronicle-observations.md +25 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +79 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +48 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +75 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +164 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +88 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +47 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +147 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +36 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +126 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +57 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +52 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +17 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +77 -57
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +50 -20
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +211 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +44 -6
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +64 -10
- package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +34 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +209 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +89 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +128 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +176 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +36 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +149 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +59 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +255 -0
- package/package/corpus/skills/cratis-screenplay-model-review/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +32 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +239 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/code-reading-and-tokens.md +55 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +124 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +84 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +48 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phase-report-inventories.md +25 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +162 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +53 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +63 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +31 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +31 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +46 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +204 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +55 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +86 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +16 -0
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +14 -3
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +15 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +2 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +179 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +99 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +67 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +72 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +27 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +56 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +124 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +31 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +200 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +579 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/chronicle-verification.md +24 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +102 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +41 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +196 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +102 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +71 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +91 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +30 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +236 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +107 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +130 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +20 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +201 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +23 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +41 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +122 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +305 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +43 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +217 -36
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +28 -4
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/LICENSE +33 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +191 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +154 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +54 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +191 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +70 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +65 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +128 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +378 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/LICENSE +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +177 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +121 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +319 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +96 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +107 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +48 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +113 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +148 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +267 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +51 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +88 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +51 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +134 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +134 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +53 -5
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +56 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +65 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +4 -1
- package/package/corpus/skills/cratis-specification-by-example/SKILL.md +44 -1
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +10 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +186 -219
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +177 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +150 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +87 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +98 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +19 -0
- package/package/profile-catalog.json +11 -0
- package/package.json +1 -1
package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
# Berth reservations: worked example
|
|
2
|
+
|
|
3
|
+
Complete, compiled design-mode model (marina guest berths) showing a coverage matrix turned into specifications: happy path, one rejection per rule, authorization denial, duplicate and retry, competing claim, state violation, alternative branches, compensation and a view lifecycle family. The matrix for it is in `coverage-matrix.md`; the catalogue (`scenario-catalogue.md`) names its specifications.
|
|
4
|
+
|
|
5
|
+
```screenplay
|
|
6
|
+
// Scenario coverage worked example: guest berths at a marina (complete document).
|
|
7
|
+
// Shows a coverage matrix turned into specifications: happy path, one rejection per rule,
|
|
8
|
+
// authorization denial, duplicate/retry, concurrent claim, state violation, alternative branches,
|
|
9
|
+
// compensation (cancellation frees the berth-night) and a view lifecycle family.
|
|
10
|
+
// Screens and personas are out of scope here (cratis-screenplay-slice-design). This is the canonical design-mode
|
|
11
|
+
// example: stored-state rules (the reservation must be live) are stated as `reads BerthBooking`
|
|
12
|
+
// + `require ... message` and marked NOT enforced in the slice descriptions, with their target
|
|
13
|
+
// named. Binding reports PLAY0271/PLAY0268 for them (expected; Screenplay#129/#209): such a model
|
|
14
|
+
// is design-complete but not binding-ready, and that is reported, never "fixed" by deleting the
|
|
15
|
+
// rules. The past-date rule (`night >= today`) is declarative too: ESM v1 has no runtime date,
|
|
16
|
+
// so binding reports PLAY0268 on it (recorded as blocked, not moved into prose); the rule and its rejection
|
|
17
|
+
// specification stay so the intent executes once a date value exists.
|
|
18
|
+
// Verified: V1 (warnings as errors). V3 binding is blocked by the stored-state and date rules.
|
|
19
|
+
|
|
20
|
+
concept ReservationId : Uuid
|
|
21
|
+
concept BerthCode : String
|
|
22
|
+
validate
|
|
23
|
+
not empty message "A berth code is required"
|
|
24
|
+
|
|
25
|
+
policy IsHarbourOffice
|
|
26
|
+
require role "HarbourOffice"
|
|
27
|
+
|
|
28
|
+
module Berths
|
|
29
|
+
feature GuestBerths
|
|
30
|
+
authorize IsHarbourOffice
|
|
31
|
+
|
|
32
|
+
slice StateChange ReserveBerth
|
|
33
|
+
description "One guest boat per berth per night. OneBoatPerBerthNight declares that two event sources cannot hold the same berth-night; the competing-claim specification pins the loser's rejection after an earlier holder. It neither runs two commands at once nor proves the runtime's index-and-append behaviour under failure: that needs target-level verification. A retried ReserveBerth with the same reservation id is refused by ReserveOnce: the fact occurs once, but the retry is NOT answered with success, so a client that lost the first acknowledgement must treat this rejection as 'already reserved' (idempotent handling is a target decision, recorded as an open question). The night must not be in the past: declared in `validate` (`night >= today`) with its rejection specification. Binding reports PLAY0268 for date comparisons today (ESM v1 has no runtime date value), so this rule is design-complete but blocks V3 until Screenplay supports it."
|
|
34
|
+
command ReserveBerth
|
|
35
|
+
reservationId ReservationId identifier
|
|
36
|
+
berth BerthCode
|
|
37
|
+
night Date
|
|
38
|
+
boatName String
|
|
39
|
+
boatLength Decimal
|
|
40
|
+
validate
|
|
41
|
+
boatLength > 0 message "Boat length must be positive"
|
|
42
|
+
boatLength <= 24 message "Guest berths take boats up to 24 metres"
|
|
43
|
+
night >= today message "The night must not be in the past"
|
|
44
|
+
produces BerthReserved
|
|
45
|
+
for reservationId
|
|
46
|
+
berth = berth
|
|
47
|
+
night = night
|
|
48
|
+
boatName = boatName
|
|
49
|
+
boatLength = boatLength
|
|
50
|
+
event BerthReserved
|
|
51
|
+
berth BerthCode
|
|
52
|
+
night Date
|
|
53
|
+
boatName String
|
|
54
|
+
boatLength Decimal
|
|
55
|
+
constraint OneBoatPerBerthNight
|
|
56
|
+
unique berth, night on BerthReserved
|
|
57
|
+
released by ReservationCancelled
|
|
58
|
+
constraint ReserveOnce
|
|
59
|
+
unique event BerthReserved
|
|
60
|
+
|
|
61
|
+
specification ReservingAGuestBerth
|
|
62
|
+
given caller
|
|
63
|
+
authenticated
|
|
64
|
+
role "HarbourOffice"
|
|
65
|
+
when ReserveBerth
|
|
66
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
67
|
+
berth = "C7"
|
|
68
|
+
night = "2027-07-14"
|
|
69
|
+
boatName = "Silje"
|
|
70
|
+
boatLength = 11.5
|
|
71
|
+
then BerthReserved
|
|
72
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
73
|
+
berth = "C7"
|
|
74
|
+
night = "2027-07-14"
|
|
75
|
+
boatName = "Silje"
|
|
76
|
+
boatLength = 11.5
|
|
77
|
+
|
|
78
|
+
specification RejectingAZeroLength
|
|
79
|
+
given caller
|
|
80
|
+
authenticated
|
|
81
|
+
role "HarbourOffice"
|
|
82
|
+
when ReserveBerth
|
|
83
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
84
|
+
berth = "C7"
|
|
85
|
+
night = "2027-07-14"
|
|
86
|
+
boatName = "Silje"
|
|
87
|
+
boatLength = 0
|
|
88
|
+
then error "Boat length must be positive"
|
|
89
|
+
|
|
90
|
+
specification RejectingAnOversizedBoat
|
|
91
|
+
given caller
|
|
92
|
+
authenticated
|
|
93
|
+
role "HarbourOffice"
|
|
94
|
+
when ReserveBerth
|
|
95
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
96
|
+
berth = "C7"
|
|
97
|
+
night = "2027-07-14"
|
|
98
|
+
boatName = "Silje"
|
|
99
|
+
boatLength = 31
|
|
100
|
+
then error "Guest berths take boats up to 24 metres"
|
|
101
|
+
|
|
102
|
+
// Declarative past-date rule; binding is blocked for date comparisons (see header).
|
|
103
|
+
specification RejectingANightInThePast
|
|
104
|
+
given caller
|
|
105
|
+
authenticated
|
|
106
|
+
role "HarbourOffice"
|
|
107
|
+
when ReserveBerth
|
|
108
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
109
|
+
berth = "C7"
|
|
110
|
+
night = "2020-07-14"
|
|
111
|
+
boatName = "Silje"
|
|
112
|
+
boatLength = 11.5
|
|
113
|
+
then error "The night must not be in the past"
|
|
114
|
+
|
|
115
|
+
// Deliberate: concept rules get one rejection spec per concept, through one command.
|
|
116
|
+
specification RejectingAnEmptyBerthCode
|
|
117
|
+
given caller
|
|
118
|
+
authenticated
|
|
119
|
+
role "HarbourOffice"
|
|
120
|
+
when ReserveBerth
|
|
121
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
122
|
+
berth = ""
|
|
123
|
+
night = "2027-07-14"
|
|
124
|
+
boatName = "Silje"
|
|
125
|
+
boatLength = 11.5
|
|
126
|
+
then error "A berth code is required"
|
|
127
|
+
|
|
128
|
+
specification ReservingABoatAtTheMaximumLength
|
|
129
|
+
given caller
|
|
130
|
+
authenticated
|
|
131
|
+
role "HarbourOffice"
|
|
132
|
+
when ReserveBerth
|
|
133
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
134
|
+
berth = "C7"
|
|
135
|
+
night = "2027-07-14"
|
|
136
|
+
boatName = "Silje"
|
|
137
|
+
boatLength = 24
|
|
138
|
+
then BerthReserved
|
|
139
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
140
|
+
berth = "C7"
|
|
141
|
+
night = "2027-07-14"
|
|
142
|
+
boatName = "Silje"
|
|
143
|
+
boatLength = 24
|
|
144
|
+
|
|
145
|
+
specification RefusingASkipper
|
|
146
|
+
given caller
|
|
147
|
+
authenticated
|
|
148
|
+
role "Skipper"
|
|
149
|
+
when ReserveBerth
|
|
150
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
151
|
+
berth = "C7"
|
|
152
|
+
night = "2027-07-14"
|
|
153
|
+
boatName = "Silje"
|
|
154
|
+
boatLength = 11.5
|
|
155
|
+
then denied
|
|
156
|
+
|
|
157
|
+
specification RejectingASecondBoatForTheSameBerthNight
|
|
158
|
+
given caller
|
|
159
|
+
authenticated
|
|
160
|
+
role "HarbourOffice"
|
|
161
|
+
given BerthReserved
|
|
162
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
163
|
+
berth = "C7"
|
|
164
|
+
night = "2027-07-14"
|
|
165
|
+
boatName = "Silje"
|
|
166
|
+
boatLength = 11.5
|
|
167
|
+
when ReserveBerth
|
|
168
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c02"
|
|
169
|
+
berth = "C7"
|
|
170
|
+
night = "2027-07-14"
|
|
171
|
+
boatName = "Havbris"
|
|
172
|
+
boatLength = 9
|
|
173
|
+
then error "Constraint 'OneBoatPerBerthNight' is violated: another event source already holds the constrained value."
|
|
174
|
+
|
|
175
|
+
specification RejectingARetriedReservation
|
|
176
|
+
given caller
|
|
177
|
+
authenticated
|
|
178
|
+
role "HarbourOffice"
|
|
179
|
+
given BerthReserved
|
|
180
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
181
|
+
berth = "C7"
|
|
182
|
+
night = "2027-07-14"
|
|
183
|
+
boatName = "Silje"
|
|
184
|
+
boatLength = 11.5
|
|
185
|
+
when ReserveBerth
|
|
186
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
187
|
+
berth = "C7"
|
|
188
|
+
night = "2027-07-14"
|
|
189
|
+
boatName = "Silje"
|
|
190
|
+
boatLength = 11.5
|
|
191
|
+
then error "Constraint 'ReserveOnce' is violated: the event source already has the constrained event."
|
|
192
|
+
|
|
193
|
+
specification ReservingABerthNightFreedByACancellation
|
|
194
|
+
given caller
|
|
195
|
+
authenticated
|
|
196
|
+
role "HarbourOffice"
|
|
197
|
+
given BerthReserved
|
|
198
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
199
|
+
berth = "C7"
|
|
200
|
+
night = "2027-07-14"
|
|
201
|
+
boatName = "Silje"
|
|
202
|
+
boatLength = 11.5
|
|
203
|
+
given ReservationCancelled
|
|
204
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
205
|
+
reason = "Weather"
|
|
206
|
+
when ReserveBerth
|
|
207
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c02"
|
|
208
|
+
berth = "C7"
|
|
209
|
+
night = "2027-07-14"
|
|
210
|
+
boatName = "Havbris"
|
|
211
|
+
boatLength = 9
|
|
212
|
+
then BerthReserved
|
|
213
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c02"
|
|
214
|
+
berth = "C7"
|
|
215
|
+
night = "2027-07-14"
|
|
216
|
+
boatName = "Havbris"
|
|
217
|
+
boatLength = 9
|
|
218
|
+
|
|
219
|
+
slice StateChange CancelReservation
|
|
220
|
+
description "Compensation for ReserveBerth: ReservationCancelled releases the berth-night claim. Cancelling and departing are mutually exclusive per reservation (CancelOrDepart). NOT enforced in the model today: a cancellation needs a live reservation. The `reads BerthBooking` + `require` below states the intent; it protects nothing (an unguarded materialized read). Target: Chronicle DCB on the reservation stream, or Arc `[ProtectedDecision]` + `DecisionRead<BerthBooking>`. The command specifications after a departure or cancellation pin that target validation message, which fires before the constraint; the constraint itself is tested separately with `when append`."
|
|
221
|
+
command CancelReservation
|
|
222
|
+
reservationId ReservationId identifier
|
|
223
|
+
reason String
|
|
224
|
+
reads BerthBooking as booking by reservationId
|
|
225
|
+
validate
|
|
226
|
+
reason not empty message "Say why the reservation is cancelled"
|
|
227
|
+
require booking.status == "reserved"
|
|
228
|
+
message "Only a live reservation can be cancelled"
|
|
229
|
+
produces ReservationCancelled
|
|
230
|
+
for reservationId
|
|
231
|
+
reason = reason
|
|
232
|
+
event ReservationCancelled
|
|
233
|
+
reason String
|
|
234
|
+
constraint CancelOrDepart
|
|
235
|
+
unique event ReservationCancelled
|
|
236
|
+
unique event BoatDeparted
|
|
237
|
+
|
|
238
|
+
specification CancellingAReservation
|
|
239
|
+
given caller
|
|
240
|
+
authenticated
|
|
241
|
+
role "HarbourOffice"
|
|
242
|
+
given BerthReserved
|
|
243
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
244
|
+
berth = "C7"
|
|
245
|
+
night = "2027-07-14"
|
|
246
|
+
boatName = "Silje"
|
|
247
|
+
boatLength = 11.5
|
|
248
|
+
when CancelReservation
|
|
249
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
250
|
+
reason = "Weather"
|
|
251
|
+
then ReservationCancelled
|
|
252
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
253
|
+
reason = "Weather"
|
|
254
|
+
|
|
255
|
+
specification RejectingACancellationWithoutAReason
|
|
256
|
+
given caller
|
|
257
|
+
authenticated
|
|
258
|
+
role "HarbourOffice"
|
|
259
|
+
given BerthReserved
|
|
260
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
261
|
+
berth = "C7"
|
|
262
|
+
night = "2027-07-14"
|
|
263
|
+
boatName = "Silje"
|
|
264
|
+
boatLength = 11.5
|
|
265
|
+
when CancelReservation
|
|
266
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
267
|
+
reason = ""
|
|
268
|
+
then error "Say why the reservation is cancelled"
|
|
269
|
+
|
|
270
|
+
specification RejectingASecondCancellation
|
|
271
|
+
given caller
|
|
272
|
+
authenticated
|
|
273
|
+
role "HarbourOffice"
|
|
274
|
+
given BerthReserved
|
|
275
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
276
|
+
berth = "C7"
|
|
277
|
+
night = "2027-07-14"
|
|
278
|
+
boatName = "Silje"
|
|
279
|
+
boatLength = 11.5
|
|
280
|
+
given ReservationCancelled
|
|
281
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
282
|
+
reason = "Weather"
|
|
283
|
+
when CancelReservation
|
|
284
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
285
|
+
reason = "Weather"
|
|
286
|
+
then error "Only a live reservation can be cancelled"
|
|
287
|
+
|
|
288
|
+
specification RejectingACancellationAfterDeparture
|
|
289
|
+
given caller
|
|
290
|
+
authenticated
|
|
291
|
+
role "HarbourOffice"
|
|
292
|
+
given BerthReserved
|
|
293
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
294
|
+
berth = "C7"
|
|
295
|
+
night = "2027-07-14"
|
|
296
|
+
boatName = "Silje"
|
|
297
|
+
boatLength = 11.5
|
|
298
|
+
given BoatDeparted
|
|
299
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
300
|
+
when CancelReservation
|
|
301
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
302
|
+
reason = "Changed plans"
|
|
303
|
+
then error "Only a live reservation can be cancelled"
|
|
304
|
+
|
|
305
|
+
// The CancelOrDepart constraint is only reachable at append time: a command first fails its own
|
|
306
|
+
// live-reservation validation once the history has a departure or cancellation.
|
|
307
|
+
specification AppendingACancellationAfterDeparture
|
|
308
|
+
given BerthReserved
|
|
309
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
310
|
+
berth = "C7"
|
|
311
|
+
night = "2027-07-14"
|
|
312
|
+
boatName = "Silje"
|
|
313
|
+
boatLength = 11.5
|
|
314
|
+
given BoatDeparted
|
|
315
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
316
|
+
when append ReservationCancelled
|
|
317
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
318
|
+
reason = "Changed plans"
|
|
319
|
+
then error "Constraint 'CancelOrDepart' is violated: the event source already has the constrained event."
|
|
320
|
+
|
|
321
|
+
specification AppendingASecondCancellation
|
|
322
|
+
given BerthReserved
|
|
323
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
324
|
+
berth = "C7"
|
|
325
|
+
night = "2027-07-14"
|
|
326
|
+
boatName = "Silje"
|
|
327
|
+
boatLength = 11.5
|
|
328
|
+
given ReservationCancelled
|
|
329
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
330
|
+
reason = "Weather"
|
|
331
|
+
when append ReservationCancelled
|
|
332
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
333
|
+
reason = "Weather"
|
|
334
|
+
then error "Constraint 'CancelOrDepart' is violated: the event source already has the constrained event."
|
|
335
|
+
|
|
336
|
+
specification RefusingASkipperCancellation
|
|
337
|
+
given caller
|
|
338
|
+
authenticated
|
|
339
|
+
role "Skipper"
|
|
340
|
+
when CancelReservation
|
|
341
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
342
|
+
reason = "Weather"
|
|
343
|
+
then denied
|
|
344
|
+
|
|
345
|
+
slice StateChange RecordDeparture
|
|
346
|
+
description "Damage seen at departure is a separate fact the repair crew acts on. NOT enforced in the model today: a departure needs a live reservation, stated as `reads BerthBooking` + `require`. Target: Chronicle DCB or Arc `[ProtectedDecision]`."
|
|
347
|
+
command RecordDeparture
|
|
348
|
+
reservationId ReservationId identifier
|
|
349
|
+
damageObserved Bool
|
|
350
|
+
reads BerthBooking as booking by reservationId
|
|
351
|
+
validate
|
|
352
|
+
require booking.status == "reserved"
|
|
353
|
+
message "Only a live reservation can record a departure"
|
|
354
|
+
produces BoatDeparted
|
|
355
|
+
for reservationId
|
|
356
|
+
produces when damageObserved == true
|
|
357
|
+
BerthDamageReported
|
|
358
|
+
for reservationId
|
|
359
|
+
event BoatDeparted
|
|
360
|
+
event BerthDamageReported
|
|
361
|
+
|
|
362
|
+
specification RecordingACleanDeparture
|
|
363
|
+
given caller
|
|
364
|
+
authenticated
|
|
365
|
+
role "HarbourOffice"
|
|
366
|
+
given BerthReserved
|
|
367
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
368
|
+
berth = "C7"
|
|
369
|
+
night = "2027-07-14"
|
|
370
|
+
boatName = "Silje"
|
|
371
|
+
boatLength = 11.5
|
|
372
|
+
when RecordDeparture
|
|
373
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
374
|
+
damageObserved = false
|
|
375
|
+
then BoatDeparted
|
|
376
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
377
|
+
|
|
378
|
+
specification RecordingADepartureWithDamage
|
|
379
|
+
given caller
|
|
380
|
+
authenticated
|
|
381
|
+
role "HarbourOffice"
|
|
382
|
+
given BerthReserved
|
|
383
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
384
|
+
berth = "C7"
|
|
385
|
+
night = "2027-07-14"
|
|
386
|
+
boatName = "Silje"
|
|
387
|
+
boatLength = 11.5
|
|
388
|
+
when RecordDeparture
|
|
389
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
390
|
+
damageObserved = true
|
|
391
|
+
then BoatDeparted
|
|
392
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
393
|
+
then BerthDamageReported
|
|
394
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
395
|
+
|
|
396
|
+
specification RejectingARepeatedDeparture
|
|
397
|
+
given caller
|
|
398
|
+
authenticated
|
|
399
|
+
role "HarbourOffice"
|
|
400
|
+
given BerthReserved
|
|
401
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
402
|
+
berth = "C7"
|
|
403
|
+
night = "2027-07-14"
|
|
404
|
+
boatName = "Silje"
|
|
405
|
+
boatLength = 11.5
|
|
406
|
+
given BoatDeparted
|
|
407
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
408
|
+
when RecordDeparture
|
|
409
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
410
|
+
damageObserved = false
|
|
411
|
+
then error "Only a live reservation can record a departure"
|
|
412
|
+
|
|
413
|
+
specification RejectingADepartureAfterCancellation
|
|
414
|
+
given caller
|
|
415
|
+
authenticated
|
|
416
|
+
role "HarbourOffice"
|
|
417
|
+
given BerthReserved
|
|
418
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
419
|
+
berth = "C7"
|
|
420
|
+
night = "2027-07-14"
|
|
421
|
+
boatName = "Silje"
|
|
422
|
+
boatLength = 11.5
|
|
423
|
+
given ReservationCancelled
|
|
424
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
425
|
+
reason = "Weather"
|
|
426
|
+
when RecordDeparture
|
|
427
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
428
|
+
damageObserved = false
|
|
429
|
+
then error "Only a live reservation can record a departure"
|
|
430
|
+
|
|
431
|
+
specification AppendingARepeatedDeparture
|
|
432
|
+
given BerthReserved
|
|
433
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
434
|
+
berth = "C7"
|
|
435
|
+
night = "2027-07-14"
|
|
436
|
+
boatName = "Silje"
|
|
437
|
+
boatLength = 11.5
|
|
438
|
+
given BoatDeparted
|
|
439
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
440
|
+
when append BoatDeparted
|
|
441
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
442
|
+
then error "Constraint 'CancelOrDepart' is violated: the event source already has the constrained event."
|
|
443
|
+
|
|
444
|
+
specification AppendingADepartureAfterCancellation
|
|
445
|
+
given BerthReserved
|
|
446
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
447
|
+
berth = "C7"
|
|
448
|
+
night = "2027-07-14"
|
|
449
|
+
boatName = "Silje"
|
|
450
|
+
boatLength = 11.5
|
|
451
|
+
given ReservationCancelled
|
|
452
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
453
|
+
reason = "Weather"
|
|
454
|
+
when append BoatDeparted
|
|
455
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
456
|
+
then error "Constraint 'CancelOrDepart' is violated: the event source already has the constrained event."
|
|
457
|
+
|
|
458
|
+
specification RefusingASkipperDeparture
|
|
459
|
+
given caller
|
|
460
|
+
authenticated
|
|
461
|
+
role "Skipper"
|
|
462
|
+
when RecordDeparture
|
|
463
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
464
|
+
damageObserved = false
|
|
465
|
+
then denied
|
|
466
|
+
|
|
467
|
+
slice StateView BerthBoard
|
|
468
|
+
description "One row per live reservation; a cancelled reservation leaves the board"
|
|
469
|
+
readmodel BerthBooking
|
|
470
|
+
reservationId ReservationId
|
|
471
|
+
berth BerthCode
|
|
472
|
+
night Date
|
|
473
|
+
boatName String
|
|
474
|
+
status String
|
|
475
|
+
query BerthBookingById => BerthBooking optional
|
|
476
|
+
by reservationId ReservationId
|
|
477
|
+
projection BerthBoard => BerthBooking
|
|
478
|
+
from BerthReserved
|
|
479
|
+
reservationId = $eventSourceId
|
|
480
|
+
berth = berth
|
|
481
|
+
night = night
|
|
482
|
+
boatName = boatName
|
|
483
|
+
status = "reserved"
|
|
484
|
+
from BoatDeparted
|
|
485
|
+
status = "departed"
|
|
486
|
+
remove with ReservationCancelled
|
|
487
|
+
|
|
488
|
+
specification BerthBoardLifecycle1Reserved
|
|
489
|
+
given caller
|
|
490
|
+
authenticated
|
|
491
|
+
role "HarbourOffice"
|
|
492
|
+
given BerthReserved
|
|
493
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
494
|
+
berth = "C7"
|
|
495
|
+
night = "2027-07-14"
|
|
496
|
+
boatName = "Silje"
|
|
497
|
+
boatLength = 11.5
|
|
498
|
+
then query BerthBookingById
|
|
499
|
+
arguments
|
|
500
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
501
|
+
result
|
|
502
|
+
berth = "C7"
|
|
503
|
+
night = "2027-07-14"
|
|
504
|
+
boatName = "Silje"
|
|
505
|
+
status = "reserved"
|
|
506
|
+
|
|
507
|
+
// Lifecycle2 and Lifecycle3 are sibling branches after Lifecycle1, not consecutive steps.
|
|
508
|
+
specification BerthBoardLifecycle2Departed
|
|
509
|
+
given caller
|
|
510
|
+
authenticated
|
|
511
|
+
role "HarbourOffice"
|
|
512
|
+
given BerthReserved
|
|
513
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
514
|
+
berth = "C7"
|
|
515
|
+
night = "2027-07-14"
|
|
516
|
+
boatName = "Silje"
|
|
517
|
+
boatLength = 11.5
|
|
518
|
+
when append BoatDeparted
|
|
519
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
520
|
+
then query BerthBookingById
|
|
521
|
+
arguments
|
|
522
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
523
|
+
result
|
|
524
|
+
berth = "C7"
|
|
525
|
+
boatName = "Silje"
|
|
526
|
+
status = "departed"
|
|
527
|
+
|
|
528
|
+
specification BerthBoardLifecycle3Cancelled
|
|
529
|
+
given caller
|
|
530
|
+
authenticated
|
|
531
|
+
role "HarbourOffice"
|
|
532
|
+
given BerthReserved
|
|
533
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
534
|
+
berth = "C7"
|
|
535
|
+
night = "2027-07-14"
|
|
536
|
+
boatName = "Silje"
|
|
537
|
+
boatLength = 11.5
|
|
538
|
+
when append ReservationCancelled
|
|
539
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
540
|
+
reason = "Weather"
|
|
541
|
+
then no readmodel BerthBooking for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
542
|
+
|
|
543
|
+
specification RemovingOnlyTheCancelledBooking
|
|
544
|
+
given caller
|
|
545
|
+
authenticated
|
|
546
|
+
role "HarbourOffice"
|
|
547
|
+
given BerthReserved
|
|
548
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
549
|
+
berth = "C7"
|
|
550
|
+
night = "2027-07-14"
|
|
551
|
+
boatName = "Silje"
|
|
552
|
+
boatLength = 11.5
|
|
553
|
+
given BerthReserved
|
|
554
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c02"
|
|
555
|
+
berth = "C8"
|
|
556
|
+
night = "2027-07-14"
|
|
557
|
+
boatName = "Havbris"
|
|
558
|
+
boatLength = 9
|
|
559
|
+
when append ReservationCancelled
|
|
560
|
+
for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
561
|
+
reason = "Weather"
|
|
562
|
+
then no readmodel BerthBooking for "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
563
|
+
then query BerthBookingById
|
|
564
|
+
arguments
|
|
565
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c02"
|
|
566
|
+
result
|
|
567
|
+
berth = "C8"
|
|
568
|
+
boatName = "Havbris"
|
|
569
|
+
status = "reserved"
|
|
570
|
+
|
|
571
|
+
specification RefusingASkipperTheBoard
|
|
572
|
+
given caller
|
|
573
|
+
authenticated
|
|
574
|
+
role "Skipper"
|
|
575
|
+
then query BerthBookingById
|
|
576
|
+
arguments
|
|
577
|
+
reservationId = "6a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c01"
|
|
578
|
+
then denied
|
|
579
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Chronicle verification obligations
|
|
2
|
+
|
|
3
|
+
Logical `.play` outcomes, in-process Chronicle scenarios and real-kernel tests prove different
|
|
4
|
+
things; do not substitute one for another. Match each guarantee you claim to evidence of that
|
|
5
|
+
kind, and add only the applicable cases below to the coverage matrix (as `spec`, `open`, `gap`
|
|
6
|
+
or `question` cells).
|
|
7
|
+
|
|
8
|
+
- **Claims**: different-source collision, same-source reclaim, change or release, a legitimate
|
|
9
|
+
repeat.
|
|
10
|
+
- **Decision reads**: never-created absence, removal then recreation, a relevant concurrent
|
|
11
|
+
change, an irrelevant one, rejected or no-fact outcomes, refusal of an incompatible
|
|
12
|
+
projection or key.
|
|
13
|
+
- **Namespaces**: identical business keys in different tenants, background target selection,
|
|
14
|
+
independent observer progress, every namespace covered by erasure.
|
|
15
|
+
- **Compliance**: subject resolution, unreadable values after erasure, fenced new writes,
|
|
16
|
+
partial erasure, deliberate re-enrollment, disposal of external copies.
|
|
17
|
+
- **Evolution**: historical generations replay through the real migrations into current views.
|
|
18
|
+
- **Projections and reducers**: AutoMap collisions, join ordering, child removal, variant entry,
|
|
19
|
+
update-before-create, stale attempts, late events after completion.
|
|
20
|
+
- **Reactors**: normal delivery, replay, recovery redelivery, uncertain external outcome,
|
|
21
|
+
duplicate-result handling, failure becoming visible.
|
|
22
|
+
|
|
23
|
+
A competing-claim spec pins the loser's outcome after an earlier holder. It does not run
|
|
24
|
+
commands in parallel and does not prove index-and-append behaviour under failure.
|