Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
Refactor the working summarizeOrders implementation without changing its public exports, behavior, error type, or input immutability. Extract validateOrders into validation.ts and aggregateOrders into aggregation.ts. Keep exported Order and Summary types in orders.ts. orders.ts must import and call both helpers; avoid copying their implementations back into summarizeOrders. validateOrders returns new records with trimmed customer names and rejects invalid records (including cancelled records) with RangeError. aggregateOrders accepts validated records, ignores cancelled ones, groups by customer, sums priceCents*quantity and quantities, and returns summaries sorted by customer using code-point order. Both helpers must be exported and must not mutate input. Only orders.ts, validation.ts and aggregation.ts may be changed/created. No packages needed. Run node --test acceptance.test.ts; do not change tests.