You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 020ccd9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: examples/order-management/README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,12 @@ mvn -q install -DskipTests
8
8
mvn -q exec:java -pl java-app-console
9
9
```
10
10
11
-
The first run creates `.local/order.db`, ensures schema from generated metadata, seeds through generated entities, performs a governed query, and saves an audited preset. The second run demonstrates idempotency.
11
+
The first run creates `.local/order.db`, ensures schema from generated metadata,
12
+
seeds through generated entities, performs a governed query, and saves an
13
+
audited preset. It also installs a customer-owned `OrderMutationPolicy`, denies
14
+
an unauthorized high-value order as one complete graph, and queries SQLite to
15
+
prove that zero order rows were written. The second run demonstrates
16
+
idempotency and repeats the policy proof.
12
17
13
18
Read `java-app-console/.../OrderManagementApp.java` first (handwritten), then `java-lib-core/lib/.../Q.java`, `CustomerOrderRequest.java`, and `CustomerOrder.java` (generated). Java is the naming and governance gold standard: `comment(...)` may appear anywhere before `purpose(...)`; only the purposed request exposes execute methods.
14
19
@@ -19,6 +24,25 @@ Expect one `WEB-2026-001` row dated `2026-08-12` with amount `129.95`. The first
19
24
## Customize it
20
25
21
26
Change the `withOrderNumberContaining` filter, ordering, or projection in the app and rerun. Add business behavior only under `java-app-console`; regenerate everything under `java-lib-core`. This library was generated from the shared Order Management model used by the six-language example suite, but that model and the generator are not runtime prerequisites.
27
+
28
+
### Customize whole-graph mutation policy
29
+
30
+
`OrderMutationPolicy.java` is application-owned code. It reviews the immutable
31
+
`MutationPlan` after Checker/Fix and graph assembly but before the first
32
+
provider write. The example requires a trusted `MutationAuthority` capability
33
+
for orders above `10000.00` and returns the stable denial code
34
+
`ORDER-HIGH-VALUE-AUTHORITY-REQUIRED` when that authority is absent.
35
+
36
+
`OrderManagementApp.context(...)` shows the three customer configuration
37
+
points:
38
+
39
+
1. register policy by the stable `CustomerOrder.saveGraph` request key;
40
+
2. provide approval for the exact policy identity and fingerprint;
41
+
3. install trusted request authority in `UserContext`, outside remote input.
42
+
43
+
Change the installed permission set to
44
+
`Set.of(OrderMutationPolicy.HIGH_VALUE_PERMISSION)` to exercise the allowed
45
+
path. Do not place trusted authority in request JSON or generated entities.
22
46
### Materialized-list hard limit
23
47
24
48
`executeForList` protects the service by applying a default hard limit of 10,000 rows. A requested page size above that ceiling fails explicitly. Trusted application code can call `hardLimit(...)` to override the outer-query ceiling. **Caution:** most applications should not override it; do so only for a reviewed, exceptional requirement. This setting does not describe streaming execution.
0 commit comments