~ Path Cutover Punch List

What to do next, in order. Built from the Pastel triage, tonight's adversarial verification, and a read of the 24-hour medusa-core push against the actual repos.

2026-09-01 · 22:00 UTC
storefront live build 06:33Z
admin live build 17:58Z
core live build 19:42Z
20replies posted
2false check-offs reopened
56claims still unverified
40lenses dead on credits
3systemic defects open
Do this before anything else

The WS0 work exists only as uncommitted files in a worktree

The push describes _distributor-link.ts, distributor-hierarchy.ts and “37 tests” as already coded. They are — but only in _worktrees/medusa-core, on no branch, tracked by nothing. One git worktree remove or a disk hiccup and it's gone, and WS-P, WS1 and WS3 all sit behind it. It also carries edits to approve/route.ts and the NPI routes, which WS-N and the #60 board fix will both touch.

_distributor-link.tsdistributor-hierarchy.tscommission-plan.ts+3 unit specsapprove/route.tsdistributors/[id]/route.tsdistributors/[id]/customers/*npi-checknpi-attachalert-distributorcustomers/[id]/timeline
cd ~/Projects/Path/path2-src/_worktrees/medusa-core
git checkout -b ws0/pairs-and-hierarchy
git add -A && git commit -m "WS0: pair-aware links, hierarchy validation, commission plan"
git push gh ws0/pairs-and-hierarchy

Run it in the medusa-core terminal — I stayed out of that working tree while it's live.

Three lanes

check items off as you go — saved in this browser

Yours nobody else can do these

Blocked waiting on credits

Mine say go and I'll run them

Decisions waiting on you

each blocks a written spec
#53credit-note
Does the credit note cover any unpaid order, or only true on-account (terms) orders? Refunds measure settled money, so an unpaid account order has nothing to refund and no way to reduce what's owed.
Any unpaid order. The order QA tested is Due-on-receipt — the narrow version leaves that exact case broken, with the balance showing owed forever.
#36mirrored orders
Should migrated order_shop_* orders be editable in the admin at all? Their line values are 100× inflated; 40,530 of 51,497 lines still cents-scaled.
Read-only with a banner until repair-migrated-line-cents.ts runs. Editing them today produces wrong money.
#49payment terms
Lock terms for credit-line customers, or keep the per-order override? Carlos asked for no selection at all. Three places in core resolve terms differently today.
Unify the three resolvers first, make the preselect fire for credit-limit holders, keep the override. Revisit locking once it's one code path.
#51fulfil gate
Should unpaid Due-on-receipt orders be blocked from fulfilment too? The gate as shipped is narrower than the case QA actually reported, so that order class still passes.
Yes, block them, and make the gate fail closed on a credit-check error like the order-creation gate already does.

Dev sequence

dependency order — each unblocks the next
  1. Database connection exhaustion302 files open a raw client per request against a pooler capped at 15. It's the confirmed cause of Carlos's “unable to load customers” and the intermittent 500s across both apps. Every retest below is unreliable until this lands.
    core
  2. Store-credit approval dead endA later change broke the second-approver step, so mid-band approvals cannot complete and one request is parked waiting. The table that step expects exists in no migration.
    core
  3. Tier-1 pricing data syncTier-1 accounts are being charged retail — $330 where the approved sheet says $220 — and 2,629 approved customer price sheets have never materialized. Money-facing, live now, and the reason for #48, #30, #32 and #65.
    core · data
  4. Credit-note / AR-reduction pathBlocked on decision #53.
    core + admin
  5. Duplicate customer identityOne test account exists as four separate customer records, and the credit board ignores overrides — so an approved limit reads as zero. Pair imports will attach to the wrong record until this is settled.
    core + admin
  6. Soft-fail / retry on server-side core fetchesRecurring ETIMEDOUT upstream failures — do this before WS6 starts redeploying core repeatedly, or every deploy degrades live shoppers.
    storefront
  7. Run the two pending repair scriptsrepair-migrated-line-cents.ts (after #36) and backfill-native-onaccount-invoices.ts. Dry-run, back up, record in the verification log.
    ops

Where the 24-hour push is wrong

checked against the actual repos
ClaimVerdictWhat's actually true
WS0 already codeduncommittedExists only in a local worktree, on no branch. See the callout above.
“Tier ladder rates — not in these 24h”mis-scopedIt isn't a rate decision. Tier-1 customers are paying retail today; it's a same-day data sync.
Engine order_payment_statuswrong sourceReads raw Shopify status; must go through deriveSettlement() or store-credit-settled orders drop out.
Portal read-path handoffwill break KPIsThe portal has no pagination and sums KPIs client-side over the full array. Adding limit/offset without shipping the portal change silently under-reports every total.
portal.payout in coreabsentZero references in core. WS5 needs raw SQL and a check that core's role can write the portal schema.
“67 duplicate groups”unfoundedThat figure appears nowhere. The register says 72 pairs / 153 excess rows / ≈$4,630.
has_distributor / NPI gate approvaladvisory onlyBoth are computed and shown, but approve/route.ts never enforces them. D6 is new server-side work.
Finance settings via POSTit's PUTMinor, but the route exports GET and PUT only.
Migration name collisionalready fixedRemediated and now CI-guarded. Still verify the credit CHECK constraints actually exist.

What went out tonight

20 replies · 12 status changes · 0 resolved
CommentActionWhy
SF #7reopenedResolved 8 minutes after posting with zero replies — and the section was never removed. Assigned to Alfie.
SF #15reopenedClosed as a “Pastel proxy” artifact with no log evidence; Maria's #61/#62 today are the same shape.
SF #27correctedClosed as “video intentionally not wired” — Alfie contradicted that 53 minutes later. Left closed, record fixed.
SA #49 #43 #42correctedAll three were reported fixed to Carlos. None were.
SA #5corrected“Couldn't reproduce” was wrong — his two failing requests are in the 22:01 log.
SA #47 #44 #51 #16correctedWrong retest steps, wrong timing, partial fixes described as complete.
SF #48 · SA #65root causeTier pricing explained honestly, including retracting “Tier 1 = standard price”.
SA #61 #62re-diagnosedI guessed a restart; the logs showed impersonation sessions ending. Corrected in-thread within minutes.