@mandateops/cli-linux-x64 0.0.0-stage → 0.7.2

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.
Files changed (68) hide show
  1. package/LICENSE +55 -0
  2. package/README.md +181 -2
  3. package/audit-lab/README.md +194 -0
  4. package/audit-lab/bin/mandateops +0 -0
  5. package/audit-lab/contracts/contact-plain-text.vectors.json +85 -0
  6. package/audit-lab/contracts/history-reading.md +185 -0
  7. package/audit-lab/contracts/history-reading.vectors.json +284 -0
  8. package/audit-lab/contracts/profiles.md +161 -0
  9. package/audit-lab/contracts/properties.md +512 -0
  10. package/audit-lab/contracts/sdk-config.md +155 -0
  11. package/audit-lab/contracts/system-under-test.md +385 -0
  12. package/audit-lab/contracts/test-provider.md +350 -0
  13. package/audit-lab/lab/compose.audit.yml +181 -0
  14. package/audit-lab/lab/config/fault-control.json +14 -0
  15. package/audit-lab/lab/examples/agents/Dockerfile +28 -0
  16. package/audit-lab/lab/examples/agents/codeloc.cjs +199 -0
  17. package/audit-lab/lab/examples/agents/load.cjs +9 -0
  18. package/audit-lab/lab/examples/agents/package-lock.json +2840 -0
  19. package/audit-lab/lab/examples/agents/package.json +9 -0
  20. package/audit-lab/lab/examples/agents/python/mandateops_codeloc.py +271 -0
  21. package/audit-lab/lab/examples/agents/python/sitecustomize.py +51 -0
  22. package/audit-lab/lab/examples/agents/requirements-python.txt +522 -0
  23. package/audit-lab/lab/examples/agents/telemetry-router.cjs +272 -0
  24. package/audit-lab/lab/examples/test-provider/.dockerignore +4 -0
  25. package/audit-lab/lab/examples/test-provider/Dockerfile +28 -0
  26. package/audit-lab/lab/examples/test-provider/bun.lock +405 -0
  27. package/audit-lab/lab/examples/test-provider/package.json +42 -0
  28. package/audit-lab/lab/examples/test-provider/src/amount.ts +32 -0
  29. package/audit-lab/lab/examples/test-provider/src/app.ts +538 -0
  30. package/audit-lab/lab/examples/test-provider/src/auth.ts +30 -0
  31. package/audit-lab/lab/examples/test-provider/src/barrier.ts +262 -0
  32. package/audit-lab/lab/examples/test-provider/src/codeloc.ts +27 -0
  33. package/audit-lab/lab/examples/test-provider/src/config.ts +311 -0
  34. package/audit-lab/lab/examples/test-provider/src/connect.ts +204 -0
  35. package/audit-lab/lab/examples/test-provider/src/declaration.ts +270 -0
  36. package/audit-lab/lab/examples/test-provider/src/declared.ts +198 -0
  37. package/audit-lab/lab/examples/test-provider/src/domain.ts +193 -0
  38. package/audit-lab/lab/examples/test-provider/src/egress.ts +396 -0
  39. package/audit-lab/lab/examples/test-provider/src/flow.ts +263 -0
  40. package/audit-lab/lab/examples/test-provider/src/gate.ts +301 -0
  41. package/audit-lab/lab/examples/test-provider/src/main.ts +31 -0
  42. package/audit-lab/lab/examples/test-provider/src/notify.ts +157 -0
  43. package/audit-lab/lab/examples/test-provider/src/owner.ts +60 -0
  44. package/audit-lab/lab/examples/test-provider/src/payment.ts +103 -0
  45. package/audit-lab/lab/examples/test-provider/src/profile.ts +417 -0
  46. package/audit-lab/lab/examples/test-provider/src/request.ts +201 -0
  47. package/audit-lab/lab/examples/test-provider/src/rows.ts +173 -0
  48. package/audit-lab/lab/examples/test-provider/src/schema.ts +114 -0
  49. package/audit-lab/lab/examples/test-provider/src/signature.ts +86 -0
  50. package/audit-lab/lab/examples/test-provider/src/staged.ts +318 -0
  51. package/audit-lab/lab/examples/test-provider/src/store.ts +432 -0
  52. package/audit-lab/lab/examples/test-provider/src/traffic.ts +50 -0
  53. package/audit-lab/lab/examples/test-provider/src/webauthn.d.ts +11 -0
  54. package/audit-lab/lab/examples/test-provider/src/wire.ts +153 -0
  55. package/audit-lab/lab/examples/test-provider/tsconfig.build.json +9 -0
  56. package/audit-lab/lab/examples/test-provider/tsconfig.json +24 -0
  57. package/audit-lab/lab/images/capture/Dockerfile +15 -0
  58. package/audit-lab/lab/images/capture/LICENSE +201 -0
  59. package/audit-lab/lab/images/fault-control/Dockerfile +13 -0
  60. package/audit-lab/lab/images/fault-control/LICENSE +21 -0
  61. package/audit-lab/lab/images/provider-store/Dockerfile +4 -0
  62. package/audit-lab/lab/images/provider-store/LICENSE +23 -0
  63. package/audit-lab/lab/images/telemetry/Dockerfile +14 -0
  64. package/audit-lab/lab/images/telemetry/LICENSE +201 -0
  65. package/audit-lab/lab/scripts/compose-down.sh +148 -0
  66. package/audit-lab/lab/scripts/compose-lib.sh +663 -0
  67. package/audit-lab/lab/scripts/compose-up.sh +240 -0
  68. package/package.json +16 -4
@@ -0,0 +1,512 @@
1
+ # Financial property contracts
2
+
3
+ These are the normative properties the checker (`crates/audit-core/src/check.rs`) evaluates over
4
+ one payout's trace. Each property has its own identifier and its own result. The global verdict
5
+ and the process exit code are derived from the per-property results (below); they add nothing to
6
+ them. There is one current meaning of each property and no version numbering: every derived file
7
+ records the build that produced it, and `mandateops recheck` reads only records of its own build.
8
+
9
+ Requirements here are normative. Behaviour mined from an implementation (for example "the
10
+ example backend never records a definitive rejection") is never a requirement: it appears only
11
+ under observation coverage.
12
+
13
+ ## Common model
14
+
15
+ - **Scope.** One logical payout, identified by the declared instruction, inside one delegated
16
+ capacity scope of fixed limit `L` (declared by the run input, never by the backend). In a
17
+ declared competition, a further competitor's own provider effects and refusals (those naming its
18
+ payment) are its own: P6 judges them against its approval and P8 against the shared limit, and
19
+ P1 to P5 never count them against the payout judged. The stocks a backend reports with a flow
20
+ then describe the shared balance, so they are not read as this payout's; its own share is read
21
+ from the final capacity reading (see P8).
22
+ - **Instruction binding.** Payment, tenant, agent, delegation, payer account, destination, integer
23
+ amount in minor units, currency, asset and network, plus the declared provider binding:
24
+ provider account, provider operation and idempotency scope. A profile for a backend without an
25
+ agent or delegation concept must declare reviewed fixed values; it never invents them.
26
+ - **Stocks.** `A` available, `C` committed, `S` consumed, in minor units of the declared asset,
27
+ partitioning `L`: `A + C + S = L`. `E` is the independently observed amount of unique external
28
+ debit effects for the payout. `E` is not a term of that partition.
29
+ - **Flows.** Reserve `A -> C`; consume `C -> S`; release `C -> A`. A release is permitted only when
30
+ nothing effect-producing was submitted, or when every submitted attempt is definitively
31
+ established not to have executed under the provider contract. A timeout or a lost response
32
+ changes knowledge, not the external effect.
33
+ - **Model.** A finite state machine per payout (idle, held, held-ambiguous, non-executed,
34
+ released, consumed) over append-only flow records. Results concern the captured histories
35
+ only; no inductive proof over all executions is claimed.
36
+ - **Quiescence.** Under the native-worker profile the runner waits a declared, bounded window
37
+ (`MANDATEOPS_QUIESCENCE_MS`, recorded as a `quiesce` step) after the payout settles, then captures,
38
+ then reads the provider's effects again last. The window has no default: it must be non-zero and
39
+ at least the declared `MANDATEOPS_RETRY_DELAY_MS` plus `MANDATEOPS_WORKER_LEASE_MS` (a late attempt can
40
+ follow a lease expiry and then a retry delay), or the run is refused and a stored run is not
41
+ admitted. A hosted test whose backend timings are `"unknown"` records a scoped window: effects
42
+ after it are not covered, and checks needing a complete observation are refused before
43
+ deployment (see `contracts/sdk-config.md`). Assumption: every effect of the payout commits within that
44
+ window. `observations.json`, `outcome.json`, the trace and the report state it. An effect later
45
+ than the window is outside the run, so `satisfied` is never a claim about all later time.
46
+ - **Provider reads.** Provider evidence is the union of every effects read, so no read erases
47
+ another's witness. Reads that differ record `effects_changed_during_capture`; a record absent from
48
+ a later read also records `provider_records_shrank`; a read that cannot be interpreted records
49
+ `provider_records_unavailable` and leaves the other reads standing.
50
+ - **Payout scope.** Every provider record of a run is judged. The fixture holds only that run: it
51
+ is reset, or the deployment is single-use, so no other payout can share it, and a record the
52
+ backend neither keyed nor reported is still this run's. No backend report can take a record out
53
+ of judgement. A shared provider account is not a supported fixture.
54
+ - **Sources.** Backend history (backend-reported, append-only, commit order), backend payout row
55
+ and capacity reading (backend-reported), provider effect and notification records
56
+ (independent of the backend), runner step log (runner-recorded).
57
+
58
+ ## Ordering and admissibility
59
+
60
+ Backend records and provider records have no shared clock. The conversion places each provider
61
+ effect directly after the first backend submission of its key: the backend records a submission
62
+ durably before it sends it, so that is the earliest causally possible point, and the checker treats
63
+ it as that lower bound only. An effect whose key was never submitted has no causal anchor; it is
64
+ appended at the end. A rule that needs an effect to follow a backend record is judged at the end of
65
+ the stream, and only when every admissible order breaks it; when the records admit both a compliant
66
+ and a violating order the property is inconclusive (`ordering_ambiguous`).
67
+
68
+ Each witness has a basis:
69
+
70
+ | Basis | Meaning | Not admissible when |
71
+ |---|---|---|
72
+ | `record` | Lies within one source: a prefix of the backend's append-only lifecycle, or the provider's records alone. | Never withdrawn by a capture gap. |
73
+ | `complete_history` | Compares a backend payout row or inspection with the lifecycle; needs the history to be complete. | `truncated_history`. |
74
+ | `cross_source` | Compares backend history with provider records. | `truncated_history`, `history_changed_during_capture`. |
75
+ | `capacity` | Compares a capacity reading with the lifecycle. | `truncated_history`, `history_changed_during_capture`. |
76
+
77
+ A witness whose basis is not admissible is not reported; the property is inconclusive with the
78
+ gap that withdrew it. Order-dependent claims are only made from positions the causal placement
79
+ supports; a position chosen for convenience never yields a violation. Positive results state the
80
+ same handling: "satisfied" means satisfied for the captured records under this placement.
81
+
82
+ ## Results
83
+
84
+ Every property yields exactly one of:
85
+
86
+ - `violated` with a witness `{property, index, rule, establishing}`, for P8 also
87
+ `obligations`, the declared payments whose obligations together break it, and for P9 also
88
+ `effects`, each duplicated backend effect with the notification delivery it cites: the observation index where an
89
+ admissible rule broke, the rule name, and every observation index the rule rests on, ascending.
90
+ For an excess effect that includes each counted effect, the submissions of their keys and the
91
+ payout rows; for a contradiction, the submissions, non-execution records and the effect. The
92
+ lowest-index admissible witness is reported.
93
+ - `satisfied` within the observed scope, under the stated assumptions.
94
+ - `inconclusive` with named missing evidence (`missing`: capture gaps or reasons).
95
+ - `not_applicable`: the reviewed run input deliberately excludes the property
96
+ (`excluded_properties`). Missing evidence is never "not applicable".
97
+
98
+ An operational failure (no interpretable evidence from any source) is a separate outcome and yields
99
+ no property results. Global verdict: `violation` if any property is violated (findings are the
100
+ witnesses); otherwise `unknown` if any property is inconclusive (reasons are the union of their
101
+ missing evidence) or every property is excluded (`no_property_evaluated`); otherwise
102
+ `conformant_observed_trace`. Exit codes: 0 conformant, 1 violation,
103
+ 2 unknown, 3 operational failure.
104
+
105
+ ## Fault lifecycle
106
+
107
+ Every fault the runner arms is listed in `faults` of `observations.json` and `outcome.json`, and in
108
+ `run.json` and `trace.txt`, derived from the raw record's steps alone. Supported faults are
109
+ `provider_hold` (the test provider's barrier commits the next effect and holds its response),
110
+ `proxy_cut` (MandateOps fault control disables the provider proxy) and `process_crash` (the declared process service
111
+ is killed). Each lists the phases it reached: `armed` when its step was attempted, whatever the
112
+ reply; `established` only on the tool's confirming reply (a committed barrier, a proxy read back
113
+ disabled, a reported kill); `released` when an established fault was undone; `cancelled` when one
114
+ never established was withdrawn. `proxy_cut` and `process_crash` state `after_commit`: whether the
115
+ provider's commit was established before them. A fault never established records
116
+ `fault_not_established`; a response-losing fault established without a prior commit records
117
+ `fault_ordering_unestablished`. Either leaves the run unknown, never a pass.
118
+
119
+ ## Capture gaps and the properties they affect
120
+
121
+ | Gap | Affects |
122
+ |---|---|
123
+ | `observation_deadline`, `inspection_missing`, `loss_cause_unproven`, `unexpected_submission_count`, `scenario_incomplete`, `stimulus_not_exercised`, `defect_path_not_reached`, `provider_traffic_absent`, `provider_traffic_bypassed`, `provider_requests_unrecorded`, `rejection_unproven`, `fault_not_established`, `fault_ordering_unestablished` | Every property: the scenario's stimulus was not demonstrated, so nothing is "satisfied". |
124
+ | `truncated_history`, `history_changed_during_capture`, `effects_changed_during_capture`, `provider_records_shrank` | Every property; also withdraw witnesses by basis (below). |
125
+ | `backend_history_unavailable`, `backend_records_uninterpretable`, `backend_terms_unbound`, `history_not_append_only` | Every property, and withdraw every basis except `record`. A witness in the provider's records alone stands; a provider-only result that is not violated stays inconclusive, because attribution to a submission is part of `effect_within_authorisation`. |
126
+ | `provider_records_unavailable` | Every property; withdraws `cross_source`. |
127
+ | `provider_operation_unsupported`, `provider_request_unplaced` | Every property, including a result resting on the provider's records alone; no witness basis is withdrawn. `provider_operation_unsupported`: the backend made a money-moving call that the declared provider format does not imitate, so the run did not exercise the flow the backend uses. `provider_request_unplaced`: the provider received a request that the declared flow cannot place. Neither gap claims that the declared flow covers every route the backend could call. |
128
+ | `provider_identity_unlinked` | `instruction_binding`. Provider terms were read as this run's single payout. |
129
+ | `capacity_scope_not_single_payout`, `capacity_limit_mismatch`, `capacity_not_atomic`, `inspection_changed_during_capture`, `capacity_capture_failed`, `capacity_not_read` | `commitment_retention` and `reconciliation_consistency`. The capacity reading was not used. |
130
+ | `backend_status_unavailable` | `reported_outcome` only: the status reading failed, was not of the contract's shape, or named another payout. |
131
+
132
+ Basis withdrawal: `truncated_history` and the backend-loss gaps withdraw all but `record`;
133
+ `history_changed_during_capture` withdraws `cross_source` and `capacity`;
134
+ `provider_records_unavailable`, `effects_changed_during_capture` and `provider_records_shrank`
135
+ withdraw `cross_source`.
136
+
137
+ A missing capacity reading therefore never erases an independently established duplicate effect:
138
+ `effect_within_authorisation` does not depend on capacity at all.
139
+
140
+ ## P1 `instruction_binding`
141
+
142
+ - **Assertion.** Every backend submission's request terms, every backend payout row, every provider
143
+ effect of the payout and every request the provider refused carry exactly the authorised
144
+ instruction; every provider effect and refused request was made on the declared provider account
145
+ and operation, and every effect under the declared idempotency scope. A term the declared
146
+ provider format fixes is a constant of the declaration: it was not observed, the report names it,
147
+ and this property says nothing about it.
148
+ - **Financial scope.** The single declared instruction and provider binding.
149
+ - **Input evidence.** Per-attempt request terms on each `submitted` observation (as the backend
150
+ recorded them for that attempt), payout rows, provider effect records with their provider
151
+ account, operation and idempotency scope, and refused requests with the terms received. The
152
+ payment identifier is waived only where the provider record says the request named none and it
153
+ was taken from the key (`payment_from_key`); a stated payment is compared. Refused
154
+ requests are the independent check on a backend that records terms it did not send.
155
+ - **Assumptions.** The backend records the terms it actually sent; the provider records the
156
+ terms it actually executed.
157
+ - **Coverage.** Attempts the backend recorded; effects the provider recorded.
158
+ - **Method.** Exact equality of every bound field; amounts compared as integers.
159
+ - **Rules.** `instruction_changed` (record), `provider_binding_changed` (record).
160
+ - **Bounds.** At most 10,000 observations per trace.
161
+ - **Inconclusive.** `no_submission_observed`; `lifecycle_unmodelled`; `attempt_terms_unrecorded` when
162
+ any submission lacks per-attempt terms. The final payout row never stands in for historical
163
+ request terms. Comparisons run on single records, so changed terms after an `invalid_lifecycle`
164
+ record are still reported.
165
+
166
+ ## P2 `commitment_retention`
167
+
168
+ - **Assertion.** While a submitted attempt's outcome is unresolved, its amount stays in `C`: no
169
+ release, no inspection or independently reported row showing it uncommitted, a reservation of the
170
+ authorised amount on the authorised account, and, from a single-payout capacity reading taken
171
+ during the ambiguous period, `C` equal to the authorised amount. A release needs every submitted
172
+ attempt established non-executed. No effect contradicts a declared definitive non-execution.
173
+ - **Financial scope.** The payout's own commitment.
174
+ - **Input evidence.** Backend lifecycle with flow amounts where reported, runner commitment
175
+ inspection and row flag when the backend reports that flag independently of the lifecycle,
176
+ capacity readings, provider effects. A flag replayed from the lifecycle is not evidence and is
177
+ not reported.
178
+ - **Assumptions.** Lifecycle records are append-only and in commit order; `rejected` outcomes
179
+ mean definitive non-execution under the declared provider contract.
180
+ - **Coverage.** Captured lifecycle; inspection only in scenarios that perform it. A reservation
181
+ that reports no amount or account narrows that clause to the reservation's presence, and the
182
+ coverage notes state it.
183
+ - **Method.** State machine; an unsafe release is reported even if a later reservation restores
184
+ `C`. A rejection answers only the attempt it ended. A broken partition does not hide this
185
+ clause: both are judged. A non-execution claim is contradicted only when every submission of the
186
+ effect's key was answered with non-execution.
187
+ - **Rules.** `unresolved_commitment_released` (record from a release record; complete_history
188
+ from a row or inspection), `commitment_not_retained` (capacity from a reading; record from a
189
+ reservation's own terms or stocks), `contradictory_non_execution` (cross_source).
190
+ - **Inconclusive.** `unresolved_outcome`, `lifecycle_incomplete`, `lifecycle_unmodelled` (the
191
+ lifecycle left the model at an `invalid_lifecycle` record, which is a
192
+ `reconciliation_consistency` witness), `capacity_unobserved` (an ambiguous period with no usable
193
+ reading: the capacity clause fails closed), `ordering_ambiguous`.
194
+
195
+ ## P3 `retry_identity`
196
+
197
+ - **Assertion.** Every submission of the payout uses the same provider idempotency key, except that
198
+ a fresh commitment cycle after a permitted release may use a new one, and every key the provider
199
+ received for the payout is one the backend reported submitting, so that under the declared provider contract (`idempotency_scope`, and the key retention the provider
200
+ documents) a retry cannot create a second effect.
201
+ - **Financial scope.** The payout's submissions within the declared provider account and
202
+ idempotency scope. This is not an exactly-once theorem: the guarantee holds only within the
203
+ provider's declared retention and scope.
204
+ - **Input evidence.** `submitted` observations; provider effect records and refused requests
205
+ (independent of the backend).
206
+ - **Method.** Key equality across all submissions, reset only by a permitted release. An unsafe
207
+ release does not reset it, and the comparison runs on single records, so it stays reported after
208
+ an `invalid_lifecycle` record. Then, over the whole stream, each key on a provider record must be
209
+ a submitted key. A key no submission carries has no commitment cycle, so no release excuses it.
210
+ With no submission at all, one provider key has nothing to differ from; two provider keys differ
211
+ from each other.
212
+ - **Rules.** `retry_identity_changed` (record between submissions, cross_source against the
213
+ provider's keys).
214
+ - **Inconclusive.** `no_submission_observed`, `lifecycle_unmodelled`, and every gap that withdraws
215
+ `cross_source`, as a key the provider never recorded cannot be compared.
216
+ - **Limit.** The provider's keys are those on its effect and refusal records. A request that never
217
+ reached the provider's store leaves no key, so a changed key on such an attempt is not seen.
218
+ - **Coverage note.** A run with one submission satisfies the property only for that run;
219
+ the lost-response scenario is what exercises a retry.
220
+
221
+ ## P4 `effect_within_authorisation`
222
+
223
+ - **Assertion.** The sum `E` of the amounts of unique provider effects for the payout does not
224
+ exceed the authorised amount, every effect is attributable to a recorded submission, and one
225
+ effect identifier names one effect. Effects in an asset other than the authorised one are
226
+ never summed with it: the authorised amount in any other asset is zero. A payout drawn on a
227
+ balance that effects funded (a connected account's, under Stripe Connect) is never an effect,
228
+ and it may not draw more on its account, in its currency, than the effects to that account put
229
+ there.
230
+ - **Financial scope.** Provider effects for this payout, in the authorised asset identity, and the
231
+ payouts drawn on their destinations.
232
+ - **Input evidence.** Provider effect records (independent of the backend), backend submissions
233
+ for attribution, provider notifications, provider payout records (`payout_drawn`).
234
+ - **Method.** Checked `u128` addition over unique effect identifiers; repeated identical records
235
+ count once; notifications are never effects. Payouts are summed per account and currency
236
+ (compared case-insensitively) over unique payout identifiers, so a replayed payout counts once,
237
+ and held against the effects to that account: a repeated payout within what was transferred is
238
+ the same money, while one beyond it, or a payout in a currency nothing funded, is
239
+ `excess_economic_effect`, as is a second effect. A sum that overflows counts as beyond.
240
+ - **Rules.** `excess_economic_effect` (record), `arithmetic_overflow` (record),
241
+ `conflicting_effect_record` (record: a repeated identifier with another key, instruction, provider
242
+ account, operation or scope), `unattributed_effect` (cross_source).
243
+ - **Inconclusive.** `notification_without_effect`.
244
+
245
+ ## P5 `reconciliation_consistency`
246
+
247
+ - **Assertion.** The backend's own records agree with each other and with the provider: lifecycle
248
+ records follow the model; consumption names a provider effect of the key last submitted, and a
249
+ late outcome names an effect the provider holds; flow amounts and accounts equal the authorised
250
+ ones; each payout row matches the lifecycle; each single-payout capacity reading, and the stocks
251
+ a flow records with itself, satisfy `A + C + S = L` and hold exactly what the lifecycle moved;
252
+ and no provider effect of a submitted key stands against a lifecycle that ended concluding no
253
+ money moved.
254
+ - **Financial scope.** One payout. The capacity checks assume the reading's scope contains
255
+ exactly this payout and the declared `L`; readings of any other scope are not used (gap) and
256
+ aggregate concurrent budgets need their own property.
257
+ - **Input evidence.** Lifecycle, payout rows, capacity readings, provider effects.
258
+ - **Method.** How the lifecycle ended is judged against every effect of a submitted key at the end
259
+ of the stream. Ending released, or ending non-executed with every submission of the key answered
260
+ with non-execution, contradicts the effect in every order. Any other unsettled end (reserved,
261
+ executing, unknown, needs review, or non-executed with a submission unanswered) may precede the
262
+ effect, because a row and a provider record share no clock: the property is inconclusive with
263
+ `ordering_ambiguous`. This rule stands alone when `commitment_retention` is not applicable. A
264
+ release with no effect is not a reconciliation failure; only P2 judges it, so under
265
+ `payout-effects` such a run can pass, which that profile's limitation states.
266
+ - **Rules.** `invalid_lifecycle` (record), `consumed_without_effect` (cross_source),
267
+ `effect_not_reconciled` (cross_source),
268
+ `flow_terms_changed` (record), `state_inconsistent_with_history` (complete_history),
269
+ `capacity_partition_broken`, `capacity_flow_mismatch` (capacity; record for a flow's own stocks). An overflowing `A + C + S` is reported as
270
+ `capacity_partition_broken`.
271
+ - **Inconclusive.** `unresolved_outcome`, `lifecycle_incomplete`, `capacity_unobserved`,
272
+ `ordering_ambiguous`, capacity gaps.
273
+
274
+ ## P6 `external_outcome`
275
+
276
+ A declined key counts against a `final` format only where a readable effect
277
+ provably precedes or ties with its refusal. Any unknown order claims no breach: the
278
+ `provider_records_unavailable` gap leaves the property inconclusive. Traces state
279
+ both instants, and null needs that gap.
280
+
281
+ - **Assertion.** The provider's records alone show the outcome the test declared: `exactly_one_effect`
282
+ means one unique effect, `no_effect` means no effect and at least one refused request; every effect
283
+ and refused request carries the authorised terms (all but the payment identifier, which a backend
284
+ may assign) on the declared provider binding, under one idempotency key. A payout drawn on a
285
+ balance effects funded is never an effect; one that draws more than the effects to its account
286
+ put there is `excess_external_effect` (`unexpected_external_effect` under `no_effect`), judged as P4
287
+ judges it. Within a competition each accepted competitor is its own approval: each effect belongs
288
+ to the competitor whose bound payment it names, and is judged against that competitor's terms
289
+ alone. Competitors each paid once are the outcome declared, each under its own key; a competitor
290
+ paid more than once, or beyond its own approved amount (summed with checked arithmetic), or an
291
+ effect naming no bound payment, is `excess_external_effect`, and an accepted competitor with no
292
+ effect is `expected_effect_missing`. Totals across competitors are the sum of their approvals. The
293
+ record's `comparison` states the approved total across every competitor (`authorised_minor`, with
294
+ `approvals` naming how many), and lists in `unmatched` each effect whose recorded payment reference
295
+ names no bound payment, or whose destination is no competitor's, as recorded and with which of the
296
+ two the approvals lack. Such an effect is worded as matching no declared payment, never as money
297
+ beyond approval. A competitor's bound payment is the reference the provider's records carry: the
298
+ declared format's payment field, or the idempotency key the backend sent when the format maps none.
299
+ It is a correlation identifier only; the idempotency key is judged on its own, and nothing else,
300
+ such as a transfer grouping field, is read as either. A test must bind that reference, and declare
301
+ the destination the backend pays; the backend's internal payout identifier matches only when the
302
+ backend sends it to the provider.
303
+ - **Financial scope.** Every record in the session's isolated test provider, whatever payment identifier
304
+ it carries. Nothing about the backend: its commitments, holds, capacity and records are not
305
+ observed, so a pass is labelled `money_out_only_commitments_not_checked` and "Money out only".
306
+ - **Input evidence.** Effect, refused-request and payout records of the test provider, and the declared outcome
307
+ (`expected_outcome` in the raw record and trace). An identical replay of a key adds no record because
308
+ it is the same request, unless a refusal is armed, which a `final` format's repeat spends and records, and any other reuse of a key is refused and recorded. A request refused
309
+ before the store (bad credentials, the rate limit, a malformed body) leaves no record; the test provider's
310
+ traffic counters count it, and a run with any such request cannot pass.
311
+ - **Assumptions.** The test provider records what it executed. The declared outcome is test-declared: an
312
+ expectation, not evidence of any approval. Test environment: no real money moves; real provider
313
+ settlement is not covered, and nothing here establishes that a real provider would behave the same.
314
+ - **Method.** Provider records only. Records present are judged first and stand whatever is missing;
315
+ an absence or a pass needs a complete read, so any gap below, or a trace with no
316
+ `provider_records_read` marker, makes the property inconclusive first.
317
+ - **Rules.** All `record`: `excess_external_effect`, `unexpected_external_effect`,
318
+ `expected_effect_missing`, `expected_refusal_missing`, `external_terms_changed`,
319
+ `external_binding_changed`, `external_key_changed`. One witness is reported, money first. Only where
320
+ the declared format's `refusals` is `final` does a key the provider `declined` while no effect
321
+ existed not count towards `external_key_changed`: moving on is then the only way to pay. Provider
322
+ order cannot show the client saw the refusal: two keys sent at once can record a decline first, and
323
+ a run judged on provider records alone cannot tell that from moving on. A refusal
324
+ at or after the first effect, or a key conflict, excuses nothing, since that client changed key
325
+ once it had paid. Elsewhere an effect and a refusal under another key breach it. The report states
326
+ which refusal rule the format declared.
327
+ - **Inconclusive.** `provider_records_unavailable` (also reported when the read marker is absent), `effects_changed_during_capture`,
328
+ `provider_records_shrank`, `observation_deadline`, `scenario_incomplete`, `stimulus_not_exercised`,
329
+ `fault_not_established`, `fault_ordering_unestablished`.
330
+ Backend gaps do not affect it. `defect_path_not_reached` stays reported but does not either: it is a
331
+ claim about backend records, which this property cannot see.
332
+ - **Stimulus proof.** With no backend records, a fault is exercised when the test provider's barrier
333
+ committed an effect it still holds and the host then applied the control (cut, release, crash).
334
+ This shows the response was lost; it says nothing about what the backend concluded.
335
+ An accepted `refuse_next` must show a `declined` record, or the run has `stimulus_not_exercised`.
336
+ - **Applicability.** Evaluated only for a trace declaring an expected outcome, under the reviewed
337
+ `payout-effects-only` profile, which marks P1 to P5 not applicable. A test cannot select that by
338
+ itself: the profile is chosen at setup, it requires the declared outcome, the host refuses adapter
339
+ readings under it, and admission refuses a record where any of these disagree. Not in `Property::ALL`.
340
+
341
+ ## P7 `reported_outcome`
342
+
343
+ - **Assertion.** The outcome the backend itself reports for the payout, read once after the
344
+ provider's records, agrees with them: it is not `failed` while the provider holds an effect, and
345
+ not `confirmed` while the provider holds none. Reporting that it does not yet know (`unknown`,
346
+ `needs_review`, or a state still in progress) is honest and does not break it.
347
+ - **Financial scope.** One payout's reported outcome against every record in the session's
348
+ isolated test provider, as P6 reads them.
349
+ - **Input evidence.** The status reading (`contracts/history-reading.md`), as a payout row, and
350
+ the test provider's effect records with their read marker.
351
+ - **Assumptions.** The status is the backend's own record of the payout at the time it was read,
352
+ taken after the provider's records, so an effect it disagrees with was already committed. The
353
+ reading names the payout by the reference given to `expectPayment`.
354
+ - **Method.** The status is read between the provider's first read and its re-read. An effect
355
+ present in both stands whatever else is missing: a `failed` status beside one is a witness. When
356
+ the reads differ (`effects_changed_during_capture`) an effect may have committed after the backend
357
+ spoke, so it is not held against the status, and the property is inconclusive. An absence needs
358
+ the whole of the provider's records, so a `confirmed` status with no effect is judged only once
359
+ they were read to the end.
360
+ - **Rules.** `failure_reported_with_effect` (cross_source), `success_reported_without_effect`
361
+ (cross_source).
362
+ - **Inconclusive.** `backend_status_unavailable` and the gaps that affect P6.
363
+ - **Applicability.** Judged only for a trace declaring an expected outcome, under
364
+ `payout-effects-only`, and only where its test read the status; otherwise absent from the
365
+ outcome. Where present it is required: a run whose test asked for the status passes only when
366
+ P7 is satisfied, so an unusable reading fails it. A profile that reads the backend's lifecycle judges its rows under
367
+ `reconciliation_consistency` instead. Not in `Property::ALL`.
368
+
369
+ ## P8 `shared_capacity`
370
+
371
+ - **Assertion.** Across one declared shared capacity scope, the obligations of the payments the
372
+ backend accepted, effected or still outstanding, never exceed the limit they share. An outcome
373
+ nobody resolved keeps its obligation; only a provider refusal that the declared format makes
374
+ final, with no effect, releases one.
375
+ - **Distinct failure.** P6 judges each competitor against its own approval, so two competitors each
376
+ paid once under their own key satisfy it. Two $80 payments accepted against a $100 shared limit
377
+ break no per-payment rule; this property is the one that sees the aggregate. It is a new property
378
+ rather than part of P6: its scope is the shared limit, not one approval, its evidence includes
379
+ each competitor's admission, and a P6 result keeps its meaning unchanged. Each admission is read
380
+ from the backend's and the provider's records, never the test's record alone, and the competitors
381
+ must be shown in flight together. The scope is the declared funding balance, so competitors under
382
+ different approvals or delegations that draw on one balance are judged together, and each
383
+ currency and asset is held against its own declared limit. Instruction binding is unchanged: each competitor is still bound to
384
+ its own approval.
385
+ - **Financial scope.** Every competitor of one `declare_competition` step drawing on its declared
386
+ funding balance, of one tenant and network, in integer minor units of each currency and asset
387
+ separately.
388
+ - **Input evidence.** The declared funding balance (`funding_balance`) with one limit per currency
389
+ and asset (`capacity_limits`), or the declared absence of a cap (`capacity_cap: "none"`). A
390
+ declaration in the earlier shape, one `capacity_limit` with no funding balance, is refused; each competitor's admission as the backend's own records show it; the
391
+ `concurrency_gate` steps of the race; and the provider's effect and refusal records with their
392
+ read marker. The trace carries the admissions as `shared_capacity`. An admission is decided by,
393
+ in order: the backend's history of that competitor (the run's `capture_history` for the judged
394
+ payout, a `capture_competitor_history` step for each other one: the lab reads it, and a hosted
395
+ test's SDK reads its adapter's history for every bound competitor by that competitor's own
396
+ provider reference after the drain), where a payout record admits it,
397
+ and a 404 refuses it only from an adapter whose contract declares that answer definite (it looks
398
+ payouts up by the run's own unique reference in the backend's store); any other 404 or failed read
399
+ decides nothing. Next, a provider effect or refusal of it shows the backend sent it on. For a
400
+ competitor neither decides, a test's refusal record (`submit_competitor` refused, `bind_competitor`
401
+ with `admission: "refused"`) stands only where every undecided competitor is recorded refused and
402
+ a payout count the adapter declares complete and atomic for the run's isolated scope equals the
403
+ competitors already shown admitted; a count never names which payout it counts, so a recorded
404
+ admission is never taken from it. The test's record is never the basis alone. Sources that disagree, including a test's record the backend's
405
+ history contradicts or a payout count that differs from the decided admissions, leave the
406
+ admission `contradicted`; a competitor nothing decides is `unevidenced`.
407
+ - **Assumptions.** The limit is the test's declaration, never the backend's. The backend's history
408
+ and payout count are its own records: they show what it admitted, not that its capacity
409
+ accounting is right, which is what this property judges. A competitor the provider holds an
410
+ effect for is an obligation whatever its admission.
411
+ - **Method.** Checked `u128` addition of declared amounts within each currency and asset, never
412
+ across them. Effected competitors alone past their unit's limit are a witness on the provider's records (`record`).
413
+ Effected and outstanding competitors past the limit are a witness once the provider's records were
414
+ read (`cross_source`): it rests on the backend's records of admission agreeing with each other and
415
+ with the provider's, and on the provider's records holding every refusal, so the gaps that
416
+ withdraw `cross_source`, backend history gaps among them, withdraw it. A sum that overflows
417
+ exceeds any limit.
418
+ - **Rules.** `shared_capacity_exceeded`; the witness names every counted obligation and cites each
419
+ counted effect, and the records read marker when outstanding obligations are counted.
420
+ - **Inconclusive.** `shared_limit_undeclared` (neither a limit nor its absence declared, or a
421
+ competitor's currency and asset has no declared limit); `capacity_scope_mixed` (competitors differ
422
+ in tenant or network, so nothing is summed); `admission_unevidenced` (no backend evidence decides a
423
+ competitor's admission, with no effect of it); `admission_contradicted` (the backend's records
424
+ disagree about it, with no effect of it); `ordering_ambiguous` (only a released obligation takes
425
+ the sum past the limit, and nothing captured orders its release before the other admissions);
426
+ `race_not_established` (no `concurrency_gate` step, or one that did not establish overlap, so a
427
+ refusal may only show requests that arrived one after another; an over-admission still stands);
428
+ and the gaps that affect P6. `scope_membership_incomplete` names a competition whose
429
+ competitors are not all known.
430
+ - **Applicability.** Judged only for a trace declaring a competition; otherwise absent from the
431
+ outcome. `not_applicable` when the test declared that the backend holds no shared cap. Not in
432
+ `Property::ALL`; wherever a competition is declared, CI's competition check is this result, so a
433
+ run passes only where it is satisfied or not applicable (see Concurrent submissions).
434
+
435
+ ## P9 `event_effect_idempotency`
436
+
437
+ Proposed as P10 in the epic; the catalogue numbers properties in the order they ship.
438
+
439
+ - **Assertion.** Within the judged payout, the notifications of one provider effect, however many
440
+ times, however late and in whatever order or overlap they reach the backend, cause at most one
441
+ backend economic effect of each kind: a wallet or ledger `credit`, a `fulfilment`, or a further
442
+ `payout`. Receiving a notification twice is not a breach; acting on it twice is.
443
+ - **Distinct failure.** P4 and P6 count the provider's effects, so a backend that credits a wallet
444
+ on every delivery of one paid notification breaks neither: the provider moved money once. This
445
+ property is the one that sees the backend's own repeated action. It is a new property: its
446
+ evidence is the backend's effects and the provider's deliveries, not the provider's debits.
447
+ - **Financial scope.** The judged payout's provider effects and the backend effects its history
448
+ reading reports, each in integer minor units of its asset.
449
+ - **Input evidence.** The provider's delivery records: each delivery's identifier, the effect it is
450
+ about, the order it was issued in, when it was sent and answered, and the backend's HTTP status.
451
+ A delivery counts when the backend answered it. The backend's `effects` in its history reading
452
+ (`contracts/history-reading.md`): each effect's identifier, kind, amount, asset, the delivery it
453
+ cites and that delivery's provider effect. The trace carries them as `event_effects`, each
454
+ delivery citing its `effect_notified` observation.
455
+ - **Assumptions.** The effects are the backend's word, read through the same reading as its
456
+ lifecycle; a delivery is the provider's independent record. A backend that reports no effects
457
+ for a delivered notification has made no economic action as far as its reading shows; one that
458
+ reports nothing about effects leaves them unknown.
459
+ - **Method.** Backend effects are grouped by kind and the provider effect they name, and again by
460
+ kind and the provider effect the provider's own record of the cited delivery is about, one effect
461
+ identifier counting once however often it is listed. A group with two or more effects is a
462
+ witness on the backend's reading (`record`): a backend naming a fresh provider effect for each
463
+ delivery of one event is still seen acting twice.
464
+ - **Rules.** `duplicate_event_effect`; the witness names every effect of the group with its cited
465
+ delivery, and cites the `effect_notified` observations of those deliveries (or of every delivery of
466
+ that provider effect when they cite none the provider recorded).
467
+ - **Inconclusive.** `event_effects_unobserved` (the reading did not report effects at all), and the
468
+ gaps that affect P6 plus `truncated_history`, `history_changed_during_capture`,
469
+ `backend_history_unavailable`, `backend_records_uninterpretable` and `history_not_append_only`.
470
+ The absence of a second provider debit never satisfies it.
471
+ - **Applicability.** Judged only when at least one notification reached the backend; otherwise
472
+ absent from the outcome. Not in `Property::ALL`, and not a required property of any profile, so
473
+ a backend that takes no notifications runs as before.
474
+ - **Scenarios.** `duplicate-notification` delivers one notification twice in turn;
475
+ `delayed-notification` holds one back, delivers a second, then releases the first, so it arrives
476
+ late and out of order (`delayed_notification` stimulus: an earlier-issued delivery answered after a
477
+ later-issued one); `concurrent-notification` sends two deliveries at once
478
+ (`concurrent_notification` stimulus: each sent before the other was answered, on the provider's
479
+ clock). Each also needs `duplicate_notification`. A hosted test sends them with
480
+ `faults.notify({ copies, hold })` and `faults.releaseNotifications()` to the system's declared
481
+ `notifyPath`, and arms the same stimuli.
482
+
483
+ ## Concurrent submissions
484
+
485
+ A hosted test, or a lab competition, races requests to the backend through a concurrency gate (2 to 8 parties). The gate's report is a `concurrency_gate` step: overlap is established only when every party's first request arrived within the deadline and the last was written to the backend before the backend answered any of them. A race with no competition and a gate that did not establish overlap cannot pass (`overlap_not_established`). Competing payments are declared together in a `declare_competition` step with one shared limit; the first competitor the test binds is the payout the backend-record properties judge, and further accepted ones are `bind_competitor` steps. The trace carries each further accepted competitor's approved instruction as `entrants`, so `external_outcome` judges every competitor against its own approval. A test may declare that the backend holds no cap the competitors share (`no_shared_cap`, recorded as `"capacity_cap": "none"` on the `declare_competition` step); the host never infers that a backend has no cap. A competitor the backend refused, or queued without consuming capacity, may be recorded by the test as a `bind_competitor` step with `admission: "refused"`: like every test record of an admission, it is a hint P8 checks against the backend's records, never the basis.
486
+
487
+ For a declared competition, CI's capped-concurrency check is P8's result and nothing else: `ci-result.json` records it as `competition: { result, reason }` with P8's result and a plain-language reason naming what P8 found. A run passes only where P8 is `satisfied` or `not_applicable`. Its refusal reason follows P8: `capacity_exceeded` when violated; `concurrency_cap_undeclared` when the competition declares neither a limit nor its absence (any other `capacity_cap` value counts as undeclared); `overlap_not_established` when the race was not established; and `shared_capacity_inconclusive` for any other reason P8 names. Under `payout-effects-only` a competition must declare a limit or `no_shared_cap` and is otherwise refused when declared (`competition_cap_undeclared`); with no backend readings there, an admission is decided only by the provider's records. Everything is derived from the verdict and the raw record, so `mandateops recheck` reproduces it.
488
+
489
+ The lab's `shared-capacity` scenario declares the run's payout and two competitors against the
490
+ run's capacity limit, each for one minor unit more than half of what the limit leaves beside the
491
+ payout, so either competitor fits beside the payout and both do not. It submits the payout, then
492
+ races both competitors through a concurrency gate, recorded as `submit_competitor` steps and one
493
+ `concurrency_gate` step, and attempts only the payout. `shared-capacity-crowd` does the same with
494
+ three competitors, each one minor unit more than a third of what is left, so any two fit and all
495
+ three do not. An answer to a competitor is a hint; a refusal is the backend's answer, not an
496
+ interrupted run. After the run settles it reads each competitor's history as a
497
+ `capture_competitor_history` step. Every example adapter routes its submissions through the gate and
498
+ addresses each competitor by its own backend identifier. The judged payout's balance checks (P2,
499
+ P5) read its own share of the shared reading: what the other competitors' backend records hold,
500
+ committed or consumed, is moved back to available, so A + C + S = L still holds. A reported payout
501
+ count that the records do not explain, a competitor whose admission is not settled, a record that
502
+ does not say what it holds, or records claiming more than the balance holds leave
503
+ `capacity_scope_not_single_payout`. Every example backend can be asked for a payout by the run's
504
+ unique reference, so a refused competitor's 404 is definite there.
505
+
506
+ ## Records and builds
507
+
508
+ `raw-run.json`, `observations.json` and `outcome.json` each name the build that produced them. A
509
+ build reads only its own records: a record from another build is refused by name, never
510
+ reinterpreted with this build's meanings; recheck it with the CLI that sealed it, or run it again.
511
+ `sources` in `observations.json` is an array aligned with `observations` by index, each entry a list
512
+ of `{file, pointer, cursor?}`.