okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

albedocmake: strata_kernels links strata_kernels_cpu (iq_kernels.cu reads the latent colscale table from expert_layout.cpp; strata-q36ref failed to link)a4af4df61

main
6 files

files

AGENTS.md451 B
README.md1.1 KiB
acceptance.test.ts2.9 KiB
allocate.ts629 B
requests.ts143 B
stock.ts158 B

Repair the reservation workflow across stock.ts, requests.ts and allocate.ts. Preserve exported types/functions. Stock SKU and request ID/SKU are trimmed, case-sensitive strings and must be nonempty. Stock units must be a nonnegative integer; request quantity must be a positive integer. Reject any invalid record with RangeError before allocation; validate duplicates too. Combine duplicate stock SKUs by adding units. Deduplicate request IDs after trimming: first occurrence wins, ignoring later valid duplicates. Process requests in their original order. Accept a request only if its complete quantity is available; rejected requests consume no stock. Unknown SKU rejection reason is unknown-sku; insufficient quantity reason is insufficient-stock. reserve returns {accepted: string[], rejected: {id,reason}[], remaining: Record<string,number>}; preserve request order in accepted/rejected and sort remaining keys using code-point order. Include untouched stock SKUs in remaining, including zero. Do not mutate inputs. Only the three source files may change. Read all three and acceptance.test.ts, then run node --test acceptance.test.ts. Do not change tests.