--- id: review-impl name: Review alktls v1 implementation for spec conformance (pre-rewrite gate) status: pending depends_on: [integration-suite] scope: moderate risk: low impact: phase level: review tags: [review, phase-gate, spec-conformance] --- ## Description Review the completed port against the architecture docs before the alknet rewrite consumes the crate. This is the one-way-door gate: the public API surface freezes here (the rewrite compiles against it). ### The checklist 1. **API surface == ADR-004** — every accessor signature matches the ADR sketches exactly (`&self` server / `self` client; `for_tcp_tls` infallible; `rustls_config` borrows). Re-export block is the documented surface. 2. **`TlsError` == ADR-002** — six variants, `#[non_exhaustive]`, no string catch-all, `#[source]` chains intact. 3. **Invariants == ADR-001/server.md/client.md** — all five server invariants + the client 0-RTT half + fail-closed structure, each with a passing test (check the test asserts the behavior, not that a compile succeeded). 4. **Deltas vs the extraction source** — diff `src/` against `crates/alknet-tls/src/` + the moved alknet-core modules; every difference maps to an ADR-pinned delta (identity-type rewire, error mapping, `for_noq`, borrowed accessors, no `unreachable!`). Any un-pinned divergence is either fixed or recorded. 5. **Feature hygiene** — `default = []` lean (AGENTS.md convention 4); tokio subset (`rt`, `sync`, `macros`) in `[dependencies]`; doc comments on the public API; no inline `//` comments outside the convention. 6. **Docs sync** — if the port revealed a spec mismatch, the ADR/spec gets an amendment note (not silent divergence). ## Work 1. Run the checklist against the code. 2. File findings (fix-forward for small ones; blockers get Safe Exit treatment). 3. Update `docs/architecture/README.md` statuses (Draft → Reviewed for the specs) when the checklist passes. ## Verification - [ ] The full checklist passes with findings recorded - [ ] `cargo test`, `cargo test --all-features`, `cargo clippy --all-targets -- -D warnings`, `cargo fmt --check`, `cargo doc --no-deps` all green - [ ] `cargo publish --dry-run --allow-dirty` passes (packaging readiness: metadata, license files, exclude list) - [ ] Spec statuses advanced where the gate passes ## Acceptance Criteria - [ ] Zero un-pinned divergences from the architecture docs - [ ] The API surface is declared frozen for the rewrite (README lifecycle note) - [ ] Findings + resolutions documented in the task Summary ## References - docs/architecture/ (all ADRs + specs — the conformance target) - docs/research/phase-0.md §Prior art (the extraction deltas) - AGENTS.md (conventions 1–12) ## Notes > Agent fills this during implementation. ## Summary > Agent fills this on completion.