Reconcile route costs and preserve better quotes #1484

Merged
PlasticDigits merged 2 commits from fix/1483-route-cost-attribution into main 2026-10-12 15:12:13 +00:00
Owner

Native and wrapped quotes now reconcile wrapper loss, trading costs, market movement and reference divergence in exact final-output units. Swap and Trade show one consistent deviation and a compact explanation; exact raw thresholds and review-bound second-click consent preserve the 5/30/99 safeguards.

A pinned regression also proved that deeper search discarded a better route when the improvement was below 0.1%. The worker now publishes every strictly better eligible net result while retaining its work caps and the original reviewed transaction. Exact-amount quote caching already isolates small and large inputs; no route scaling or asset exceptions were added.

Validation: make verify-issue-1483 passed 16 groups with two explicit external acceptance skips, first/retest; related #1480 passed 10 groups with three scope skips. The focused verifier runs first/retest; recorded rounds include 8 raw-attribution tests, 1 exact book-fee test, 2 same-cohort socket scenarios, 225 frontend tests and eight public-probe tests and seven wallet-preparation tests. The production frontend build passed with the current public Coolify configuration, and tracked/staged secret scans passed. Owned LocalTerra native/wrapped first/retest each passed 12 exact settlements and 24 atomic floor rejections. Additional legacy/v1 pool and 1/5/30% protection matrices passed. The full 4,250-case controlled browser rerun passed with zero failures, 3,948 useful samples and a 236.3 ms maximum against the named 750 ms budget. All related normal verifiers were executed; missing device/contract/IPv6/live scopes and historical failures are explicit in the receipts. Deployment receipts follow.

References #1483. Acceptance checklist, results and retained failures, and agent invariants document the rounding contract, protocol limits and verification scope. Original reporter economics, production settlement, complete contract provenance and physical-wallet acceptance remain incomplete; merging this fix must not close the issue automatically.

Native and wrapped quotes now reconcile wrapper loss, trading costs, market movement and reference divergence in exact final-output units. Swap and Trade show one consistent deviation and a compact explanation; exact raw thresholds and review-bound second-click consent preserve the 5/30/99 safeguards. A pinned regression also proved that deeper search discarded a better route when the improvement was below 0.1%. The worker now publishes every strictly better eligible net result while retaining its work caps and the original reviewed transaction. Exact-amount quote caching already isolates small and large inputs; no route scaling or asset exceptions were added. Validation: `make verify-issue-1483` passed 16 groups with two explicit external acceptance skips, first/retest; related #1480 passed 10 groups with three scope skips. The focused verifier runs first/retest; recorded rounds include 8 raw-attribution tests, 1 exact book-fee test, 2 same-cohort socket scenarios, 225 frontend tests and eight public-probe tests and seven wallet-preparation tests. The production frontend build passed with the current public Coolify configuration, and tracked/staged secret scans passed. Owned LocalTerra native/wrapped first/retest each passed 12 exact settlements and 24 atomic floor rejections. Additional legacy/v1 pool and 1/5/30% protection matrices passed. The full 4,250-case controlled browser rerun passed with zero failures, 3,948 useful samples and a 236.3 ms maximum against the named 750 ms budget. All related normal verifiers were executed; missing device/contract/IPv6/live scopes and historical failures are explicit in the receipts. Deployment receipts follow. References [#1483](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1483). [Acceptance checklist](docs/qa/issue-1483/README.md), [results and retained failures](docs/qa/issue-1483/RESULTS.md), and [agent invariants](skills/AGENTS_ROUTE_COST_ATTRIBUTION.md) document the rounding contract, protocol limits and verification scope. Original reporter economics, production settlement, complete contract provenance and physical-wallet acceptance remain incomplete; merging this fix must not close the issue automatically.
fix: reconcile route costs and preserve better net quotes
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
8227ed351a
Add bounded signed-output attribution, exact protection thresholds and reviewed consent in Swap and Trade. Publish every eligible positive deeper-route improvement and cover amount-bound caches with independent fixtures.
qa: publish verified route economics and API schema
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
eceec0e61a
Document nullable diagnostic fields and exact book commissions. Add bounded live UI checks and current native settlement, rollback, browser and isolation evidence with retained failures.
PlasticDigits changed title from WIP: Reconcile route costs and preserve better quotes to Reconcile route costs and preserve better quotes 2026-10-12 14:52:20 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/cl8y-dex-terraclassic!1484
No description provided.