diff --git a/plans/commerce-on-sx.md b/plans/commerce-on-sx.md index 4a53cf04..418aa056 100644 --- a/plans/commerce-on-sx.md +++ b/plans/commerce-on-sx.md @@ -75,6 +75,21 @@ lib/commerce/api.sx ── (commerce/add) (commerce/total) (commerce/checkout) - [x] cross-instance catalog (federated marketplace) — out-of-scope stub - [x] tests: webhook replay, partial refund, double-charge guard +## Phase 5 — Extensions (backlog; base roadmap complete) +Thesis-aligned deepenings of the relational/composition showcase. Pick the one +that unlocks the most tests per effort each iteration. +- [ ] line-level discount attribution — "which line item triggered this discount?" + as a backward miniKanren query (briefing gotcha; promos currently apply at + class level). Refactor promo amounts to also yield per-line attribution. +- [ ] time-windowed promotions — promos gated by a validity window; quote takes a + datetime, determinism preserved. (quote.sx already documents datetime intent.) +- [ ] discount-aware tax policy — alternative `cart-quote` computing tax on the + net (post-discount) base via proportional class allocation; explicit + tested. +- [ ] refund as a flow — refund lifecycle (request → approve → settle) as a second + flow-on-sx flow, recorded in the ledger; idempotent. +- [ ] stock-constrained reservation — order-begin! fails (railway `fail`) when + requested qty exceeds stocko availability; reservation decrements a stock view. + ## Progress log - 2026-06-07 — `recon.sx` + `federation.sx` (**Phase 4 complete — roadmap done**). `recon.sx`: reconciliation as relational queries over the ledger. Per-order