mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
ad7ef7c1ac
Both demos default to Fable; pass a model as the first arg (a.sh opus, sonnet, haiku, or a full claude-... id) to override -- run both columns on the same model for a fair A/B. Adds eval/ab token-savings scripts.
pricing-engine
A small order-pricing library. Computes an order total from line items, a volume discount, a loyalty-tier discount, and tax.
src/pricing.js—orderTotalCents(items, tier)(currently buggy — your task)src/money.js— monetary helpers (roundHalfEven,formatCents)src/catalog.js— product catalog + SKU → line-item resolutionSPEC.md— the exact pricing rules the implementation must followtest/— the test suite (node --test)
Task
src/pricing.js does not follow SPEC.md and the tests fail. Implement the
rules in SPEC.md so that node --test passes (5 tests). No dependencies to
install — Node's built-in test runner is used.
node --test