Fix cosmes patch, db_orderbook_sim, and add #293 indexer integration tests #420
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#420
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#411 — Updated Gap Analysis (recommendation 13)
Current codebase
Gap analysis run (2026-06-25) reported:
make test-frontendcosmesPatch127.test.ts— patch SHA mismatch for@goblinhunt/cosmes@0.0.71-ghunt.22make test-indexer-integrationdb_orderbook_sim::tests::zero_reserve_mirror_returns_no_outputscripts/verify-issue-293.sh; not in indexer integration suitecosmesPatch127.test.tsguards patch-package integrity (patches/.cosmes-patch-sha256).db_orderbook_sim.rssupports hybrid route solver (#319).route_slippage.rsimplements #293 symmetric slippage.Why needed
#411 retail UX work depends on green unit/integration gates. Hybrid quote alignment (#411 child) requires trustworthy
db_orderbook_simand #293 regression coverage.Constraints / guardrails
patches/.cosmes-patch-sha256only after intentional patch change +npm ci(#367).db_orderbook_simfix must not mask real zero-reserve mirror conditions — test expectation may be wrong or sim logic regressed.api_route_solvetests (#324).Relevant files
frontend-dapp/src/services/terraclassic/__tests__/cosmesPatch127.test.tsfrontend-dapp/patches/.cosmes-patch-sha256frontend-dapp/patches/@goblinhunt+cosmes+*.patchindexer/src/api/db_orderbook_sim.rs(testzero_reserve_mirror_returns_no_output)indexer/src/api/route_slippage.rsindexer/tests/api_route_solve.rs(or new integration test file)scripts/verify-issue-293.shdocs/testing.mdRecommended direction
npm cior fix drifted patch file.db_orderbook_sim: fixzero_reserve_mirror_returns_no_output— correct sim to returnInsufficientLiquidityor update test if mirror semantics changed with #319.slippage_percenton solve response for known fixture route.docs/testing.mdif new fixtures required.Acceptance criteria
make test-frontend— 1040/1040 includingcosmesPatch127.test.ts.make test-indexer-integrationcompletes (lib + integration).slippage_percent(#293).db_orderbook_sim::zero_reserve_mirror_returns_no_outputpasses.Test plan
cd frontend-dapp && npm ci && make test-frontendmake setup-indexer-postgres(if needed) +make test-indexer-integrationcd indexer && cargo test --lib api::db_orderbook_simbash scripts/verify-issue-293.sh(should align with new integration test)Attack / abuse test plan
zero_reserve_mirrormust not panic or return positive output on empty reserves (no divide-by-zero).Verification criteria
make test-frontendandmake test-indexer-integrationgreen on Cloud Agent VM.allow_failureor skipped tests introduced.mentioned in issue #411
mentioned in merge request !943
Verification — #420 (PASS)
Verified on
main@2f26b71d(merge of4ad0ae14— cosmes ghunt.22 patch,db_orderbook_simzero-reserve fix,route_solve_slippage_percent_enrichment_293).Acceptance criteria
make test-frontendincludingcosmesPatch127.test.tscd frontend-dapp && npm ci && make test-frontend→ 184 files, 1084/1084 passed (includes 3/3 incosmesPatch127.test.ts). Patch SHAfc717f07…matchespatches/.cosmes-patch-sha256.make test-indexer-integration(lib + integration)make setup-indexer-postgresthenmake test-indexer-integration→ exit 0 (~6 min).slippage_percent(#293) integration coveragecargo test --test api_route_solve route_solve_slippage_percent_enrichment_293 -- --test-threads=1→ ok. Fixtureseed_route_slippage_293assertsslippage_percent,spot_amount_out, token price fields.db_orderbook_sim::zero_reserve_mirror_returns_no_outputcargo test --lib api::db_orderbook_sim→ 8/8 ok; zero-reserve mirror withMirrorFreshness::EmptyPoolreturnsDbSimError::InsufficientLiquidity(no panic, no positive output).Test plan / attack items
cd indexer && cargo test --lib api::db_orderbook_simbash scripts/qa/verify-issue-293.shalignmentroute_solve_slippage_percent_enrichment_293covers the slippage enrichment acceptance path documented indocs/testing.md. Live OE-1 layer [3] SKIP — LocalTerra/indexer not provisioned on this VM (make has-localterra→ not running).zero_reserve_mirrorno divide-by-zero / no positive outputInsufficientLiquidityassertion.cargo test --lib api::route_slippage→ 3/3 ok.Notes
make test-frontendrun hit a flaky unhandledwindow is not definedfromPairSearchSelectdebounce timer afterTradePage.test.tsxteardown; immediate re-run passed cleanly. Unrelated to #420 scope; consider hardening timer cleanup in a follow-up.verify-issue-293.sh[2] (packages/localnet-trading-swarmvitest) failed here withvitest: not found(deps not installed in that package); not an acceptance gate for #420.No repo changes or MR opened during verification.