fix(trading): use >5% order slippage or >10% total deviation for risk warnings and reduce alert fatigue #1560

Open
opened 2026-10-19 02:53:31 +00:00 by PlasticDigits · 3 comments
Owner

Problem and requested behavior

The trading form raises a red fair-reference warning for an otherwise ordinary quote with expected order slippage 3.34%, trading fee 1.71%, and total fair-reference deviation 6.91%. This creates warning/confirmation fatigue and conflicts with the cognitive-load policy. These are three different metrics; adding the displayed slippage and fee is not the total reference comparison.

Use one consistent warning/review rule across Swap and shared Trade market execution:

  • Warn when validated expected order slippage >5% OR total symmetric fair-reference deviation >10%.
  • Exactly 5% order slippage and exactly 10% total deviation do not cross those warning thresholds. Compare original economics before display rounding.
  • A quote with 3.34% order slippage and 6.91% total deviation has no risk warning or extra risk-confirmation step. Keep the factual comparison available in DETAILS.
  • Preserve the independent >30% fair-reference Expert requirement and >=99% symmetric nonwaivable refusal, including favorable fair-reference deviations. Order slippage remains signed: favorable order improvement is not positive slippage.

This is a targeted change to warning and ordinary review policy, not a general removal of safety controls. The companion #1561 mobile layout and inline-status issue handles rendering.

Current codebase and investigation

Inspected main at b7b08736; the remote main revision matched during investigation on 2026-10-19. Evidence here is sanitized source analysis; no reporter identity, conversation, account, wallet, or attachment is published.

  • frontend-dapp/src/utils/swapPayAcquireGuidance.ts: SWAP_FUNDED_HIGH_IMPACT_PCT = 5; funded guidance classifies expectedSlippagePct above this aggregate threshold as high impact.
  • frontend-dapp/src/components/swap/SwapImpactAside.tsx: only receives routeSlippagePct; uses that 5% constant to emit Fair-reference deviation ... with role="alert". It cannot currently distinguish low order slippage from aggregate loss/reference divergence.
  • frontend-dapp/src/pages/SwapPage.tsx: expectedSlippagePct resolves routeSlippagePercent with a legacy worst-hop fallback. The same >5 aggregate check appears in notice selection, CTA first-click review, and the mutation guard. Updating only the visual component would leave extra confirmation and inconsistent refusal behavior.
  • frontend-dapp/src/components/trade/TradeMarketOrderPanel.tsx: duplicates the >5 aggregate check in needsImpactConsent, notice selection, review binding, and submission.
  • frontend-dapp/src/utils/routeOrderMetrics.ts: independently validates selected-route fee-free economics and returns signed orderSlippagePercent; its integer ratios are converted to JavaScript numbers. That advisory display number is not yet a safe exact boundary predicate.
  • frontend-dapp/src/utils/swapRouteSlippage.ts: preciseFairDeviationPercent and formatTradingPriceDifference explicitly protect 5/30/99 boundaries; a new 10% transition needs exact handling too. swapQuoteAmountScale.ts contains the independent 30/99 submit rules.
  • indexer/src/api/local_quote/order_economics.rs and the frontend validator already distinguish fee-free order movement from trading/tax/hook/wrapper/reference components. Preserve that contract rather than relabeling the aggregate.

Related policy-noise audit findings to address in this bundle:

  1. Warning, extra click, funded high-impact guidance, mutation guard and Trade use the same old aggregate threshold. Centralize the actual policy, not just its constant name.
  2. Swap nests alert children under a polite live status region and always prints a checked None for settled no-notice states. Audit transition announcements for duplicate/interruption noise; keep stable reserved geometry without an always-visible no-error message. Announce meaningful state changes once, not on identical background refreshes.
  3. slippageSeverityClass marks values >1% amber, and INDEXER_WALLET_AMOUNT_MISMATCH_WARN_PCT is 0.1%; neither currently has production callers found in this checkout. Record this distinction; do not claim these inactive helpers caused the reported warning or mechanically weaken unrelated validation. Audit any active equivalents before adding new thresholds.
  4. The generic ToastContext.tsx has a 6000ms timer, but both Swap and Trade set toastOnError: false and retain inline errors. Do not replace these persistent failures with a timed toast. Check duplicate notifications for the touched flows rather than changing unrelated pages speculatively.

Relevant tests/policy: SwapImpactAside.test.tsx, SwapPage.test.tsx, SwapPage.acquireGuidance.test.tsx, TradeMarketOrderPanel.submitSnapshot.test.tsx, swapRouteSlippage.test.ts, routeOrderMetrics.test.ts, utils/tradingNotice.ts, docs/design-system.md, docs/route-solver.md, skills/AGENTS_ORDER_SLIPPAGE.md, skills/AGENTS_ROUTE_COST_ATTRIBUTION.md, skills/AGENTS_SWAP_LAYOUT.md, and skills/AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md.

Source entry points: SwapImpactAside.tsx, swapRouteSlippage.ts, routeOrderMetrics.ts.

Why a new implementation is needed

The previous 5% rule measured total fair/net difference, while the current headline now measures fee-free order slippage. Using the old aggregate threshold for every ordinary warning makes the lower, correctly separated order metric appear inconsistent and makes red errors routine. A single policy evaluator and consistent review behavior are needed so the visible reason, required acknowledgement, and final guard agree.

  • Introduce a shared, typed evaluator with explicit order slippage, total symmetric deviation, availability, and reason/severity. Prefer checked original numerator/denominator comparisons for 5/10/30/99 transitions, not toFixed, binary floats, tolerance settings, worst-hop spread, or server-provided labels. Extend validated evidence only if needed; do not trust an unvalidated diagnostic as a signing authority.
  • Apply the evaluator to Swap/Trade notices, funded guidance, review first-click behavior, confirmation wording and mutation-time checks. Below both new thresholds, avoid an extra risk-consent click. Above either, show one short accurate reason and retain quote-bound review without a fast reaction deadline. If both trigger, use one notice with concise wording, with metric detail in DETAILS.
  • Bind review to the original account, exact identities/amount/direction, selected operations, policy/tolerance, original observation/expiry, generation and the validated risk evidence. A material change revokes acceptance; an unchanged fresh background refresh must not repeatedly announce or reset consent unnecessarily.
  • Missing, malformed, unsupported, stale or contradictory evidence stays unavailable, never 0%, safe, or silently replaced by a lower legacy metric. Specify the unavailable classification and retain fail-closed execution where required evidence cannot establish the risk class; missing diagnostics cannot bypass consent or any existing admission guard. No additional quote-triggered RPC or polling.
  • Explicitly supersede the ordinary >5% aggregate warning/consent statements in OS1500-8, related RC1483 guidance, frontend/API docs and tests with >5% order / >10% total. Keep >30 and >=99 fair-reference controls and original reference admission intact. This issue supplies the requested product-policy change; do not leave old conflicting instructions forcing the bug back in.
  • Preserve the 30-minute reviewed local signing window, independently admitted references, exact delivered-net ranking, selected quote-relative tolerance, positive post-hook/hop/final floors, original offline observations/expiry, amount/actor binding, tax funding/refunds, pause/freeze/blacklist, native gas/Max parity and no duplicate broadcast. Fees or favorable movements cannot cancel a required total-deviation warning.
  • Preserve persistent actionable blocking text, accessible names/focus and required risk/trust disclosures. Avoid repeated alert announcements; no colour-only or sound-only failures. No identity/amount/symbol exceptions.

Acceptance criteria

  • AC1: One documented shared evaluator drives warnings and ordinary quote-bound consent in both Swap and Trade, using order >5 OR total >10 with exact strict boundaries.
  • AC2: The 3.34% / 1.71% / 6.91% control has no warning or extra risk-confirmation click; DETAILS retains truthful numbers. Order >5 with total <=10 and total >10 with order <=5 each produce one correctly named notice and review.
  • AC3: >30 fair-reference Expert review and >=99 nonwaivable refusal pass for unfavorable and favorable deviations. Expert mode never waives the extreme rule or other signing controls.
  • AC4: Missing/forged/stale risk evidence never becomes zero, safe status, waived consent or signing permission. No new request-time network validation or renewed original expiry.
  • AC5: The adjacent noise audit records active versus inactive findings and removes confirmed redundant normal-state/duplicate announcements. Required blockers persist and are announced once per meaningful transition.
  • AC6: Quote-bound consent and submission agree after edits, route promotion, background refresh, Expert/tolerance changes, expiry, wallet/network changes and failure recovery; unchanged observations do not demand repeated acknowledgement.
  • AC7: Policy/docs/agent guidance and tests reflect the targeted supersession and preserve all other economic/reference/accessibility guards.

Test plan: functional paths

Path Required checks
Boundary truth table Order below/equal/just above 5 crossed with total below/equal/just above 10; order-negative/favorable; total favorable and unfavorable; both triggers; zero. Include 4.999..., 5, 5.000..., 9.999..., 10, 10.000..., >30 and >=99, plus one-raw-unit crossings at large Uint128 amounts that render the same rounded percentage. Independently calculate expected ratios.
Components isolated Fee-only, wrapper-only, tax/hook-only, independent-reference-only, pure pool size impact, favorable book execution, mixed/offsetting effects. Never sum fee and order percentages to decide total deviation.
Execution families Direct, 2/3/4-hop, native/wrapped boundaries, supported pool/book/hybrid/manual splits, both pay and receive sizing, 6/9/12/18 decimals, dust/ordinary/large amounts, arbitrary assets and both directions. Direct wrap/unwrap and unsupported diagnostics need explicit classification.
UI/review Disconnected preview/connect, funded/unfunded wallets, default/Expert, expanded/collapsed DETAILS, initial loading, same-intent refresh, new intent, deferred improvement, transport/provider rejection, retained quote, expiry, retry, pre-sign rejection, uncertain broadcast recovery. Prove notices and first-click/mutation guards agree.
Accessibility Keyboard and screen-reader transitions; unchanged polling does not repeat alerts; blockers remain textual/persistent; exactly one actionable notice; reduced motion/audio off; 200% text zoom, both themes.

Test plan: attacks, hacks and abuse

  • Forge a small orderSlippagePercent, strip/alter original order economics, change raw denominators/signs, mismatch hops/generation/direction/account or pair identities, and replay accepted review on a new quote. Reject or remain unavailable without lowering actual risk.
  • Exercise NaN/Infinity, malformed strings, negative total values, zero denominators, overflow and extreme integers. Rounding or Number conversion must not bypass 5/10/30/99 transitions.
  • Use favorable reference divergence, high fees/taxes or an offsetting book improvement to hide one triggered predicate; ensure the OR rule and symmetric total protection still apply.
  • Race edit/refresh/route promotion/wallet switch/expiry against two-step review; rapidly repeat clicks and retry after ambiguous broadcast. No stale consent, no automatic resend or duplicate execution.
  • Flood identical quote/error updates; assert bounded notices and no live-region storm while a real blocker remains visible. Inject HTML/long control-character token/provider strings; render escaped concise text without identities or raw provider output leaking.

Verification criteria

Run updated make verify-issue-1500, make verify-issue-1498, and applicable verify-issue-1483, 1489, 1473, 1480, 1452 regression suites, plus frontend types/lint and a production-build Swap/Trade browser check. Verify against the explicit truth table rather than retaining tests that encode the old policy. Run accessibility checks on touched flows and capture sanitized before/after metrics, notice count and review outcomes on the final revision.

Executed failures remain failures; unavailable live/device/funded checks are explicitly listed with their scope and do not block filing this issue. Source or synthetic-browser passes do not prove deployed or funded acceptance. No conversation screenshots, reporter data, credentials or wallet/session identifiers belong in receipts. The implementation can proceed without re-requesting product approval for the thresholds specified here.

Related work: #1498 stable layout, #1500 distinct order metrics, and #1330 executable-route presentation. This follow-up does not expand route search or replace net-output ranking.

Investigation verification receipts (2026-10-19)

  • make verify-issue-1500: FAIL overall on the unmodified revision. First and retest each passed 6 independent order-economics tests, 1 manual-split identity test, and 143 frontend tests in 8 files; frontend types and invariant/documentation checks passed. cargo fmt --check failed in indexer/src/api/local_quote.rs and indexer/src/db/queries/hub_prices.rs under rustfmt 1.10.0. This existing formatting failure is retained, not reclassified as a skip or repaired as part of issue filing. Two declared deployed/funded/device scopes remain unverified.
  • Source confirms the observed 6.91% notice follows the old >5% total-deviation condition; the unchanged component/page tests currently encode that older rule. The low-slippage report is not claimed as a fresh live-chain quote. The companion layout investigation separately reproduced the initial 375×667 CTA defect using synthetic production-build browser evidence.
  • make verify-issue-1498: PASS WITH SKIPS, 9 passed / 0 failed / 1 skipped. First/retest each passed 145 frontend tests in 8 files; the production-build geometry fixture passed 9 scenarios at each of 1440/320/390/430 widths with height 1000, including 200% root text, and types/crosslinks/stable-source checks passed. The declared live-artifact/device/funded scope was skipped. These passes do not exercise the missing 375×667 initial-CTA criterion.
## Problem and requested behavior The trading form raises a red fair-reference warning for an otherwise ordinary quote with expected order slippage 3.34%, trading fee 1.71%, and total fair-reference deviation 6.91%. This creates warning/confirmation fatigue and conflicts with the cognitive-load policy. These are three different metrics; adding the displayed slippage and fee is not the total reference comparison. Use one consistent warning/review rule across Swap and shared Trade market execution: - Warn when validated expected **order slippage >5% OR total symmetric fair-reference deviation >10%**. - Exactly 5% order slippage and exactly 10% total deviation do not cross those warning thresholds. Compare original economics before display rounding. - A quote with 3.34% order slippage and 6.91% total deviation has no risk warning or extra risk-confirmation step. Keep the factual comparison available in DETAILS. - Preserve the independent **>30% fair-reference Expert requirement** and **>=99% symmetric nonwaivable refusal**, including favorable fair-reference deviations. Order slippage remains signed: favorable order improvement is not positive slippage. This is a targeted change to warning and ordinary review policy, not a general removal of safety controls. The companion [#1561 mobile layout and inline-status issue](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1561) handles rendering. ## Current codebase and investigation Inspected [main at b7b08736](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/b7b08736b3529af344a693ae6d16236a4f324c13); the remote main revision matched during investigation on 2026-10-19. Evidence here is sanitized source analysis; no reporter identity, conversation, account, wallet, or attachment is published. - `frontend-dapp/src/utils/swapPayAcquireGuidance.ts`: `SWAP_FUNDED_HIGH_IMPACT_PCT = 5`; funded guidance classifies `expectedSlippagePct` above this aggregate threshold as high impact. - `frontend-dapp/src/components/swap/SwapImpactAside.tsx`: only receives `routeSlippagePct`; uses that 5% constant to emit `Fair-reference deviation ...` with `role="alert"`. It cannot currently distinguish low order slippage from aggregate loss/reference divergence. - `frontend-dapp/src/pages/SwapPage.tsx`: `expectedSlippagePct` resolves `routeSlippagePercent` with a legacy worst-hop fallback. The same >5 aggregate check appears in notice selection, CTA first-click review, and the mutation guard. Updating only the visual component would leave extra confirmation and inconsistent refusal behavior. - `frontend-dapp/src/components/trade/TradeMarketOrderPanel.tsx`: duplicates the >5 aggregate check in `needsImpactConsent`, notice selection, review binding, and submission. - `frontend-dapp/src/utils/routeOrderMetrics.ts`: independently validates selected-route fee-free economics and returns signed `orderSlippagePercent`; its integer ratios are converted to JavaScript numbers. That advisory display number is not yet a safe exact boundary predicate. - `frontend-dapp/src/utils/swapRouteSlippage.ts`: `preciseFairDeviationPercent` and `formatTradingPriceDifference` explicitly protect 5/30/99 boundaries; a new 10% transition needs exact handling too. `swapQuoteAmountScale.ts` contains the independent 30/99 submit rules. - `indexer/src/api/local_quote/order_economics.rs` and the frontend validator already distinguish fee-free order movement from trading/tax/hook/wrapper/reference components. Preserve that contract rather than relabeling the aggregate. Related policy-noise audit findings to address in this bundle: 1. Warning, extra click, funded high-impact guidance, mutation guard and Trade use the same old aggregate threshold. Centralize the actual policy, not just its constant name. 2. Swap nests alert children under a polite live status region and always prints a checked `None` for settled no-notice states. Audit transition announcements for duplicate/interruption noise; keep stable reserved geometry without an always-visible no-error message. Announce meaningful state changes once, not on identical background refreshes. 3. `slippageSeverityClass` marks values >1% amber, and `INDEXER_WALLET_AMOUNT_MISMATCH_WARN_PCT` is 0.1%; neither currently has production callers found in this checkout. Record this distinction; do not claim these inactive helpers caused the reported warning or mechanically weaken unrelated validation. Audit any active equivalents before adding new thresholds. 4. The generic `ToastContext.tsx` has a 6000ms timer, but both Swap and Trade set `toastOnError: false` and retain inline errors. Do not replace these persistent failures with a timed toast. Check duplicate notifications for the touched flows rather than changing unrelated pages speculatively. Relevant tests/policy: `SwapImpactAside.test.tsx`, `SwapPage.test.tsx`, `SwapPage.acquireGuidance.test.tsx`, `TradeMarketOrderPanel.submitSnapshot.test.tsx`, `swapRouteSlippage.test.ts`, `routeOrderMetrics.test.ts`, `utils/tradingNotice.ts`, `docs/design-system.md`, `docs/route-solver.md`, `skills/AGENTS_ORDER_SLIPPAGE.md`, `skills/AGENTS_ROUTE_COST_ATTRIBUTION.md`, `skills/AGENTS_SWAP_LAYOUT.md`, and `skills/AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md`. Source entry points: [SwapImpactAside.tsx](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/b7b08736b3529af344a693ae6d16236a4f324c13/frontend-dapp/src/components/swap/SwapImpactAside.tsx), [swapRouteSlippage.ts](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/b7b08736b3529af344a693ae6d16236a4f324c13/frontend-dapp/src/utils/swapRouteSlippage.ts), [routeOrderMetrics.ts](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/b7b08736b3529af344a693ae6d16236a4f324c13/frontend-dapp/src/utils/routeOrderMetrics.ts). ## Why a new implementation is needed The previous 5% rule measured total fair/net difference, while the current headline now measures fee-free order slippage. Using the old aggregate threshold for every ordinary warning makes the lower, correctly separated order metric appear inconsistent and makes red errors routine. A single policy evaluator and consistent review behavior are needed so the visible reason, required acknowledgement, and final guard agree. ## Recommended direction and guardrails - Introduce a shared, typed evaluator with explicit order slippage, total symmetric deviation, availability, and reason/severity. Prefer checked original numerator/denominator comparisons for 5/10/30/99 transitions, not `toFixed`, binary floats, tolerance settings, worst-hop spread, or server-provided labels. Extend validated evidence only if needed; do not trust an unvalidated diagnostic as a signing authority. - Apply the evaluator to Swap/Trade notices, funded guidance, review first-click behavior, confirmation wording and mutation-time checks. Below both new thresholds, avoid an extra risk-consent click. Above either, show one short accurate reason and retain quote-bound review without a fast reaction deadline. If both trigger, use one notice with concise wording, with metric detail in DETAILS. - Bind review to the original account, exact identities/amount/direction, selected operations, policy/tolerance, original observation/expiry, generation and the validated risk evidence. A material change revokes acceptance; an unchanged fresh background refresh must not repeatedly announce or reset consent unnecessarily. - Missing, malformed, unsupported, stale or contradictory evidence stays unavailable, never 0%, safe, or silently replaced by a lower legacy metric. Specify the unavailable classification and retain fail-closed execution where required evidence cannot establish the risk class; missing diagnostics cannot bypass consent or any existing admission guard. No additional quote-triggered RPC or polling. - Explicitly supersede the **ordinary >5% aggregate warning/consent** statements in OS1500-8, related RC1483 guidance, frontend/API docs and tests with **>5% order / >10% total**. Keep >30 and >=99 fair-reference controls and original reference admission intact. This issue supplies the requested product-policy change; do not leave old conflicting instructions forcing the bug back in. - Preserve the 30-minute reviewed local signing window, independently admitted references, exact delivered-net ranking, selected quote-relative tolerance, positive post-hook/hop/final floors, original offline observations/expiry, amount/actor binding, tax funding/refunds, pause/freeze/blacklist, native gas/Max parity and no duplicate broadcast. Fees or favorable movements cannot cancel a required total-deviation warning. - Preserve persistent actionable blocking text, accessible names/focus and required risk/trust disclosures. Avoid repeated alert announcements; no colour-only or sound-only failures. No identity/amount/symbol exceptions. ## Acceptance criteria - [ ] AC1: One documented shared evaluator drives warnings and ordinary quote-bound consent in both Swap and Trade, using `order >5 OR total >10` with exact strict boundaries. - [ ] AC2: The 3.34% / 1.71% / 6.91% control has no warning or extra risk-confirmation click; DETAILS retains truthful numbers. Order >5 with total <=10 and total >10 with order <=5 each produce one correctly named notice and review. - [ ] AC3: >30 fair-reference Expert review and >=99 nonwaivable refusal pass for unfavorable and favorable deviations. Expert mode never waives the extreme rule or other signing controls. - [ ] AC4: Missing/forged/stale risk evidence never becomes zero, safe status, waived consent or signing permission. No new request-time network validation or renewed original expiry. - [ ] AC5: The adjacent noise audit records active versus inactive findings and removes confirmed redundant normal-state/duplicate announcements. Required blockers persist and are announced once per meaningful transition. - [ ] AC6: Quote-bound consent and submission agree after edits, route promotion, background refresh, Expert/tolerance changes, expiry, wallet/network changes and failure recovery; unchanged observations do not demand repeated acknowledgement. - [ ] AC7: Policy/docs/agent guidance and tests reflect the targeted supersession and preserve all other economic/reference/accessibility guards. ## Test plan: functional paths | Path | Required checks | | --- | --- | | Boundary truth table | Order below/equal/just above 5 crossed with total below/equal/just above 10; order-negative/favorable; total favorable and unfavorable; both triggers; zero. Include 4.999..., 5, 5.000..., 9.999..., 10, 10.000..., >30 and >=99, plus one-raw-unit crossings at large Uint128 amounts that render the same rounded percentage. Independently calculate expected ratios. | | Components isolated | Fee-only, wrapper-only, tax/hook-only, independent-reference-only, pure pool size impact, favorable book execution, mixed/offsetting effects. Never sum fee and order percentages to decide total deviation. | | Execution families | Direct, 2/3/4-hop, native/wrapped boundaries, supported pool/book/hybrid/manual splits, both pay and receive sizing, 6/9/12/18 decimals, dust/ordinary/large amounts, arbitrary assets and both directions. Direct wrap/unwrap and unsupported diagnostics need explicit classification. | | UI/review | Disconnected preview/connect, funded/unfunded wallets, default/Expert, expanded/collapsed DETAILS, initial loading, same-intent refresh, new intent, deferred improvement, transport/provider rejection, retained quote, expiry, retry, pre-sign rejection, uncertain broadcast recovery. Prove notices and first-click/mutation guards agree. | | Accessibility | Keyboard and screen-reader transitions; unchanged polling does not repeat alerts; blockers remain textual/persistent; exactly one actionable notice; reduced motion/audio off; 200% text zoom, both themes. | ## Test plan: attacks, hacks and abuse - Forge a small `orderSlippagePercent`, strip/alter original order economics, change raw denominators/signs, mismatch hops/generation/direction/account or pair identities, and replay accepted review on a new quote. Reject or remain unavailable without lowering actual risk. - Exercise NaN/Infinity, malformed strings, negative total values, zero denominators, overflow and extreme integers. Rounding or Number conversion must not bypass 5/10/30/99 transitions. - Use favorable reference divergence, high fees/taxes or an offsetting book improvement to hide one triggered predicate; ensure the OR rule and symmetric total protection still apply. - Race edit/refresh/route promotion/wallet switch/expiry against two-step review; rapidly repeat clicks and retry after ambiguous broadcast. No stale consent, no automatic resend or duplicate execution. - Flood identical quote/error updates; assert bounded notices and no live-region storm while a real blocker remains visible. Inject HTML/long control-character token/provider strings; render escaped concise text without identities or raw provider output leaking. ## Verification criteria Run updated `make verify-issue-1500`, `make verify-issue-1498`, and applicable `verify-issue-1483`, `1489`, `1473`, `1480`, `1452` regression suites, plus frontend types/lint and a production-build Swap/Trade browser check. Verify against the explicit truth table rather than retaining tests that encode the old policy. Run accessibility checks on touched flows and capture sanitized before/after metrics, notice count and review outcomes on the final revision. Executed failures remain failures; unavailable live/device/funded checks are explicitly listed with their scope and do not block filing this issue. Source or synthetic-browser passes do not prove deployed or funded acceptance. No conversation screenshots, reporter data, credentials or wallet/session identifiers belong in receipts. The implementation can proceed without re-requesting product approval for the thresholds specified here. Related work: [#1498 stable layout](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1498), [#1500 distinct order metrics](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1500), and [#1330 executable-route presentation](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1330). This follow-up does not expand route search or replace net-output ranking. ## Investigation verification receipts (2026-10-19) - `make verify-issue-1500`: **FAIL overall** on the unmodified revision. First and retest each passed 6 independent order-economics tests, 1 manual-split identity test, and 143 frontend tests in 8 files; frontend types and invariant/documentation checks passed. `cargo fmt --check` failed in `indexer/src/api/local_quote.rs` and `indexer/src/db/queries/hub_prices.rs` under rustfmt 1.10.0. This existing formatting failure is retained, not reclassified as a skip or repaired as part of issue filing. Two declared deployed/funded/device scopes remain unverified. - Source confirms the observed 6.91% notice follows the old >5% total-deviation condition; the unchanged component/page tests currently encode that older rule. The low-slippage report is not claimed as a fresh live-chain quote. The companion layout investigation separately reproduced the initial 375×667 CTA defect using synthetic production-build browser evidence. - `make verify-issue-1498`: **PASS WITH SKIPS**, 9 passed / 0 failed / 1 skipped. First/retest each passed 145 frontend tests in 8 files; the production-build geometry fixture passed 9 scenarios at each of 1440/320/390/430 widths with height 1000, including 200% root text, and types/crosslinks/stable-source checks passed. The declared live-artifact/device/funded scope was skipped. These passes do not exercise the missing 375×667 initial-CTA criterion.
Author
Owner

Implemented, tested and deployed through PR #1562; PR #1563 records live evidence and fixes the release observer. Frontend deployment qvplhwapjhqfxd2mm8lfnzua finished at 6a5118ffc2a3bf71b4ad638226d48228bd2eb64a.

Completed implementation criteria, within the recorded automated scope:

  • AC1: One validated integer evaluator drives Swap/Trade warnings, funded guidance, ordinary review and final submission: signed order >5 OR symmetric total >10, strictly before rounding.
  • AC2: The 3.34/1.71/6.91 arithmetic control has no warning/extra consent. Separate order, total and combined triggers have one accurate reason; factual DETAILS remain.
  • AC3: Exact favorable/unfavorable >30 Expert and >=99 nonwaivable protections pass, including one-raw-unit Uint128 crossings.
  • AC4: Missing, forged, contradictory, unsupported and expired evidence fails closed. Supported direct wrappers revalidate structural zero movement; original observation/deadline and offline execution remain.
  • AC5: Active/inactive noise audit documented; settled None and nested live alerts removed; persistent blockers and polite risk notices retained. Physical screen-reader behavior remains unverified below.
  • AC6: Review binds original account/intent/operations/economics. Automatic arithmetic/promotion stays pinned during unexpired review; edits and expiry revoke it. Fake-time 25s and production-browser 12s controls prove no repeated quote request/consent deadline; original expiry still revokes and refresh resumes.
  • AC7: Policy, API/frontend docs, agent guidance and relevant regression coverage updated. Final 1500 runs each pass 171 frontend tests; final 1498 runs each pass 160. Types, lint, hooks, relevant Rust/source checks and production browser checks pass. Every test process was bounded below 60s; skipped unchanged/full suites are documented.

Live native USTC→CL8Y Swap and wrapped Trade previews pass with no risk notice on the sampled low-risk quotes, zero runtime errors and zero serious/critical axe findings. This does not claim a fresh reproduction of the historical 3.34% quote. Fresh Grafana/Loki/Prometheus checks pass for both exact DEX jobs; API health/serving stayed HTTP200 and backend source is unchanged. Indexer readiness was separately 0 in the final monitoring sample and is retained independently. Coolify started the new frontend at 04:21:33 UTC before removing old containers at 04:21:38 UTC; no outage was observed.

Remaining acceptance:

  • Complete funded execution/decimal/amount/manual-route/abuse matrix, physical signing and assistive-device trials.
  • Full repository-wide CI was pending at merge; your explicit gate override was used after bounded local checks. CI is not reported PASS.

Both issues remain open because the full verification criteria are not all proven. Physical phone reachability is assigned in cl8y-pm Inbox, card 3fff415d-9cc2-42b1-b635-37e0be4fd0f7, with no transaction signing requested. Results, screenshots, failed loops/retests and exact skipped scopes.

Implemented, tested and deployed through [PR #1562](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1562); [PR #1563](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1563) records live evidence and fixes the release observer. Frontend deployment `qvplhwapjhqfxd2mm8lfnzua` finished at `6a5118ffc2a3bf71b4ad638226d48228bd2eb64a`. Completed implementation criteria, within the recorded automated scope: - [x] AC1: One validated integer evaluator drives Swap/Trade warnings, funded guidance, ordinary review and final submission: signed order >5 OR symmetric total >10, strictly before rounding. - [x] AC2: The 3.34/1.71/6.91 arithmetic control has no warning/extra consent. Separate order, total and combined triggers have one accurate reason; factual DETAILS remain. - [x] AC3: Exact favorable/unfavorable >30 Expert and >=99 nonwaivable protections pass, including one-raw-unit Uint128 crossings. - [x] AC4: Missing, forged, contradictory, unsupported and expired evidence fails closed. Supported direct wrappers revalidate structural zero movement; original observation/deadline and offline execution remain. - [x] AC5: Active/inactive noise audit documented; settled None and nested live alerts removed; persistent blockers and polite risk notices retained. Physical screen-reader behavior remains unverified below. - [x] AC6: Review binds original account/intent/operations/economics. Automatic arithmetic/promotion stays pinned during unexpired review; edits and expiry revoke it. Fake-time 25s and production-browser 12s controls prove no repeated quote request/consent deadline; original expiry still revokes and refresh resumes. - [x] AC7: Policy, API/frontend docs, agent guidance and relevant regression coverage updated. Final 1500 runs each pass 171 frontend tests; final 1498 runs each pass 160. Types, lint, hooks, relevant Rust/source checks and production browser checks pass. Every test process was bounded below 60s; skipped unchanged/full suites are documented. Live native USTC→CL8Y Swap and wrapped Trade previews pass with no risk notice on the sampled low-risk quotes, zero runtime errors and zero serious/critical axe findings. This does not claim a fresh reproduction of the historical 3.34% quote. Fresh Grafana/Loki/Prometheus checks pass for both exact DEX jobs; API health/serving stayed HTTP200 and backend source is unchanged. Indexer readiness was separately 0 in the final monitoring sample and is retained independently. Coolify started the new frontend at 04:21:33 UTC before removing old containers at 04:21:38 UTC; no outage was observed. Remaining acceptance: - [ ] Complete funded execution/decimal/amount/manual-route/abuse matrix, physical signing and assistive-device trials. - [ ] Full repository-wide CI was pending at merge; your explicit gate override was used after bounded local checks. CI is not reported PASS. Both issues remain open because the full verification criteria are not all proven. Physical phone reachability is assigned in [cl8y-pm Inbox](https://pm.cl8y.com/inbox), card `3fff415d-9cc2-42b1-b635-37e0be4fd0f7`, with no transaction signing requested. [Results, screenshots, failed loops/retests and exact skipped scopes](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issues-1560-1561/RESULTS.md).
Author
Owner

Follow-up correction: the previous release still rendered the checked None status despite the audit's stated intent. PR #1564, now deployed, makes the quiet placeholder empty and aria-hidden; real pricing/blocking states retain their announcements. The related mobile footer/centering and compact right-aligned route corrections are live too.

Risk thresholds, original reviewed expiry, pinned consent and execution guards are unchanged. Relevant source tests and live native Swap/wrapped Trade previews pass; zero runtime errors and serious/critical axe findings. Live evidence and precise remaining scope. Full funded/physical/CI acceptance remains unverified; keep this issue open.

Follow-up correction: the previous release still rendered the checked None status despite the audit's stated intent. [PR #1564](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1564), now deployed, makes the quiet placeholder empty and aria-hidden; real pricing/blocking states retain their announcements. The related mobile footer/centering and compact right-aligned route corrections are live too. Risk thresholds, original reviewed expiry, pinned consent and execution guards are unchanged. Relevant source tests and live native Swap/wrapped Trade previews pass; zero runtime errors and serious/critical axe findings. [Live evidence and precise remaining scope](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issues-1560-1561/MOBILE-CENTERING.md). Full funded/physical/CI acceptance remains unverified; keep this issue open.
Author
Owner

PR #1566 implements both follow-up reports: compact all-device error leading, with inline Expert/Cancel actions that retain 44px hit targets; and direction switching that moves the exact current receive amount into the new pay field. Example: 10 CL8Y → 5.40572 SpaceUSD becomes 5.40572 SpaceUSD input for the reverse quote. Missing/expired output clears rather than carrying the old denomination. Old book budgets/review consent are cleared; signing safeguards stay enforced.

Verification checklist:

  • Exact 6/18-decimal and >2^53 amounts, original expiry, stale drafts/refresh, receive edits and long-value editing.

  • 186 Swap/layout tests and 171 metric tests on each verifier run, 161 Trade tests; types, focused lint and normal commit hooks.

  • Source-matched production browser status at 375/768/1440 widths: 16.2px leading on 12px text, 32.4–46.3px tested status heights, actual 44px hit tests, keyboard Expert modal/focus return, zero serious/critical axe findings.

  • Compact mobile centering/footer/route spacing, connected CTA clearance and 200% text regressions.

  • Coolify frontend bd2b4ba508d08bf8632b164c82ae02cff1284be0, deployment wezykqhxcuhuvdilkmbyogla, finished. Public frontend/API health/serving samples stayed HTTP200; backend unchanged.

  • Live phone/desktop switch: output 0.851568201759174334 became new pay, reverse request raw 851568201759174334, HTTP200. Compact status leading/minimum 16.2/32.4px; mobile footer hidden, form centered and route flush-right. No runtime errors or serious/critical axe findings; wrapped Trade preview also passed.

  • Deployment logs reviewed: 75 entries, two exact cleanup messages. The conservative checker’s one additional keyword FAIL was the exact public merge subject containing “error spacing”; retained and independently classified, with no remaining error tokens. No unexpected deployment fault found.

  • Fresh exact DEX Prometheus targets and Loki/Grafana observations, plus monitoring source/config verifier 1544. API serving/quote-readiness up; indexer readiness independently 0, so no recovery or traffic-SLO claim.

  • Full physical-device/funded/all-states acceptance and full repository CI. The explicit user-authorized CI gate override was used while CI was pending; CI is not claimed PASS. Keep both issues open. Physical reachability remains assigned in PM Inbox, card 3fff415d-9cc2-42b1-b635-37e0be4fd0f7.

Relevant #1561 criteria verified in the stated scope: AC1/AC7 numerical initial CTA/nav bounds; AC3 compact persistent error and keyboard action; AC4 real full native route; AC5 geometry/one DETAILS/no horizontal overflow; AC6 covered desktop browser keyboard/200% text/accessibility checks. Physical devices and the full matrix remain incomplete. The #1560 risk thresholds, original quote deadlines, raw amounts, floors and offline/signing protections remain enforced.

Invariants, verification scope, live receipts and screenshots and exact direction amount checklist. Agent guidance crosslinked in SL1498 and QL1499. No backend, database or chain reset needed for this frontend-only follow-up.

PR #1566 implements both follow-up reports: compact all-device error leading, with inline Expert/Cancel actions that retain 44px hit targets; and direction switching that moves the exact current receive amount into the new pay field. Example: 10 CL8Y → 5.40572 SpaceUSD becomes 5.40572 SpaceUSD input for the reverse quote. Missing/expired output clears rather than carrying the old denomination. Old book budgets/review consent are cleared; signing safeguards stay enforced. Verification checklist: - [x] Exact 6/18-decimal and >2^53 amounts, original expiry, stale drafts/refresh, receive edits and long-value editing. - [x] 186 Swap/layout tests and 171 metric tests on each verifier run, 161 Trade tests; types, focused lint and normal commit hooks. - [x] Source-matched production browser status at 375/768/1440 widths: 16.2px leading on 12px text, 32.4–46.3px tested status heights, actual 44px hit tests, keyboard Expert modal/focus return, zero serious/critical axe findings. - [x] Compact mobile centering/footer/route spacing, connected CTA clearance and 200% text regressions. - [x] Coolify frontend `bd2b4ba508d08bf8632b164c82ae02cff1284be0`, deployment `wezykqhxcuhuvdilkmbyogla`, finished. Public frontend/API health/serving samples stayed HTTP200; backend unchanged. - [x] Live phone/desktop switch: output `0.851568201759174334` became new pay, reverse request raw `851568201759174334`, HTTP200. Compact status leading/minimum 16.2/32.4px; mobile footer hidden, form centered and route flush-right. No runtime errors or serious/critical axe findings; wrapped Trade preview also passed. - [x] Deployment logs reviewed: 75 entries, two exact cleanup messages. The conservative checker’s one additional keyword FAIL was the exact public merge subject containing “error spacing”; retained and independently classified, with no remaining error tokens. No unexpected deployment fault found. - [x] Fresh exact DEX Prometheus targets and Loki/Grafana observations, plus monitoring source/config verifier 1544. API serving/quote-readiness up; indexer readiness independently 0, so no recovery or traffic-SLO claim. - [ ] Full physical-device/funded/all-states acceptance and full repository CI. The explicit user-authorized CI gate override was used while CI was pending; CI is not claimed PASS. Keep both issues open. Physical reachability remains assigned in [PM Inbox](https://pm.cl8y.com/inbox), card `3fff415d-9cc2-42b1-b635-37e0be4fd0f7`. Relevant #1561 criteria verified in the stated scope: AC1/AC7 numerical initial CTA/nav bounds; AC3 compact persistent error and keyboard action; AC4 real full native route; AC5 geometry/one DETAILS/no horizontal overflow; AC6 covered desktop browser keyboard/200% text/accessibility checks. Physical devices and the full matrix remain incomplete. The #1560 risk thresholds, original quote deadlines, raw amounts, floors and offline/signing protections remain enforced. [Invariants, verification scope, live receipts and screenshots](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issues-1560-1561/STATUS-DENSITY.md) and [exact direction amount checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/issues-1560-1561/DIRECTION-AMOUNT.md). Agent guidance crosslinked in SL1498 and QL1499. No backend, database or chain reset needed for this frontend-only follow-up.
Sign in to join this conversation.
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#1560
No description provided.