@openlup/platform 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/CHANGELOG.md +440 -158
  2. package/README.md +141 -589
  3. package/dist/fulfillment/adapterConformance.js +1 -1
  4. package/dist/fulfillment/bindings.js +1 -1
  5. package/dist/fulfillment/contracts/conformance.d.ts +3 -1
  6. package/dist/fulfillment/contracts/dispatch.d.ts +45 -3
  7. package/dist/fulfillment/contracts/index.d.ts +3 -3
  8. package/dist/fulfillment/contracts/observation.d.ts +21 -1
  9. package/dist/fulfillment/contracts/readback.d.ts +21 -0
  10. package/dist/fulfillment/contracts/store.d.ts +3 -0
  11. package/dist/fulfillment/contracts/sync.d.ts +58 -2
  12. package/dist/fulfillment/dispatchProjection.d.ts +20 -1
  13. package/dist/fulfillment/dispatchProjection.js +97 -6
  14. package/dist/fulfillment/index.d.ts +3 -2
  15. package/dist/fulfillment/index.js +2 -2
  16. package/dist/fulfillment/migrations.d.ts +5 -0
  17. package/dist/fulfillment/migrations.js +1 -0
  18. package/dist/fulfillment/observationProjection.d.ts +24 -3
  19. package/dist/fulfillment/observationProjection.js +65 -12
  20. package/dist/fulfillment/omnipack/client.d.ts +3 -1
  21. package/dist/fulfillment/omnipack/client.js +31 -13
  22. package/dist/fulfillment/omnipack/index.d.ts +4 -1
  23. package/dist/fulfillment/omnipack/index.js +107 -45
  24. package/dist/fulfillment/omnipack/mappers.d.ts +7 -1
  25. package/dist/fulfillment/omnipack/mappers.js +24 -2
  26. package/dist/fulfillment/omnipack/observation.d.ts +11 -4
  27. package/dist/fulfillment/omnipack/observation.js +44 -29
  28. package/dist/fulfillment/omnipack/reconciliation.d.ts +15 -0
  29. package/dist/fulfillment/omnipack/reconciliation.js +55 -0
  30. package/dist/fulfillment/postgresDispatchStore.js +1 -1
  31. package/dist/fulfillment/postgresShipmentSpine.d.ts +8 -1
  32. package/dist/fulfillment/postgresShipmentSpine.js +17 -3
  33. package/dist/fulfillment/postgresStockSyncPort.js +6 -3
  34. package/dist/fulfillment/providerDispatchAcceptance.d.ts +1 -0
  35. package/dist/fulfillment/providerDispatchAcceptance.js +8 -2
  36. package/dist/fulfillment/providerDispatchWorker.d.ts +51 -0
  37. package/dist/fulfillment/providerDispatchWorker.js +65 -20
  38. package/dist/fulfillment/providerReconciliationWorker.d.ts +27 -19
  39. package/dist/fulfillment/providerReconciliationWorker.js +75 -19
  40. package/dist/fulfillment/providerStockSyncWorker.d.ts +5 -1
  41. package/dist/fulfillment/providerStockSyncWorker.js +229 -120
  42. package/dist/fulfillment/providerTrackingReferences.d.ts +3 -2
  43. package/dist/fulfillment/verifiedIngress.d.ts +38 -11
  44. package/dist/fulfillment/verifiedIngress.js +36 -8
  45. package/dist/invoicing/accountingCanonicalProviderLines.d.ts +5 -0
  46. package/dist/invoicing/accountingCanonicalProviderLines.js +104 -0
  47. package/dist/invoicing/accountingLineAllocation.d.ts +2 -0
  48. package/dist/invoicing/accountingLineAllocation.js +69 -0
  49. package/dist/invoicing/adapterConformance.d.ts +42 -0
  50. package/dist/invoicing/adapterConformance.js +296 -0
  51. package/dist/invoicing/artifacts.d.ts +7 -0
  52. package/dist/invoicing/artifacts.js +20 -0
  53. package/dist/invoicing/bindings.d.ts +46 -0
  54. package/dist/invoicing/bindings.js +69 -0
  55. package/dist/invoicing/capabilities.d.ts +11 -0
  56. package/dist/invoicing/capabilities.js +10 -0
  57. package/dist/invoicing/channelPolicy.d.ts +28 -0
  58. package/dist/invoicing/channelPolicy.js +27 -0
  59. package/dist/invoicing/continuity.d.ts +12 -0
  60. package/dist/invoicing/continuity.js +18 -0
  61. package/dist/invoicing/contracts/capabilities.d.ts +40 -0
  62. package/dist/invoicing/contracts/capabilities.js +1 -0
  63. package/dist/invoicing/contracts/companyLookup.d.ts +49 -0
  64. package/dist/invoicing/contracts/companyLookup.js +1 -0
  65. package/dist/invoicing/contracts/delivery.d.ts +74 -0
  66. package/dist/invoicing/contracts/delivery.js +1 -0
  67. package/dist/invoicing/contracts/facts.d.ts +110 -0
  68. package/dist/invoicing/contracts/facts.js +1 -0
  69. package/dist/invoicing/contracts/host.d.ts +245 -0
  70. package/dist/invoicing/contracts/host.js +1 -0
  71. package/dist/invoicing/contracts/index.d.ts +16 -0
  72. package/dist/invoicing/contracts/index.js +1 -0
  73. package/dist/invoicing/contracts/provider.d.ts +126 -0
  74. package/dist/invoicing/contracts/provider.js +1 -0
  75. package/dist/invoicing/contracts/settlement.d.ts +66 -0
  76. package/dist/invoicing/contracts/settlement.js +1 -0
  77. package/dist/invoicing/contracts/store.d.ts +277 -0
  78. package/dist/invoicing/contracts/store.js +1 -0
  79. package/dist/invoicing/contribution.d.ts +21 -0
  80. package/dist/invoicing/contribution.js +19 -0
  81. package/dist/invoicing/correction.d.ts +42 -0
  82. package/dist/invoicing/correction.js +44 -0
  83. package/dist/invoicing/delivery.d.ts +85 -0
  84. package/dist/invoicing/delivery.js +79 -0
  85. package/dist/invoicing/documentHistory.d.ts +50 -0
  86. package/dist/invoicing/documentHistory.js +213 -0
  87. package/dist/invoicing/documentSync.d.ts +24 -0
  88. package/dist/invoicing/documentSync.js +26 -0
  89. package/dist/invoicing/dutyCollector.d.ts +15 -0
  90. package/dist/invoicing/dutyCollector.js +35 -0
  91. package/dist/invoicing/fulfillmentTrigger.d.ts +56 -0
  92. package/dist/invoicing/fulfillmentTrigger.js +90 -0
  93. package/dist/invoicing/handoff.d.ts +37 -0
  94. package/dist/invoicing/handoff.js +62 -0
  95. package/dist/invoicing/index.d.ts +39 -0
  96. package/dist/invoicing/index.js +37 -0
  97. package/dist/invoicing/issue.d.ts +39 -0
  98. package/dist/invoicing/issue.js +55 -0
  99. package/dist/invoicing/migrations.d.ts +48 -0
  100. package/dist/invoicing/migrations.js +25 -0
  101. package/dist/invoicing/nativeUnsupported.d.ts +9 -0
  102. package/dist/invoicing/nativeUnsupported.js +22 -0
  103. package/dist/invoicing/paymentReadback.d.ts +20 -0
  104. package/dist/invoicing/paymentReadback.js +47 -0
  105. package/dist/invoicing/postgresInvoiceStore.d.ts +55 -0
  106. package/dist/invoicing/postgresInvoiceStore.js +344 -0
  107. package/dist/invoicing/readModel.d.ts +74 -0
  108. package/dist/invoicing/readModel.js +90 -0
  109. package/dist/invoicing/readback.d.ts +4 -0
  110. package/dist/invoicing/readback.js +30 -0
  111. package/dist/invoicing/reversal.d.ts +37 -0
  112. package/dist/invoicing/reversal.js +28 -0
  113. package/dist/invoicing/sellerRevision.d.ts +19 -0
  114. package/dist/invoicing/sellerRevision.js +14 -0
  115. package/dist/invoicing/settlementSync.d.ts +18 -0
  116. package/dist/invoicing/settlementSync.js +32 -0
  117. package/dist/invoicing/snapshot.d.ts +52 -0
  118. package/dist/invoicing/snapshot.js +141 -0
  119. package/dist/subscriptions/automaticRenewal.d.ts +44 -0
  120. package/dist/subscriptions/automaticRenewal.js +81 -0
  121. package/dist/subscriptions/automaticRenewalExecution.d.ts +21 -0
  122. package/dist/subscriptions/automaticRenewalExecution.js +44 -0
  123. package/dist/subscriptions/contracts/commands.d.ts +115 -0
  124. package/dist/subscriptions/contracts/commands.js +1 -0
  125. package/dist/subscriptions/contracts/dunning.d.ts +133 -0
  126. package/dist/subscriptions/contracts/dunning.js +1 -0
  127. package/dist/subscriptions/contracts/index.d.ts +6 -0
  128. package/dist/subscriptions/contracts/index.js +1 -0
  129. package/dist/subscriptions/contracts/messages.d.ts +43 -0
  130. package/dist/subscriptions/contracts/messages.js +1 -0
  131. package/dist/subscriptions/contracts/renewal.d.ts +533 -0
  132. package/dist/subscriptions/contracts/renewal.js +1 -0
  133. package/dist/subscriptions/contracts/stockWait.d.ts +73 -0
  134. package/dist/subscriptions/contracts/stockWait.js +1 -0
  135. package/dist/subscriptions/index.d.ts +39 -0
  136. package/dist/subscriptions/index.js +17 -0
  137. package/dist/subscriptions/paymentOutcomes.d.ts +8 -0
  138. package/dist/subscriptions/paymentOutcomes.js +27 -0
  139. package/dist/subscriptions/postgresRenewalStore.d.ts +20 -0
  140. package/dist/subscriptions/postgresRenewalStore.js +61 -0
  141. package/dist/subscriptions/postgresRetryStore.d.ts +78 -0
  142. package/dist/subscriptions/postgresRetryStore.js +142 -0
  143. package/dist/subscriptions/renewalCycleFailureMechanism.d.ts +34 -0
  144. package/dist/subscriptions/renewalCycleFailureMechanism.js +79 -0
  145. package/dist/subscriptions/renewalCycleMechanism.d.ts +46 -0
  146. package/dist/subscriptions/renewalCycleMechanism.js +157 -0
  147. package/dist/subscriptions/renewalCycleRefusalMechanism.d.ts +41 -0
  148. package/dist/subscriptions/renewalCycleRefusalMechanism.js +160 -0
  149. package/dist/subscriptions/renewalIdentity.d.ts +3 -0
  150. package/dist/subscriptions/renewalIdentity.js +4 -0
  151. package/package.json +23 -3
  152. package/release-gates.json +74 -7
  153. package/sql/20260809210000_accounting_document_rail.sql +889 -0
  154. package/sql/20260811150000_accounting_payout_rail.sql +333 -0
  155. package/sql/20260812130000_accounting_document_lifecycle_rail.sql +460 -0
  156. package/sql/20261022160000_subscription_retry_lifecycle.sql +328 -0
  157. package/sql/20261022165000_fulfillment_stock_evidence_replay_reopen.sql +30 -0
  158. package/sql/20261022190000_invoicing_durable_duties.sql +494 -0
  159. package/sql/20261022191000_invoicing_document_effects.sql +249 -0
  160. package/sql/20261022192000_invoicing_payment_decoupling.sql +144 -0
  161. package/sql/20261022195000_invoicing_seller_revision.sql +65 -0
  162. package/src/fulfillment/adapterConformance.ts +1 -1
  163. package/src/fulfillment/bindings.ts +1 -1
  164. package/src/fulfillment/contracts/conformance.ts +3 -1
  165. package/src/fulfillment/contracts/dispatch.ts +24 -5
  166. package/src/fulfillment/contracts/index.ts +3 -3
  167. package/src/fulfillment/contracts/observation.ts +11 -3
  168. package/src/fulfillment/contracts/readback.ts +13 -0
  169. package/src/fulfillment/contracts/store.ts +1 -0
  170. package/src/fulfillment/contracts/sync.ts +13 -2
  171. package/src/fulfillment/dispatchProjection.ts +94 -7
  172. package/src/fulfillment/index.ts +3 -2
  173. package/src/fulfillment/migrations.ts +1 -0
  174. package/src/fulfillment/observationProjection.ts +64 -13
  175. package/src/fulfillment/omnipack/client.ts +32 -13
  176. package/src/fulfillment/omnipack/index.ts +99 -39
  177. package/src/fulfillment/omnipack/mappers.ts +23 -2
  178. package/src/fulfillment/omnipack/observation.ts +45 -27
  179. package/src/fulfillment/omnipack/reconciliation.ts +56 -0
  180. package/src/fulfillment/postgresDispatchStore.ts +1 -1
  181. package/src/fulfillment/postgresShipmentSpine.ts +21 -4
  182. package/src/fulfillment/postgresStockSyncPort.ts +6 -3
  183. package/src/fulfillment/providerDispatchAcceptance.ts +9 -3
  184. package/src/fulfillment/providerDispatchWorker.ts +61 -20
  185. package/src/fulfillment/providerReconciliationWorker.ts +81 -25
  186. package/src/fulfillment/providerStockSyncWorker.ts +222 -126
  187. package/src/fulfillment/providerTrackingReferences.ts +3 -2
  188. package/src/fulfillment/verifiedIngress.ts +44 -11
  189. package/src/invoicing/accountingCanonicalProviderLines.ts +134 -0
  190. package/src/invoicing/accountingLineAllocation.ts +69 -0
  191. package/src/invoicing/adapterConformance.ts +249 -0
  192. package/src/invoicing/artifacts.ts +19 -0
  193. package/src/invoicing/bindings.ts +80 -0
  194. package/src/invoicing/capabilities.ts +9 -0
  195. package/src/invoicing/channelPolicy.ts +50 -0
  196. package/src/invoicing/continuity.ts +15 -0
  197. package/src/invoicing/contracts/capabilities.ts +15 -0
  198. package/src/invoicing/contracts/companyLookup.ts +13 -0
  199. package/src/invoicing/contracts/delivery.ts +24 -0
  200. package/src/invoicing/contracts/facts.ts +71 -0
  201. package/src/invoicing/contracts/host.ts +84 -0
  202. package/src/invoicing/contracts/index.ts +16 -0
  203. package/src/invoicing/contracts/provider.ts +78 -0
  204. package/src/invoicing/contracts/settlement.ts +39 -0
  205. package/src/invoicing/contracts/store.ts +102 -0
  206. package/src/invoicing/contribution.ts +28 -0
  207. package/src/invoicing/correction.ts +56 -0
  208. package/src/invoicing/delivery.ts +122 -0
  209. package/src/invoicing/documentHistory.ts +301 -0
  210. package/src/invoicing/documentSync.ts +51 -0
  211. package/src/invoicing/dutyCollector.ts +31 -0
  212. package/src/invoicing/fulfillmentTrigger.ts +144 -0
  213. package/src/invoicing/handoff.ts +71 -0
  214. package/src/invoicing/index.ts +39 -0
  215. package/src/invoicing/issue.ts +64 -0
  216. package/src/invoicing/migrations.ts +25 -0
  217. package/src/invoicing/nativeUnsupported.ts +24 -0
  218. package/src/invoicing/paymentReadback.ts +70 -0
  219. package/src/invoicing/postgresInvoiceStore.ts +334 -0
  220. package/src/invoicing/readModel.ts +80 -0
  221. package/src/invoicing/readback.ts +26 -0
  222. package/src/invoicing/reversal.ts +34 -0
  223. package/src/invoicing/sellerRevision.ts +20 -0
  224. package/src/invoicing/settlementSync.ts +37 -0
  225. package/src/invoicing/snapshot.ts +192 -0
  226. package/src/subscriptions/automaticRenewal.ts +87 -0
  227. package/src/subscriptions/automaticRenewalExecution.ts +39 -0
  228. package/src/subscriptions/contracts/commands.ts +46 -0
  229. package/src/subscriptions/contracts/dunning.ts +48 -0
  230. package/src/subscriptions/contracts/index.ts +6 -0
  231. package/src/subscriptions/contracts/messages.ts +18 -0
  232. package/src/subscriptions/contracts/renewal.ts +325 -0
  233. package/src/subscriptions/contracts/stockWait.ts +34 -0
  234. package/src/subscriptions/index.ts +24 -0
  235. package/src/subscriptions/paymentOutcomes.ts +23 -0
  236. package/src/subscriptions/postgresRenewalStore.ts +76 -0
  237. package/src/subscriptions/postgresRetryStore.ts +174 -0
  238. package/src/subscriptions/renewalCycleFailureMechanism.ts +119 -0
  239. package/src/subscriptions/renewalCycleMechanism.ts +225 -0
  240. package/src/subscriptions/renewalCycleRefusalMechanism.ts +215 -0
  241. package/src/subscriptions/renewalIdentity.ts +5 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,446 @@ in the source repository.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.24.0]
14
+
15
+ - Publishable on the npm `latest` dist-tag as `0.24.0`, from tag
16
+ `openlup-platform-v0.24.0`.
17
+
18
+ - Require Zod `^4.6.6` to fix GHSA-mrhx-c7xc-m3w5; oversized constrained
19
+ request collections fail before element validation accumulates errors.
20
+ - Preserve the observation adapter's accepted minute-precision occurrence timestamps and raw
21
+ idempotency-key bytes with the updated validator; impossible dates still fail.
22
+
23
+ - Add the optional `runFulfillmentDispatchWorker.shadowCommandFingerprint` callback for a pure, local adopter command hash in shadow mode. Without it, shadow evidence still hashes the same `JSON.stringify(request)` bytes with SHA-256. The callback must return a lowercase 64-hex SHA-256 digest of the adopter's canonical command bytes, never command contents, credentials or contact data. The package accepts only strings matching `/^[a-f0-9]{64}$/`; invalid output or a throw returns a typed refusal with closed cause `adopter_fingerprint_invalid` or `adopter_fingerprint_failed`, without raw output, exception text or claim/attempt/evidence writes. Stage/live never invoke the callback. The fingerprint is used across shadow claim/readback/attempt, including mapped-attempt replay; shadow never begins, and live preparation must produce the same identity; shadow still performs no provider preparation, credentials lookup or POST.
24
+ - Preserve optional boolean `submissionAttempted` and `responseBodyRead` facts on typed dispatch errors and finalize evidence. `submissionAttempted: false` proves no provider submission was attempted; absence is unknown. `responseBodyRead: true` means the response body was read, including empty or malformed JSON; `false` means reading failed, and absence means there is no body-read evidence. Credential/request-construction failures include explicit non-submission proof; command validation/rebuild retains its closed `not_dispatchable` refusal. No raw body, exception prose or credentials enter these facts; durable projections admit only actual booleans.
25
+
26
+ Migration: existing callers need no changes. `shadowDispatchEvidence(request)` becomes `shadowDispatchEvidence(request, commandFingerprint?)`; omitting the new optional argument keeps the same evidence bytes and hash. These facts allow adopter classification without inferring uncertainty from retryability. Package classification remains unchanged: definitive rejections (including an unreadable HTTP 400 body) are `not_dispatched`; ambiguous submission and unreadable successful acknowledgements are `unknown`. No release, default binding, route, schedule or activation is added.
27
+
28
+ - Add inert native unsupported invoicing ports and runner-independent offline adapter conformance for exact recovery, parent identity, scoped absence, declared host capabilities and safe evidence.
29
+ - Document the invoicing design and host boundaries without installing workers, stores, fiscal providers, routes or activation.
30
+
31
+ - Extract invoice issue sequencing, snapshot/canonical line verification, unchanged allocation, payment evidence and handoff helpers into the existing invoicing entry; retain host payloads, keys, seller/tax policy and routing.
32
+ - Migration: compatibility callbacks preserve existing RPC/provider request bytes, issue fences and handoff descriptors. No native store, D7/O2 behavior, default provider, executor registration or activation is added.
33
+
34
+ - Add correction and reversal workers to the experimental invoicing entry, preserving durable correction identity, recovery, host event/key semantics and fenced outcomes. The reference host requires an explicit conforming correction bridge; its legacy vendor copy stays unchanged and unselected.
35
+ - Migration: introduce the two pinned managed v2/compatibility forwards with versioned adapter and pgTAP callers. Unkeyed attempted legacy corrections remain visibly unresolved for provider reconciliation. Preview correction references use correctionRef. Native forwards and runtime activation remain separate.
36
+ - See the [M09 forward owner](../../docs/platform/DATA_AND_MIGRATIONS.md#m09-invoicing-forward-design-and-control-approval) for sync-first settlement and permanent-failure parking.
37
+ - Registered limit: multi-reason / late-issue compensation can yield more than one full correction per invoice, as the incumbent does today.
38
+
39
+ - Add an experimental structural-executor native invoice store, a create/readback issue binding, separate native/managed migration descriptors, and six byte-identical sparse SQL assets. Read-only bounded discovery exposes duty/order IDs before facts are installed. Missing host fiscal facts refuse before writes; local-only document construction retains its previous behavior. Native fresh non-ready preflights settle before dispatch; stale preflight/finalizer results write no failure.
40
+ - Migration: append the three reviewed native duty/effect/payment forwards at positions 77–79 after the unchanged 160000/165000 prefix. Install the complete catalogue. Native child-document and managed base-row corrections have distinct descriptors. Seller revision and activation remain separate.
41
+
42
+ ### Independent native invoicing duties
43
+
44
+ Experimental invoicing adds `collectInvoiceDuties` and
45
+ `createIndependentInvoiceDutyBinding` for explicitly invoked, separately committed
46
+ duty collection. Native fulfillment no longer waits for accounting readiness or
47
+ invoice requests. Managed dispatch behavior stays unchanged.
48
+
49
+ Install the full native catalogue, including 190000/191000 before the exact
50
+ reviewed 192000 payment-decoupling forward. Captured settlement and dunning
51
+ recovery survive invoice capture failure; retained paid/handoff facts support
52
+ later repair. New unlinked payment events retain `accountingRequested=false`,
53
+ including after independent issue; historical linked events retain their readback.
54
+ Use owed-duty readback for invoice progress. No payment
55
+ export, provider activation, scheduler registration or fiscal default is added.
56
+
57
+ - Extract invoice delivery, PDF validation, accepted-document synchronization, payout item recording and document-history/read helpers into the existing invoicing entry; bind the reference host facades through explicit callbacks.
58
+ - Migration: F8 retains A2 payout transport and exact settlement keys; the legacy batch/payment importer preserves donor calls and aggregate results, while package receipt reuse across item scopes is an identity conflict with continued processing and no extra write; distinct recorded receipts require an item-capable host recorder/resolver. F11 retains M04 content, recipient, locale, transport and uncertainty. F9 bounds reference consumers; F12 leaves runbooks and customer correction intent host-owned. Native delivery uses an optional host envelope projection over P4’s store; job store mode binds fenced terminal/backoff outcomes (whole seconds clamp 60..86400, absent/invalid 900, retryable:false parks); callback mode requires terminalFailure before claim; native history requires a safe owned projection. PDF downloads now refuse invalid bytes; the reference panel displays closed diagnostic codes without free-text provider errors. No SQL, activation, executor or fiscal-policy change.
59
+
60
+ Explicit invoicing composition and first-claim seller revision
61
+
62
+ PART A: `createInvoiceServices`, `InvoiceServices` and `createInvoiceContribution`
63
+ use the existing `/invoicing` entry. Host selection is default-off; readiness
64
+ precedes factories and claim. Native helpers compose the real P4/P5 store,
65
+ collection, delivery, sync and read-model implementations. Host-specific factories
66
+ retain auth, configuration, transport/query projection and the existing executor,
67
+ registry and lease. Targeted module runs refuse before leasing.
68
+
69
+ PART B — Migration: native 195000 and managed 195100 are forward-only,
70
+ byte-identical introductions of the approved CTL-M09-4 fixtures. Eligible
71
+ obligations freeze the seller at their first-ever durable claim, independently
72
+ for corrections; retries retain it. Previously claimed legacy obligations keep
73
+ execution-time fallback. Issued documents and installed buyer/line facts are
74
+ unchanged. Native reversals use the correction request branch; managed order
75
+ reversals preserve incumbent results through the seller request wrapper.
76
+ Unknown/unsupported seller reads and order-scoped managed corrections refuse
77
+ before claim. SQL replay conflicts surface as typed identity conflicts.
78
+
79
+ ### Selection and installation boundary
80
+
81
+ Invoicing remains EXPERIMENTAL and DEFAULT-OFF. The issue/correction/reversal,
82
+ durable duty collection, native store, delivery/document/payout sync, safe history
83
+ and first-claim seller revision helpers are available for explicit host composition.
84
+ Select a provider and capability, bind host ports and establish readiness before
85
+ factories or claim; the structural contribution registers nothing itself. Fiscal
86
+ policy, ownership/authentication, M04 transport, artifact/history projections,
87
+ execution leases and route/job registration remain host responsibilities. No live
88
+ provider, fiscal acceptance or inbox-delivery evidence is established. Adopters
89
+ must not activate unselected or unready invoicing, or infer activation from SQL.
90
+
91
+ M10 subscription renewal/retry stages remain EXPERIMENTAL, INCOMPLETE and
92
+ DEFAULT-OFF, not for adopter activation: contracts, native stores/executor and
93
+ N1 SQL are present, but runner activation and the G23/N1 host composition,
94
+ correlation, authorization and replay obligations remain pending. Native delivery
95
+ alignment must remain off or shadow until the host composes the renewal runner
96
+ with its G23 admission decorator.
97
+
98
+ Migration: upgrade core, outbox and platform together from `0.23.0` to `0.24.0`
99
+ for exact internal peers. Install the complete canonical native migration chain
100
+ through position 80 (`20261022195000_invoicing_seller_revision.sql`), including
101
+ invoicing positions 77/78/79 (`190000`/`191000`/`192000`); P5 adds no SQL and P7
102
+ adds position 80. Sparse package projections are not an installation chain.
103
+ Managed installations use their own ordered forwards, including correction
104
+ `193000`/`193100` and seller `195100`; managed descriptor paths are catalogue
105
+ references, not files installed by the npm tarball. Preserve first-claim seller
106
+ snapshots and legacy fallback; there is no retroactive backfill or reversal of
107
+ forward SQL on application rollback. Retain the `0.23.0` shadow/observation retry
108
+ and legacy stock-fingerprint migration precautions when upgrading older rows.
109
+
110
+ ### Limits closed by this set
111
+
112
+ - The earlier invoicing contract-only/no-SQL/no-worker surface limit is closed:
113
+ P1b–P7 introduce explicit services, native store and helpers, with CTL-M09-1–4
114
+ reviewed forwards at native positions 77–80 and the managed correction/seller
115
+ forwards; see the [design boundary](../../docs/platform/plans/oss-m09-invoicing.md#p7-composition-and-seller-revision).
116
+ Default activation and live fiscal/provider acceptance remain unclaimed.
117
+ - M08 stock-evidence replay/reopen was already closed in `0.23.0` by position 76;
118
+ this set does not close its legacy fingerprint conflict or other M08 gaps.
119
+
120
+ ### Known limitations
121
+
122
+ - Managed dunning exhaustion still pauses active subscriptions; retaining active status needs a managed forward. Native N1 lands the bounded retry/failure repair, with the host obligations below still pending.
123
+ - D8-1: native advisory v2 promo-code candidates/rejection details unavailable.
124
+ - D8-2: native mounted v2 issue/honor/fallback unavailable.
125
+ - D8-3: native acquisition-only mounted issuance/honor unavailable.
126
+ - D8-4: full native/managed eligibility equivalence unavailable.
127
+ - Bundle-1: independent DB human-only actor-kind enforcement absent natively; first in the native-backend parity round.
128
+ - Bundle-2: managed-equivalent actor-kind/email history absent natively.
129
+ - Bundle-3 closes injected-reader M05 mounted admin/feed readback only. Native new-purchase stock read absent despite P5a installed-store proof; deferred second after bundle-1 (owner 2026-10-21); readiness refuses.
130
+ - Bundle-4: incumbent real-PostgreSQL contention only; no exactly-once guarantee.
131
+ - Managed schema/pgTAP retain `44.404`; removal needs owner decision/forward; reference composition supplies it to app code.
132
+ - A1 offline only; account/hosted-time/owner TEST evidence unclaimed; `communications/klaviyo` verification-pending.
133
+ - M05 omitted opt-ins preserve defaults/outputs/read order/schedules/refusals/acceptance-token bytes/SQL.
134
+ - Native inventory adjustment unavailable; address writes refuse readiness. Flat-rate save needs selected port/Core readiness/applied-seed observation.
135
+ - Native shipping audit unavailable; handler swallows best-effort audit failure.
136
+ - Native flat-rate integer bounds (0 through host maximum; reference 100,000 minor units) use request schema, not DB CHECK.
137
+ - Managed ATP/forecast/dated-supply/pagination readback unproved/pending M06.
138
+ - Managed two-session locks/concurrency/uncovered compensation unproved/pending M06.
139
+ - Managed exact-prefix upgrade/ledger unproved/pending M06.
140
+ - Managed address idempotency/conflict/readback unproved/pending M06.
141
+ - Managed successful flat-rate read/save unproved/pending host authority.
142
+ - M06 stock-wait lifecycle/durable timing/staging controls retain C5/C6; busy/try-gate, continuity/flag/TTL transfers are dispositions, not PASS.
143
+ - Shipping national-registry fields/locale-specific `canonicalAddressKey` fold await M16 host market pack/key migration; reference shipping copy stays locale-specific until M16.
144
+ - Native durable prepared storage, method setup, absence reopen and cumulative refunds unavailable; no production installation parity claimed.
145
+ - Typed refusal-envelope forwarding unavailable (`failureReason` only); reusable registration needs host ownership resolution.
146
+ - Incomplete chargebacks stay refunds/unapplied: reclassification bypasses evidence validation into dispute apply; limited operator recovery.
147
+ - Audit compatibility still detects `chargeId`; refund operation identity/original money supply no typed charge identity.
148
+ - M07 follow-up: repair poll can clear host redirect; post-timeout verify never restarts polling; unlocalized poller; fixture builds/never calls handler.
149
+ - M07 follow-up: reference status route wrong-rail witness.
150
+ - M07 follow-up: explicit reference-route refusal for unsupported method setup.
151
+ - M07 follow-up: deployment-neutral disabled-verify reason.
152
+ - M07 follow-up: reference card normalizer missing-amount path; package settling evidence already requires positive money.
153
+
154
+ - Native delivery alignment stays off or shadow until a host composes the native automatic-renewal runner with the G23 renewal admission decorator. The decorator alone neither composes nor activates the runner.
155
+ - The core fulfillment status map carries localized adopter labels; replace them with host-injected labels or internationalization keys at the host presentation boundary.
156
+ - The warehouse adapter example is opt-in and has offline conformance only; no provider-account proof or activation is established. Exact absence, label create/void and cancellation remain unsupported.
157
+ - After an alignment extension, a deferred renewal operation at the old schedule remains claimed with no reader or reservation effect. Changed terms snapshots conflict under the existing snapshot-conflict rules.
158
+
159
+ Native parity remains host-owned at these seams. Missing native bindings use the shared `FULFILLMENT_NATIVE_UNSUPPORTED` refusal; no partial write or parity claim is implied.
160
+
161
+ | Amendment | Host-owned seam and native boundary |
162
+ | --- | --- |
163
+ | G18 | Replacement creation and atomic eligibility/replay receipts; native replacement callback refuses. |
164
+ | G19 | Operator mutations, actor attribution and replay receipts; native mutation callbacks refuse. |
165
+ | G20 | Customer alignment rows; native reader refuses, while the pure delay projection remains callable. |
166
+ | G21 | Commerce list/detail and shipments overview; native read callbacks refuse. |
167
+ | G22 | Authoritative preparation edits, authorization and replay receipts; missing preparation binding refuses before dispatch, after disabled/selection/readiness checks. |
168
+
169
+ - M08 parity D2 KEEP-GAP: native dispatch finish still loses rejected/unknown error detail.
170
+ - M08 parity KEEP-GAP: immutable stock snapshot/alert evidence storage is absent; cursor JSON is overwritten. Hosts retain referenced evidence.
171
+ - Stock-evidence replay/reopen is CLOSED by native position 76; legacy `0.22.0` alert fingerprints still conflict with `23505`, including after resolution.
172
+
173
+ ### Invoicing registered limitations
174
+
175
+ These are notes carried from the landed design, not fixes in this preparation.
176
+
177
+ - M07 `payment_truth_readback` still joins `accounting_documents`: operator
178
+ ACCESS EXCLUSIVE DDL or denied ACL can block/refuse the call. New unlinked
179
+ payment events remain `accountingRequested=false` after independent issue;
180
+ use owed-duty readback for invoice progress (PR #334).
181
+ - Managed multi-reason and late-issue compensation can create more than one full
182
+ correction per invoice. A later finalizer can be fenced `claim_inactive`, leaving
183
+ its row `processing`; failed/pending rows on already-corrected parents may never
184
+ be reclaimed. Reconcile provider identity/evidence, including unresolved attempted
185
+ legacy corrections. Broader reversal/manual arbitration needs a separately
186
+ designed replacement forward (PR #329, #330, #348).
187
+ - An in-flight issue can still compensate outside the seller wrapper with
188
+ `legacy_fallback`; latest-parent reselection retains incumbent behavior.
189
+ Managed keys are scoped to invoice/provider/reason, and delegated void stores
190
+ no key; native cross-order reuse refuses. Pre-wrapper native reversal-key
191
+ retries can conflict after wrapper evidence is added (PR #346, #348).
192
+ - Managed paid/handoff contention (`55P03`) is a visible retryable no-effect
193
+ refusal with no automatic adapter retry. Fail-soft dispatch can finish without
194
+ an invoice request; durable recreation can require operator recovery and delayed
195
+ shipped-without-invoice monitoring (PR #348).
196
+ - A bad host fiscal revision can refuse an entire scoped/provider batch. A null
197
+ payment `providerRef` falls back to the fiscal provider: hosts must supply explicit
198
+ payment identity. A failing `store.fail` aborts remaining leased work; retain
199
+ lease recovery and host retry handling (PR #334).
200
+ - Reversed-duty fact installation can still report owed: read authoritative
201
+ reversal/duty evidence, never treat that answer as permission to issue.
202
+ Unsupported reversal and parked document/request residues remain visible and
203
+ unclaimable; later fact installation/reversal retry can change their diagnostics
204
+ (PR #332, #334; design phase obligations).
205
+ - Native corrections ride the issue batch; a separate correction operation without
206
+ a host factory refuses `host_binding_required`. Unknown native seller selection
207
+ currently maps to non-retryable unsupported; hosts must handle recovery explicitly
208
+ (PR #348).
209
+ - Delivery visibility must exceed transport timeout. Fenced settlement, database
210
+ failure or lease expiry can abort a batch and leave unsent leased rows uncertain.
211
+ Retryable/unsupported transport diagnostics may project as `retryable`; counters
212
+ omit projection failures/parked mismatches, so inspect durable status/error
213
+ evidence. Malformed projections and permanently invalid PDFs can retry without
214
+ an attempt cap (PR #332, #344).
215
+ - Reused settlement-receipt detection continues within one call only; it does not
216
+ detect another item's reuse in a later run. Legacy host aggregates expose item
217
+ conflicts through count differences; distinct receipts require an item-capable
218
+ recorder/resolver (PR #344).
219
+ - Hosts retain accepted-document observation polling and safe history composition.
220
+ `resolveDownload` must bind the document to the authorized order; the package
221
+ ticket check compares `documentRef`. Opaque-reference filtering covers its listed
222
+ schemes only (PR #344).
223
+ - Closed diagnostic policy reduces managed message-only/non-allowlisted errors to
224
+ `unknown`; an empty/non-string earlier `code` can hide a later closed code. The
225
+ separate OMS projection retains redacted free text. Missing-order cleanup can
226
+ log error rather than warn with the same refused/discarded outcome (PR #344, #348).
227
+ - PDF content-type normalization retains OpenLup behavior; signature checks are
228
+ stricter than donor ASCII decoding. `invoicePdfFilename` falls back to English
229
+ `invoice`; supply host captions (PR #344).
230
+
231
+ ## [0.23.0]
232
+
233
+ - Publishable on the npm `latest` dist-tag as `0.23.0`, from tag
234
+ `openlup-platform-v0.23.0`.
235
+
236
+ - Add `approveTrackingUrl` inputs to `verifyAndNormalizeFulfillmentObservation`,
237
+ `PostgresFulfillmentShipmentSpineOptions`, `FulfillmentAdapterConformanceSubject`
238
+ and reconciliation `trackingCodecs`. Under the strict default, provider tracking
239
+ URLs persist only with host approval and must be query-free and credential-free
240
+ HTTPS; host-built tracking URLs pass unchanged, including query strings.
241
+ - Existing `reconcileFulfillmentObservations` callers now receive row-local unknown
242
+ readback failures (`ok: false` with `failures`) while recognized rows still
243
+ process.
244
+ - Observation ingest (`verifyAndNormalizeFulfillmentObservation`, the native
245
+ `recordObservation`, `reconcileFulfillmentObservations` and
246
+ `runFulfillmentReconciliationPage`) now applies the durable-sink sanitizer: provider-derived
247
+ references outside the opaque reference rule (for example `#1001` or
248
+ `ORD/2026/1`) are stored as null or redacted and counted instead of verbatim,
249
+ and `firstReceivedAt` must be an RFC 3339 timestamp with an offset; other
250
+ values fail ingest or the reconciliation row. A correlation refused to null can
251
+ be quarantined as `missing_correlation` in reconciliation.
252
+ - Fulfillment reconciliation inputs replace `readLocalFulfillmentState` with
253
+ `readLocalFulfillmentStatus`, `latestStatusOccurredAt` and `readHandedOverAt`;
254
+ migrate host persistence implementations to these three reads.
255
+ - Add exported page observation contracts and `runFulfillmentReconciliationPage`
256
+ for host-owned scheduling, checkpoint resume and HTTP/ledger result projection;
257
+ exact lookup remains separate. `providerCalls` counts logical page-port reads,
258
+ including failures and exhaustion, separately from transport retries.
259
+ - Add redacted dispatch transcript/mapping fields, typed operation errors,
260
+ acceptance recovery evidence and provider-status occurrence evidence. Existing
261
+ unchanged stage/live dispatch identities retain their stored evidence for native replay.
262
+ - Migration: shadow drafts/attempts recorded by `0.22.0`'s native dispatch store
263
+ do not replay after this change: shadow now hashes the local candidate rather
264
+ than the provider-prepared command. Claim may consume a remap or raise
265
+ `fulfillment_dispatch_remap_exhausted`; an existing attempt may raise
266
+ `fulfillment_attempt_key_conflict`. Complete or abandon such drafts before
267
+ upgrading. The `0.22.0` native dispatch store has no adopter; no compatibility
268
+ transition is supplied.
269
+ - D2 KEEP-GAP: native `fulfillment_dispatch_finish` drops rejected/unknown error
270
+ detail; durable retention is a scheduled SQL follow-up.
271
+
272
+ - Compatibility: `getStock()` and `getStockMovements()` now return a row union;
273
+ consumers must discriminate rejections with
274
+ `"kind" in row && row.kind === "rejected"` before reading observation fields.
275
+ Provider read failures now return failed worker results (`ok: false`) with
276
+ persisted `providerError` diagnostics when the provider supplies a typed failure,
277
+ instead of throwing. Hosts can map those
278
+ failures to HTTP 502; terminal cursor-write failures still reject.
279
+ Cursor reads, running-cursor writes, local stock/class/reservation reads and
280
+ stock/evidence writes or SKU evidence resolution now also resolve `ok: false`
281
+ instead of rejecting when a terminal failed cursor can be persisted.
282
+ - `SyncCursor` adds optional `syncRunId`, `counts`, `items`, `alerts`, `staleSync`
283
+ and `error`, worker results add `rejected`, `items`, `providerError` and `refusal`,
284
+ and `fulfillment_stock_sync_cursors.error_code` now stores safe operation reasons
285
+ (including `operation:SQLSTATE`) or typed provider/admission reasons instead of
286
+ the generic `io_failure`.
287
+ - Mixed valid/rejected batches with valid stock rows succeed, retain rejection
288
+ counts and diagnostics, evaluate/resolve alerts for valid SKUs and advance
289
+ `lastStockSyncedAt`; an empty stock response is also valid, but a nonempty stock
290
+ response with no valid stock rows is malformed and non-retryable even with valid
291
+ movements, preserves prior coverage gaps and cannot resolve stale alerts.
292
+ Typed disabled, not-ready and bad-identity refusals retain their original reason
293
+ and retryability in the worker result and cursor.
294
+ Blank stock SKU references are skipped before persistence; stale-sync recovery
295
+ resolves after the terminal cursor, with cleanup failure preserving success.
296
+ Stock and movement rejection diagnostics carry a `kind` discriminator.
297
+ Stock-sync redirects are non-retryable, report `redirect_refused` and make only
298
+ one GET attempt; exhausted stock network reads remain retryable through the stock
299
+ failure projection. Product-sync retains the base client diagnostics and retry
300
+ behavior, including `retryable: false` after exhausted network reads.
301
+ - Stock-sync alert fingerprints now contain only `requestKey`, `skuRef` and
302
+ `thresholdKind`: changing quantities, severity or run evidence under the same
303
+ key returns `replayed: true`. Different SKUs or thresholds use different keys;
304
+ a changed identity under a reused key still conflicts.
305
+ - Closed the scheduled KEEP-GAP for stock alert refresh/reopen with native forward
306
+ `20261022165000_fulfillment_stock_evidence_replay_reopen.sql`. Matching-identity
307
+ replay reopens the alert, refreshes severity/quantities and clears `resolved_at`;
308
+ identity mismatches retain SQLSTATE `23505`.
309
+
310
+ Migration: install the complete native catalogue through `20261022165000` before
311
+ stock adoption. The package descriptor and SQL asset project that same forward;
312
+ replay preserves the row identity, first-seen time and historical resolver run.
313
+ There is no managed forward or legacy fingerprint rewrite.
314
+
315
+ Migration: alert rows written by 0.22.0's native port carry the earlier whole-input fingerprint; subsequent writes under those keys conflict with SQLSTATE `23505`, and resolve only marks the row resolved while retaining its key and fingerprint, so it does not clear the conflict. Legacy fingerprints are documented only; this change does not rewrite them.
316
+
317
+ - Fulfillment ingress exposes receipt IDs, a host-neutral HTTP result mapping,
318
+ counted correlation/timestamp/tracking refusals and persisted safe superseded
319
+ causes. The opt-in adapter preserves donor webhook key bytes and defaults to
320
+ strict opaque references. Adopters can explicitly allow wider reference shapes
321
+ through `observationCodecs.approveReference`; tracking URLs retain their strict
322
+ default policy. `carrierRef` now stores the service-derived lowercase carrier
323
+ prefix by default, or the safe kind returned by `normalizeCarrier`, and effects
324
+ receive that same value as `carrierKind`. Both are null when no kind is available
325
+ or service evidence is refused; raw provider carrier codes have no fallback,
326
+ matching donor deduplication. Strict timestamp validation applies only at
327
+ webhook ingress, accepting compact offsets and local timestamps as before;
328
+ reconciliation and stock-movement timestamp parsing retain PR2 behavior.
329
+ Hosts retain referenced raw evidence.
330
+
331
+ Migration (observation ingress): donor-format colon identities remain the
332
+ compatibility target. Observation receipts/effects recorded by 0.22.0's native
333
+ stores under package digest keys are not recognized under the incumbent colon
334
+ keys, so retrying such an event can apply tracking again. Replaying a superseded
335
+ receipt processed by 0.22.0 fails with `fulfillment_observation_outcome_conflict`.
336
+ Drain in-flight observation retries before upgrading. No bridges or aliases are
337
+ provided for these native rows. Wider incumbent correlation/tracking references
338
+ require an explicit adopter allowlist; the default refuses and reports them.
339
+
340
+ Close the scheduled native stock-evidence refresh/reopen gap with forward
341
+ `20261022165000_fulfillment_stock_evidence_replay_reopen.sql` and its byte-identical
342
+ fulfillment package projection. Matching fingerprints refresh severity and nullable
343
+ quantities, reopen status, and clear `resolved_at`; identity, first-seen time and
344
+ historical resolver metadata survive. Existing-row replays and resolution serialize
345
+ on the row lock. Fingerprint mismatches still raise `23505`.
346
+
347
+ Migration: install the complete canonical native catalogue through `20261022165000`
348
+ before stock adoption, preserving its immutable ledger prefix. Sparse package SQL
349
+ is not a standalone install chain. The managed baseline already has this behavior.
350
+ Legacy 0.22.0 whole-input fingerprints are not rewritten and still conflict with
351
+ PR1 identity fingerprints, including after resolution.
352
+
353
+ - Add experimental invoicing declarations and explicit default-off capability selection, preserving exact absence, uncertain effects, correction identity and owed-duty visibility.
354
+ - Freeze host fiscal/facts/seller/money, registry, artifact, delivery, payout-item and safe account-history seams without installing a worker, store, provider or route.
355
+
356
+ Approve only the exact frozen M10/F17 native and managed SQL packet through a separate forward-control class, with inert fixtures, refusal plants and a required real PostgreSQL/pgTAP catalog gate. This control adds no migration, runtime activation or new permission to an installation.
357
+
358
+ - Add experimental subscription contracts and exact server/browser subpaths, preserving schedule identity, graph transaction boundaries, deferred admission and explicit native capability refusals.
359
+ - Contribute the unchanged hosted cycle, refusal and durable failure mechanisms with injected policy and their characterization; preserve native captured-case protection through rollback until actual arrival.
360
+
361
+ - Add injected native renewal and retry stores and a native executor using the subscription ports; bind hosted charge/failure facades to the contributed mechanism and existing M07 policies.
362
+ - Type-level change visible to dev-preview consumers: `capabilities.retryRecovery` changes from `"unavailable"` to `"selected"` (asserted in packages/platform/test/subscriptions/portFit.test.ts).
363
+
364
+ Migration: Install native N1 through the full ordered manifest before composing the retry driver. Native declines can retry or recover the original obligation instead of stalling indefinitely (F16); exhaustion leaves an active subscription and open case with no next retry. Preserve ledgers on rollback. The initial binding preserves case-before-outcome order and atomic terminal/bookkeeping writes. An existing immutable receipt short-circuits initial terminal replay before settlement, rebinding or case propagation, preserving all later retry effects; no runner is activated and M07 native prepared-store parity remains unavailable.
365
+
366
+ Host obligations: establish explicit logical-cycle correlation before invoking the runner (including prepare/execute). Ordinary retries must use the frozen mandate/authorization; N1 does not bind an ordinary retry method, so the P8 retry driver or host must enforce this, with a composition witness added in P8. Prepared retries retain the existing non-terminal `retry_scheduled` disposition with no next dispatch date. Bare `failed` execution status without explicit failure evidence requires verified readback (or remains awaiting an ACK).
367
+
368
+ A host or driver must never call `openCase` after a replayed `applyFailure` receipt, and the P8 retry driver must add a zero-delta replay witness.
369
+
370
+ ### Warehouse product-sync parity
371
+
372
+ A3 #311 restores product-sync parity and safe diagnostics in the opt-in warehouse
373
+ adapter, including product/pack projection and injected transport behavior.
374
+ It remains default-off with offline evidence only and no provider-account proof.
375
+
376
+ Migration: upgrade the complete core/outbox/platform set from `0.22.0` to
377
+ `0.23.0` for exact peers. Install the complete canonical native chain through
378
+ position 76 (`20261022165000_fulfillment_stock_evidence_replay_reopen.sql`),
379
+ including native N1, before selecting native stores. Sparse package SQL is not
380
+ an installation chain. Follow the shadow-draft, observation-retry and legacy
381
+ alert-fingerprint migration notes above; rollback preserves the forward ledger.
382
+
383
+ ### Experimental stages: no adopter activation
384
+
385
+ M10 subscription renewal/retry is **EXPERIMENTAL, INCOMPLETE and DEFAULT-OFF**,
386
+ not for adopter activation. This set includes P1 exports, the forward controls,
387
+ and P2 native renewal/retry stores and executor with native N1 SQL landed.
388
+ No runner is activated. G23 composition and N1 correlation, frozen authorization
389
+ and replay obligations remain pending: compose admission before any new cycle,
390
+ bind a logical cycle before prepare/execute, enforce frozen authorization on
391
+ ordinary retries, and never open a case after a replayed failure receipt.
392
+ The later retry driver still owes its zero-delta replay witness.
393
+
394
+ M09 invoicing capability selection and type-only contracts are
395
+ **EXPERIMENTAL, INCOMPLETE and DEFAULT-OFF**, not for adopter activation.
396
+ There is no invoicing SQL, store, worker, provider or route in this stage.
397
+ Installing the set does not register subscription or invoicing routes, workers
398
+ or a renewal runner; host composition remains explicit.
399
+
400
+ ### Known limitations
401
+
402
+ - Managed dunning exhaustion still pauses active subscriptions; retaining active status needs a managed forward. Native N1 lands the bounded retry/failure repair, with the host obligations below still pending.
403
+ - D8-1: native advisory v2 promo-code candidates/rejection details unavailable.
404
+ - D8-2: native mounted v2 issue/honor/fallback unavailable.
405
+ - D8-3: native acquisition-only mounted issuance/honor unavailable.
406
+ - D8-4: full native/managed eligibility equivalence unavailable.
407
+ - Bundle-1: independent DB human-only actor-kind enforcement absent natively; first in the native-backend parity round.
408
+ - Bundle-2: managed-equivalent actor-kind/email history absent natively.
409
+ - Bundle-3 closes injected-reader M05 mounted admin/feed readback only. Native new-purchase stock read absent despite P5a installed-store proof; deferred second after bundle-1 (owner 2026-10-21); readiness refuses.
410
+ - Bundle-4: incumbent real-PostgreSQL contention only; no exactly-once guarantee.
411
+ - Managed schema/pgTAP retain `44.404`; removal needs owner decision/forward; reference composition supplies it to app code.
412
+ - A1 offline only; account/hosted-time/owner TEST evidence unclaimed; `communications/klaviyo` verification-pending.
413
+ - M05 omitted opt-ins preserve defaults/outputs/read order/schedules/refusals/acceptance-token bytes/SQL.
414
+ - Native inventory adjustment unavailable; address writes refuse readiness. Flat-rate save needs selected port/Core readiness/applied-seed observation.
415
+ - Native shipping audit unavailable; handler swallows best-effort audit failure.
416
+ - Native flat-rate integer bounds (0 through host maximum; reference 100,000 minor units) use request schema, not DB CHECK.
417
+ - Managed ATP/forecast/dated-supply/pagination readback unproved/pending M06.
418
+ - Managed two-session locks/concurrency/uncovered compensation unproved/pending M06.
419
+ - Managed exact-prefix upgrade/ledger unproved/pending M06.
420
+ - Managed address idempotency/conflict/readback unproved/pending M06.
421
+ - Managed successful flat-rate read/save unproved/pending host authority.
422
+ - M06 stock-wait lifecycle/durable timing/staging controls retain C5/C6; busy/try-gate, continuity/flag/TTL transfers are dispositions, not PASS.
423
+ - Shipping national-registry fields/locale-specific `canonicalAddressKey` fold await M16 host market pack/key migration; reference shipping copy stays locale-specific until M16.
424
+ - Native durable prepared storage, method setup, absence reopen and cumulative refunds unavailable; no production installation parity claimed.
425
+ - Typed refusal-envelope forwarding unavailable (`failureReason` only); reusable registration needs host ownership resolution.
426
+ - Incomplete chargebacks stay refunds/unapplied: reclassification bypasses evidence validation into dispute apply; limited operator recovery.
427
+ - Audit compatibility still detects `chargeId`; refund operation identity/original money supply no typed charge identity.
428
+ - M07 follow-up: repair poll can clear host redirect; post-timeout verify never restarts polling; unlocalized poller; fixture builds/never calls handler.
429
+ - M07 follow-up: reference status route wrong-rail witness.
430
+ - M07 follow-up: explicit reference-route refusal for unsupported method setup.
431
+ - M07 follow-up: deployment-neutral disabled-verify reason.
432
+ - M07 follow-up: reference card normalizer missing-amount path; package settling evidence already requires positive money.
433
+
434
+ - Native delivery alignment stays off or shadow until a host composes the native automatic-renewal runner with the G23 renewal admission decorator. The decorator alone neither composes nor activates the runner.
435
+ - The core fulfillment status map carries localized adopter labels; replace them with host-injected labels or internationalization keys at the host presentation boundary.
436
+ - The warehouse adapter example is opt-in and has offline conformance only; no provider-account proof or activation is established. Exact absence, label create/void and cancellation remain unsupported.
437
+ - After an alignment extension, a deferred renewal operation at the old schedule remains claimed with no reader or reservation effect. Changed terms snapshots conflict under the existing snapshot-conflict rules.
438
+
439
+ Native parity remains host-owned at these seams. Missing native bindings use the shared `FULFILLMENT_NATIVE_UNSUPPORTED` refusal; no partial write or parity claim is implied.
440
+
441
+ | Amendment | Host-owned seam and native boundary |
442
+ | --- | --- |
443
+ | G18 | Replacement creation and atomic eligibility/replay receipts; native replacement callback refuses. |
444
+ | G19 | Operator mutations, actor attribution and replay receipts; native mutation callbacks refuse. |
445
+ | G20 | Customer alignment rows; native reader refuses, while the pure delay projection remains callable. |
446
+ | G21 | Commerce list/detail and shipments overview; native read callbacks refuse. |
447
+ | G22 | Authoritative preparation edits, authorization and replay receipts; missing preparation binding refuses before dispatch, after disabled/selection/readiness checks. |
448
+
449
+ - M08 parity D2 KEEP-GAP: native dispatch finish still loses rejected/unknown error detail.
450
+ - M08 parity KEEP-GAP: immutable stock snapshot/alert evidence storage is absent; cursor JSON is overwritten. Hosts retain referenced evidence.
451
+ - Stock-evidence replay/reopen is CLOSED by native position 76; legacy `0.22.0` alert fingerprints still conflict with `23505`, including after resolution.
452
+
13
453
  ## [0.22.0]
14
454
 
15
455
  - Publishable on the npm `latest` dist-tag as `0.22.0`, from tag
@@ -219,161 +659,3 @@ Native parity remains host-owned at these seams. Missing native bindings use the
219
659
  | G20 | Customer alignment rows; native reader refuses, while the pure delay projection remains callable. |
220
660
  | G21 | Commerce list/detail and shipments overview; native read callbacks refuse. |
221
661
  | G22 | Authoritative preparation edits, authorization and replay receipts; missing preparation binding refuses before dispatch, after disabled/selection/readiness checks. |
222
-
223
- ## [0.21.0]
224
-
225
- - Publishable on the npm `latest` dist-tag as `0.21.0`, from tag
226
- `openlup-platform-v0.21.0`.
227
- - Preview set: core/outbox unchanged, UI private `0.0.0`; published `0.20.0` size baselines, unchanged caps.
228
-
229
- ### Cumulative M07 status: payment truth and repair surfaces complete for this wave
230
-
231
- - Experimental payments/contracts/runtime: unchanged prepared ordering; neutral execution/evidence/readback/conformance, verified truth, first-receipt ingress, method lifecycle/reconciliation; host-owned persistence, translation/failure policy.
232
- - Native PostgreSQL truth/settlement/later-only alignment; three unchanged sparse SQL projections, not an install chain. Refunds never cancel subscriptions.
233
- - Repair/recovery/buyer verify inject rail capabilities; unknown rails refuse. Reference BFF retains mapping/schemas/ownership/auth order/transient callbacks. Browser/verify outcomes never prove payment success.
234
- - Reference-application source (no new export), opt-in repair view: `commerce/paymentStatusClient`, `commerce/paymentVerifyClient`, `payment/components/PaymentStatusPoller`; stored paid alone confirms, redirects require HTTPS, collection/confirmation stay injected, unsupported setup is visible. Exact file/specifier guards refuse broad commerce/operator clients; source-import proof keeps default view unmounted.
235
- - Truth services/one optional named binder use the host executor, no new schedule/executor. Selectors default-off: nothing activates by default. First-insert adapter fingerprint excludes receipt time/audit.
236
- - Two experimental example adapter subpaths under `./payments/`, named in the README. Card-processor example: three frozen exports, injected host client/neutral ports; refund creation, split authorization/capture and exact absence unavailable; cancellation needs host support.
237
- - Regional-processor example: host I/O, Model O aliases, verified observations, purpose-sensitive readback; check certificate validity/notification freshness. Both examples have no import I/O/default binding and await account TEST evidence.
238
- - Example adapter advisory: mismatched nonzero refusal money stays unknown/manual; trusted document refusals mean customer data correction; configuration mismatches throw before I/O. Unpaid/transient no-dispatch classifications unchanged.
239
- - Settling money missing/invalid/non-positive or blank currency refuses as amount mismatch; conformance requires positive money. Empty optional transients stop false leak refusals; JSON-escaped transients in diagnostics/readbacks/stored payloads and payer contact in execution results now refuse.
240
- - Private types reuse canonical money/attempts; unused imports removed, runtime/API unchanged.
241
-
242
- Migration: upgrade all `@openlup/*` `0.20.0` → `0.21.0` for exact pins. No schema migration; install the canonical catalogue, not sparse projections. Attempts add optional method selection/transient payer contact; contact is dispatch-only, never persisted/audited/logged/diagnosed. Missing adapter-required input requires exact before-dispatch `notDispatched`. Registration refs/kind/status require host `resolveMethodOwner` client/subscription ownership or are omitted. Lifecycle/normalized nested audit copies typed fields only; conformance scans all for secrets/contact. Adapter-filtered redacted audit never stores raw bodies; typed evidence overrides reader facts, audit bag fills untyped facts; identity/fingerprint exclude bag/receipt time. Other changes need no migration, and nothing rewires a host automatically.
243
-
244
- Migration: F2 replaces assumed full refund with `require-evidence`: missing/null kind/amount/operation identity is durably recorded/acknowledged, not applied. Supply original money, stable operation identity and cumulative snapshot, event delta or explicit full reversal (`refund`/`chargeback`); full evidence stays valid. Former default needs `refundEvidencePolicy: "legacy-assume-full"`, also in the reference handler; no native parity implied.
245
-
246
- Migration: D11 changes every caller of the reference payment control port (the selected verified ingress, the existing provider webhook handler and the captured reference checkout): apply/post-process redelivery using the first stored receipt instant, not redelivery time, so it cannot shift the cycle again. Replay reads winning receipt evidence and refuses (503) when that instant is unavailable. A legacy pre-fingerprint row takes the later clock once. Retain receipt evidence on upgrade; provider routes are not switched to opt-in ingress.
247
-
248
- ### Known limitations
249
-
250
- - Portable dunning repair has no managed twin: exhaustion still pauses active subscriptions there; retaining active status needs a managed forward.
251
- - D8-1: native advisory v2 promo-code candidates/rejection details unavailable.
252
- - D8-2: native mounted v2 issue/honor/fallback unavailable.
253
- - D8-3: native acquisition-only mounted issuance/honor unavailable.
254
- - D8-4: full native/managed eligibility equivalence unavailable.
255
- - Bundle-1: independent DB human-only actor-kind enforcement absent natively; first in the native-backend parity round.
256
- - Bundle-2: managed-equivalent actor-kind/email history absent natively.
257
- - Bundle-3 closes injected-reader M05 mounted admin/feed readback only. Native new-purchase stock read absent despite P5a installed-store proof; deferred second after bundle-1 (owner 2026-10-21); readiness refuses.
258
- - Bundle-4: incumbent real-PostgreSQL contention only; no exactly-once guarantee.
259
- - Managed schema/pgTAP retain `44.404`; removal needs owner decision/forward; reference composition supplies it to app code.
260
- - A1 offline only; account/hosted-time/owner TEST evidence unclaimed; `communications/klaviyo` verification-pending.
261
- - M05 omitted opt-ins preserve defaults/outputs/read order/schedules/refusals/acceptance-token bytes/SQL.
262
- - Native inventory adjustment unavailable; address writes refuse readiness. Flat-rate save needs selected port/Core readiness/applied-seed observation.
263
- - Native shipping audit unavailable; handler swallows best-effort audit failure.
264
- - Native flat-rate integer bounds (0 through host maximum; reference 100,000 minor units) use request schema, not DB CHECK.
265
- - Managed ATP/forecast/dated-supply/pagination readback unproved/pending M06.
266
- - Managed two-session locks/concurrency/uncovered compensation unproved/pending M06.
267
- - Managed exact-prefix upgrade/ledger unproved/pending M06.
268
- - Managed address idempotency/conflict/readback unproved/pending M06.
269
- - Managed successful flat-rate read/save unproved/pending host authority.
270
- - M06 stock-wait lifecycle/durable timing/staging controls retain C5/C6; busy/try-gate, continuity/flag/TTL transfers are dispositions, not PASS.
271
- - Shipping national-registry fields/locale-specific `canonicalAddressKey` fold await M16 host market pack/key migration; reference shipping copy stays locale-specific until M16.
272
- - Native durable prepared storage, method setup, absence reopen and cumulative refunds unavailable; no production installation parity claimed.
273
- - Typed refusal-envelope forwarding unavailable (`failureReason` only); reusable registration needs host ownership resolution.
274
- - Incomplete chargebacks stay refunds/unapplied: reclassification bypasses evidence validation into dispute apply; limited operator recovery.
275
- - Audit compatibility still detects `chargeId`; refund operation identity/original money supply no typed charge identity.
276
- - M07 follow-up: repair poll can clear host redirect; post-timeout verify never restarts polling; unlocalized poller; fixture builds/never calls handler.
277
- - M07 follow-up: reference status route wrong-rail witness.
278
- - M07 follow-up: explicit reference-route refusal for unsupported method setup.
279
- - M07 follow-up: deployment-neutral disabled-verify reason.
280
- - M07 follow-up: reference card normalizer missing-amount path; package settling evidence already requires positive money.
281
-
282
- ## [0.20.0]
283
-
284
- - Publishable on the npm `latest` dist-tag as `0.20.0`, from tag
285
- `openlup-platform-v0.20.0`.
286
-
287
- - Refresh release size-gate baselines from the published `0.19.0` tarballs; all caps remain unchanged.
288
-
289
- - Keep active subscriptions active on portable dunning exhaustion (invariant repair).
290
-
291
- Migration: apply the complete portable catalogue through
292
- `20261021120000_dunning_lifecycle_active_repair.sql` at position 71. Previously,
293
- NULL next retry expired the case and paused an active subscription; it now leaves
294
- the case open and repairable, retains the final notice and exhaustion event, and
295
- changes no subscription or cycle dates. Existing rows are not rewritten. Pass
296
- NULL only when `isDunningLadderExhausted` holds; a class-terminated rung-one refusal
297
- still must not be passed as NULL. There is no managed twin yet; the managed
298
- baseline still needs a separate forward.
299
-
300
- - Add the readiness-gated native flat-rate binding; the host supplies the named
301
- role-free lane and fixed-key rate port, as in the reference composition.
302
- - Require the native port and Core readiness for the shipping seed migration.
303
- - Refuse missing-row saves; native audit remains explicitly unsupported and best effort.
304
-
305
- Migration:
306
- Apply the complete portable chain through 20261021200000_shipping_flat_rate_seed.
307
- The seed preserves an existing rate and inserts zero only when absent; no ACL or
308
- role changes are made. New code on an unmigrated schema keeps refusing. Older code
309
- reads the seeded zero as it read an absent row. An application rollback does not reverse either forward
310
- (positions 71 and 72), and older runners refuse the extended ledger.
311
- Managed host-save authority remains pending.
312
-
313
- - Add the shipping `SHIPPING_MIGRATIONS` export and the optional
314
- `nativeRateReadiness` / `nativeRateSchema` binding dependencies.
315
-
316
- Migration: upgrade the complete `@openlup/*` set from `0.19.0` to `0.20.0`
317
- for exact internal pins. Native rate bindings require the selected port plus
318
- Core readiness and a same-database schema observation of the applied seed.
319
- Install the complete canonical migration catalogue, never sparse package
320
- projections as an installation chain.
321
-
322
- ### Cumulative M06 status
323
-
324
- - M06 remains incomplete: inventory and shipping are development-preview
325
- surfaces, with managed-host proof classes pending.
326
- - Inventory and shipping contracts, stock/ATP reads, reserve/release/expire
327
- operations, subscription forecasts, delivery selection, address and flat-rate
328
- handlers first shipped in `0.18.0`. Opt-in inventory/shipping/composition
329
- bindings (P5a/P5b) first shipped in `0.19.0`. M06's only new behaviour in
330
- `0.20.0` is native flat-rate save behind readiness; the portable dunning
331
- invariant repair is separate from M06. Host-owned policy and unsupported
332
- operations retain their explicit boundaries.
333
-
334
- ### Known limitations
335
-
336
- - The portable dunning invariant repair has no managed twin in this set. The
337
- managed baseline pauses active subscriptions on exhaustion; keeping them active
338
- requires a separate managed forward. Portable proof does not establish managed parity.
339
-
340
- - D8-1: native advisory v2 promo-code candidates and rejection details are not supported on the native backend.
341
- - D8-2: native mounted v2 code issue/honor/fallback is not supported on the native backend.
342
- - D8-3: acquisition-only mounted issuance/honor is not supported on the native backend.
343
- - D8-4: full native/managed eligibility equivalence is not supported on the native backend.
344
- - Bundle-1: independent database human-only actor-kind enforcement is not supported on the native backend and is the first item of a future native-backend parity round.
345
- - Bundle-2: managed-equivalent actor-kind/email history is not supported on the native backend.
346
- - Bundle-3 remains closed for M05 mounted admin/feed readback with an injected stock reader, while native new-purchase stock reads remain unsupported despite P5a's installed native inventory-store read proof.
347
- - Bundle-4 establishes only incumbent real-PostgreSQL contention characterization and provides no exactly-once guarantee.
348
- - The managed baseline schema and its pgTAP tests retain the incumbent legacy value `44.404`; removing it needs a forward migration and an owner decision, while reference composition supplies that value to application code.
349
- - A1 evidence is offline only: account verification, hosted-time behaviour and owner TEST certification are not claimed, and the `communications/klaviyo` adapter's capabilities stay verification-pending.
350
- - M05 parity seams are opt-in and omitted bindings preserve incumbent defaults, outputs, read order, scheduling, refusals, acceptance-token bytes and exported SQL.
351
- - Native inventory adjustment remains unsupported; native address writes refuse
352
- required-capability readiness. Native flat-rate save is supported only behind
353
- the selected port, Core readiness and applied-seed schema observation.
354
- - Native new-purchase stock read is deferred to the native-backend parity round
355
- (owner 2026-10-21), second after M05 bundle-1; required readiness still refuses
356
- honestly.
357
- - Native shipping-rate save has no durable audit: audit is explicitly unsupported,
358
- and the incumbent handler swallows the best-effort audit failure.
359
- - Native flat-rate value bounds (integer, 0 <= value <= the host request schema's
360
- maximum) are enforced by that schema, not a database CHECK; the reference
361
- maximum is 100,000 minor units.
362
- - Managed host ATP/forecast/dated-supply/pagination readback is not proved and
363
- remains pending in the M06 ledger; no managed-host parity is claimed.
364
- - Managed two-session lock order/concurrency and uncovered compensation paths
365
- are not proved on a managed host and remain pending; no equivalence is claimed.
366
- - Managed exact-prefix upgrade/ledger is not proved on a managed host and remains
367
- pending; no managed installation equivalence is claimed.
368
- - Managed address adapter idempotency/conflict/readback is not proved on a managed
369
- host and remains pending; no fixture-to-host equivalence is claimed.
370
- - Managed successful flat-rate read/save remains pending host authority and is
371
- not proved on a managed host; no successful managed host-save claim is made.
372
- - M06 adopter stock-wait lifecycle, durable subscription timing and staging
373
- control observations retain their separate C5/C6 evidence gates. Busy/try-gate
374
- protocol, durable stock-wait continuity and staging flag/TTL rows transferred
375
- to C5 adopter evidence are dispositions, not PASS.
376
- - Shipping contracts retain national-registry address fields and
377
- `canonicalAddressKey` retains a locale-specific character fold. M16 owns their
378
- move behind a host-supplied market pack with a canonical-key migration plan.
379
- - Reference shipping UI copy remains locale-specific until M16.