## Plan: Fix Provision SQL Build Break

This DRAFT addresses your selected scope: hardened fix plus a fallback for the E0282 closure typing issue only if it remains after root-cause fixes. The primary failure is Docker build context mismatch: Rust `include_str!` reads at compile time, and [Dockerfile](Dockerfile#L5-L16) currently does not copy [sql/](sql/provision.sql), so both include sites fail. The plan applies a minimal Docker correction and path hardening in Rust to reduce future path fragility, then conditionally applies a tiny type annotation in CLI parsing if needed.

**Steps**

1. Update [Dockerfile](Dockerfile) builder stage to include the SQL assets (`COPY sql ./sql`) alongside existing `src`, `config`, and `generated` copies so compile-time includes can resolve in container builds.
2. Harden `include_str!` usage in [src/api/provision.rs](src/api/provision.rs#L27) (`PROVISION_SQL`) to use `env!("CARGO_MANIFEST_DIR")`-anchored path concatenation rather than relative `../../`.
3. Harden `include_str!` usage in [src/cli.rs](src/cli.rs#L678) (`run_provision_command`) similarly to manifest-anchored path resolution.
4. Rebuild and reassess [src/cli.rs](src/cli.rs#L700); if E0282 persists, add a minimal explicit closure parameter type (or equivalent pattern) only on that filter line, without altering logic.
5. Confirm no collateral impact on provision flow by checking both API and CLI provisioning code paths in [src/api/provision.rs](src/api/provision.rs#L27-L133) and [src/cli.rs](src/cli.rs#L678-L701).

**Verification**

- Run `cargo check --all-targets --all-features`.
- Run `cargo test --test provision --test provision_api` (or nearest existing provision-related tests if names differ).
- Run `docker build -f Dockerfile .` (or `docker compose build`) to confirm container compile succeeds with embedded SQL.

**Decisions**

- Chosen: hardened approach (Docker fix + manifest-anchored includes) over Docker-only patch for long-term resilience.
- Chosen: E0282 type annotation as conditional fallback, not default, to keep changes minimal if root issue already resolves inference.
