Loading...
Loading...
Compare original and translation side by side
references/research-basis.mdreferences/research-basis.mdfile:lineSuspectedUnverifiedexpectedfile:lineSuspectedUnverifiedexpected.anti-bug/findings.jsonscripts/ledger.pypython scripts/ledger.py init
python scripts/ledger.py rule --area checkout \
--text "Loyalty discount is redeemable once per customer per campaign" \
--source "docs/campaigns.md:14" --confidence stated
python scripts/ledger.py add --severity critical --category business-logic \
--title "Loyalty discount redeemable N times under concurrency" \
--location "src/billing/redeem.py:88-94" --status confirmed --rule R-01 \
--repro "30 parallel POST /redeem with one code -> 30 credits applied" \
--evidence "read-check-write with no unique constraint and no transaction"
python scripts/ledger.py set F-003 --status fixed --fix-commit abc1234 --test tests/test_redeem.py::test_single_redemption
python scripts/ledger.py report # markdown for the final document
python scripts/ledger.py stats # flags anything still open or fixed without a testpython scripts/ledger.py attempt F-003 --mechanism "added unique index on (customer, campaign)" \
--outcome fail --measured "test still red: 2 of 30 requests succeed" \
--failure-class repairable --note "index correct; the read still happens outside the transaction".anti-bug/findings.jsonscripts/ledger.pypython scripts/ledger.py init
python scripts/ledger.py rule --area checkout \
--text "Loyalty discount is redeemable once per customer per campaign" \
--source "docs/campaigns.md:14" --confidence stated
python scripts/ledger.py add --severity critical --category business-logic \
--title "Loyalty discount redeemable N times under concurrency" \
--location "src/billing/redeem.py:88-94" --status confirmed --rule R-01 \
--repro "30 parallel POST /redeem with one code -> 30 credits applied" \
--evidence "read-check-write with no unique constraint and no transaction"
python scripts/ledger.py set F-003 --status fixed --fix-commit abc1234 --test tests/test_redeem.py::test_single_redemption
python scripts/ledger.py report # markdown for the final document
python scripts/ledger.py stats # flags anything still open or fixed without a testpython scripts/ledger.py attempt F-003 --mechanism "added unique index on (customer, campaign)" \
--outcome fail --measured "test still red: 2 of 30 requests succeed" \
--failure-class repairable --note "index correct; the read still happens outside the transaction"python scripts/recon.pypython scripts/hotspots.py| ID | Area | Rule | Source | Confidence |
|---|---|---|---|---|
| R-01 | Checkout | Discount code redeemable once per customer per campaign | | stated |
| R-02 | Refunds | Refund total may never exceed the captured amount | inferred from | inferred |
statedinferredinferredConfirmedNeeds decisionpython scripts/recon.pypython scripts/hotspots.py| ID | 领域 | 规则 | 来源 | 置信度 |
|---|---|---|---|---|
| R-01 | 结账 | 折扣码每个客户每个活动只能兑换一次 | | 已陈述 |
| R-02 | 退款 | 退款总额不得超过已捕获金额 | 从 | 推断 |
statedinferredinferredConfirmedNeeds decisionledger.py baselineledger.py baselinereferences/detection-playbook.mdreferences/business-logic.mdreferences/security-audit.mdreferences/toolchains.mdreferences/business-logic.mdawait.env.examplereferences/detection-playbook.mdreferences/business-logic.mdreferences/security-audit.mdreferences/toolchains.mdreferences/business-logic.mdawait.env.examplefile:linestatedinferredstatedfile:lineinferredfix/anti-bug-sweepfix(billing): enforce single redemption [F-003]fix/anti-bug-sweepfix(billing): enforce single redemption [F-003]python scripts/ledger.py statspython scripts/ledger.py statspython scripts/ledger.py report > docs/anti-bug-report.mdassets/report-template.mdpython scripts/ledger.py report > docs/anti-bug-report.mdassets/report-template.mdpkillkillkillallpkillkillkillall