StressLive reports success when every settlement item fails
StressLive reports success when every settlement item fails. Final disposition: Fixed.
Tracker: issue #35 · Status: Fixed · Verified at: audit-v3-rereview-handoff
Description
In script/StressLive.s.sol#L118-L148, the script counts successful batch items into ok, but every aggregate expectation is scaled by ok and every per-item assertion skips failed entries. It never requires any settlement to succeed before printing all invariants held and returning normally.
When all items fail, every observed balance delta and every expected delta is zero, so all assertions pass vacuously. A live reproduction produced:
settled 0 of 3settlement USDC at rest (MUST be 0) 0treasury delta 0expected 0all invariants heldONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
No order settled, no badge moved, and no seller or treasury payment occurred. This is an assurance defect rather than a contract vulnerability: no checked CI or release gate consumes the script, but its false-green result can mislead an operator running the advertised live stress check.
Recommendations
Require at least one successful item immediately after counting the results:
require(ok > 0, "STRESS FAILED: zero settlements succeeded");
This preserves intentional partial-success testing while rejecting the vacuous all-fail case. If the script is intended to prove complete deployment readiness, require ok == batchSize instead, or enforce an explicitly documented minimum success threshold.
Remediation
Fixed. _requireAllSettled requires every item in the batch to have settled, names each item that did not, and refuses an empty batch as proving nothing. A run in which every settlement failed can no longer report success.
Verification provenance
Final disposition: Fixed. Verified at audit-v3-rereview-handoff, commit f020448976eb7c4895e1626ef3228876cff2b7d2. This earlier remediation disposition is carried forward from the prior re-review, not independently re-verified in the generation-d pass. The report-wide scope and evidence limitations remain applicable; see the final report overview.