AppState now holds ports instead of concrete types: `engine: Option<SharedEngine>` replaces the mpsc::Sender<GenerationCommand>, `responses: SharedResponseStore` replaces Arc<RwLock<ResponseHistory>>, `clock: SharedClock` serves queue deadlines, uptime and response timestamps, `mcp` is a ToolHub and `vision` a VisionEncoder. The channel (adapters::ChannelEngine), the history with its disk snapshot (responses::HistoryResponseStore), the system clock, mcp::Hub and vision::Vision are the adapters; main.rs serve() composes them. No behaviour change: the HTTP handlers make the same calls in the same order, the queue claim race is unchanged, only the deadline now reads the injected clock. Ports are called per request, never per token or stream event (docs/architecture/gateway-ports.md). ports/fakes has an in-memory adapter per port; control-plane/tests/ports_fakes.rs (12 tests), queue.rs and adapters/channel_engine.rs add tests that drive the real handlers through them. Architecture gate: dyn-trait:strata-control fell 35 -> 21 (a BoxError alias replaces 20 `Box<dyn Error>` spellings, which pays for the 6 new port aliases); main.rs 1156 -> 1155 lines. Also adds scripts/dev/test-outcomes.py (per-test outcome comparison of two cargo test logs) and scripts/dev/wsl-cargo.sh.
8 lines
565 B
Bash
8 lines
565 B
Bash
#!/bin/bash
|
|
# Run cargo in WSL Ubuntu against this worktree with a worktree-local target dir (STRA-338 gateway track).
|
|
# usage: scripts/dev/wsl-cargo.sh LOGFILE cargo-args... (from Git Bash on the Windows host)
|
|
log="$1"; shift
|
|
root="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
wslroot="/mnt/$(echo "${root}" | sed -E 's#^/([a-zA-Z])/#\L\1/#')"
|
|
MSYS_NO_PATHCONV=1 wsl -d Ubuntu -e bash -lc "source ~/.cargo/env; cd '${wslroot}'; export CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=\$PWD/target/wsl; cargo $* > '${wslroot}/${log}' 2>&1; echo \"EXIT \$?\" >> '${wslroot}/${log}'"
|