OE-6 remainder: client BFS fallback indicator, route-display skill cross-link, deploy create_pair fee guard (GitLab #302 follow-up) #329

Closed
opened 2026-06-05 13:44:12 +00:00 by PlasticDigits · 24 comments
PlasticDigits commented 2026-06-05 13:44:12 +00:00 (Migrated from gitlab.com)

Parent

Follow-ups to GitLab #302 (OE-6 route display — open). MR !758 merged trade-market route row; verification (2026-06-05) FAIL on client BFS fallback indicator. Additional doc/deploy items bundled here.

Current codebase

Route display (shipped)

  • Shared util: computeSwapRouteDisplay (frontend-dapp/src/utils/swapRouteDisplay.ts) — single execution-aligned route line; indexer router_operations wins over client BFS.
  • Swap: data-testid="swap-route-summary" in SwapPage.tsx.
  • Trade market: data-testid="trade-market-route-summary" in TradeMarketOrderPanel.tsx (MR !758).
  • Skill: skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md documents Swap + trade market invariants; trade market row cross-link to trade-market-route-summary testid is partial (mentions testid in table but regression checklist could be clearer).

Client BFS fallback (gap)

  • When indexer POST /route/solve fails or returns no ops, Swap falls back to findRoute / findRouteWithNativeSupport (frontend-dapp/src/services/terraclassic/router.ts) — shortest-path BFS, not best output.
  • SwapPage.tsx swapMutation prefers indexerOperations, then direct pair, then client route — no UI signal when submit/display uses client graph vs indexer path.
  • Trade market passes clientRoute: null (pair-scoped) — fallback indicator primarily affects Swap; note if /trade ever uses client route.

Deploy create_pair fee (largely shipped)

  • GitLab #318 added factory_create_pair() in scripts/deploy-dex-local.sh attaching --amount ${PAIR_CREATION_FEE_ULUNA}uluna from on-chain factory config (DEFAULT_PAIR_CREATION_FEE_ULUNA = 100_000_000).
  • scripts/qa/verify-issue-276.sh greps for fee attachment. scripts/e2e-seed-wrap-pairs.sh also attaches fee.
  • Remaining: Ensure skill/QA docs reference #318 guard; no other deploy scripts call bare create_pair without fee.

Why this is needed

  1. Fallback indicator (OE-6): Users see a route arrow but cannot tell if it came from indexer best-execution or client BFS — explainability gap; route may differ from indexer quote when indexer recovers.
  2. Skill cross-link: Agents editing trade market route must find trade-market-route-summary quickly from AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md (#302).
  3. Deploy fee: Pre-#318 deploys failed mid-run when factory charged 100 LUNC; regression guard prevents recurrence.

Constraints / guardrails

  • One route row invariant (#158) — indicator is a brief label (e.g. "Route source: client graph"), not a second route line.
  • Do not expose internal env URLs or indexer health details.
  • Indicator only when submit actually uses client findRoute path (not when indexer ops used).
  • Trade market: indicator only if client fallback is wired in future — document N/A if unchanged.
  • Deploy fee: read fee from factory config at deploy time (not hard-coded constant only).
  • Minimal copy — one line, dim/warning style consistent with swapDisclosure.ts patterns.

Relevant files

Area Path
Route display frontend-dapp/src/utils/swapRouteDisplay.ts, swapRouteDisplay.test.ts
Swap page frontend-dapp/src/pages/SwapPage.tsx — swapMutation, swapRouteLine, sim query
Trade market frontend-dapp/src/components/trade/TradeMarketOrderPanel.tsx
Client BFS frontend-dapp/src/services/terraclassic/router.ts
Disclosure patterns frontend-dapp/src/utils/swapDisclosure.ts
Skill skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md
Deploy scripts/deploy-dex-local.sh — factory_create_pair
QA guard scripts/qa/verify-issue-276.sh
Docs docs/frontend.md § Swap page integration, § Trade market

A. Client BFS fallback indicator

  1. Add routeSource: 'indexer' | 'client_bfs' | 'direct' | 'native_wrap' to sim/submit state in SwapPage (derive from whether swapMutation used idxOps vs route).
  2. When routeSource === 'client_bfs', render brief label near swap-route-summary (e.g. data-testid="swap-route-source-client-fallback").
  3. Unit test: mock indexer failure + BFS route → indicator visible.
  4. Optional: same check on /trade if client route ever enabled.
  1. In AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md code map + regression checklist, add explicit anchor: Trade market route row → data-testid="trade-market-route-summary" inside trade-market-quote.
  2. Cross-link from Swap row (swap-route-summary) for symmetry.

C. Deploy fee verification

  1. Confirm all create_pair paths use factory_create_pair (grep scripts).
  2. If complete, add note to skill AGENTS_QA_DEPLOY_VERIFY.md citing #318 — close deploy item as verified.
  3. If gap found, fix script + extend verify-issue-276.sh.

Acceptance criteria

  • Swap shows brief client-fallback label when submit uses findRoute graph without indexer ops.
  • No label when indexer path used (including hybrid).
  • AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md documents trade-market-route-summary with cross-links.
  • All deploy create_pair txs attach on-chain fee (or documented exception when fee=0).
  • make test-frontend green.

Test plan — all paths

Path Expected
Indexer multihop quote + submit No client-fallback label
Indexer down, BFS route found Label visible; route row from client graph
Direct pair, no indexer Direct line; no "client BFS" (or "direct" only if distinguished)
Wrap/unwrap native No BFS label
Trade market indexer multihop Route row; no client label (N/A)
Deploy local full seed All pairs created with fee tx success

Test plan — attack / abuse / hack vectors

Vector Expected
Misleading "indexer" label when on client path Label tied to actual swapMutation branch, not quote-only
User trusts client BFS as "best" Copy clarifies fallback / not best-execution

Verification criteria

  • Playwright or unit test for fallback label.
  • Manual: stop indexer → Swap with routable pair → label appears.
  • grep -r create_pair scripts/ — all use fee helper.
  • #302 OE-6 fallback row → PASS in verification report.
## Parent Follow-ups to GitLab **#302** (OE-6 route display — **open**). MR !758 merged trade-market route row; verification (2026-06-05) **FAIL** on client BFS fallback indicator. Additional doc/deploy items bundled here. ## Current codebase ### Route display (shipped) - **Shared util:** `computeSwapRouteDisplay` (`frontend-dapp/src/utils/swapRouteDisplay.ts`) — single execution-aligned route line; indexer `router_operations` wins over client BFS. - **Swap:** `data-testid="swap-route-summary"` in `SwapPage.tsx`. - **Trade market:** `data-testid="trade-market-route-summary"` in `TradeMarketOrderPanel.tsx` (MR !758). - **Skill:** `skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md` documents Swap + trade market invariants; trade market row cross-link to `trade-market-route-summary` testid is **partial** (mentions testid in table but regression checklist could be clearer). ### Client BFS fallback (gap) - When indexer `POST /route/solve` fails or returns no ops, Swap falls back to `findRoute` / `findRouteWithNativeSupport` (`frontend-dapp/src/services/terraclassic/router.ts`) — shortest-path BFS, not best output. - `SwapPage.tsx` `swapMutation` prefers `indexerOperations`, then direct pair, then client `route` — **no UI signal** when submit/display uses client graph vs indexer path. - Trade market passes `clientRoute: null` (pair-scoped) — fallback indicator primarily affects **Swap**; note if `/trade` ever uses client route. ### Deploy `create_pair` fee (largely shipped) - GitLab **#318** added `factory_create_pair()` in `scripts/deploy-dex-local.sh` attaching `--amount ${PAIR_CREATION_FEE_ULUNA}uluna` from on-chain factory config (`DEFAULT_PAIR_CREATION_FEE_ULUNA` = 100_000_000). - `scripts/qa/verify-issue-276.sh` greps for fee attachment. `scripts/e2e-seed-wrap-pairs.sh` also attaches fee. - **Remaining:** Ensure skill/QA docs reference #318 guard; no other deploy scripts call bare `create_pair` without fee. ## Why this is needed 1. **Fallback indicator (OE-6):** Users see a route arrow but cannot tell if it came from indexer best-execution or client BFS — explainability gap; route may differ from indexer quote when indexer recovers. 2. **Skill cross-link:** Agents editing trade market route must find `trade-market-route-summary` quickly from `AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md` (#302). 3. **Deploy fee:** Pre-#318 deploys failed mid-run when factory charged 100 LUNC; regression guard prevents recurrence. ## Constraints / guardrails - **One route row** invariant (#158) — indicator is a **brief label** (e.g. "Route source: client graph"), not a second route line. - Do not expose internal env URLs or indexer health details. - Indicator only when **submit** actually uses client `findRoute` path (not when indexer ops used). - Trade market: indicator only if client fallback is wired in future — document N/A if unchanged. - Deploy fee: read fee from factory config at deploy time (not hard-coded constant only). - Minimal copy — one line, dim/warning style consistent with `swapDisclosure.ts` patterns. ## Relevant files | Area | Path | |------|------| | Route display | `frontend-dapp/src/utils/swapRouteDisplay.ts`, `swapRouteDisplay.test.ts` | | Swap page | `frontend-dapp/src/pages/SwapPage.tsx` — `swapMutation`, `swapRouteLine`, sim query | | Trade market | `frontend-dapp/src/components/trade/TradeMarketOrderPanel.tsx` | | Client BFS | `frontend-dapp/src/services/terraclassic/router.ts` | | Disclosure patterns | `frontend-dapp/src/utils/swapDisclosure.ts` | | Skill | `skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md` | | Deploy | `scripts/deploy-dex-local.sh` — `factory_create_pair` | | QA guard | `scripts/qa/verify-issue-276.sh` | | Docs | `docs/frontend.md` § Swap page integration, § Trade market | ## Recommended direction ### A. Client BFS fallback indicator 1. Add `routeSource: 'indexer' | 'client_bfs' | 'direct' | 'native_wrap'` to sim/submit state in `SwapPage` (derive from whether `swapMutation` used `idxOps` vs `route`). 2. When `routeSource === 'client_bfs'`, render brief label near `swap-route-summary` (e.g. `data-testid="swap-route-source-client-fallback"`). 3. Unit test: mock indexer failure + BFS route → indicator visible. 4. Optional: same check on `/trade` if client route ever enabled. ### B. Skill cross-link (#302) 1. In `AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md` code map + regression checklist, add explicit anchor: **Trade market route row** → `data-testid="trade-market-route-summary"` inside `trade-market-quote`. 2. Cross-link from Swap row (`swap-route-summary`) for symmetry. ### C. Deploy fee verification 1. Confirm all `create_pair` paths use `factory_create_pair` (grep scripts). 2. If complete, add note to skill `AGENTS_QA_DEPLOY_VERIFY.md` citing #318 — close deploy item as verified. 3. If gap found, fix script + extend `verify-issue-276.sh`. ## Acceptance criteria - [ ] Swap shows brief client-fallback label when submit uses `findRoute` graph without indexer ops. - [ ] No label when indexer path used (including hybrid). - [ ] `AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md` documents `trade-market-route-summary` with cross-links. - [ ] All deploy `create_pair` txs attach on-chain fee (or documented exception when fee=0). - [ ] `make test-frontend` green. ## Test plan — all paths | Path | Expected | |------|----------| | Indexer multihop quote + submit | No client-fallback label | | Indexer down, BFS route found | Label visible; route row from client graph | | Direct pair, no indexer | Direct line; no "client BFS" (or "direct" only if distinguished) | | Wrap/unwrap native | No BFS label | | Trade market indexer multihop | Route row; no client label (N/A) | | Deploy local full seed | All pairs created with fee tx success | ## Test plan — attack / abuse / hack vectors | Vector | Expected | |--------|----------| | Misleading "indexer" label when on client path | Label tied to actual `swapMutation` branch, not quote-only | | User trusts client BFS as "best" | Copy clarifies fallback / not best-execution | ## Verification criteria - [ ] Playwright or unit test for fallback label. - [ ] Manual: stop indexer → Swap with routable pair → label appears. - [ ] `grep -r create_pair scripts/` — all use fee helper. - [ ] #302 OE-6 fallback row → PASS in verification report.
PlasticDigits commented 2026-06-05 13:44:12 +00:00 (Migrated from gitlab.com)

marked as related to #302

marked as related to #302
ghost1 commented 2026-06-05 13:56:14 +00:00 (Migrated from gitlab.com)

mentioned in commit e924ac1e0f

mentioned in commit e924ac1e0f4757116c4ea30d5d10c3e848e55b76
ghost1 commented 2026-06-05 13:56:15 +00:00 (Migrated from gitlab.com)

mentioned in commit c9a05766e9

mentioned in commit c9a05766e938f22e42cd5b49e5873296fdec1e4e
PlasticDigits commented 2026-06-05 13:56:44 +00:00 (Migrated from gitlab.com)

mentioned in merge request !813

mentioned in merge request !813
PlasticDigits commented 2026-06-05 13:56:47 +00:00 (Migrated from gitlab.com)

Implementation complete — MR !813.

Changes

  • Swap: deriveSwapSubmitRouteSource + warning label swap-route-source-client-fallback when submit uses client multihop BFS (no indexer ops).
  • Skills: route-display cross-links (#302); deploy-verify notes #318 factory_create_pair fee guard.
  • Tests: swapRouteDisplay.test.ts, SwapPage.test.tsx (854 frontend tests PASS).

Deploy create_pair audit: scripts/deploy-dex-local.sh → factory_create_pair; scripts/e2e-seed-wrap-pairs.sh attaches PAIR_CREATION_FEE_ULUNA when non-zero.

Issue stays open until MR merge + manual indexer-down check on localnet.

Implementation complete — MR [!813](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/95). **Changes** - Swap: `deriveSwapSubmitRouteSource` + warning label `swap-route-source-client-fallback` when submit uses client multihop BFS (no indexer ops). - Skills: route-display cross-links (#302); deploy-verify notes #318 `factory_create_pair` fee guard. - Tests: `swapRouteDisplay.test.ts`, `SwapPage.test.tsx` (854 frontend tests PASS). **Deploy `create_pair` audit:** `scripts/deploy-dex-local.sh` → `factory_create_pair`; `scripts/e2e-seed-wrap-pairs.sh` attaches `PAIR_CREATION_FEE_ULUNA` when non-zero. Issue stays open until MR merge + manual indexer-down check on localnet.
PlasticDigits commented 2026-06-05 14:20:57 +00:00 (Migrated from gitlab.com)

mentioned in commit 81e7eb4711

mentioned in commit 81e7eb4711a906d8def795002308fae25e516c6a
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-05 14:20:57 +00:00
ghost1 commented 2026-06-05 14:32:15 +00:00 (Migrated from gitlab.com)

mentioned in commit f07421823c

mentioned in commit f07421823cc157abcc7f9c69705361b81c37274d
PlasticDigits commented 2026-06-05 14:32:28 +00:00 (Migrated from gitlab.com)

mentioned in merge request !820

mentioned in merge request !820
ghost1 commented 2026-06-06 07:01:42 +00:00 (Migrated from gitlab.com)

mentioned in commit 3258f31026

mentioned in commit 3258f310261f6f2a56577d38b53a4163178d0f5b
PlasticDigits commented 2026-06-06 07:02:13 +00:00 (Migrated from gitlab.com)

mentioned in merge request !824

mentioned in merge request !824
PlasticDigits commented 2026-06-06 07:02:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #302

mentioned in issue #302
PlasticDigits commented 2026-06-06 07:10:08 +00:00 (Migrated from gitlab.com)

mentioned in commit 7aeb50ba58

mentioned in commit 7aeb50ba587a954b7bb597cc30b6d179609b8d6b
PlasticDigits commented 2026-06-08 08:43:13 +00:00 (Migrated from gitlab.com)

mentioned in commit c9b20a0f9a

mentioned in commit c9b20a0f9a45ccca3ae43bbdd26da43b3cbe1fbb
PlasticDigits commented 2026-06-08 08:43:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 71016dae1b

mentioned in commit 71016dae1b9271f3f897f21d70a046836e75a5fd
PlasticDigits commented 2026-06-08 08:43:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 3d5c1eac3d

mentioned in commit 3d5c1eac3dbfaf3ade88033600f320cdd6d89da2
PlasticDigits commented 2026-06-08 08:43:14 +00:00 (Migrated from gitlab.com)

mentioned in commit 47cdf2aee1

mentioned in commit 47cdf2aee1e29c85269a23708c31e6c121f49f56
PlasticDigits commented 2026-06-08 13:42:28 +00:00 (Migrated from gitlab.com)

mentioned in commit afb38ee2fc

mentioned in commit afb38ee2fc0b08dc6abbd841bc8e7ed2a2707121
PlasticDigits commented 2026-06-08 13:42:28 +00:00 (Migrated from gitlab.com)

mentioned in commit b5c8b220f4

mentioned in commit b5c8b220f4315a002708997f70e11bbe9257795f
PlasticDigits commented 2026-06-08 13:42:28 +00:00 (Migrated from gitlab.com)

mentioned in commit ab4488e2ec

mentioned in commit ab4488e2ec721d78398feace8e405a4535d5614e
PlasticDigits commented 2026-06-08 13:42:29 +00:00 (Migrated from gitlab.com)

mentioned in commit a2e3809ffd

mentioned in commit a2e3809ffd5856037fd70176eb11ef75a87163db
PlasticDigits commented 2026-06-08 13:42:30 +00:00 (Migrated from gitlab.com)

mentioned in commit 2d7f59c809

mentioned in commit 2d7f59c809c76b35a16e71dc2b6dfb9777e3f993
Brouie commented 2026-06-11 02:07:13 +00:00 (Migrated from gitlab.com)

mentioned in issue #356

mentioned in issue #356
Brouie commented 2026-06-11 02:12:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
Brouie commented 2026-06-11 02:14:24 +00:00 (Migrated from gitlab.com)

mentioned in merge request !864

mentioned in merge request !864
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#329
No description provided.