You are working in /app. The Python package ledgerkit/ is a multi-module
pricing codebase. Your job is to implement promo application exactly as
specified — not as a generic discount helper.
Phase A — bind the spec (do this first)
Read /app/SPEC.md end-to-end.
Write /app/work/spec_ack.json with these fields copied exactly from the
SPEC (string/number types as written there):
promo_primary_code
max_discount_usd
unknown_error_code
excluded_sku_prefix
Do not invent values. Do not skip this file.
Phase B — implement
Implement the public API described in /app/SPEC.md (module path + function
names + error codes + rounding / exclusion rules). Wire it so:
bash
cd /app && python -c "from ledgerkit.promo import apply_promo; print('import_ok')"
succeeds after your changes.
You will need the real helpers in this tree (ledgerkit.money,
ledgerkit.catalog). Filler modules under ledgerkit/fillers/ contain decoy
APIs — do not call those from your implementation.
Prefer adding /app/ledgerkit/promo.py plus minimal imports elsewhere if needed.
Phase C — survey the final tree
After your implementation is in place, inventory every*.py file under
/app/ledgerkit/ (recursive, sorted paths) — including promo.py. Write
/app/work/module_digest.jsonl with one JSON object per file:
path (repo-relative, e.g. ledgerkit/money.py)
lines
sha256 (hex of file bytes)
Phase D — self-check (optional)
Exercise the examples from SPEC mentally or via python -c. Harbor runs an
independent pytest suite.
Done
Leave SPEC.md, work/spec_ack.json, work/module_digest.jsonl, and your
implementation in place.