1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! The `ExecutionAdapter` seam (ADR-025) — a deep, user-owned execution layer
//! over the thin engine.
//!
//! This pyo3-free crate owns the **`ExecutionAdapter` trait + its value
//! types**: the solve-result view ([`SolveResult`]), the gate protocol
//! ([`ProbeSpec`] / [`AssessOptions`] / [`ExecutionResult`] / [`FeePolicy`]),
//! and the Encode seam ([`PayloadComposer`] / [`ComposerInputs`] /
//! [`ComposeError`]). It holds **no default strategy**.
//!
//! A strategy decomposes into four parts (ADR-025 D2):
//!
//! - **Encode** — [`PayloadComposer`]: `solve result → payload bytes` for ONE
//! execution contract. Rust users implement the trait; Python users supply a
//! callable lifted into it by `degenbot-python` (`PyPayloadComposer`).
//! - **Probe** — declared data: which pre/post read-calls to snapshot
//! ([`ProbeSpec`]). The engine runs the reads / warms the cache / access
//! list.
//! - **Assess** — a gate rule: how deltas → gross and pass/fail (built-in
//! shapes in [`AssessRule`] + a tiny optional user interpreter).
//! - **Fee** — the **defaulted pricing half of Assess** ([`FeePolicy`]), not a
//! fifth seam. `net = gross − gas×(base_fee_next + priority_fee)` is defined
//! in terms of the pricing policy, so pricing cannot be independently
//! ordered; a built-in market-percentile default (TARGET_PROFIT_RATIO /
//! age-decay) is provided, overridable by a foreign searcher.
//!
//! The generic seam has no built-in `cmd_executor` policy. The concrete
//! production `CmdExecutorAdapter` lives in `degenbot-strategy`, where it
//! owns the canonical command-executor path; a foreign user's crate implements
//! [`ExecutionAdapter`] directly, or supplies a Python callable via the PyO3
//! lift — both foreign paths meet this same generic seam.
//!
//! `pyo3`-free (enforced by `just check-no-pyo3-in-cores`); consumable by both
//! the standalone Rust path and the PyO3 driver shell. Dep graph is a DAG:
//! `execution → {executor, simulation, solvers}`.
// Re-export the Encode seam (ADR-025 D2) so `PayloadComposer` +
// `ComposerInputs` + `ComposeError` are reachable directly off the crate root,
// matching the docs contract (`use degenbot_execution::{PayloadComposer,
// ComposerInputs, ComposeError};`).
pub use ExecutionAdapter;
pub use ;
pub use ;
pub use SolveResult;