fix(route-tax): align cyclic launch guards and owned refunds #1410

Merged
PlasticDigits merged 2 commits from fix/1390-route-launch-guards into main 2026-10-06 02:12:01 +00:00
Owner

Fixes #1390.

Routed capable-token cycles could quote successfully and fail on reacquisition; owned input residue could also fail a lowered wallet cap. Reject repeated capable assets in [initial offer, each ask] consistently across execute, forward/reverse quotes, solver eligibility and client preflight. Ordinary intermediate buy/sell funding and per-wallet cooldowns remain enforced.

Authenticate the exact original-input refund to its payer and allow only that restoration to bypass max-wallet. Purchased intermediate residue, final bought output and other recipients stay capped. Token previews and buy/sell execution share protocol-trader restrictions; deterministic solver HTTP 422 stops Swap, wrapped Swap, Trade and invoice fallback. Router/token versions are 1.2.1, funding version remains 1, and older contexts deserialize without a refund exemption.

  • AC1: cyclic capable-token policy aligned and documented; cooldown 0/1/>1, disabled features, zero rates and exemptions tested.
  • AC2: normal intermediate routes succeed; independent/prior-window trades reject and roll back.
  • AC3: original nonzero/zero residue and repeated refunds work above lowered caps; purchased residue, bought output and third-party recipients remain capped.
  • AC4: protocol-exempt preview/preflight rejects; forward/reverse APIs preserve rejection, and UI cannot convert 422 into a fallback quote.
  • Production rollout/code inventory/bounded Columbus-5 execution: unverified, explicitly skipped.

Validation at 15d6266a18a29d3c750827d91b5323a60483f42c: make verify-issue-1390 PASS=15 FAIL=0 SKIP=1; make verify-issue-1381 PASS=13 FAIL=0 SKIP=1. Both run tests and retests. Includes full contracts, 473 serial indexer library tests, API regressions, frontend 246/269-test groups, lint/types/build, real pre-v1 migrations, invoice/native wrap/unwrap and rollback. Latest focused contract tests retested after Clippy cleanup; rebuilt optimized hashes match the executed synthetic receipts. Pre-commit Clippy, formatting and secret scan passed.

Agent review/verification checklist, invariants and third-party agent playbook, results and public synthetic receipts, source/evidence manifest.

Reviewing agents may skip items they cannot complete while recording overall PASS with explicit skips, concrete reasons and unverified criteria. Executed failures remain FAIL until fixed and retested. The sole final skip is production acceptance; local execution does not establish deployment.

Fixes #1390. Routed capable-token cycles could quote successfully and fail on reacquisition; owned input residue could also fail a lowered wallet cap. Reject repeated capable assets in `[initial offer, each ask]` consistently across execute, forward/reverse quotes, solver eligibility and client preflight. Ordinary intermediate buy/sell funding and per-wallet cooldowns remain enforced. Authenticate the exact original-input refund to its payer and allow only that restoration to bypass max-wallet. Purchased intermediate residue, final bought output and other recipients stay capped. Token previews and buy/sell execution share protocol-trader restrictions; deterministic solver HTTP 422 stops Swap, wrapped Swap, Trade and invoice fallback. Router/token versions are 1.2.1, funding version remains 1, and older contexts deserialize without a refund exemption. - [x] AC1: cyclic capable-token policy aligned and documented; cooldown 0/1/>1, disabled features, zero rates and exemptions tested. - [x] AC2: normal intermediate routes succeed; independent/prior-window trades reject and roll back. - [x] AC3: original nonzero/zero residue and repeated refunds work above lowered caps; purchased residue, bought output and third-party recipients remain capped. - [x] AC4: protocol-exempt preview/preflight rejects; forward/reverse APIs preserve rejection, and UI cannot convert 422 into a fallback quote. - [ ] Production rollout/code inventory/bounded Columbus-5 execution: unverified, explicitly skipped. Validation at `15d6266a18a29d3c750827d91b5323a60483f42c`: `make verify-issue-1390` **PASS=15 FAIL=0 SKIP=1**; `make verify-issue-1381` **PASS=13 FAIL=0 SKIP=1**. Both run tests and retests. Includes full contracts, 473 serial indexer library tests, API regressions, frontend 246/269-test groups, lint/types/build, real pre-v1 migrations, invoice/native wrap/unwrap and rollback. Latest focused contract tests retested after Clippy cleanup; rebuilt optimized hashes match the executed synthetic receipts. Pre-commit Clippy, formatting and secret scan passed. [Agent review/verification checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/15d6266a18a29d3c750827d91b5323a60483f42c/docs/qa/issue-1390/README.md), [invariants and third-party agent playbook](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/15d6266a18a29d3c750827d91b5323a60483f42c/skills/AGENTS_ROUTE_LAUNCH_GUARDS.md), [results and public synthetic receipts](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/15d6266a18a29d3c750827d91b5323a60483f42c/docs/qa/issue-1390/RESULTS.md), [source/evidence manifest](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/15d6266a18a29d3c750827d91b5323a60483f42c/docs/qa/issue-1390/verification-manifest.json). Reviewing agents may skip items they cannot complete while recording overall PASS with explicit skips, concrete reasons and unverified criteria. Executed failures remain FAIL until fixed and retested. The sole final skip is production acceptance; local execution does not establish deployment.
fix(route-tax): align cyclic guards and owned refunds
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
15d6266a18
Reject repeated capable assets across routed quotes and execution. Bind owned input restoration to live route state and retain caps on acquired value. Preserve deterministic preview rejection through solver and frontend flows.
Combine launch guards with router trust lifecycle [skip ci]
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
137e9e12cf
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!1410
No description provided.