- Performance/optimization/resource work: if
cargo run --bin xtask -- mock-deploylacks claimed-gain metric, update it; capture baseline before edits; claim gains only with before/after same target/config.
- MUST pass:
cargo fmt --all -- --check;cargo clippy --all-targets -- -D warnings;cargo test. - Fmt fail: run
cargo fmt --all, recheck. Windows lock:cargo test --target-dir target/codex-test, report. - CSS change (
static/index.html,static/input.css):npm run build:css;git diff --exit-code static/tailwind.min.css. - JS change (
static/app.js):node --check static/app.js. - Never commit failing checks.
- Default proof:
cargo run --bin xtask -- mock-deploy. - Any implementation change MUST add/update
cargo run --bin xtask -- mock-deployproof. - Proof MUST verify outcome and stress changed runtime path; performance/resource claims MUST measure.
- Unit tests never replace runtime proof.
- Any change MUST use full build/deploy proof; never use
--skip-build --skip-deploy. - Cloudflare/ACME/HTTPS off unless
.deployenvenables them.
- UI embedded via
include_str!/include_bytes!; no runtime UI files. - DNS/API hot-reload uses shared
Arc<RwLock<DomainStore>>/Arc<RwLock<RewriteMap>>. - Never hold
parking_lotguards across.await; clone/copy first. - Async DB uses
tokio::task::spawn_blocking.
- Normalize via
normalize_domain(). - DB wildcards keep
*.; runtime wildcards store suffix. build()borrows records; records outlivesend_response.- Prefer
send_responseforResponseInfo; fallback usesResponseInfo::from(Header).