fix(trading): remove generic quote validation errors, default USTC to CL8Y, and widen bidirectional tests #1473

Closed
opened 2026-10-11 05:15:16 +00:00 by PlasticDigits · 2 comments
Owner

Trading quote failures by amount/direction, deterministic USTC → CL8Y default, and broader regression coverage

Problem and required behavior

Valid trading inputs can replace a working output with a persistent generic “Route validation rejected this quote” error when only the amount or direction changes. Refreshing is not a useful remedy for a deterministic rejection. The default trading flow also selects CL8Y → ALPHA through catalog order rather than the intended native USTC (uusd) → CL8Y direction.

These are bundled trading-flow defects: quote pricing and execution eligibility need clear separate outcomes, defaults need an explicit product policy, and regression acceptance needs to cover both directions and substantially more amounts/pairs. For a supported, liquid, representable input, show a quick amount-specific net price estimate. When liquidity, amount, capability, or protection prevents execution, explain that specific condition without exposing an internal route-validation error. A generic validation rejection in the retail UI is a bug, even when rejecting the transaction is correct. Do not manufacture prices for unpriceable inputs or imply an indicative estimate is executable.

Investigation and reproducible evidence

Reviewed source: 72084767e3a85fcfedb94a83bb027b3454e0ad82, merged PR #1472. Read-only API probes independently attested that exact indexer revision before and after each run on 2026-10-11 UTC. No wallet, signing, broadcasts, production mutations, or screenshots were used. The frontend build must be attested separately; backend health is not frontend build provenance. A fresh disconnected browser independently confirmed the bare / entry selects CL8Y → ALPHA, while bare /trade selected a genuine UST1/ALPHA factory pair. Neither entry defaults to native USTC → CL8Y.

At max_spread=0.05, the exact-input UST1/CL8Y reproduction at 05:08:55–05:09:33 UTC was:

Direction Human offer Raw offer Actual HTTP result
UST1 → CL8Y 1 1000000 200, positive quote shape
UST1 → CL8Y 10 10000000 200, positive quote shape
UST1 → CL8Y 100 100000000 422
UST1 → CL8Y 1000 1000000000 422
CL8Y → UST1 1 1000000000000000000 200, positive quote shape
CL8Y → UST1 10 10000000000000000000 200, positive quote shape
CL8Y → UST1 100 100000000000000000000 200, positive quote shape
CL8Y → UST1 1000 1000000000000000000000 422

All three rejected sizes were requested again after more than 20 seconds, beyond the observation TTL, and still returned 422 with the fixed server text “No eligible route within the selected protection.” Total: 11 requests, 5 HTTP 200, 6 HTTP 422. An independent production browser trial also reproduced the 10 → 100 UST1 transition: 10 showed approximately 14.74393 CL8Y, 100 displayed the generic route-validation rejection, and returning to 10 restored output. The reverse browser flow also quoted 1, 10 and 100 CL8Y, displayed the same generic rejection at 1000 CL8Y, and recovered on returning to 100. The completed browser trial at 05:13:37–05:15:30 UTC checked nine amount transitions with 14 quote requests, two generic rejections, and zero non-read attempts. Prices vary by observation; automated expected outputs must derive from pinned observations rather than hardcode a displayed estimate.

A wider census at 05:07:00–05:08:51 UTC covered six unordered pairs in both directions, each at 0.000001, 0.01, 1, 100, and 10000 human units: USTC/CL8Y, CL8Y/ALPHA, CL8Y/USTR, USTR/cUSTC, LUNC/cUSTC, and USTC/LUNC. Initial census: 60 requests, 41 HTTP 200, 19 HTTP 422. Three small CL8Y → USTC rejections subsequently became HTTP 200 after the TTL: 63 total, 44 HTTP 200, 19 HTTP 422. This recovery is retained and must not be described as a persistent failure. Large CL8Y → ALPHA and CL8Y → USTR sizes, tiny mixed-decimal inputs, and all initially tested cUSTC → LUNC sizes also rejected. These results establish wider coverage gaps; they do not prove every rejection should allow execution or establish the precise economic cause.

The probes matched normal native-mode handling (pool_only=true if either end is native), used 5% protection and maker cap 8, and supplied no actor. API positive shape checks are not complete client validation, signing acceptance, or browser latency acceptance. Existing #1472 live evidence covered four directed paths with two size classes; it did not establish broad pair/amount coverage or the reverse direction for each pair. Independent cold HTTP timing is not comparable to initialized browser input-to-useful-output latency.

Current codebase and confirmed failure pathways

  • indexer/src/api/route_solver.rs: current GET, best, and POST routes delegate to the local quote engine. HTTP 422 here is not proof of a failed on-chain router query; some OpenAPI descriptions still imply remote validation.
  • indexer/src/api/local_quote.rs: eligible_error() emits a single 422. Candidate scoring returns Option, losing the specific reason for spread, dust/zero output, reserve plausibility, tax credit, hook/split arithmetic, and reference-deviation rejection.
  • indexer/src/api/local_quote/diagnostics.rs: any prerequisite-complete fresh path can cause unsuccessful scoring to be classified as Protection. This cannot distinguish all amount/direction-specific failures or explain whether pricing exists but execution is blocked.
  • indexer/src/api/local_reference_quote.rs: raw-unit rounding and reference eligibility can change sharply with direction and 6/18-decimal amounts.
  • frontend-dapp/src/services/indexer/client.ts: non-2xx responses are reduced to status/status text, discarding the server's reason. utils/humanizeOffChainError.ts maps every 422 to generic route-validation rejection. utils/indexerErrors.ts correctly prevents fallback after authoritative 422 and must retain that safety property.
  • frontend-dapp/src/utils/localRouteQuote.ts and cw20RouteSolveQuote.ts: a separate HTTP-200 rejection path validates exact operations, metadata, actors, amount, tax funding, original expiry, spread and floors. It emits “Quote unavailable” and must not be confused with HTTP 422.
  • frontend-dapp/src/pages/SwapPage.tsx and utils/pairCatalogRank.ts: defaultRetailSwapTokenPair() chooses the first two eligible IDs, depending on supplied catalog order. pages/TradePage.tsx auto-selects firstCatalogPairAddress() for bare /trade.
  • frontend-dapp/src/utils/tradeQueryResolve.ts, tradePairRoute.ts, tradePairDisplayOrientation.ts, and components/trade/TradeMarketOrderPanel.tsx: factory pair resolution, display orientation, and executable pay/receive direction are distinct. Changing a displayed pair label alone does not implement USTC → CL8Y funding.

Root cause of each economic rejection is not yet established. Preserve the exact sampled inputs, add bounded reason evidence, and compare local integer economics against contract behavior before deciding whether the underlying scoring is incorrect, liquidity/protection genuinely blocks execution, or data/capability loss was mislabeled.

  1. Preserve typed, bounded scoring rejection reasons rather than collapsing every unsuccessful candidate into Option::None. Aggregate across eligible alternatives without allowing an unrelated broken route to erase the real outcome. Distinguish missing/stale observations, unsupported semantics, dust/amount limits, insufficient liquidity, arithmetic/accounting failures, and genuine selected-protection rejection. Keep technical diagnostics low cardinality and private; return a reviewed public reason contract.
  2. Separate an accurately priced candidate from permission to execute it. Where safe local economics permit pricing but protection blocks execution, show the net estimate and a clear protection/size explanation, with submission disabled. If indicative metadata is introduced, make it explicitly non-executable and impossible to feed into signing. Keep genuinely unavailable pricing unavailable. Search other eligible routes before concluding no supported executable candidate exists.
  3. Parse a bounded allowlisted error schema in the frontend. Render one applicable actionable condition; do not render “route validation rejected/failed” as retail copy, blindly retry deterministic failures, advise arbitrary smaller sizes without a fresh confirming quote, or suggest weakening protection as the default remedy. Amount/pair changes and fresh scheduled observations must clear obsolete blockers while retaining authoritative current guards.
  4. Define an identity-based product default of native USTC → configured CL8Y for the trading entry, independent of catalog order, symbol sorting, response timing and liquidity ranking. Preserve valid explicit links and deliberate user choices. Never confuse native USTC with cUSTC. If factory-only /trade cannot represent native funding, support an explicit native-capable market-ticket path or navigation to that flow; do not invent a factory/virtual economic pair or silently relabel cUSTC as USTC. Specify deterministic behavior when configured identities or usable liquidity are absent.
  5. Add a reproducible matrix harness shared by source, socket and browser checks. Pin observations and derive integer expected outputs; publish exact revision, UTC scope, per-scenario outcomes and first/retest results. Update API descriptions, invariants, relevant skills/ instructions and a new agent QA checklist, crosslinked with this issue and the eventual fix.

Constraints and guardrails

Preserve LQ1452, PR1464, LF1453, NE1398, RT1381, LG1390, GR1428, FRQ1422, PD1394, DB1396, oracle safety and quote-coverage #1459.

  • Zero quote/request-triggered chain polling, remote validation, simulation or attestation. Independently scheduled ingestion remains the observation owner; retries and input changes cannot accelerate it.
  • Preserve original pool/hybrid watermarks and expiry, compatibility, known negative invalidation, cache isolation, bounded search/work/concurrency, 4-second fee phase, 20-second observation TTL and 180-second configuration TTL. Do not raise retention/work caps to mask the bug.
  • Use checked raw integers and actual decimals. No linear scaling of a previously executable quote. Keep fair-reference deviation, market spread, fees/tax/wrap costs and realized slippage distinct.
  • Preserve gross route-local funding, exact pair credit, positive hop/post-hook/final floors, reserve/LP rollback, nonwaivable ≥99% protection, wallet debit bounds, actor context, pause/freeze/blacklist, launch guards and refund ownership. Unsupported hook/tax/wrapper semantics remain non-executable.
  • Never downgrade a genuine execution rejection to an executable fallback, remove validation, return a misleading HTTP 200 success, or make an indicative price signable merely to hide the message.
  • Factory/chart/limit-order identity stays genuine. Token names, duplicated symbols, catalog order and opaque listing IDs cannot select the default or admit an economic route.
  • Use disposable owned QA databases/chains and least-privilege runtime credentials; no production reserve/book/schema/ACL mutations for tests. Production probes are bounded and read-only. Use bao-exec from openbao-tools for scoped credentials.
  • Publish no reporter identities, conversations, wallet actors/digests, raw private bodies, credentials, private endpoints, workstation/VPN-exit location data or IPs. Evidence uses public asset labels, aggregate classes, source/artifact identity and UTC only.

Acceptance criteria

  • AC1: Independently reproduce and classify the UST1/CL8Y transitions above at pinned economics, 1%, 5%, and 30% settings, distinguishing actual protection from data/capability/accounting/client failures. Large-amount cases yield an accurate price when priceable or a precise truthful condition, never generic route-validation copy.
  • AC2: Supported liquid pairs and representable positive amounts show amount-specific net estimates in both directions. Size/protection-blocked pricing is explicitly separated from executable quotes. Zero/dust, depleted/no-liquidity and unsupported inputs receive clear bounded outcomes without invented pricing.
  • AC3: Refresh, repeat, amount edit, direction flip, pair switch and scheduled generation replacement do not leave an obsolete error latched. Deterministic blockers remain truthful and do not generate endless retries.
  • AC4: Fresh trading entry defaults to native USTC → CL8Y regardless of catalog permutations. Explicit deep links and deliberate selections retain precedence; bid/ask, orientation, actual funding and displayed labels agree. Missing/ambiguous identities fail safely with deterministic behavior.
  • AC5: Stable API reason semantics and frontend mapping cover every documented rejection class. HTTP 200 client validation failures remain distinguishable. API docs describe the actual local engine, not nonexistent request-time router validation.
  • AC6: The expanded matrix below passes first and repeat trials with meaningful assertions. Every pair is tested both ways; token-decimal and amount-boundary cases cannot be replaced by only a smaller successful amount.
  • AC7: Representative initialized priceable route misses and hits reach useful browser output within 750 ms, measured from the original input event through all attempts. Report per-class sample counts, p50/p95/p99/max; errors/loading/progress and a fast final retry are not successful quotes. Original <250 ms optimization remains deferred. Report cold/new transport separately and retain measured failures.

Temporary user instruction (2026-10-11 UTC): AC7 uses 750 ms for now. Earlier 500 ms FAIL receipts remain evidence; socket budgets and economic protection percentages are unchanged.

  • AC8: All execution/accounting/security invariants remain intact under the abuse tests below. Indicative or malformed/stale quotes never reach signing. Applicable zero-request-RPC and hard-budget regressions pass.
  • AC9: Document invariants, changed API/UX/default behavior, provenance and reproducible agent verification instructions; crosslink relevant skills/, this issue and the fix. Attest deployed frontend and backend separately, inspect classified logs, and repeat live matrix checks beyond 20-second observation and 180-second configuration cycles.

Test plan: all affected paths

Dimension Required coverage and assertions
Pair corpus UST1 ↔ CL8Y, native USTC ↔ CL8Y, CL8Y ↔ ALPHA, CL8Y ↔ USTR, USTR ↔ cUSTC, LUNC ↔ cUSTC, USTC ↔ LUNC; expand deterministically across all supported factory assets and direct/multihop/wrap-enter/wrap-exit paths. Include an unsupported and disconnected pair as explicit negative controls. Record both directions separately.
Human/raw amounts 1 raw unit; minimum positive human input; 0.000001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000 where representable; realistic small/ordinary/large notionals; exact minimum/dust, tax-floor, reserve-consumption and spread thresholds ±1 raw unit. Include mixed 6/18 decimals and bounded Uint128 limits. Expected huge/dust rejections need precise classification, not executable success.
Modes/endpoints GET solve and best, exact-output/receive sizing and round-trip bounds, declared POST pool/hybrid/manual plans, automatic hybrid optimization, zero/positive book budget and maker caps, progress-only, reference, refresh, preflight and reviewed signing preparation. Preserve explicitly unsupported mode outcomes.
State/identity Cold and initialized; misses/hits/coalescing; independently fresh/expired pool and hybrid views; missing reference; changing reserves/config/tax and original generations; configured native wrappers; disconnected and fixture-connected trader/sender/tier/exemption contexts; pause/freeze/blacklist/cooldown and supported/unsupported hook/tax modes.
User flow Bare entry, explicit query aliases/deep links, preserved selection, shuffled/late/empty/duplicate catalogs; forward/reverse amount edits, receive edits, direction flip, pair switch, refresh, retry, returning to prior amount, reload and rapid canceled edits. Desktop, phone viewport and available physical-device checks. No stale amount/direction output or blocker may replace the current intent.
Actual execution Owned LocalTerra fixtures for exact funded messages/floors/credit and net delivery; rejected floor leaves reserves and LP shares unchanged. Confirm price-only results cannot submit. No production signing needed for read-only live acceptance. Record unavailable artifact/hook cases explicitly rather than claiming full settlement coverage.

Relevant existing tests to extend: indexer/tests/route_local_quotes_1452.rs, scenarios/fee_generation_recovery_1464.rs; frontend-dapp/src/utils/localRouteQuote.test.ts, cw20RouteSolveQuote.test.ts, utils/__tests__/pairCatalogRank.issue562.test.ts, pages/SwapPage.queryParams.test.tsx, pages/TradePage.test.tsx, components/trade/__tests__/TradeMarketOrderPanel.submitSnapshot.test.tsx; frontend-dapp/e2e/swap-query-params.spec.ts, swap-direction-seam-659.spec.ts, swap-route-alignment-tx.spec.ts and trade-market-route-solve-501-tx.spec.ts. Confirm filenames and extend appropriate existing suites rather than adding tests that mirror implementation branches.

Security, attack and abuse test plan

  1. Feed negative/zero/overlong/overflow/scientific-notation/noncanonical amounts, malformed spread ratios, unsupported decimals, repeated/self/cyclic assets, excessive hops, oversized/malformed plans and absent/excessive floors. Reject safely with bounded work and no panics or silent rounding into a different authorized input.
  2. Tamper with token/pair identities, generation, amount, trader/sender, mode, namespace, tax version, economic debit, hybrid splits, timestamps and wrapper metadata. Test expired/future/incompatible observations, absent fair references, changed fees and floor mismatch. No cached quote, old actor context, or indicative result may become executable.
  3. Exercise exact spread boundaries, ≥99% fair deviation, taxes/hooks/AutoLP and launch/freeze/blacklist/pause failures. A clear UI message must not weaken the underlying guard, use wallet-funded intermediate tax, omit positive floors or misattribute execution slippage.
  4. Poison default discovery with spoofed USTC/CL8Y names/symbols, duplicate identities, gem/hidden/listing-only markets, malicious URL aliases and reordered catalogs. Default selection must use configured execution identities and never auto-submit or navigate to arbitrary input strings.
  5. Test rapid size flips, concurrent/coalesced quote traffic, cancellation, slow/missing producers, generation churn and provider recovery in owned fixtures. Preserve bounded queues/search/caches, original expiry, permit release and zero request-triggered RPC; no unbounded retry loops or production load test.
  6. Inject malicious/oversized error bodies, unknown codes, markup and private actor/endpoint fields. Only bounded allowlisted public classifications reach UI/evidence; no HTML execution, raw-body echo, sensitive telemetry or high-cardinality labels.

Agent verification and release criteria

  1. Work in an isolated git worktree. Record exact source revisions and run the changed frontend/indexer suites and the complete deterministic bidirectional matrix. Execute feasible checks; inspect expected integer outputs and actual blocker classes, not only status or text existence.
  2. Run make verify-issue-1452, verify-issue-1464, verify-issue-1453 and applicable floor/tax/guard/database/provider checks (1398, 1381, 1390, 1399, 1422, 1394, 1392, 1396). Use owned fixtures and supported toolchain; fix executed failures and retest. Document any unavailable prerequisite instead of waiting on an unrelated hold.
  3. Repeat focused tests and full relevant suites after corrections. Verify meaningful contract execution where fixtures exist, including quote → reviewed plan → exact net settlement and rollback, without treating arithmetic-only or probe gas counts as full settlement proof.
  4. After deployment, separately attest backend revision and frontend artifact, initialize independently, run the widened desktop/phone pair × amount × direction matrix twice across configuration/observation cycles, and inspect bounded classified logs. Preserve individual failures, sample counts and latency distributions. Health, a successful merge, or the previous narrow corpus does not close this issue.
  5. An unavailable device, operational or artifact check may be marked SKIP with reason, prerequisite, revision and UTC scope; the agent may report PASS WITH SKIPS for the stated tested scope. Skipped acceptance criteria stay unchecked. Executed correctness/latency failures remain FAIL until fixed and rerun; never relabel them as SKIP or claim complete deployed acceptance from partial checks.

Related scope: #1464, #1452, #1459, #1456 and #1330. This is a new reproducible trading UX/coverage defect, not a claim that earlier narrow checks failed or that those broader rollout items are complete.

Sanitized reproduction artifacts

All three public receipts were privacy-checked and downloaded without credentials to verify identical bytes. Browser source revision is explicitly unattested; public asset filenames are recorded separately. These are baseline bug-reproduction results, not verification of a fix.

# Trading quote failures by amount/direction, deterministic USTC → CL8Y default, and broader regression coverage ## Problem and required behavior Valid trading inputs can replace a working output with a persistent generic **“Route validation rejected this quote”** error when only the amount or direction changes. Refreshing is not a useful remedy for a deterministic rejection. The default trading flow also selects CL8Y → ALPHA through catalog order rather than the intended **native USTC (`uusd`) → CL8Y** direction. These are bundled trading-flow defects: quote pricing and execution eligibility need clear separate outcomes, defaults need an explicit product policy, and regression acceptance needs to cover both directions and substantially more amounts/pairs. For a supported, liquid, representable input, show a quick amount-specific net price estimate. When liquidity, amount, capability, or protection prevents execution, explain that specific condition without exposing an internal route-validation error. A generic validation rejection in the retail UI is a bug, even when rejecting the transaction is correct. Do not manufacture prices for unpriceable inputs or imply an indicative estimate is executable. ## Investigation and reproducible evidence Reviewed source: [`72084767e3a85fcfedb94a83bb027b3454e0ad82`](https://git.cl8y.com/code/cl8y-dex-terraclassic/commit/72084767e3a85fcfedb94a83bb027b3454e0ad82), merged [PR #1472](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1472). Read-only API probes independently attested that exact indexer revision before and after each run on **2026-10-11 UTC**. No wallet, signing, broadcasts, production mutations, or screenshots were used. The frontend build must be attested separately; backend health is not frontend build provenance. A fresh disconnected browser independently confirmed the bare `/` entry selects **CL8Y → ALPHA**, while bare `/trade` selected a genuine **UST1/ALPHA** factory pair. Neither entry defaults to native USTC → CL8Y. At `max_spread=0.05`, the exact-input UST1/CL8Y reproduction at **05:08:55–05:09:33 UTC** was: | Direction | Human offer | Raw offer | Actual HTTP result | | --- | ---: | ---: | --- | | UST1 → CL8Y | 1 | 1000000 | 200, positive quote shape | | UST1 → CL8Y | 10 | 10000000 | 200, positive quote shape | | UST1 → CL8Y | 100 | 100000000 | 422 | | UST1 → CL8Y | 1000 | 1000000000 | 422 | | CL8Y → UST1 | 1 | 1000000000000000000 | 200, positive quote shape | | CL8Y → UST1 | 10 | 10000000000000000000 | 200, positive quote shape | | CL8Y → UST1 | 100 | 100000000000000000000 | 200, positive quote shape | | CL8Y → UST1 | 1000 | 1000000000000000000000 | 422 | All three rejected sizes were requested again after **more than 20 seconds**, beyond the observation TTL, and still returned 422 with the fixed server text “No eligible route within the selected protection.” Total: **11 requests, 5 HTTP 200, 6 HTTP 422**. An independent production browser trial also reproduced the 10 → 100 UST1 transition: 10 showed approximately 14.74393 CL8Y, 100 displayed the generic route-validation rejection, and returning to 10 restored output. The reverse browser flow also quoted 1, 10 and 100 CL8Y, displayed the same generic rejection at 1000 CL8Y, and recovered on returning to 100. The completed browser trial at **05:13:37–05:15:30 UTC** checked nine amount transitions with 14 quote requests, two generic rejections, and zero non-read attempts. Prices vary by observation; automated expected outputs must derive from pinned observations rather than hardcode a displayed estimate. A wider census at **05:07:00–05:08:51 UTC** covered six unordered pairs in **both directions**, each at `0.000001`, `0.01`, `1`, `100`, and `10000` human units: USTC/CL8Y, CL8Y/ALPHA, CL8Y/USTR, USTR/cUSTC, LUNC/cUSTC, and USTC/LUNC. Initial census: **60 requests, 41 HTTP 200, 19 HTTP 422**. Three small CL8Y → USTC rejections subsequently became HTTP 200 after the TTL: **63 total, 44 HTTP 200, 19 HTTP 422**. This recovery is retained and must not be described as a persistent failure. Large CL8Y → ALPHA and CL8Y → USTR sizes, tiny mixed-decimal inputs, and all initially tested cUSTC → LUNC sizes also rejected. These results establish wider coverage gaps; they do not prove every rejection should allow execution or establish the precise economic cause. The probes matched normal native-mode handling (`pool_only=true` if either end is native), used 5% protection and maker cap 8, and supplied no actor. API positive shape checks are not complete client validation, signing acceptance, or browser latency acceptance. Existing #1472 live evidence covered four directed paths with two size classes; it did not establish broad pair/amount coverage or the reverse direction for each pair. Independent cold HTTP timing is not comparable to initialized browser input-to-useful-output latency. ## Current codebase and confirmed failure pathways - `indexer/src/api/route_solver.rs`: current GET, best, and POST routes delegate to the local quote engine. HTTP 422 here is not proof of a failed on-chain router query; some OpenAPI descriptions still imply remote validation. - `indexer/src/api/local_quote.rs`: `eligible_error()` emits a single 422. Candidate scoring returns `Option`, losing the specific reason for spread, dust/zero output, reserve plausibility, tax credit, hook/split arithmetic, and reference-deviation rejection. - `indexer/src/api/local_quote/diagnostics.rs`: any prerequisite-complete fresh path can cause unsuccessful scoring to be classified as `Protection`. This cannot distinguish all amount/direction-specific failures or explain whether pricing exists but execution is blocked. - `indexer/src/api/local_reference_quote.rs`: raw-unit rounding and reference eligibility can change sharply with direction and 6/18-decimal amounts. - `frontend-dapp/src/services/indexer/client.ts`: non-2xx responses are reduced to status/status text, discarding the server's reason. `utils/humanizeOffChainError.ts` maps every 422 to generic route-validation rejection. `utils/indexerErrors.ts` correctly prevents fallback after authoritative 422 and must retain that safety property. - `frontend-dapp/src/utils/localRouteQuote.ts` and `cw20RouteSolveQuote.ts`: a separate HTTP-200 rejection path validates exact operations, metadata, actors, amount, tax funding, original expiry, spread and floors. It emits “Quote unavailable” and must not be confused with HTTP 422. - `frontend-dapp/src/pages/SwapPage.tsx` and `utils/pairCatalogRank.ts`: `defaultRetailSwapTokenPair()` chooses the first two eligible IDs, depending on supplied catalog order. `pages/TradePage.tsx` auto-selects `firstCatalogPairAddress()` for bare `/trade`. - `frontend-dapp/src/utils/tradeQueryResolve.ts`, `tradePairRoute.ts`, `tradePairDisplayOrientation.ts`, and `components/trade/TradeMarketOrderPanel.tsx`: factory pair resolution, display orientation, and executable pay/receive direction are distinct. Changing a displayed pair label alone does not implement USTC → CL8Y funding. Root cause of each economic rejection is **not yet established**. Preserve the exact sampled inputs, add bounded reason evidence, and compare local integer economics against contract behavior before deciding whether the underlying scoring is incorrect, liquidity/protection genuinely blocks execution, or data/capability loss was mislabeled. ## Recommended implementation direction 1. Preserve typed, bounded scoring rejection reasons rather than collapsing every unsuccessful candidate into `Option::None`. Aggregate across eligible alternatives without allowing an unrelated broken route to erase the real outcome. Distinguish missing/stale observations, unsupported semantics, dust/amount limits, insufficient liquidity, arithmetic/accounting failures, and genuine selected-protection rejection. Keep technical diagnostics low cardinality and private; return a reviewed public reason contract. 2. Separate an accurately priced candidate from permission to execute it. Where safe local economics permit pricing but protection blocks execution, show the net estimate and a clear protection/size explanation, with submission disabled. If indicative metadata is introduced, make it explicitly non-executable and impossible to feed into signing. Keep genuinely unavailable pricing unavailable. Search other eligible routes before concluding no supported executable candidate exists. 3. Parse a bounded allowlisted error schema in the frontend. Render one applicable actionable condition; do not render “route validation rejected/failed” as retail copy, blindly retry deterministic failures, advise arbitrary smaller sizes without a fresh confirming quote, or suggest weakening protection as the default remedy. Amount/pair changes and fresh scheduled observations must clear obsolete blockers while retaining authoritative current guards. 4. Define an identity-based product default of **native USTC → configured CL8Y** for the trading entry, independent of catalog order, symbol sorting, response timing and liquidity ranking. Preserve valid explicit links and deliberate user choices. Never confuse native USTC with cUSTC. If factory-only `/trade` cannot represent native funding, support an explicit native-capable market-ticket path or navigation to that flow; do not invent a factory/virtual economic pair or silently relabel cUSTC as USTC. Specify deterministic behavior when configured identities or usable liquidity are absent. 5. Add a reproducible matrix harness shared by source, socket and browser checks. Pin observations and derive integer expected outputs; publish exact revision, UTC scope, per-scenario outcomes and first/retest results. Update API descriptions, invariants, relevant `skills/` instructions and a new agent QA checklist, crosslinked with this issue and the eventual fix. ## Constraints and guardrails Preserve [LQ1452](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/skills/AGENTS_LOCAL_SWAP_QUOTES.md), [PR1464](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/skills/AGENTS_PROVIDER_RECOVERY.md), [LF1453](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/skills/AGENTS_LIQUIDITY_FEED.md), NE1398, RT1381, LG1390, GR1428, FRQ1422, PD1394, DB1396, oracle safety and quote-coverage #1459. - Zero quote/request-triggered chain polling, remote validation, simulation or attestation. Independently scheduled ingestion remains the observation owner; retries and input changes cannot accelerate it. - Preserve original pool/hybrid watermarks and expiry, compatibility, known negative invalidation, cache isolation, bounded search/work/concurrency, 4-second fee phase, 20-second observation TTL and 180-second configuration TTL. Do not raise retention/work caps to mask the bug. - Use checked raw integers and actual decimals. No linear scaling of a previously executable quote. Keep fair-reference deviation, market spread, fees/tax/wrap costs and realized slippage distinct. - Preserve gross route-local funding, exact pair credit, positive hop/post-hook/final floors, reserve/LP rollback, nonwaivable ≥99% protection, wallet debit bounds, actor context, pause/freeze/blacklist, launch guards and refund ownership. Unsupported hook/tax/wrapper semantics remain non-executable. - Never downgrade a genuine execution rejection to an executable fallback, remove validation, return a misleading HTTP 200 success, or make an indicative price signable merely to hide the message. - Factory/chart/limit-order identity stays genuine. Token names, duplicated symbols, catalog order and opaque listing IDs cannot select the default or admit an economic route. - Use disposable owned QA databases/chains and least-privilege runtime credentials; no production reserve/book/schema/ACL mutations for tests. Production probes are bounded and read-only. Use `bao-exec` from openbao-tools for scoped credentials. - Publish no reporter identities, conversations, wallet actors/digests, raw private bodies, credentials, private endpoints, workstation/VPN-exit location data or IPs. Evidence uses public asset labels, aggregate classes, source/artifact identity and UTC only. ## Acceptance criteria - [ ] AC1: Independently reproduce and classify the UST1/CL8Y transitions above at pinned economics, 1%, 5%, and 30% settings, distinguishing actual protection from data/capability/accounting/client failures. Large-amount cases yield an accurate price when priceable or a precise truthful condition, never generic route-validation copy. - [ ] AC2: Supported liquid pairs and representable positive amounts show amount-specific net estimates in both directions. Size/protection-blocked pricing is explicitly separated from executable quotes. Zero/dust, depleted/no-liquidity and unsupported inputs receive clear bounded outcomes without invented pricing. - [ ] AC3: Refresh, repeat, amount edit, direction flip, pair switch and scheduled generation replacement do not leave an obsolete error latched. Deterministic blockers remain truthful and do not generate endless retries. - [x] AC4: Fresh trading entry defaults to native USTC → CL8Y regardless of catalog permutations. Explicit deep links and deliberate selections retain precedence; bid/ask, orientation, actual funding and displayed labels agree. Missing/ambiguous identities fail safely with deterministic behavior. - [x] AC5: Stable API reason semantics and frontend mapping cover every documented rejection class. HTTP 200 client validation failures remain distinguishable. API docs describe the actual local engine, not nonexistent request-time router validation. - [ ] AC6: The expanded matrix below passes first and repeat trials with meaningful assertions. Every pair is tested both ways; token-decimal and amount-boundary cases cannot be replaced by only a smaller successful amount. - [ ] AC7: Representative initialized priceable route misses and hits reach useful browser output within **750 ms**, measured from the original input event through all attempts. Report per-class sample counts, p50/p95/p99/max; errors/loading/progress and a fast final retry are not successful quotes. Original <250 ms optimization remains deferred. Report cold/new transport separately and retain measured failures. Temporary user instruction (2026-10-11 UTC): AC7 uses 750 ms for now. Earlier 500 ms FAIL receipts remain evidence; socket budgets and economic protection percentages are unchanged. - [ ] AC8: All execution/accounting/security invariants remain intact under the abuse tests below. Indicative or malformed/stale quotes never reach signing. Applicable zero-request-RPC and hard-budget regressions pass. - [ ] AC9: Document invariants, changed API/UX/default behavior, provenance and reproducible agent verification instructions; crosslink relevant `skills/`, this issue and the fix. Attest deployed frontend and backend separately, inspect classified logs, and repeat live matrix checks beyond 20-second observation and 180-second configuration cycles. ## Test plan: all affected paths | Dimension | Required coverage and assertions | | --- | --- | | Pair corpus | UST1 ↔ CL8Y, native USTC ↔ CL8Y, CL8Y ↔ ALPHA, CL8Y ↔ USTR, USTR ↔ cUSTC, LUNC ↔ cUSTC, USTC ↔ LUNC; expand deterministically across all supported factory assets and direct/multihop/wrap-enter/wrap-exit paths. Include an unsupported and disconnected pair as explicit negative controls. Record both directions separately. | | Human/raw amounts | 1 raw unit; minimum positive human input; 0.000001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000 where representable; realistic small/ordinary/large notionals; exact minimum/dust, tax-floor, reserve-consumption and spread thresholds ±1 raw unit. Include mixed 6/18 decimals and bounded Uint128 limits. Expected huge/dust rejections need precise classification, not executable success. | | Modes/endpoints | GET solve and best, exact-output/receive sizing and round-trip bounds, declared POST pool/hybrid/manual plans, automatic hybrid optimization, zero/positive book budget and maker caps, progress-only, reference, refresh, preflight and reviewed signing preparation. Preserve explicitly unsupported mode outcomes. | | State/identity | Cold and initialized; misses/hits/coalescing; independently fresh/expired pool and hybrid views; missing reference; changing reserves/config/tax and original generations; configured native wrappers; disconnected and fixture-connected trader/sender/tier/exemption contexts; pause/freeze/blacklist/cooldown and supported/unsupported hook/tax modes. | | User flow | Bare entry, explicit query aliases/deep links, preserved selection, shuffled/late/empty/duplicate catalogs; forward/reverse amount edits, receive edits, direction flip, pair switch, refresh, retry, returning to prior amount, reload and rapid canceled edits. Desktop, phone viewport and available physical-device checks. No stale amount/direction output or blocker may replace the current intent. | | Actual execution | Owned LocalTerra fixtures for exact funded messages/floors/credit and net delivery; rejected floor leaves reserves and LP shares unchanged. Confirm price-only results cannot submit. No production signing needed for read-only live acceptance. Record unavailable artifact/hook cases explicitly rather than claiming full settlement coverage. | Relevant existing tests to extend: `indexer/tests/route_local_quotes_1452.rs`, `scenarios/fee_generation_recovery_1464.rs`; `frontend-dapp/src/utils/localRouteQuote.test.ts`, `cw20RouteSolveQuote.test.ts`, `utils/__tests__/pairCatalogRank.issue562.test.ts`, `pages/SwapPage.queryParams.test.tsx`, `pages/TradePage.test.tsx`, `components/trade/__tests__/TradeMarketOrderPanel.submitSnapshot.test.tsx`; `frontend-dapp/e2e/swap-query-params.spec.ts`, `swap-direction-seam-659.spec.ts`, `swap-route-alignment-tx.spec.ts` and `trade-market-route-solve-501-tx.spec.ts`. Confirm filenames and extend appropriate existing suites rather than adding tests that mirror implementation branches. ## Security, attack and abuse test plan 1. Feed negative/zero/overlong/overflow/scientific-notation/noncanonical amounts, malformed spread ratios, unsupported decimals, repeated/self/cyclic assets, excessive hops, oversized/malformed plans and absent/excessive floors. Reject safely with bounded work and no panics or silent rounding into a different authorized input. 2. Tamper with token/pair identities, generation, amount, trader/sender, mode, namespace, tax version, economic debit, hybrid splits, timestamps and wrapper metadata. Test expired/future/incompatible observations, absent fair references, changed fees and floor mismatch. No cached quote, old actor context, or indicative result may become executable. 3. Exercise exact spread boundaries, ≥99% fair deviation, taxes/hooks/AutoLP and launch/freeze/blacklist/pause failures. A clear UI message must not weaken the underlying guard, use wallet-funded intermediate tax, omit positive floors or misattribute execution slippage. 4. Poison default discovery with spoofed USTC/CL8Y names/symbols, duplicate identities, gem/hidden/listing-only markets, malicious URL aliases and reordered catalogs. Default selection must use configured execution identities and never auto-submit or navigate to arbitrary input strings. 5. Test rapid size flips, concurrent/coalesced quote traffic, cancellation, slow/missing producers, generation churn and provider recovery in owned fixtures. Preserve bounded queues/search/caches, original expiry, permit release and zero request-triggered RPC; no unbounded retry loops or production load test. 6. Inject malicious/oversized error bodies, unknown codes, markup and private actor/endpoint fields. Only bounded allowlisted public classifications reach UI/evidence; no HTML execution, raw-body echo, sensitive telemetry or high-cardinality labels. ## Agent verification and release criteria 1. Work in an isolated git worktree. Record exact source revisions and run the changed frontend/indexer suites and the complete deterministic bidirectional matrix. Execute feasible checks; inspect expected integer outputs and actual blocker classes, not only status or text existence. 2. Run `make verify-issue-1452`, `verify-issue-1464`, `verify-issue-1453` and applicable floor/tax/guard/database/provider checks (`1398`, `1381`, `1390`, `1399`, `1422`, `1394`, `1392`, `1396`). Use owned fixtures and supported toolchain; fix executed failures and retest. Document any unavailable prerequisite instead of waiting on an unrelated hold. 3. Repeat focused tests and full relevant suites after corrections. Verify meaningful contract execution where fixtures exist, including quote → reviewed plan → exact net settlement and rollback, without treating arithmetic-only or probe gas counts as full settlement proof. 4. After deployment, separately attest backend revision and frontend artifact, initialize independently, run the widened desktop/phone pair × amount × direction matrix twice across configuration/observation cycles, and inspect bounded classified logs. Preserve individual failures, sample counts and latency distributions. Health, a successful merge, or the previous narrow corpus does not close this issue. 5. An unavailable device, operational or artifact check may be marked **SKIP** with reason, prerequisite, revision and UTC scope; the agent may report **PASS WITH SKIPS** for the stated tested scope. Skipped acceptance criteria stay unchecked. Executed correctness/latency failures remain **FAIL** until fixed and rerun; never relabel them as SKIP or claim complete deployed acceptance from partial checks. Related scope: [#1464](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1464), [#1452](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1452), [#1459](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1459), [#1456](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1456) and [#1330](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1330). This is a new reproducible trading UX/coverage defect, not a claim that earlier narrow checks failed or that those broader rollout items are complete. ## Sanitized reproduction artifacts - [quote-matrix-1473.json](https://git.cl8y.com/attachments/d933332e-6089-432e-a286-e60cee7eb46a) - [ust1-cl8y-reproduction-1473.json](https://git.cl8y.com/attachments/3b46752b-e9ab-4ae9-8a4e-5c79f74b5555) - [browser-reproduction-1473.json](https://git.cl8y.com/attachments/60b2feef-63f6-4de5-93dd-9f3da55274ee) All three public receipts were privacy-checked and downloaded without credentials to verify identical bytes. Browser source revision is explicitly unattested; public asset filenames are recorded separately. These are baseline bug-reproduction results, not verification of a fix.
Author
Owner

PRs #1474 and #1475 are merged. The deployed application revision is ea627f7b0e8d5ebc9fde2bb5b243f451cf159f4d. The QA/CI follow-up #1476 is also merged, and main is pushed at 2d1627ffa33eb3e08199acfff574a5b63fcfbd39; its product trees are byte-identical to the deployed application. No app redeployment was needed for the QA/CI changes. Hosted pipeline 410 passed all six required jobs with exit 0 on exact PR head ff2ee8f8d71cf132de9d342eb918b486ba7f3d5d; backend and frontend separately completed deployment of the merged revision, with backend health and served frontend root artifacts independently attested.

The fix computes amount-specific net quotes with exact selected UI tolerance, separate reviewed market-spread ceilings and positive rounded-up floors. Missing/stale observations now show an indeterminate loading bar until independently scheduled eligible data arrives. Original client expiry removes stale display/signing data promptly; unknown transport/client-validation forward failures retain ten-second cadence; typed deterministic local blockers stop interval retries, receive errors have no interval retries, and typed missing/stale recovery watches changed publication. No token-specific economics, request-triggered RPC, reference-floor reduction, extra price panel or invented completion/ETA was added.

Completed subitems:

  • Typed public reason/status schema and bounded privacy-safe client mapping; HTTP 200 validation remains separate; local-engine/API/invariant/skill docs updated.
  • Source generic bidirectional economics and security tests, 420-case integer corpus, selected 427 frontend tests twice on final source fingerprint 90ae4cf2…, types/lint, and unchanged backend scopes tested separately.
  • Controlled headed desktop/phone first/retest: 4,250 scenarios, 3,948 useful quotes, zero failures/provider requests; p50/p95/p99/max 97.6/158.5/198.4/657.2 ms under the explicit temporary 750 ms browser budget. This new headed scope does not resolve earlier headless failures.
  • Twenty-four owned hook-free direct/multihop 6/18/9-decimal funded cases twice at 1/5/30%, exact net delivery and rejected-floor reserve/LP rollback. This is not complete hook/tax/native settlement acceptance.
  • Default discovery permutations, missing/ambiguous/spoofed identities, aliases, explicit links, direction and source funding/label tests; four deployed desktop/phone-viewport entry views display USTC→CL8Y. Four fresh deployed unsigned checks also observe exact uusd → configured CL8Y requests, bound native gross/wrapper/route metadata and independently validated visible net. All four pass with four quote GETs and unchanged before/after exact revision/root artifact matches; no wallet/signing/broadcast.
  • Sixteen completed scoped deployed KENA checks (eight cases in each first/retest trial, split by desktop and phone viewport) verify eight buying waits that retain blank receive, indeterminate accessible bar, no pricing/outage error and no enabled trading action after at least ten seconds in the disconnected real UI. Connect Wallet remains enabled; fixture-connected signing guards are a separate source-test scope; current actual dust/unsupported outcomes remain distinct. No executable KENA quote or missing→available transition was observed; loading is not useful latency. The observed catalog/probe snapshot valued that market at approximately $25.77, below the unchanged $100 reference-admission default; this is not a fresh claim about current reserves or a direct container-environment attestation.

Whole acceptance criteria (do not check a criterion from a passing subset):

Criterion Complete Remaining scope
AC1 [ ] Original historical production economic observations/reference pins are unavailable. Current synthetic/contract parity cannot reconstruct them.
AC2 [ ] Generic source economics pass; complete supported factory/path/capability and deployed actor/hook/wrapper coverage remains separate.
AC3 [ ] Source intent/generation/expiry/cadence and deployed continued waiting pass; complete deployed refresh/receive/manual/race/recovery transitions remain unverified.
AC4 [x] Source permutation/alias/explicit-link/bid-ask behavior plus four fresh deployed unsigned default-funding checks pass: exact native request and independently validated wrapper gross/route identity, visible matching net and original expiry. No production signing is claimed; complete funded native settlement remains AC8.
AC5 [x] Stable bounded API/client reason semantics, distinct HTTP 200 validation and accurate local-engine documentation verified.
AC6 [ ] Expanded mode/state/actor/manual/hook/native and widened deployed first/repeat matrix are not yet complete.
AC7 [ ] Current headed scope passes temporary 750 ms; earlier 762.4/857.4 ms headless failures and initial live 889 ms API / approximately 1.01 s render remain recorded. The complete current public socket matrix classified all 1,680 responses (997 executable, 683 blocked) across two cycles but failed the independent 500 ms budget on 13 useful samples (two cold, eleven reused). The current full public browser attempt hit its original 30-minute cap: 426/1,680 rows, all 420 first-desktop cases classified (286 useful and 134 typed blocked/waiting), nine useful >750 ms, and six phone visibility failures. It did not reach complete phone/repeat coverage or the 181-second cycle gap. The corrected 96-case reproduction has zero visibility failures but two phone results above 750 ms. Prior 500 ms acceptance is not established.
AC8 [ ] Abuse/zero-RPC/budgets and funded subset pass; complete hook/tax/native/actor/physical settlement/security scope remains incomplete. The separate #1396 custom-bridge host check remains an executed FAIL.
AC9 [ ] Documentation, CI, separate exact deployment/root artifacts and bounded classified logs pass; full live matrix repetition beyond observation/configuration cycles and lazy-asset scope remain incomplete.

The initial KENA 7/8 elapsed-budget trial remains FAIL; the zero-sample/zero-GET KENA phone retest setup timeout and native-default prerequisite attempt also remain FAIL. Narrower completed trials and the corrected private artifact parser do not relabel those earlier failures. The physical-wallet/device action is queued in the PM inbox as “Check KENA loading in the mobile wallet browser”; it is not a completed acceptance check. The card has four observation steps and requires no swap or signing. The inbox-assigner skill was used for this specific operator action required by the repository instructions. The dashboard could not link the DEX repository; the card uses its verified inbox-master association and includes this DEX issue URL in its body. Classified runtime logs are a bounded window with producer/oracle warnings, not proof of sustained pricing readiness or absence of all errors.

The current socket trial covered solve+best twice with a 181-second gap: 1,680 classified responses (997 executable, 683 blocked), no shape/classification failures, and 13 executable samples above the separate 500 ms limit. New transport: n=2, p50/p95/p99/max 849.585/1029.957/1029.957/1029.957 ms; reused: n=995, 287.625/452.714/750.397/825.929 ms. Overall FAIL remains.

The original capped live browser trial also remains FAIL: 426/1,680 rows, 420 first-desktop classified, 286 useful, 134 typed blocked/waiting, nine useful timing failures and six phone visibility failures; useful p50/p95/p99/max 353.1/383/942.6/987.2 ms. The six phone rows received prompt independently validated matching HTTP 200 results, but the receive/surface visibility check stayed false. The helper opened Settings and did not close it before input; expanded-state and exact offscreen versus opacity geometry were not recorded, so these are verification setup/visibility failures, not established product pricing timeouts. The helper's final-cycle/backend and final root-artifact checks were not reached. A separate official post-run attestation passed eight bounded reads for both deployed revisions and unchanged frontend root hashes; it does not complete the interrupted trial.

PR #1476 changes the verification helper/tests, trusted CI runner/tests, stale image-pin ledger records, public-key Docker copy permissions, and their documentation. The helper closes Settings and confirms both amount fields intersect before installing the original-input clock; invisible output still cannot pass. Eleven actual helper/DOM tests passed twice plus an independent root run, and the measurement closure remained byte-identical. App code has no diff. Measured QA tool head is cf176c0ee426991b417341c277f19220bb2b4a5d, fingerprint b4c64d57d87ab7c064bc144564a088e50135d8be009c70794ceadab2f55c993e; the deployed app remains ea627f7b0e8d5ebc9fde2bb5b243f451cf159f4d.

The corrected reproduction completed all 96 first/retest UST1↔CL8Y samples in both viewports across the 181-second gap. All 96 had independently validated matching visible useful output, zero visibility timeouts, 120 quote GETs and no writes/WebSockets. Five backend revision checks and both root-artifact boundary checks matched the unchanged app; tool head/fingerprint matched before/after and its owned browser was cleaned up. This is a bounded reproduction, not the expanded full matrix. Overall FAIL remains because two first-phone samples took 1008.4 and 1005.1 ms. All useful samples: p50/p95/p99/max 362.2/684.5/1008.4/1008.4 ms; desktop n=48: 355.6/431/690.7/690.7; phone n=48: 401.4/735.4/1008.4/1008.4. Cache misses n=39: 363.3/680.5/684.5/684.5; cache unobserved n=57: 362.2/735.4/1008.4/1008.4; hits n=0. All 96 transports were reused; no cold-transport browser acceptance is claimed.

QA CI413 and the single unchanged-source retry414 failed during canvas dependency installation, before frontend lint/test/build; downstream indexer jobs were skipped and completeness failed. Those remain actual FAIL. The native-build prerequisite repair is reviewed and the immutable policy is deployed at 28272783a171911e1b249381d0dbf7a4b48ca98d, health hash 80da17a5428fe88f1803ab592a474a51b3a3e52a7c954284f59f6793dcf982b4. An independent two-read check confirmed the hash and exclusive signed/no-netrc settings. Required status checks were preserved.

The CI repair keeps ordinary npm installation and all six mandatory jobs, adds the native compiler/Cairo/Pango/DejaVu prerequisites, then forces a fresh Canvas rebuild and checks nonempty objects/binding, exact RGBA and rendered Pango text. Installation, compilation or rendering failures cannot record PASS. The public Ed25519 key bytes are unchanged; Docker copies that public file read-only for the nonroot service independently of checkout permissions. Fifteen hermetic runner cases passed twice and all nine available #1400 groups passed; existing image references were verified against official registry bytes, with five stale ledger entries reconciled to their unchanged declarations. The attempted local exact-image native fixture remains unavailable and is not native proof.

The policy-only rollout completed from exact reviewed commit 28272783a171911e1b249381d0dbf7a4b48ca98d; its hash is 80da17a5428fe88f1803ab592a474a51b3a3e52a7c954284f59f6793dcf982b4, independently read back with unchanged exclusive/no-netrc settings. Nonroot health passed and unsigned configuration requests returned 401. The previous pin/hash was preserved for rollback. No required context, signing key, job graph, image declaration or resource cap was weakened.

Pipeline 416 passed all six real jobs with exit 0 and exact-head log markers on 80009d6f755abf59438ed9562fb34d5ed551ed08. A fresh independent API read also confirmed all six successful states. The actual pinned worker produced 17 Canvas CXX compile lines, linked the purged native binding, used two make jobs, and passed the anchored exact RGBA/DejaVu/Pango render check. Full frontend 3,240 tests/363 files plus lint/type/build, 999 contract tests, 774 indexer library tests and 84 Postgres tests passed. The one manual cache benchmark and one runtime-DDL credential fixture remain explicitly ignored; this is not complete database acceptance. Pipeline 415 was killed when superseded by the final documentation head, separately from the executed 413/414 failures.

The normal server merge and local main fast-forward/push completed at 2d1627ffa33eb3e08199acfff574a5b63fcfbd39, with no incoming main commits and all three unrelated user files byte-preserved. Reviewed head is an ancestor and its tree matches the merged tree. Retained full live failures, corrected bounded reproduction, and CI repair/provenance are crosslinked with the invariants and agent instructions.

Agent review: use the checklist and data-wait/cadence instructions. Verify each item's actual integer/result/identity assertion, original expiry, expected disabled signing state and source/artifact/UTC scope. Unavailable checks may be explicit SKIP with reason and prerequisites; an agent may mark the stated executed scope PASS WITH SKIPS when every executed check in that scope passes. Executed failures retain FAIL and incomplete acceptance remains unchecked.

The issue-body AC4 and AC5 boxes are checked after independent review and readback. #1473 remains open: not every current body/comment criterion passes. This comment records implemented functional improvements and their actual verification limits, not complete issue acceptance.

PRs [#1474](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1474) and [#1475](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1475) are merged. The deployed application revision is `ea627f7b0e8d5ebc9fde2bb5b243f451cf159f4d`. The QA/CI follow-up [#1476](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1476) is also merged, and main is pushed at `2d1627ffa33eb3e08199acfff574a5b63fcfbd39`; its product trees are byte-identical to the deployed application. No app redeployment was needed for the QA/CI changes. Hosted pipeline 410 passed all six required jobs with exit 0 on exact PR head `ff2ee8f8d71cf132de9d342eb918b486ba7f3d5d`; backend and frontend separately completed deployment of the merged revision, with backend health and served frontend root artifacts independently attested. The fix computes amount-specific net quotes with exact selected UI tolerance, separate reviewed market-spread ceilings and positive rounded-up floors. Missing/stale observations now show an indeterminate loading bar until independently scheduled eligible data arrives. Original client expiry removes stale display/signing data promptly; unknown transport/client-validation forward failures retain ten-second cadence; typed deterministic local blockers stop interval retries, receive errors have no interval retries, and typed missing/stale recovery watches changed publication. No token-specific economics, request-triggered RPC, reference-floor reduction, extra price panel or invented completion/ETA was added. Completed subitems: - [x] Typed public reason/status schema and bounded privacy-safe client mapping; HTTP 200 validation remains separate; local-engine/API/invariant/skill docs updated. - [x] Source generic bidirectional economics and security tests, 420-case integer corpus, selected 427 frontend tests twice on final source fingerprint `90ae4cf2…`, types/lint, and unchanged backend scopes tested separately. - [x] Controlled headed desktop/phone first/retest: 4,250 scenarios, 3,948 useful quotes, zero failures/provider requests; p50/p95/p99/max 97.6/158.5/198.4/657.2 ms under the explicit temporary 750 ms browser budget. This new headed scope does not resolve earlier headless failures. - [x] Twenty-four owned hook-free direct/multihop 6/18/9-decimal funded cases twice at 1/5/30%, exact net delivery and rejected-floor reserve/LP rollback. This is not complete hook/tax/native settlement acceptance. - [x] Default discovery permutations, missing/ambiguous/spoofed identities, aliases, explicit links, direction and source funding/label tests; four deployed desktop/phone-viewport entry views display USTC→CL8Y. Four fresh deployed unsigned checks also observe exact `uusd` → configured CL8Y requests, bound native gross/wrapper/route metadata and independently validated visible net. All four pass with four quote GETs and unchanged before/after exact revision/root artifact matches; no wallet/signing/broadcast. - [x] Sixteen completed scoped deployed KENA checks (eight cases in each first/retest trial, split by desktop and phone viewport) verify eight buying waits that retain blank receive, indeterminate accessible bar, no pricing/outage error and no enabled trading action after at least ten seconds in the disconnected real UI. Connect Wallet remains enabled; fixture-connected signing guards are a separate source-test scope; current actual dust/unsupported outcomes remain distinct. No executable KENA quote or missing→available transition was observed; loading is not useful latency. The observed catalog/probe snapshot valued that market at approximately $25.77, below the unchanged $100 reference-admission default; this is not a fresh claim about current reserves or a direct container-environment attestation. Whole acceptance criteria (do not check a criterion from a passing subset): | Criterion | Complete | Remaining scope | | --- | --- | --- | | AC1 | [ ] | Original historical production economic observations/reference pins are unavailable. Current synthetic/contract parity cannot reconstruct them. | | AC2 | [ ] | Generic source economics pass; complete supported factory/path/capability and deployed actor/hook/wrapper coverage remains separate. | | AC3 | [ ] | Source intent/generation/expiry/cadence and deployed continued waiting pass; complete deployed refresh/receive/manual/race/recovery transitions remain unverified. | | AC4 | [x] | Source permutation/alias/explicit-link/bid-ask behavior plus four fresh deployed unsigned default-funding checks pass: exact native request and independently validated wrapper gross/route identity, visible matching net and original expiry. No production signing is claimed; complete funded native settlement remains AC8. | | AC5 | [x] | Stable bounded API/client reason semantics, distinct HTTP 200 validation and accurate local-engine documentation verified. | | AC6 | [ ] | Expanded mode/state/actor/manual/hook/native and widened deployed first/repeat matrix are not yet complete. | | AC7 | [ ] | Current headed scope passes temporary 750 ms; earlier 762.4/857.4 ms headless failures and initial live 889 ms API / approximately 1.01 s render remain recorded. The complete current public socket matrix classified all 1,680 responses (997 executable, 683 blocked) across two cycles but failed the independent 500 ms budget on 13 useful samples (two cold, eleven reused). The current full public browser attempt hit its original 30-minute cap: 426/1,680 rows, all 420 first-desktop cases classified (286 useful and 134 typed blocked/waiting), nine useful >750 ms, and six phone visibility failures. It did not reach complete phone/repeat coverage or the 181-second cycle gap. The corrected 96-case reproduction has zero visibility failures but two phone results above 750 ms. Prior 500 ms acceptance is not established. | | AC8 | [ ] | Abuse/zero-RPC/budgets and funded subset pass; complete hook/tax/native/actor/physical settlement/security scope remains incomplete. The separate #1396 custom-bridge host check remains an executed FAIL. | | AC9 | [ ] | Documentation, CI, separate exact deployment/root artifacts and bounded classified logs pass; full live matrix repetition beyond observation/configuration cycles and lazy-asset scope remain incomplete. | The initial KENA 7/8 elapsed-budget trial remains FAIL; the zero-sample/zero-GET KENA phone retest setup timeout and native-default prerequisite attempt also remain FAIL. Narrower completed trials and the corrected private artifact parser do not relabel those earlier failures. The physical-wallet/device action is queued in the [PM inbox](https://pm.cl8y.com/inbox) as “Check KENA loading in the mobile wallet browser”; it is not a completed acceptance check. The card has four observation steps and requires no swap or signing. The [inbox-assigner skill](https://git.cl8y.com/PlasticDigits/cl8y-pm/src/branch/main/skills/inbox-assigner/SKILL.md) was used for this specific operator action required by the repository instructions. The dashboard could not link the DEX repository; the card uses its verified inbox-master association and includes this DEX issue URL in its body. Classified runtime logs are a bounded window with producer/oracle warnings, not proof of sustained pricing readiness or absence of all errors. The current socket trial covered solve+best twice with a 181-second gap: 1,680 classified responses (997 executable, 683 blocked), no shape/classification failures, and 13 executable samples above the separate 500 ms limit. New transport: n=2, p50/p95/p99/max 849.585/1029.957/1029.957/1029.957 ms; reused: n=995, 287.625/452.714/750.397/825.929 ms. Overall FAIL remains. The original capped live browser trial also remains FAIL: 426/1,680 rows, 420 first-desktop classified, 286 useful, 134 typed blocked/waiting, nine useful timing failures and six phone visibility failures; useful p50/p95/p99/max 353.1/383/942.6/987.2 ms. The six phone rows received prompt independently validated matching HTTP 200 results, but the receive/surface visibility check stayed false. The helper opened Settings and did not close it before input; expanded-state and exact offscreen versus opacity geometry were not recorded, so these are verification setup/visibility failures, not established product pricing timeouts. The helper's final-cycle/backend and final root-artifact checks were not reached. A separate official post-run attestation passed eight bounded reads for both deployed revisions and unchanged frontend root hashes; it does not complete the interrupted trial. [PR #1476](https://git.cl8y.com/code/cl8y-dex-terraclassic/pulls/1476) changes the verification helper/tests, trusted CI runner/tests, stale image-pin ledger records, public-key Docker copy permissions, and their documentation. The helper closes Settings and confirms both amount fields intersect before installing the original-input clock; invisible output still cannot pass. Eleven actual helper/DOM tests passed twice plus an independent root run, and the measurement closure remained byte-identical. App code has no diff. Measured QA tool head is `cf176c0ee426991b417341c277f19220bb2b4a5d`, fingerprint `b4c64d57d87ab7c064bc144564a088e50135d8be009c70794ceadab2f55c993e`; the deployed app remains `ea627f7b0e8d5ebc9fde2bb5b243f451cf159f4d`. The corrected reproduction completed all 96 first/retest UST1↔CL8Y samples in both viewports across the 181-second gap. All 96 had independently validated matching visible useful output, zero visibility timeouts, 120 quote GETs and no writes/WebSockets. Five backend revision checks and both root-artifact boundary checks matched the unchanged app; tool head/fingerprint matched before/after and its owned browser was cleaned up. This is a bounded reproduction, not the expanded full matrix. Overall FAIL remains because two first-phone samples took 1008.4 and 1005.1 ms. All useful samples: p50/p95/p99/max 362.2/684.5/1008.4/1008.4 ms; desktop n=48: 355.6/431/690.7/690.7; phone n=48: 401.4/735.4/1008.4/1008.4. Cache misses n=39: 363.3/680.5/684.5/684.5; cache unobserved n=57: 362.2/735.4/1008.4/1008.4; hits n=0. All 96 transports were reused; no cold-transport browser acceptance is claimed. QA CI413 and the single unchanged-source retry414 failed during canvas dependency installation, before frontend lint/test/build; downstream indexer jobs were skipped and completeness failed. Those remain actual FAIL. The native-build prerequisite repair is reviewed and the immutable policy is deployed at `28272783a171911e1b249381d0dbf7a4b48ca98d`, health hash `80da17a5428fe88f1803ab592a474a51b3a3e52a7c954284f59f6793dcf982b4`. An independent two-read check confirmed the hash and exclusive signed/no-netrc settings. Required status checks were preserved. The CI repair keeps ordinary npm installation and all six mandatory jobs, adds the native compiler/Cairo/Pango/DejaVu prerequisites, then forces a fresh Canvas rebuild and checks nonempty objects/binding, exact RGBA and rendered Pango text. Installation, compilation or rendering failures cannot record PASS. The public Ed25519 key bytes are unchanged; Docker copies that public file read-only for the nonroot service independently of checkout permissions. Fifteen hermetic runner cases passed twice and all nine available #1400 groups passed; existing image references were verified against official registry bytes, with five stale ledger entries reconciled to their unchanged declarations. The attempted local exact-image native fixture remains unavailable and is not native proof. The policy-only rollout completed from exact reviewed commit `28272783a171911e1b249381d0dbf7a4b48ca98d`; its hash is `80da17a5428fe88f1803ab592a474a51b3a3e52a7c954284f59f6793dcf982b4`, independently read back with unchanged exclusive/no-netrc settings. Nonroot health passed and unsigned configuration requests returned 401. The previous pin/hash was preserved for rollback. No required context, signing key, job graph, image declaration or resource cap was weakened. [Pipeline 416](https://ci.cl8y.com/repos/7/pipeline/416/1) passed all six real jobs with exit 0 and exact-head log markers on `80009d6f755abf59438ed9562fb34d5ed551ed08`. A fresh independent API read also confirmed all six successful states. The actual pinned worker produced 17 Canvas CXX compile lines, linked the purged native binding, used two make jobs, and passed the anchored exact RGBA/DejaVu/Pango render check. Full frontend 3,240 tests/363 files plus lint/type/build, 999 contract tests, 774 indexer library tests and 84 Postgres tests passed. The one manual cache benchmark and one runtime-DDL credential fixture remain explicitly ignored; this is not complete database acceptance. Pipeline 415 was killed when superseded by the final documentation head, separately from the executed 413/414 failures. The normal server merge and local main fast-forward/push completed at `2d1627ffa33eb3e08199acfff574a5b63fcfbd39`, with no incoming main commits and all three unrelated user files byte-preserved. Reviewed head is an ancestor and its tree matches the merged tree. [Retained full live failures](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/2d1627ffa33eb3e08199acfff574a5b63fcfbd39/docs/qa/issue-1473/live-warmup-failure-summary.json), [corrected bounded reproduction](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/2d1627ffa33eb3e08199acfff574a5b63fcfbd39/docs/qa/issue-1473/live-browser-setup-corrected-summary.json), and [CI repair/provenance](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/2d1627ffa33eb3e08199acfff574a5b63fcfbd39/docs/qa/issue-1473/CI-NATIVE.md) are crosslinked with the invariants and agent instructions. Agent review: use the [checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/2d1627ffa33eb3e08199acfff574a5b63fcfbd39/docs/qa/issue-1473/README.md) and [data-wait/cadence instructions](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/2d1627ffa33eb3e08199acfff574a5b63fcfbd39/docs/qa/issue-1473/WARMUP.md). Verify each item's actual integer/result/identity assertion, original expiry, expected disabled signing state and source/artifact/UTC scope. Unavailable checks may be explicit SKIP with reason and prerequisites; an agent may mark the stated executed scope PASS WITH SKIPS when every executed check in that scope passes. Executed failures retain FAIL and incomplete acceptance remains unchecked. The issue-body AC4 and AC5 boxes are checked after independent review and readback. #1473 remains open: not every current body/comment criterion passes. This comment records implemented functional improvements and their actual verification limits, not complete issue acceptance.
Author
Owner

Closed at the user's request as part of consolidating issues #1449–#1500.

Typed outcomes and deterministic defaults are implemented. The demonstrated native quote availability/recovery problem moves to #1504.

Replacement: #1504

Wallet/device chores and verification-only holds are intentionally excluded. Historical failed receipts remain unchanged; this closure does not claim every old acceptance checkbox passed.

Closed at the user's request as part of consolidating issues #1449–#1500. Typed outcomes and deterministic defaults are implemented. The demonstrated native quote availability/recovery problem moves to #1504. Replacement: https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1504 Wallet/device chores and verification-only holds are intentionally excluded. Historical failed receipts remain unchanged; this closure does not claim every old acceptance checkbox passed.
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#1473
No description provided.