Skip to content

Sticky PO System — Design Package (v1, for approval before any code)

Per Ace's directive (2026-09-08): design first; no production code until the workflow and data contract are approved. Demand engine = Sticky's own forecast. Keep what SoStocked got right (order-by dates, urgency worklist, supplier-grouped ordering, staged lead times, projected timeline, full PO lifecycle, partial receiving); drop what it got wrong (manual velocity dials, spreadsheet-style configuration, drafts counted as supply).

Comps live in docs/design/po/ (desktop + mobile for all 7 surfaces), rendered with the locked design system (hd/DESIGN.md) and REAL pilot data read from the warehouse on Sep 8.

0 · Pilot scope — one real vendor, real SKUs

Wanda - RAVE (Rave Envy brand): 24 products on history, 7 currently URGENT/REORDER in forecast run #244 — 3 already stocked out, 2 more inside the 77-day pipeline window. It is also a live demonstration of the bug this system fixes: today's recommender zeroes po_units on all 7 because MOQ (512) exceeds the 90-day forecast — the seasonal under-ordering failure. The pilot ships with these 7 SKUs.

1 · End-to-end operator flow

Forecast run (daily, exists)                 ← Sticky forecasts.predictions p10–p90
   ↓
WORKLIST  (exceptions only, ranked by order-by date)
   "Wanda - RAVE needs one PO this week" — one plain-words brief, counts agree
   ↓ [Draft PO — all N lines]  (supplier-grouped "Order All")
RECOMMENDATION DETAIL  (optional drill-in: why this number, projected timeline, override+reason)
   ↓
PO DRAFT  (edit qtys — case-rounded; drops/overrides need a reason; NEVER counts as supply)
   ↓ submit
APPROVAL  (independent approver; payload-hash equality; approve = starts counting as supply)
   ↓
SENT → CONFIRMED  (PI attached; supplier-confirmed dates overwrite planned dates)
   ↓
PRODUCTION → ENROUTE  (staged: production / freight / receiving / FBA check-in; slips flag + reproject)
   ↓
RECEIVED  (partial OK: per-line received vs ordered; shortage → back-order / cancel / dispute)
   ↓
CLOSED  (all variances dispositioned; ledger check-in verified; record locks; reopen = approver + audited)

Information architecture: Purchasing becomes a first-class console section with three pages — Worklist (default), POs (list + detail/tracking), Suppliers (the supplier card: staged lead times, MOQ/case/cost per item, scorecard). No settings spreadsheet; every configured number lives on the supplier card with an audit trail.

2 · The seven surfaces (comps: desktop + mobile each)

# Surface What it must prove
1 Worklist One brief line an operator can act on; exceptions only; order-by date + qty is the recommendation
2 Recommendation detail The number explains itself in plain words; projected timeline with events; override requires reason
3 Supplier PO draft Order-All lands here; case rounding; MOQ checks; draft ≠ supply
4 Approval Independent approver; what-you-approve-is-what-you-send (hash); named checks
5 Tracking Staged lifecycle with planned vs actual; slips reflag and reproject
6 Partial receipt Received vs ordered per line; shortage needs a disposition; nothing silent
7 Close Final reconciliation + append-only audit history; close locks

3 · State model, permissions, and the supply-counting rule

States: draft → submitted → approved → sent → confirmed → production → enroute → received_partial → received → closed + rejected (back to draft), cancelled (any pre-received state, approver-only, audited). Every transition is an append-only event (actor, timestamp, payload) — same pattern as accounting.journal_posting_events.

Permissions: two named roles, reused from Books. Preparer creates/edits drafts, records receipts. Approver approves/rejects/cancels/reopens. Preparer ≠ approver, enforced server-side (self-approval 409s). Edits after approval reset the PO to draft and require reapproval (payload hash changes).

Proposed supply-counting rule: a PO's undelivered units count as incoming supply from approved onward — never in draft/submitted (Ace's rule, enforced in the demand math, stated on the draft UI). Rationale: approval is the internal commitment; if counting waited for sent/confirmed, every approved-but-unsent PO would re-recommend the same units and double-order. Two guards: - Staleness: a PO whose stage ETA has passed by >14 days with no receipt or update is flagged and its units drop out of the demand math until the operator re-dates it or excludes it with a reason (machinery exists: forecasts.po_exclusions, on_order_fresh vs on_order_stale). - Receipts: received units move from "on order" to on-hand at the receiving location immediately; they count as FBA-sellable only after ledger check-in verifies.

Proposed quantile policy — how the recommendation numbers are made. One fixed system-wide rule; no per-SKU or per-user quantile choice anywhere in the UI (a quantile picker would be a velocity dial wearing math): - Order quantities size at p85 over the lead-time + cover window — only a 15% chance demand beats the buy while we wait. Continuity, not invention: the seasonal recommender's need column is already need_p85. - Order-by dates and stockout timing use p50 — the honest middle expectation. Padding the clock too would flood the exceptions-only worklist with false OVERDUE and make it ignorable. - The projected timeline draws the p10–p90 band so uncertainty is visible instead of pretending one line is truth. - Phase 2, only if pilot evidence asks for it: class-tiered sizing (winners p90 · standard p85 · discontinue-candidates p50) — a 3-row system policy, still never a dial.

4 · Data contract — exact fields, sources, and honest gaps

Live today (no new work):

Field Source Freshness
Demand p10/p50/p90 daily forecasts.predictions (run #244) daily runs
Recommendation baseline (need, margins, class) forecasts.po_recommendations + forecasts.seasonal_recommendations daily
On hand FBA / AWD / 3PL raw.inventory_daily / raw.awd_inventory / raw.warehouse_inventory nightly
FBA transfers (timeline events) raw.fba_inbound_shipments + _items + _po_links daily
FBA check-in verification raw.inventory_ledger_daily receipts daily
Unit cost raw.product_skus.unit_cost + close-workspace overrides shared input with Books
Product identity raw.products.internal_name live
Historical POs (migration + scorecard seed) raw.purchase_orders (SoStocked import, snapshot 9/7, 330 POs) daily during transition
Line confirm/exclude machinery forecasts.po_line_confirmations / po_exclusions live

Gaps — each one named, with the V1 answer:

Gap Today V1 answer
Staged lead times (production/freight/receiving/check-in) nowhere in the warehouse entered on the supplier card at onboarding (one vendor = one row); per-PO override with reason
Supplier as an entity free-text string on SoStocked rows new purchasing.suppliers table; pilot seeds ONE row (Wanda - RAVE)
MOQ / case pack / current cost per supplier-item in recommender output, provenance unversioned new purchasing.supplier_items card, versioned, seeded from SoStocked + confirmed by Karl at onboarding
Internal names 3 of 7 pilot SKUs unnamed (B07J35Z66B, B07YBLNHH3, B07YBKSMBT) backfill before pilot (blocker, cheap)
Payment milestones (deposit/balance) free text phase 2 — V1 records amounts as notes only
Forecast quality ~45% MAPE overall, weaker on seasonal stated on the detail page; p10–p90 band shown, not hidden; overrides always available with reason
3PL receiving counts HIEX nightly snapshot deltas only V1: manual receipt entry by operator, verified against next snapshot; flagged as the weakest link

Unreliable input called out: raw.purchase_orders.est_arrival_date (SoStocked) is a single undated-provenance date — 70 of 330 POs are flagged likely-orphans today. That is why V1 makes Sticky the system of record for new POs instead of importing deeper.

5 · V1 boundary and phases

V1 (pilot): one vendor (Wanda - RAVE), 7 SKUs, USD only. Worklist + detail + draft + approval + tracking + partial receipt + close, all seven surfaces. Staged lead times on the supplier card. Sticky = source of record for NEW Wanda - RAVE POs; SoStocked stays read-only mirror for everything else (daily import continues untouched). No emails to the supplier (Sent = export PDF/xlsx + mark sent), no payment ledger, no auto-posting, no multi-currency, no AWD replenishment planning.

Phase 2: all vendors + brand rollup; payment milestones; supplier scorecards from receipt history; discontinue-review queue (the B07YBKSMBT case); MOQ renegotiation tracking.

Phase 3: Books integration — open POs give the close workspace its in_transit_ownership and china_quantities controlled inputs automatically (two of the three July blockers disappear); landed-cost actuals feed unit-cost evidence.

Success criteria for exiting pilot: one real Wanda - RAVE PO taken draft→closed in Sticky; zero stockout-days on the 7 pilot SKUs after the first received PO; worklist counts agree with the forecast run every day of the pilot.

6 · Decisions / access needed

  1. Supply rule sign-off (§3): count from approved, stale-out after 14 days past ETA.
  2. Roles: same pair as Books (Karl prepares, Ace approves) or a different approver for purchasing?
  3. Pilot vendor confirm: Wanda - RAVE as proposed (or name another).
  4. SoStocked supplier settings access (one-time read of Wanda's lead times/MOQ/case/cost to seed the supplier card — Karl transcribes, you confirm values).
  5. Real MOQ reality check: is 512 truly Wanda's MOQ per SKU? The recommender's RENEGOTIATE_MOQ wall on all 7 pilot SKUs hinges on it.
  6. Cutover policy: during pilot, new Wanda - RAVE POs are created ONLY in Sticky (SoStocked frozen for that vendor) — confirm.
  7. Quantile policy sign-off (§3): quantities sized at p85, dates at p50, p10–p90 band on charts — one fixed policy, no dials; class-tiering deferred to phase 2.