# AGENTS.md — `http-compress`
Concise engineering and iteration guidelines for `http-compress` (`compress/`).
Global workspace rules live in [`../.agents/skills/hyperlane/SKILL.md`](../.agents/skills/hyperlane/SKILL.md) and `~/.agents/skills/rust-standards/SKILL.md`.
## Scope & Module Boundaries
- **Role**: Bounded gzip, deflate, and brotli HTTP codecs, RFC 9110 `Accept-Encoding` negotiation, and `XxHash3_64` hashing helpers.
- **Dependencies**: Leaf crate (`brotli`, `flate2`, `twox-hash` only). Do NOT depend on `http-type`, `hyperlane-core`, or async runtimes.
- **Layout**: Public `compress` (`Compress`) and `xx_hash3_64`; internal codec modules `brotli`, `deflate`, `gzip`; tests in `tests/`.
## Core Iteration Invariants
- Strictly enforce `MAX_DECOMPRESSED_BYTES` (`64 MiB`) across gzip, deflate, and brotli decompression paths; never introduce unbounded `read_to_end` reads or zip-bomb amplification.
- Keep `Compress::from_accept_encoding` zero-allocation with exact integer (`u16`) q-value parsing per RFC 9110 (avoid float rounding drift and respect `q=0` rejections).
- Preserve pre-sized encode/decode output buffers and ensure reusable thread-local codec state is fully reset across invocations.
- Keep `XxHash3_64` hashing deterministic and allocation-free because downstream routing and plugins rely on it on hot paths.
## Code & Documentation Standards
- Follow `rust-standards`: pure 9-keyword filenames, 3-section `mod.rs` (zero comments), centralized imports in `src/lib.rs` and `tests/mod.rs`, `pub(crate)` struct fields with `lombok-macros` accessors (no direct `self.field`), explicit types on all `let`/closure bindings, zero `#[allow]`/`unwrap()`/`expect()`/`panic!()`, `pub` before `pub(crate)` in `const.rs`/`static.rs`, strict `Cargo.toml` dependency order, and comment-free tests in `tests/`.
- Keep all code, comments, docs, and commits pure English. Update `compress/README.md` alongside any public API or codec limit change.
## Local Verification
```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p http-compress --all-features --all-targets -- -D warnings
cargo test -p http-compress --all-features
python3 ~/.agents/skills/rust-standards/scripts/staged_file_gate.py .
python3 ~/.agents/skills/rust-standards/scripts/verify_dep_order.py .
```