- perf-validation.md:五实验协议/判据/材料(2026-09-23 自设计) - perf-validation-report-2026-09-23.md:汇总报告(判据逐项对照 + 诚实结论) - tests/blind_experiment.rs + tests/blind/:盲测 harness(查询通道/修复回路/usage 计量)+ 冻结材料(6 任务书 + docs-bundle) - tests/contract_ablation.rs:四边界×三情形消融(拦截 100%/误报 0%/零回归) - tests/drift_drill.rs:9 漂移必报 + 2 负对照 - src/mlsp.rs:syntax 卡片自持化(semantics/rule/sample/doc_quote) - three-problems.md §5.1 判据矩阵逐行判定(问题 1✅ 2✅ 3❌);three-problems-plan.md Phase 4 落地记录 - 全量干净回归零失败 Co-authored-by: Cursor <cursoragent@cursor.com>
1.8 KiB
1.8 KiB
Task: contract_milestone_pay (construction milestone payable)
Implement a contract milestone payment desk for an EPC / construction settlement. This is a business-policy pipeline (retention, late penalty, change order, tax), not an algorithms puzzle. Use integer arithmetic only. Hardcode the demo inputs below and print one integer: the final payable.
Business requirements (authoritative)
- Earned value:
earned = contract_value * progress_pct / 100. - Retention withhold:
retention = earned * retain_pct / 100(demo uses retain_pct = 5). - Net after retention:
net = earned - retention. - Late penalty: if
days_late > grace_days(grace_days = 7), setpenalty = net * late_rate / 100(late_rate = 2); otherwisepenalty = 0. Penalty is always computed fromnet, never fromearned. - After penalty:
net2 = net - penalty. - Change order:
taxed_base = net2 + change_order. Iftaxed_base < 0, settaxed_base = 0. - Tax:
tax = taxed_base * tax_rate / 100(tax_rate = 6). - Payable:
payable = taxed_base + tax. Ifpayable < min_pay(min_pay = 500), setpayable = min_pay.
Demo inputs (hardcode)
contract_value = 100000progress_pct = 40retain_pct = 5days_late = 10grace_days = 7late_rate = 2change_order = -2000tax_rate = 6min_pay = 500
Requirements
- Provide named helpers (or clear stages) for earned, retention, penalty, change+tax, and floor — not one opaque expression.
- Print only the final integer (no labels).
- Align to the business requirements above; do not invent alternate thresholds or penalty bases.
Expected output (self-check)
Exactly one line: 37354
Deliverable
Write the program as a Marqdo .mq.md file. Return the complete source in a single ```markdown fence — no prose outside the fence.