@ybotok/loam 0.2.0-alpha.5 → 0.2.0-alpha.6
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/CHANGELOG.md +901 -0
- package/MIGRATING-from-OpenSpec.md +7 -4
- package/QUICKSTART.md +8 -3
- package/README.md +13 -7
- package/ROADMAP.md +264 -11
- package/SCHEMA.md +439 -38
- package/WORKFLOW.md +23 -10
- package/dist/commands/adopt/render.js +47 -8
- package/dist/commands/adopt/render.js.map +1 -1
- package/dist/commands/archive/plan/landscape.js +45 -1
- package/dist/commands/archive/plan/landscape.js.map +1 -1
- package/dist/commands/archive/plan/model/extending.js +85 -0
- package/dist/commands/archive/plan/model/extending.js.map +1 -0
- package/dist/commands/archive/run.js +5 -2
- package/dist/commands/archive/run.js.map +1 -1
- package/dist/commands/context/print.js +11 -1
- package/dist/commands/context/print.js.map +1 -1
- package/dist/commands/doctor.js +46 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explore.js +12 -2
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/list/views.js +5 -1
- package/dist/commands/list/views.js.map +1 -1
- package/dist/commands/seed/plan.js +97 -3
- package/dist/commands/seed/plan.js.map +1 -1
- package/dist/commands/seed/seed.js +7 -2
- package/dist/commands/seed/seed.js.map +1 -1
- package/dist/commands/show/feature.js +2 -1
- package/dist/commands/show/feature.js.map +1 -1
- package/dist/commands/show/marks.js +3 -5
- package/dist/commands/show/marks.js.map +1 -1
- package/dist/commands/show/service.js +39 -18
- package/dist/commands/show/service.js.map +1 -1
- package/dist/commands/subsystem/sync.js +128 -74
- package/dist/commands/subsystem/sync.js.map +1 -1
- package/dist/commands/subsystem/txn/exclude.js +132 -0
- package/dist/commands/subsystem/txn/exclude.js.map +1 -0
- package/dist/commands/subsystem/txn/report.js +124 -0
- package/dist/commands/subsystem/txn/report.js.map +1 -0
- package/dist/commands/subsystem/txn/txn.js +10 -3
- package/dist/commands/subsystem/txn/txn.js.map +1 -1
- package/dist/commands/subsystem/txn/views.js +113 -16
- package/dist/commands/subsystem/txn/views.js.map +1 -1
- package/dist/commands/validate/arch-coverage.js +16 -9
- package/dist/commands/validate/arch-coverage.js.map +1 -1
- package/dist/commands/validate/checks/fleet-shape.js +30 -77
- package/dist/commands/validate/checks/fleet-shape.js.map +1 -1
- package/dist/commands/validate/checks/vocabulary.js +4 -19
- package/dist/commands/validate/checks/vocabulary.js.map +1 -1
- package/dist/commands/validate/feature.js +1 -1
- package/dist/commands/validate/feature.js.map +1 -1
- package/dist/commands/validate/fleet/census.js +11 -10
- package/dist/commands/validate/fleet/census.js.map +1 -1
- package/dist/commands/validate/fleet/landscape.js +127 -119
- package/dist/commands/validate/fleet/landscape.js.map +1 -1
- package/dist/commands/validate/fleet/load.js +66 -0
- package/dist/commands/validate/fleet/load.js.map +1 -1
- package/dist/commands/validate/fleet/map/attest.js +103 -0
- package/dist/commands/validate/fleet/map/attest.js.map +1 -0
- package/dist/commands/validate/fleet/map/bindings.js +96 -0
- package/dist/commands/validate/fleet/map/bindings.js.map +1 -0
- package/dist/commands/validate/fleet/map/consumers.js +298 -0
- package/dist/commands/validate/fleet/map/consumers.js.map +1 -0
- package/dist/commands/validate/fleet/map/isolation.js +116 -0
- package/dist/commands/validate/fleet/map/isolation.js.map +1 -0
- package/dist/commands/validate/fleet/map/usecases.js +56 -0
- package/dist/commands/validate/fleet/map/usecases.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/steps.js +49 -17
- package/dist/commands/validate/fleet/usecases/steps.js.map +1 -1
- package/dist/commands/validate/fleet/views/fleet-project.js +217 -0
- package/dist/commands/validate/fleet/views/fleet-project.js.map +1 -0
- package/dist/commands/validate/fleet/views/ids.js +13 -9
- package/dist/commands/validate/fleet/views/ids.js.map +1 -1
- package/dist/commands/validate/fleet/views/projects.js +258 -70
- package/dist/commands/validate/fleet/views/projects.js.map +1 -1
- package/dist/commands/validate/fleet/views/root-documents.js +97 -0
- package/dist/commands/validate/fleet/views/root-documents.js.map +1 -0
- package/dist/commands/validate/fleet/views/stale.js +2 -2
- package/dist/commands/validate/fleet/views/stale.js.map +1 -1
- package/dist/commands/validate/service/model/diverged.js +226 -0
- package/dist/commands/validate/service/model/diverged.js.map +1 -0
- package/dist/commands/validate/service/model/grade.js +163 -0
- package/dist/commands/validate/service/model/grade.js.map +1 -0
- package/dist/commands/validate/service/service.js +110 -34
- package/dist/commands/validate/service/service.js.map +1 -1
- package/dist/commands/validate/service/specs.js +39 -5
- package/dist/commands/validate/service/specs.js.map +1 -1
- package/dist/commands/validate/service/spine.js +41 -3
- package/dist/commands/validate/service/spine.js.map +1 -1
- package/dist/commands/validate/service/usecases/tags.js +113 -0
- package/dist/commands/validate/service/usecases/tags.js.map +1 -0
- package/dist/commands/validate/service/usecases/usecases.js +209 -0
- package/dist/commands/validate/service/usecases/usecases.js.map +1 -0
- package/dist/commands/validate/validate.js +10 -24
- package/dist/commands/validate/validate.js.map +1 -1
- package/dist/core/agent/agents-md/artifacts.js +1 -0
- package/dist/core/agent/agents-md/artifacts.js.map +1 -1
- package/dist/core/agent/agents-md/command-map.js +18 -4
- package/dist/core/agent/agents-md/command-map.js.map +1 -1
- package/dist/core/agent/agents-md/cycle.js +24 -9
- package/dist/core/agent/agents-md/cycle.js.map +1 -1
- package/dist/core/agent/agents-md/map/lenses/context.js +4 -3
- package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -1
- package/dist/core/agent/agents-md/map/subsystem.js +51 -11
- package/dist/core/agent/agents-md/map/subsystem.js.map +1 -1
- package/dist/core/agent/agents-md/map/usecases.js +45 -3
- package/dist/core/agent/agents-md/map/usecases.js.map +1 -1
- package/dist/core/agent/agents-md.js +14 -4
- package/dist/core/agent/agents-md.js.map +1 -1
- package/dist/core/agent/support/report.js +39 -5
- package/dist/core/agent/support/report.js.map +1 -1
- package/dist/core/agent/workflows/adopt.js +123 -14
- package/dist/core/agent/workflows/adopt.js.map +1 -1
- package/dist/core/agent/workflows/check.js +35 -20
- package/dist/core/agent/workflows/check.js.map +1 -1
- package/dist/core/agent/workflows/closing.js +3 -1
- package/dist/core/agent/workflows/closing.js.map +1 -1
- package/dist/core/brief/brief.js +63 -11
- package/dist/core/brief/brief.js.map +1 -1
- package/dist/core/brief/checks.js +133 -7
- package/dist/core/brief/checks.js.map +1 -1
- package/dist/core/brief/landscape.js +212 -129
- package/dist/core/brief/landscape.js.map +1 -1
- package/dist/core/brief/map/extend.js +81 -0
- package/dist/core/brief/map/extend.js.map +1 -0
- package/dist/core/brief/map/owed.js +284 -0
- package/dist/core/brief/map/owed.js.map +1 -0
- package/dist/core/brief/targets.js +30 -29
- package/dist/core/brief/targets.js.map +1 -1
- package/dist/core/brief/unchecked.js +12 -2
- package/dist/core/brief/unchecked.js.map +1 -1
- package/dist/core/c4/likec4.js +23 -1
- package/dist/core/c4/likec4.js.map +1 -1
- package/dist/core/c4/parsed/deployment.js +5 -3
- package/dist/core/c4/parsed/deployment.js.map +1 -1
- package/dist/core/c4/parsed/view-ids.js +39 -1
- package/dist/core/c4/parsed/view-ids.js.map +1 -1
- package/dist/core/c4/prefetch/fleet.js +142 -0
- package/dist/core/c4/prefetch/fleet.js.map +1 -0
- package/dist/core/c4/project/architecture.js +52 -4
- package/dist/core/c4/project/architecture.js.map +1 -1
- package/dist/core/c4/project/batch.js +140 -0
- package/dist/core/c4/project/batch.js.map +1 -0
- package/dist/core/c4/project/documents.js +9 -4
- package/dist/core/c4/project/documents.js.map +1 -1
- package/dist/core/c4/project/load.js +77 -38
- package/dist/core/c4/project/load.js.map +1 -1
- package/dist/core/c4/project/staged.js +46 -12
- package/dist/core/c4/project/staged.js.map +1 -1
- package/dist/core/c4/resolve/attested.js +0 -0
- package/dist/core/c4/resolve/attested.js.map +1 -0
- package/dist/core/c4/resolve/service.js +8 -17
- package/dist/core/c4/resolve/service.js.map +1 -1
- package/dist/core/c4/resolve/steps.js +18 -0
- package/dist/core/c4/resolve/steps.js.map +1 -1
- package/dist/core/c4/root-project/exclude.js +352 -0
- package/dist/core/c4/root-project/exclude.js.map +1 -0
- package/dist/core/c4/service-model/documents.js +47 -0
- package/dist/core/c4/service-model/documents.js.map +1 -0
- package/dist/core/c4/service-model/fleet/extending.js +82 -0
- package/dist/core/c4/service-model/fleet/extending.js.map +1 -0
- package/dist/core/c4/service-model/load.js +165 -0
- package/dist/core/c4/service-model/load.js.map +1 -0
- package/dist/core/c4/service-model/renderer.js +128 -0
- package/dist/core/c4/service-model/renderer.js.map +1 -0
- package/dist/core/c4/service-model/shape.js +126 -0
- package/dist/core/c4/service-model/shape.js.map +1 -0
- package/dist/core/c4/service-model/slice.js +188 -0
- package/dist/core/c4/service-model/slice.js.map +1 -0
- package/dist/core/c4/source-scan.js +26 -0
- package/dist/core/c4/source-scan.js.map +1 -1
- package/dist/core/c4/splice/authored-source.js +60 -13
- package/dist/core/c4/splice/authored-source.js.map +1 -1
- package/dist/core/c4/splice/contract.js.map +1 -1
- package/dist/core/c4/splice/identity/declared.js +87 -0
- package/dist/core/c4/splice/identity/declared.js.map +1 -0
- package/dist/core/c4/splice/identity/edges.js +17 -0
- package/dist/core/c4/splice/identity/edges.js.map +1 -1
- package/dist/core/c4/splice/identity/existing.js +80 -0
- package/dist/core/c4/splice/identity/existing.js.map +1 -0
- package/dist/core/c4/splice/identity/interior.js +80 -0
- package/dist/core/c4/splice/identity/interior.js.map +1 -0
- package/dist/core/c4/splice/identity/owner.js +50 -0
- package/dist/core/c4/splice/identity/owner.js.map +1 -0
- package/dist/core/c4/splice/landscape-merge.js +154 -100
- package/dist/core/c4/splice/landscape-merge.js.map +1 -1
- package/dist/core/c4/splice/model/merge.js +140 -0
- package/dist/core/c4/splice/model/merge.js.map +1 -0
- package/dist/core/c4/splice/placement.js +14 -4
- package/dist/core/c4/splice/placement.js.map +1 -1
- package/dist/core/c4/workspace.js +2 -1
- package/dist/core/c4/workspace.js.map +1 -1
- package/dist/core/coherence/coherence.js +7 -0
- package/dist/core/coherence/coherence.js.map +1 -1
- package/dist/core/delta/delta.js +9 -0
- package/dist/core/delta/delta.js.map +1 -1
- package/dist/core/deployment/delta.js +4 -0
- package/dist/core/deployment/delta.js.map +1 -1
- package/dist/core/diff/base-state.js +21 -5
- package/dist/core/diff/base-state.js.map +1 -1
- package/dist/core/diff/victims.js +10 -1
- package/dist/core/diff/victims.js.map +1 -1
- package/dist/core/docs.js +29 -24
- package/dist/core/docs.js.map +1 -1
- package/dist/core/doctor/config.js +7 -3
- package/dist/core/doctor/config.js.map +1 -1
- package/dist/core/doctor/doctor.js +36 -8
- package/dist/core/doctor/doctor.js.map +1 -1
- package/dist/core/doctor/report.js.map +1 -1
- package/dist/core/doctor/reports/scan.js +242 -0
- package/dist/core/doctor/reports/scan.js.map +1 -0
- package/dist/core/explain/refusals.js +1 -1
- package/dist/core/explain/refusals.js.map +1 -1
- package/dist/core/explore/explore.js +44 -9
- package/dist/core/explore/explore.js.map +1 -1
- package/dist/core/fleet-context.js +47 -0
- package/dist/core/fleet-context.js.map +1 -1
- package/dist/core/gate/partners.js +5 -9
- package/dist/core/gate/partners.js.map +1 -1
- package/dist/core/kernel/ids/fqn/ancestors.js +65 -0
- package/dist/core/kernel/ids/fqn/ancestors.js.map +1 -0
- package/dist/core/pack/living.js +47 -13
- package/dist/core/pack/living.js.map +1 -1
- package/dist/core/pack/pack.js +9 -6
- package/dist/core/pack/pack.js.map +1 -1
- package/dist/core/projection/arch-slice.js +2 -2
- package/dist/core/projection/arch-slice.js.map +1 -1
- package/dist/core/repo/paths.js +11 -9
- package/dist/core/repo/paths.js.map +1 -1
- package/dist/core/repo/tree/render/projects.js +93 -35
- package/dist/core/repo/tree/render/projects.js.map +1 -1
- package/dist/core/repo/tree/render/stale.js +2 -3
- package/dist/core/repo/tree/render/stale.js.map +1 -1
- package/dist/core/repo/tree/render/views.js +51 -3
- package/dist/core/repo/tree/render/views.js.map +1 -1
- package/dist/core/repo/tree/walk.js +45 -2
- package/dist/core/repo/tree/walk.js.map +1 -1
- package/dist/core/scaffold/landscape.js +219 -9
- package/dist/core/scaffold/landscape.js.map +1 -1
- package/dist/core/staging/writes.js.map +1 -1
- package/dist/core/usecases/delta/claims.js +1 -0
- package/dist/core/usecases/delta/claims.js.map +1 -1
- package/dist/core/usecases/delta/overlay.js +4 -0
- package/dist/core/usecases/delta/overlay.js.map +1 -1
- package/dist/core/usecases/fleet.js +18 -6
- package/dist/core/usecases/fleet.js.map +1 -1
- package/dist/core/usecases/operations.js +7 -0
- package/dist/core/usecases/operations.js.map +1 -1
- package/dist/core/usecases/service/exclude.js +119 -0
- package/dist/core/usecases/service/exclude.js.map +1 -0
- package/dist/core/usecases/service/flows.js +161 -0
- package/dist/core/usecases/service/flows.js.map +1 -0
- package/dist/core/vocabulary/maturity.js +10 -0
- package/dist/core/vocabulary/maturity.js.map +1 -1
- package/examples/README.md +24 -6
- package/examples/docs/architecture/landscape.likec4 +41 -0
- package/examples/docs/architecture/usecases/order-notification.likec4 +5 -2
- package/examples/docs/likec4.config.json +0 -1
- package/examples/docs/services/checkout-web/model.likec4 +39 -56
- package/examples/docs/services/order-service/arch.spec.md +13 -6
- package/examples/docs/services/order-service/model.likec4 +53 -67
- package/examples/docs/services/payment-service/arch.spec.md +7 -4
- package/examples/docs/services/payment-service/model.likec4 +32 -35
- package/examples/docs/services/platform/identity-service/arch.spec.md +7 -4
- package/examples/docs/services/platform/identity-service/model.likec4 +29 -33
- package/examples/docs/services/platform/notification-service/health.yaml +8 -3
- package/examples/docs/services/platform/notification-service/model.likec4 +39 -59
- package/package.json +1 -1
- package/examples/docs/services/checkout-web/likec4.config.json +0 -4
- package/examples/docs/services/order-service/likec4.config.json +0 -4
- package/examples/docs/services/payment-service/likec4.config.json +0 -4
- package/examples/docs/services/platform/identity-service/likec4.config.json +0 -4
- package/examples/docs/services/platform/notification-service/likec4.config.json +0 -4
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
// service needs a directory (warning). An element is tied to its directory by
|
|
9
9
|
// `metadata { service '<id>' }`, or by its title when there is no binding.
|
|
10
10
|
// Systems that are not ours carry #external and are exempt.
|
|
11
|
+
//
|
|
12
|
+
// This file is also the SPECIFICATION every service model borrows. Each
|
|
13
|
+
// `services/<…>/<svc>/model.likec4` here is an EXTENDING model: it declares no
|
|
14
|
+
// kinds and no partners, and says what is inside its service with
|
|
15
|
+
// `extend marketplace.<svc> { … }` on the element below that binds to its
|
|
16
|
+
// directory. The root `likec4.config.json` therefore does NOT exclude
|
|
17
|
+
// `services/**` — the map and every model are ONE LikeC4 project, so an element
|
|
18
|
+
// is declared exactly once and no two documents can disagree about its tags.
|
|
19
|
+
// SCHEMA.md, "Two shapes of a service model", has both shapes and the rule that
|
|
20
|
+
// picks between them; a kind or tag a model needs is added HERE, once.
|
|
11
21
|
specification {
|
|
12
22
|
// A grouping element — it stands for no service and owns no directory. The
|
|
13
23
|
// service checks WALK the tree rather than reading only top-level elements:
|
|
@@ -20,7 +30,18 @@ specification {
|
|
|
20
30
|
// Declared here because archive SPLICES a delta's additions verbatim: FEAT-101's
|
|
21
31
|
// new system carries its `api` container along, and the kind has to be legal in
|
|
22
32
|
// THIS document for the merged landscape to parse (archive refuses otherwise).
|
|
33
|
+
// Only a NEW service arrives this way — one that already has an extending model
|
|
34
|
+
// takes the addition into that model instead, and this file never grows an
|
|
35
|
+
// interior.
|
|
23
36
|
element container
|
|
37
|
+
// Declared here for the SERVICE MODELS, and nothing in this file uses it: a
|
|
38
|
+
// store lives inside the service that owns it (`landscape.datastore-private`
|
|
39
|
+
// is the check that pushes one back in), so every `database` element in this
|
|
40
|
+
// fleet is written in a `services/<svc>/model.likec4` under
|
|
41
|
+
// `extend marketplace.<svc>`. An extending model declares no kinds of its
|
|
42
|
+
// own, so a kind it needs and this block does not declare is ONE parse error
|
|
43
|
+
// on the model — which is what this line prevents.
|
|
44
|
+
element database
|
|
24
45
|
element person
|
|
25
46
|
// A topic is an element, and the kind carries #external rather than each
|
|
26
47
|
// instance doing it: LikeC4 does NOT inherit tags, so a topic nested inside
|
|
@@ -137,6 +158,18 @@ model {
|
|
|
137
158
|
description 'CRM of record — the fleet reads its events and writes none'
|
|
138
159
|
}
|
|
139
160
|
|
|
161
|
+
// Declared HERE rather than in notification-service's model, and that is the
|
|
162
|
+
// rule an extending model turns on: a system a service reaches is the fleet's
|
|
163
|
+
// element, declared once, and a model that declared its own copy would be
|
|
164
|
+
// `c4.element-unowned` (an extending model may only add elements under the
|
|
165
|
+
// element that resolves to its own service). One consumer, so it never
|
|
166
|
+
// becomes `landscape.platform-candidate`; #external, so no
|
|
167
|
+
// services/notification-provider/ is asked for.
|
|
168
|
+
notificationProvider = softwareSystem 'notification-provider' {
|
|
169
|
+
#external
|
|
170
|
+
description 'Third-party email and SMS gateway — quota-limited, and outside this fleet'
|
|
171
|
+
}
|
|
172
|
+
|
|
140
173
|
customer -> marketplace.checkoutWeb 'Uses'
|
|
141
174
|
|
|
142
175
|
// The synchronous spine. Every one of these resolves against the TARGET's
|
|
@@ -185,6 +218,14 @@ model {
|
|
|
185
218
|
// it raises no warning because its title does not claim to be a call into a
|
|
186
219
|
// fleet service.
|
|
187
220
|
marketplace.paymentService -> stripe 'Authorizes cards'
|
|
221
|
+
// The second half of the rule the extending shape keeps: the container that
|
|
222
|
+
// really makes the call is drawn in the service's own model
|
|
223
|
+
// (`marketplace.notificationService.sender -> notificationProvider`), and the
|
|
224
|
+
// SERVICE-level twin is drawn here, because every fleet check — the spine,
|
|
225
|
+
// `landscape.service-isolated`, the platform census — reads this file alone.
|
|
226
|
+
// The edge exists twice on purpose; SCHEMA.md says so where it says the map
|
|
227
|
+
// is the one document holding every cross-service edge.
|
|
228
|
+
marketplace.notificationService -> notificationProvider 'Sends email and SMS'
|
|
188
229
|
|
|
189
230
|
// The event spine, the async mirror of `metadata { op }`: the name must be a
|
|
190
231
|
// message the PRODUCER's own asyncapi.yaml declares an `action: send` for, or
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
// read as ONE LikeC4 project, so the steps below resolve against the landscape's
|
|
15
15
|
// elements even though this file declares none — which also means exactly one
|
|
16
16
|
// file in this directory declares the `specification` block, and it is not this
|
|
17
|
-
// one.
|
|
17
|
+
// one. (The renderer's root project is WIDER than what loam grades here: it also
|
|
18
|
+
// holds every `services/<svc>/model.likec4`, because each of them extends the
|
|
19
|
+
// map. A tag declared twice across that whole set is `c4.fleet-project-invalid`,
|
|
20
|
+
// which is why a tag belongs in the landscape's one block.)
|
|
18
21
|
//
|
|
19
22
|
// THE TAG MUST BE THE FIRST THING IN THE VIEW BODY. Written after `title` it is
|
|
20
23
|
// five parse errors, none of which mentions tags. That is the mistake every
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
// `usecase.step-unlinked` is met except the one that matters, which is that a
|
|
31
34
|
// person is not a caller. Somebody clicking a button owes no operationId. Delete
|
|
32
35
|
// that exemption from the checker and this file is what notices: the example
|
|
33
|
-
// fleet's warning count moves from
|
|
36
|
+
// fleet's warning count moves from ten to eleven and test/examples.test.ts
|
|
34
37
|
// fails.
|
|
35
38
|
//
|
|
36
39
|
// The hop from checkout-web to order-service is DELIBERATELY NOT DRAWN, and its
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// checkout-web's own C4 — what is INSIDE the element the fleet map binds to
|
|
2
|
+
// services/checkout-web/. A UI is a first-class C4 system: it has containers, it
|
|
3
|
+
// has runtime dependencies, and its pages (ui/pages/*.page.yaml) hang off the
|
|
4
|
+
// operations the edges below name.
|
|
4
5
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
// An EXTENDING model: no `specification` block, no partner copies. The kinds and
|
|
7
|
+
// every element this file points at — `customer`, `marketplace.orderService`,
|
|
8
|
+
// `marketplace.paymentService` — are declared once in
|
|
9
|
+
// architecture/landscape.likec4, and the root `likec4.config.json` does not
|
|
10
|
+
// exclude `services/**`, so the map and every model are read as ONE LikeC4
|
|
11
|
+
// project. `extend` takes the fully-qualified id, because the element is nested
|
|
12
|
+
// in the `marketplace` group.
|
|
13
|
+
//
|
|
14
|
+
// Note what this file does NOT do: it does not declare `customer = person`. The
|
|
15
|
+
// actor is the map's, and the edge below simply points at it. That is the rule
|
|
16
|
+
// the shape turns on — an element declared here outside
|
|
17
|
+
// `marketplace.checkoutWeb` is `c4.element-unowned` — and it is also what stops
|
|
18
|
+
// two documents from holding two different descriptions of the same person.
|
|
19
|
+
// SCHEMA.md, "Two shapes of a service model", has the other shape.
|
|
15
20
|
model {
|
|
16
|
-
|
|
17
|
-
// the pages exist for this person, and the flows in ui/pages/ start at them.
|
|
18
|
-
// The landscape draws the same customer -> checkout-web edge at fleet scale;
|
|
19
|
-
// a person is exempt from the service/directory cross-check either way.
|
|
20
|
-
customer = person 'Customer'
|
|
21
|
-
|
|
22
|
-
checkoutWeb = softwareSystem 'checkout-web' {
|
|
23
|
-
description 'Customer-facing checkout UI'
|
|
24
|
-
|
|
21
|
+
extend marketplace.checkoutWeb {
|
|
25
22
|
spa = container 'spa' {
|
|
26
23
|
description 'Checkout SPA — cart, payment and order status pages'
|
|
27
24
|
technology 'React'
|
|
@@ -37,37 +34,21 @@ model {
|
|
|
37
34
|
technology 'Node.js'
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
customer -> spa 'Buys'
|
|
41
37
|
spa -> bff 'Calls the checkout BFF'
|
|
42
38
|
}
|
|
43
39
|
|
|
44
|
-
// The
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
// `c4.no-relationships` would be right to say a model that reaches nothing is
|
|
50
|
-
// almost never true.
|
|
51
|
-
orderService = softwareSystem 'order-service' {
|
|
52
|
-
description 'Owns the order lifecycle'
|
|
53
|
-
// Bind rather than rely on the title. A renamed box silently stops matching
|
|
54
|
-
// its directory everywhere the two are joined — in the landscape that costs
|
|
55
|
-
// `landscape.binding-unknown` (error) when the id is wrong, and here it is
|
|
56
|
-
// what `health.dependency-unmodelled` resolves a declared dependency
|
|
57
|
-
// through in the services that have a health.yaml. checkout-web has none:
|
|
58
|
-
// a UI is nobody's runtime dependency, so it declares no SLIs, no alerts
|
|
59
|
-
// and no dependency graph, and owes no arch.spec.md to cover them.
|
|
60
|
-
metadata {
|
|
61
|
-
service 'order-service'
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
paymentService = softwareSystem 'payment-service' {
|
|
65
|
-
description 'Owns payment authorization/capture'
|
|
66
|
-
metadata {
|
|
67
|
-
service 'payment-service'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
40
|
+
// The person is the MAP's element and the hop into this UI is drawn from it.
|
|
41
|
+
// The landscape draws the coarser `customer -> marketplace.checkoutWeb` twin
|
|
42
|
+
// at fleet scale; this one says which container the click reaches. A person is
|
|
43
|
+
// exempt from the service/directory cross-check either way.
|
|
44
|
+
customer -> marketplace.checkoutWeb.spa 'Buys'
|
|
70
45
|
|
|
46
|
+
// The services this one actually calls, drawn with the edge the service really
|
|
47
|
+
// has — the landscape carries only the boundary crossing (checkout-web ->
|
|
48
|
+
// order-service), while the edges below say WHICH container makes the call.
|
|
49
|
+
// Without them this file would be two boxes and a hop, and `c4.no-relationships`
|
|
50
|
+
// would be right to say a model that reaches nothing is almost never true.
|
|
51
|
+
//
|
|
71
52
|
// `metadata { op }` is the C4 half of the operation join: the exact
|
|
72
53
|
// operationId order-service's openapi.yaml declares. What `loam validate`
|
|
73
54
|
// grades is the LANDSCAPE's twin of each edge below — `spine.op-undefined`
|
|
@@ -77,12 +58,12 @@ model {
|
|
|
77
58
|
// nothing would catch it if they did. Two calls to one service are two edges,
|
|
78
59
|
// not one edge with a list — a view has to be able to show that the status
|
|
79
60
|
// page and the checkout page stand on different operations.
|
|
80
|
-
checkoutWeb.bff -> orderService 'Calls createOrder' {
|
|
61
|
+
marketplace.checkoutWeb.bff -> marketplace.orderService 'Calls createOrder' {
|
|
81
62
|
metadata {
|
|
82
63
|
op 'createOrder'
|
|
83
64
|
}
|
|
84
65
|
}
|
|
85
|
-
checkoutWeb.bff -> orderService 'Calls getOrder' {
|
|
66
|
+
marketplace.checkoutWeb.bff -> marketplace.orderService 'Calls getOrder' {
|
|
86
67
|
metadata {
|
|
87
68
|
op 'getOrder'
|
|
88
69
|
}
|
|
@@ -94,16 +75,18 @@ model {
|
|
|
94
75
|
// for an edge that SAYS it calls something and names no operation, so nothing
|
|
95
76
|
// can check the call still exists. Free here and one warning there, which is
|
|
96
77
|
// the asymmetry worth knowing: the fleet map is what the spine reads.
|
|
97
|
-
checkoutWeb.spa -> paymentService 'Calls the payment API'
|
|
78
|
+
marketplace.checkoutWeb.spa -> marketplace.paymentService 'Calls the payment API'
|
|
98
79
|
}
|
|
99
80
|
|
|
100
81
|
// Views are the LikeC4 renderer's, never loam's — no check reads this block.
|
|
101
|
-
// Scoped to the
|
|
102
|
-
// rather than redrawing the fleet, which architecture/landscape.likec4
|
|
82
|
+
// Scoped to the service's element so the page answers "what does the checkout UI
|
|
83
|
+
// stand on" rather than redrawing the fleet, which architecture/landscape.likec4
|
|
84
|
+
// already does. This file is part of the root project: `npx likec4 start` at the
|
|
85
|
+
// docs root draws it, with no per-service project file to write.
|
|
103
86
|
views {
|
|
104
|
-
view checkout_web of checkoutWeb {
|
|
87
|
+
view checkout_web of marketplace.checkoutWeb {
|
|
105
88
|
title 'checkout-web — containers and the services they call'
|
|
106
89
|
include *
|
|
107
|
-
include orderService, paymentService
|
|
90
|
+
include marketplace.orderService, marketplace.paymentService
|
|
108
91
|
}
|
|
109
92
|
}
|
|
@@ -25,9 +25,16 @@ this service's own `model.likec4` plus the landscape (`covers.unknown`, with a d
|
|
|
25
25
|
hint, is the typo guard — a mistyped entry otherwise costs exactly the coverage it was written
|
|
26
26
|
for), and every `slis[].name` and `alerts[].name` in `health.yaml` must be named by one of them
|
|
27
27
|
(`health.uncovered`, or a signal ships to the on-call rotation with nothing testing it). Edge
|
|
28
|
-
entries below are spelled as this model draws them — `orderService.outbox ->
|
|
29
|
-
— because the endpoint that matters is the container; `order-service ->
|
|
30
|
-
resolves too, through the `metadata { service }` binding on the
|
|
28
|
+
entries below are spelled as this model draws them — `marketplace.orderService.outbox ->
|
|
29
|
+
kafka.orderEvents` — because the endpoint that matters is the container; `order-service ->
|
|
30
|
+
payment-service` resolves too, through the `metadata { service }` binding on the map's element.
|
|
31
|
+
|
|
32
|
+
Element ids here carry the FULL path, `marketplace.` and all. That is a consequence of the model
|
|
33
|
+
shape rather than a style: `model.likec4` extends the element the fleet map declares inside the
|
|
34
|
+
`marketplace` group, so the container it adds is `marketplace.orderService.db` and no shorter
|
|
35
|
+
spelling of it exists. A service whose model declares its own `specification` and is parsed alone
|
|
36
|
+
mints shorter ids and writes them here — see SCHEMA.md, "Two shapes of a service model", which also
|
|
37
|
+
lists requalifying these lines as a step of the migration between the two.
|
|
31
38
|
|
|
32
39
|
## Requirements
|
|
33
40
|
|
|
@@ -40,7 +47,7 @@ key rather than placing a second order or requesting a second authorization. che
|
|
|
40
47
|
retry on a gateway timeout is not a rare path — it is the normal shape of a mobile checkout —
|
|
41
48
|
and without the key a customer's flaky connection charges the card twice.
|
|
42
49
|
|
|
43
|
-
Covers: orderService.db, orderService.domain -> paymentService
|
|
50
|
+
Covers: marketplace.orderService.db, marketplace.orderService.domain -> marketplace.paymentService
|
|
44
51
|
|
|
45
52
|
#### Scenario: checkout-web retries a placement it never saw acknowledged
|
|
46
53
|
- **Given** an order placed under `Idempotency-Key` "ik-8842" with an authorization already requested
|
|
@@ -63,7 +70,7 @@ database and then to kafka. A dual write has no failure mode in which both sides
|
|
|
63
70
|
between them either announces an order nobody stored or stores one nobody hears about, and
|
|
64
71
|
notification-service is the service that pays for the second case.
|
|
65
72
|
|
|
66
|
-
Covers: orderService.outbox, orderService.outbox -> kafka.orderEvents
|
|
73
|
+
Covers: marketplace.orderService.outbox, marketplace.orderService.outbox -> kafka.orderEvents
|
|
67
74
|
|
|
68
75
|
#### Scenario: The broker is unavailable when an order is placed
|
|
69
76
|
- **Given** an accepted order whose `OrderPlaced` row is still in the outbox table
|
|
@@ -86,7 +93,7 @@ already recorded. The producer's outbox promises at-least-once delivery and a re
|
|
|
86
93
|
redelivers whatever was in flight, so a consumer without a ledger is a consumer that confirms
|
|
87
94
|
an order it already confirmed — and, once ORD-CANCEL has moved on, resurrects a cancelled one.
|
|
88
95
|
|
|
89
|
-
Covers: orderService.consumer, kafka.paymentEvents -> orderService.consumer
|
|
96
|
+
Covers: marketplace.orderService.consumer, kafka.paymentEvents -> marketplace.orderService.consumer
|
|
90
97
|
Consumes: payment.PaymentAuthorized
|
|
91
98
|
|
|
92
99
|
#### Scenario: The same authorization is redelivered after a consumer rebalance
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
// order-service's own C4 — the
|
|
1
|
+
// order-service's own C4 — what is INSIDE the element the fleet map binds to
|
|
2
|
+
// services/order-service/.
|
|
2
3
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
// This is an EXTENDING model: it declares no `specification` block, so every
|
|
5
|
+
// kind and tag it uses comes from architecture/landscape.likec4, and it declares
|
|
6
|
+
// no partner of its own. The map already says that order-service exists, what it
|
|
7
|
+
// is called and which directory it binds to; this file says what is inside it,
|
|
8
|
+
// with `extend` on the fully-qualified id the map gave that element. The id has
|
|
9
|
+
// to be the full path — `extend orderService` resolves to nothing, because the
|
|
10
|
+
// element is nested in the `marketplace` group.
|
|
11
|
+
//
|
|
12
|
+
// Nothing here re-declares kafka, payment-service or identity-service. That is
|
|
13
|
+
// the whole point of the shape: the root likec4.config.json does not exclude
|
|
14
|
+
// `services/**`, so the map and every model are ONE LikeC4 project, an element
|
|
15
|
+
// is declared exactly once, and two documents cannot disagree about its tags or
|
|
16
|
+
// its description. A PARTNER is what this file refers to and never owns — the
|
|
17
|
+
// map's element, reached by the id the map spells. An element declared here
|
|
18
|
+
// outside `marketplace.orderService` would be `c4.element-unowned`.
|
|
19
|
+
//
|
|
20
|
+
// SCHEMA.md, "Two shapes of a service model", has the other shape (a model that
|
|
21
|
+
// declares its own `specification` and is parsed alone) and the recipe for
|
|
22
|
+
// migrating between them.
|
|
16
23
|
model {
|
|
17
|
-
orderService
|
|
18
|
-
description 'Owns the order lifecycle and orchestrates the payment behind it'
|
|
19
|
-
// The binding, not the title, is what ties this element to services/order-service/,
|
|
20
|
-
// and it is what every join downstream resolves through: health.yaml's dependency
|
|
21
|
-
// ids, an `arch.spec.md` edge entry written as `order-service -> payment-service`,
|
|
22
|
-
// the landscape's twin element. Rename the box without it and each of those stops
|
|
23
|
-
// matching in silence.
|
|
24
|
-
metadata {
|
|
25
|
-
service 'order-service'
|
|
26
|
-
}
|
|
27
|
-
|
|
24
|
+
extend marketplace.orderService {
|
|
28
25
|
api = container 'api' {
|
|
29
26
|
description 'REST API: createOrder, getOrder, cancelOrder, and the deprecated createOrderV1'
|
|
30
27
|
technology 'Spring Boot'
|
|
@@ -36,7 +33,8 @@ model {
|
|
|
36
33
|
// The two background containers exist in this model because arch.spec.md has to
|
|
37
34
|
// be able to point at them: ARCH-ORD-OUTBOX and ARCH-ORD-DEDUPE cover them by id,
|
|
38
35
|
// and an obligation whose subject is not modelled is an obligation no `Covers:`
|
|
39
|
-
// line can name.
|
|
36
|
+
// line can name. Written the way the map spells them —
|
|
37
|
+
// `marketplace.orderService.outbox` — because that is the id this file makes.
|
|
40
38
|
outbox = container 'outbox-relay' {
|
|
41
39
|
description 'Publishes committed outbox rows to order.events.v1 — at-least-once'
|
|
42
40
|
technology 'Kotlin'
|
|
@@ -48,55 +46,40 @@ model {
|
|
|
48
46
|
// The store is a NESTED container of this service, never a fleet-level peer: it
|
|
49
47
|
// has exactly one consumer, so drawn beside the services in the landscape it would
|
|
50
48
|
// read as a system in its own right (`landscape.datastore-private` is the check
|
|
51
|
-
// that pushes it back in here).
|
|
49
|
+
// that pushes it back in here). Nesting hides nothing — a second service reaching
|
|
50
|
+
// the same data earns `landscape.datastore-shared`, counted from that service's own
|
|
51
|
+
// model — but it does decide where the store may be written: an edge naming
|
|
52
|
+
// `marketplace.orderService.db` resolves only for a project that holds this file,
|
|
53
|
+
// so a store two services will share belongs on the map inside `marketplace.orderService`.
|
|
54
|
+
// The `database` kind is the landscape's, declared there once for every model that needs it.
|
|
52
55
|
db = database 'db' {
|
|
53
56
|
description 'Orders, idempotency keys, the applied-payment ledger and the outbox table'
|
|
54
57
|
technology 'PostgreSQL'
|
|
55
58
|
}
|
|
56
59
|
|
|
60
|
+
// The internal edges, written INSIDE the extend block, where the children
|
|
61
|
+
// resolve by their short names.
|
|
57
62
|
api -> domain 'Places, reads and cancels'
|
|
58
63
|
domain -> db 'Writes the order, its idempotency key and its outbox row in one transaction'
|
|
59
64
|
outbox -> db 'Polls unpublished outbox rows and marks them sent'
|
|
60
65
|
consumer -> db 'Records the applied paymentId, then advances the order'
|
|
61
66
|
}
|
|
62
67
|
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// the
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
metadata {
|
|
71
|
-
service 'payment-service'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
identityService = softwareSystem 'identity-service' {
|
|
75
|
-
description 'Issues and introspects access tokens'
|
|
76
|
-
metadata {
|
|
77
|
-
service 'identity-service'
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
kafka = softwareSystem 'kafka' {
|
|
81
|
-
description 'Event backbone (platform)'
|
|
82
|
-
// A topic per channel rather than one broker box. What a producer and a consumer
|
|
83
|
-
// actually share is the channel, and pointing every edge at the broker turns the
|
|
84
|
-
// fleet map into a star with one node in the middle the moment the fleet is
|
|
85
|
-
// bigger than this example.
|
|
86
|
-
orderEvents = topic 'order.events'
|
|
87
|
-
paymentEvents = topic 'payment.events'
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// The edges, drawn from the container that really makes each call — which is the
|
|
91
|
-
// half of the truth the landscape cannot hold. A model with elements and no
|
|
92
|
-
// relationships beside a health.yaml declaring two dependencies is
|
|
93
|
-
// `c4.no-relationships`: a service that reaches nothing is almost never true.
|
|
68
|
+
// The cross-boundary edges, drawn OUTSIDE the extend block, from the container
|
|
69
|
+
// that really makes each call to the other party's element as the MAP spells
|
|
70
|
+
// it — which is the half of the truth the landscape cannot hold, since the map
|
|
71
|
+
// carries only the service-level crossing. This file names no `kafka` of its
|
|
72
|
+
// own: `kafka.orderEvents` is the map's topic, and pointing at it is what makes
|
|
73
|
+
// health.yaml's `kafka` dependency resolve (a partner brings its ancestors with
|
|
74
|
+
// it, so the broker answers even though only its topic is named).
|
|
94
75
|
//
|
|
95
76
|
// The `metadata` blocks below are not read for a service model — only landscape
|
|
96
77
|
// edges feed `spine.op-*` and the event spine — but they are written anyway so the
|
|
97
78
|
// two documents cannot drift into disagreeing about which operation and which
|
|
98
|
-
// message each edge stands for.
|
|
99
|
-
|
|
79
|
+
// message each edge stands for. A model with elements and no relationships beside
|
|
80
|
+
// a health.yaml declaring two dependencies is `c4.no-relationships`: a service
|
|
81
|
+
// that reaches nothing is almost never true.
|
|
82
|
+
marketplace.orderService.domain -> marketplace.paymentService 'Calls authorizePayment' {
|
|
100
83
|
metadata {
|
|
101
84
|
op 'authorizePayment'
|
|
102
85
|
}
|
|
@@ -104,12 +87,12 @@ model {
|
|
|
104
87
|
// ORD-CANCEL's `Requires: user/orders:cancel` has to be enforced somewhere, and this
|
|
105
88
|
// is that edge: the API introspects the caller's token before it will cancel anything.
|
|
106
89
|
// Drawn here and absent from health.yaml, which states the asymmetry and the reason.
|
|
107
|
-
orderService.api -> identityService 'Calls introspectToken' {
|
|
90
|
+
marketplace.orderService.api -> marketplace.identityService 'Calls introspectToken' {
|
|
108
91
|
metadata {
|
|
109
92
|
op 'introspectToken'
|
|
110
93
|
}
|
|
111
94
|
}
|
|
112
|
-
orderService.outbox -> kafka.orderEvents 'Publishes OrderPlaced' {
|
|
95
|
+
marketplace.orderService.outbox -> kafka.orderEvents 'Publishes OrderPlaced' {
|
|
113
96
|
metadata {
|
|
114
97
|
publishes 'order.OrderPlaced'
|
|
115
98
|
}
|
|
@@ -119,7 +102,7 @@ model {
|
|
|
119
102
|
// edge drawn the other way round binds to nothing. Nothing grades it in a
|
|
120
103
|
// service model, which is exactly why it follows the same convention — a
|
|
121
104
|
// reader who learns the arrow here should not have to unlearn it upstairs.
|
|
122
|
-
kafka.paymentEvents -> orderService.consumer 'PaymentAuthorized advances the order' {
|
|
105
|
+
kafka.paymentEvents -> marketplace.orderService.consumer 'PaymentAuthorized advances the order' {
|
|
123
106
|
metadata {
|
|
124
107
|
consumes 'payment.PaymentAuthorized'
|
|
125
108
|
}
|
|
@@ -127,12 +110,15 @@ model {
|
|
|
127
110
|
}
|
|
128
111
|
|
|
129
112
|
// Views are the LikeC4 renderer's, never loam's — no check reads this block. Scoped
|
|
130
|
-
// to the
|
|
131
|
-
// the fleet-wide one is already answered in architecture/landscape.likec4.
|
|
113
|
+
// to the service's element, because "what does an order stand on" is this file's
|
|
114
|
+
// question and the fleet-wide one is already answered in architecture/landscape.likec4.
|
|
115
|
+
// This file is part of the ROOT project, beside the map: `npx likec4 start` at the
|
|
116
|
+
// docs root draws it, and there is no per-service likec4.config.json to write.
|
|
117
|
+
// View ids are flat across the whole project, so this one is spelled to be unique.
|
|
132
118
|
views {
|
|
133
|
-
view order_service of orderService {
|
|
119
|
+
view order_service of marketplace.orderService {
|
|
134
120
|
title 'order-service — containers, its store, and what it reaches'
|
|
135
121
|
include *
|
|
136
|
-
include paymentService, identityService, kafka, kafka.*
|
|
122
|
+
include marketplace.paymentService, marketplace.identityService, kafka, kafka.*
|
|
137
123
|
}
|
|
138
124
|
}
|
|
@@ -15,9 +15,12 @@ its scenarios exercise, and `loam validate` checks every entry resolves
|
|
|
15
15
|
(`covers.unknown`) and every declared alert/SLI is covered (`health.uncovered`).
|
|
16
16
|
|
|
17
17
|
An edge entry resolves by exact element id **or** by the service an endpoint stands for, which
|
|
18
|
-
is why the entries below name `payment-service` rather than `marketplace.paymentService`:
|
|
19
|
-
landscape draws this service inside a grouping element, and
|
|
20
|
-
|
|
18
|
+
is why the edge entries below name `payment-service` rather than `marketplace.paymentService`:
|
|
19
|
+
the landscape draws this service inside a grouping element, and an edge written against a group
|
|
20
|
+
path would have to be rewritten the day somebody moves the box. A CONTAINER has no such coarser
|
|
21
|
+
name, so `marketplace.paymentService.outbox` is spelled in full — `model.likec4` extends the
|
|
22
|
+
element the map declares inside `marketplace`, so that IS the container's id. SCHEMA.md, "Two
|
|
23
|
+
shapes of a service model", has the rule and the migration step that requalifies these lines.
|
|
21
24
|
|
|
22
25
|
## Requirements
|
|
23
26
|
|
|
@@ -27,7 +30,7 @@ Requirement-ID: ARCH-PAY-OUTBOX
|
|
|
27
30
|
The service SHALL write a domain event and the state change it reports in one
|
|
28
31
|
database transaction, published to kafka by an outbox relay — never a dual write.
|
|
29
32
|
|
|
30
|
-
Covers: paymentService.outbox, payment-service -> kafka.paymentEvents
|
|
33
|
+
Covers: marketplace.paymentService.outbox, payment-service -> kafka.paymentEvents
|
|
31
34
|
Publishes: payment.PaymentAuthorized, payment.PaymentCaptured
|
|
32
35
|
|
|
33
36
|
#### Scenario: Broker down at commit time
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
//
|
|
1
|
+
// payment-service's own C4 — what is INSIDE the element the fleet map binds to
|
|
2
|
+
// services/payment-service/. Written by an agent from the `loam adopt` brief,
|
|
3
|
+
// then curated.
|
|
2
4
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// `likec4.config.json`
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
// An EXTENDING model: no `specification` block of its own, no copy of any
|
|
6
|
+
// partner. The kinds (`container`, `database`) and every element this file
|
|
7
|
+
// points at are declared once in architecture/landscape.likec4, and the root
|
|
8
|
+
// `likec4.config.json` does not exclude `services/**`, so the map and every
|
|
9
|
+
// model are one LikeC4 project. `extend` takes the FULLY-QUALIFIED id — the
|
|
10
|
+
// element is nested in the `marketplace` group, so `extend paymentService`
|
|
11
|
+
// would resolve to nothing.
|
|
12
|
+
//
|
|
13
|
+
// There is no likec4.config.json beside this file and loam never writes one for
|
|
14
|
+
// an extending model: it belongs to the root project, so `npx likec4 start` at
|
|
15
|
+
// the docs root already draws it beside the map. SCHEMA.md, "Two shapes of a
|
|
16
|
+
// service model", has the other shape and the migration recipe.
|
|
15
17
|
model {
|
|
16
|
-
paymentService
|
|
17
|
-
description 'Owns payment authorization/capture'
|
|
18
|
-
|
|
18
|
+
extend marketplace.paymentService {
|
|
19
19
|
api = container 'api' {
|
|
20
20
|
description 'REST API'
|
|
21
21
|
technology 'Spring Boot'
|
|
@@ -42,28 +42,25 @@ model {
|
|
|
42
42
|
domain -> outbox 'Appends events in the state-change transaction'
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
stripe
|
|
57
|
-
description 'Card acquirer'
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
paymentService.outbox -> kafka 'Relay publishes payment events'
|
|
61
|
-
paymentService.domain -> identityService 'Validates the caller token'
|
|
62
|
-
paymentService.domain -> stripe 'Authorizes and captures cards'
|
|
45
|
+
// Everything the service touches across its own boundary, drawn from the
|
|
46
|
+
// container that really touches it to the other party's element AS THE MAP
|
|
47
|
+
// SPELLS IT — never a copy of that element. The landscape carries only the
|
|
48
|
+
// service-level crossing; these three edges say which container makes it.
|
|
49
|
+
// health.yaml's three dependencies resolve through them
|
|
50
|
+
// (`health.dependency-unmodelled` otherwise): `identity-service` through the
|
|
51
|
+
// binding on the map's element, `stripe` by its id, and `kafka` because a
|
|
52
|
+
// partner brings its ancestors — the edge names the TOPIC and the broker
|
|
53
|
+
// answers for it.
|
|
54
|
+
marketplace.paymentService.outbox -> kafka.paymentEvents 'Relay publishes payment events'
|
|
55
|
+
marketplace.paymentService.domain -> marketplace.identityService 'Validates the caller token'
|
|
56
|
+
marketplace.paymentService.domain -> stripe 'Authorizes and captures cards'
|
|
63
57
|
}
|
|
64
58
|
|
|
59
|
+
// Views are the LikeC4 renderer's, never loam's. This file is part of the root
|
|
60
|
+
// project, so `npx likec4 start` at the docs root draws this view beside the
|
|
61
|
+
// fleet map with nothing else to write.
|
|
65
62
|
views {
|
|
66
|
-
view payment_service of paymentService {
|
|
63
|
+
view payment_service of marketplace.paymentService {
|
|
67
64
|
include *
|
|
68
65
|
}
|
|
69
66
|
}
|
|
@@ -23,8 +23,11 @@ element id, an edge `source -> target`, or a health signal `sli:<id>` / `alert:<
|
|
|
23
23
|
is `covers.unknown` (a mistyped id silently costs exactly the coverage it was written
|
|
24
24
|
for), and an SLI or alert in `health.yaml` that no requirement here covers is
|
|
25
25
|
`health.uncovered`. Every id below comes from `model.likec4` or `health.yaml` in this
|
|
26
|
-
directory;
|
|
27
|
-
|
|
26
|
+
directory; no entry names another service, because everything this service touches is
|
|
27
|
+
inside its own boundary. The element ids carry the full `marketplace.identityService.`
|
|
28
|
+
path because that is what the ids ARE: `model.likec4` extends the element the fleet map
|
|
29
|
+
declares inside the `marketplace` group, so a container it adds has no shorter spelling.
|
|
30
|
+
SCHEMA.md, "Two shapes of a service model", has the rule.
|
|
28
31
|
|
|
29
32
|
## Requirements
|
|
30
33
|
|
|
@@ -41,7 +44,7 @@ one a single-instance test never catches: the signer and the verifier are differ
|
|
|
41
44
|
processes reading the same store, and a key promoted before it lands there makes
|
|
42
45
|
one instance mint tokens the others report inactive.
|
|
43
46
|
|
|
44
|
-
Covers: identityService.keyStore, identityService.tokens -> identityService.keyStore
|
|
47
|
+
Covers: marketplace.identityService.keyStore, marketplace.identityService.tokens -> marketplace.identityService.keyStore
|
|
45
48
|
|
|
46
49
|
#### Scenario: A rotation keeps tokens minted a minute earlier verifiable
|
|
47
50
|
- **Given** the active key K1 and tokens issued under it with thirty minutes of life left
|
|
@@ -71,7 +74,7 @@ cache holds derived state only: losing it costs latency, never correctness, and
|
|
|
71
74
|
design where a cache miss can produce a *different verdict* is the bug this
|
|
72
75
|
requirement exists to prevent.
|
|
73
76
|
|
|
74
|
-
Covers: identityService.introspectionCache, identityService.tokens -> identityService.introspectionCache
|
|
77
|
+
Covers: marketplace.identityService.introspectionCache, marketplace.identityService.tokens -> marketplace.identityService.introspectionCache
|
|
75
78
|
|
|
76
79
|
#### Scenario: A revocation invalidates the cached verdict immediately
|
|
77
80
|
- **Given** a token whose active verdict is cached
|