Refs #42
PR: feat(cli): wire scanner → router → builder → simulator pipeline (feat/17-cli-e2e-pipeline)
Commit: latest on feat/17-cli-e2e-pipeline
File: crates/charon-cli/src/ (no test module), crates/charon-executor/src/ (no test module)
PRD clause: CLAUDE.md: 'Before any commit: run the gates locally — cargo test --workspace.' Live soak is not a substitute for automated tests.
Problem:
The PR's test evidence is: 'Live soak: 21 pipeline ticks in 25s, zero borrowers, zero panics.' With zero borrowers, the pipeline runs:
- fetch_positions(&[]) — returns empty vec
- scanner.upsert([]) — no-op
- No liquidatable positions — inner loop body never executes
These code paths have zero test coverage:
- No-signer branch (BOT_SIGNER_KEY absent): is opportunity enqueued or dropped?
- Simulation failure branch: does Err from simulate() drop the opportunity or enqueue it?
- Profit threshold gate: is the filter applied before or after enqueue?
- min_amount_out arithmetic: is the repay+fee formula correct for all token decimals?
- get_liquidation_params failure: does it skip the position or abort the tick?
The three p0-blocker scenarios (broken profit calc, empty params, unsimulated enqueue) are not caught by any test.
Impact: Pipeline branching logic is entirely untested. Logic errors in the drop-vs-enqueue decision surface only at mainnet.
Fix: Add unit tests using mock adapter, mock router, and mock simulator (trait objects). Required test cases:
- Happy path: profitable opportunity, sim passes, enqueued.
- Sim failure: opportunity, sim returns Err, not enqueued.
- No-signer: BOT_SIGNER_KEY absent, not enqueued.
- Below threshold: profit < min_profit, not enqueued.
- Adapter failure: fetch_positions returns Err, tick logged as warn, pipeline continues.
Refs #42
PR: feat(cli): wire scanner → router → builder → simulator pipeline (feat/17-cli-e2e-pipeline)
Commit: latest on feat/17-cli-e2e-pipeline
File: crates/charon-cli/src/ (no test module), crates/charon-executor/src/ (no test module)
PRD clause: CLAUDE.md: 'Before any commit: run the gates locally — cargo test --workspace.' Live soak is not a substitute for automated tests.
Problem:
The PR's test evidence is: 'Live soak: 21 pipeline ticks in 25s, zero borrowers, zero panics.' With zero borrowers, the pipeline runs:
These code paths have zero test coverage:
The three p0-blocker scenarios (broken profit calc, empty params, unsimulated enqueue) are not caught by any test.
Impact: Pipeline branching logic is entirely untested. Logic errors in the drop-vs-enqueue decision surface only at mainnet.
Fix: Add unit tests using mock adapter, mock router, and mock simulator (trait objects). Required test cases: