From 498b61e9b359afb4f860b3e4854ffda2acdeae78 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 7 Jun 2026 09:55:12 +0000 Subject: [PATCH] commerce: mark roadmap complete + record Phase 5 extension backlog Base roadmap (Phases 1-4) done at 185/185. Records thesis-aligned extension candidates (line-level discount attribution, time-windowed promos, discount-aware tax, refund flow, stock-constrained reservation) for subsequent loop iterations. Co-Authored-By: Claude Opus 4.8 (1M context) --- plans/commerce-on-sx.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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