- src/lib.rs: crate docs, ADR-002 TlsError verbatim (six variants, #[non_exhaustive], typed #[source] chains), module declarations, compile-assertion tests for the enum + noq-gated NoqWrap - seven module files with doc headers only (ports land per task) - Cargo.toml verified against ADR-003 verbatim (no edits needed) - deviation: VerifierBuild source is rustls::client::VerifierBuilderError (rustls::webpki is private at pinned 0.23.44; same type, public path) Verification: cargo build/test (default, noq, tcp, acme, all-features), clippy -D warnings, fmt --check, doc --no-deps — all green
5.5 KiB
5.5 KiB
id, name, status, depends_on, scope, risk, impact, level, tags
| id | name | status | depends_on | scope | risk | impact | level | tags | ||
|---|---|---|---|---|---|---|---|---|---|---|
| crate-init | Crate skeleton — module files, feature gates, error type, re-exports | completed | narrow | low | project | implementation |
|
Description
Initialize the alktls module skeleton per ADR-006: replace the
placeholder src/lib.rs with the eight-module layout
(identity, credentials, fingerprint, server, client, pem,
signing + lib.rs), the feature gates per ADR-003
(default = []; noq, tcp, acme), and the TlsError type per
ADR-002. Modules may be stubs (pub fn bodies todo!-free — empty
with doc comments) but the module map, features, deps, and error enum
land now so subsequent tasks are additive, not structural.
What lands here
Cargo.tomlfinal shape: deps per ADR-003's TOML block (noq+noq-protooptional, default-features off;tokio-rustls;rustls-acme; the always-present set per the overview's dependency posture).src/lib.rs: crate docs (the overview's shape),TlsError(the ADR-002 enum verbatim, including thenoq-gatedNoqWrapvariant), and the re-export block (the documented public API surface).- Empty module files with
//!doc headers only — no function bodies. .taskgraph.tomlnot needed (default./tasksworks).
What does NOT land here
- Any ported logic (subsequent tasks).
- Any test beyond a compile assertion that the error enum matches.
Work
- Rewrite
Cargo.tomlfeatures/deps per ADR-003. - Write
src/lib.rswith the ADR-002TlsError+ module declarations + re-exports. - Create the seven module files with doc headers.
- Verify the feature matrix compiles (all four combos below).
Verification
cargo build(default,default = []) passescargo test --all-featurespasses (noq + tcp + acme all resolve)- Each feature alone:
cargo check --features noq,--features tcp,--features acme cargo clippy --all-targets -- -D warnings,cargo fmt --checkTlsErroris#[non_exhaustive]with exactly the ADR-002 variants (CertLoad,SelfSigned,Rustls,VerifierBuild,NoqWrapnoq-gated,AcmeConfig)
Acceptance Criteria
- The module map matches ADR-006 (one module per file, re-exported
from
lib.rs; public API surface is the re-export block) - Feature gates match ADR-003 exactly
- No
todo!/unimplemented!/panics in library code — stubs are empty or error-returning, never panicking
References
- docs/architecture/decisions/002-tlserror-shape.md (the enum)
- docs/architecture/decisions/003-noq-replaces-quinn.md (features, deps)
- docs/architecture/decisions/006-module-layout-and-tests.md (module map)
- docs/architecture/overview.md (dependency posture)
Notes
Agent fills this during implementation. Document any decisions, deviations from architecture, or relevant context discovered.
Decisions / deviations
VerifierBuildsource path:rustls::client::VerifierBuilderError, notrustls::webpki::VerifierBuilderError. The ADR-002 sketch used therustls::webpkipath, but at the pinned rustls 0.23.44 that module is private — the type is re-exported publicly atrustls::client(verified in the 0.23.44 source:mod webpki;+pub use crate::webpki::{VerifierBuilderError, ...}insidepub mod client). Same type, public path; noted in the variant's doc comment. ADR-002 needs a one-line amendment (recorded for the review-impl docs-sync pass).- Re-export block deferred per module.
lib.rscarries the module declarations now; thepub useblock lands incrementally with each port task (a re-export of a not-yet-ported type cannot compile, and every intermediate commit must stay green). The final shape is ADR-006's map + overview.md's surface; port-client (the last module port) completes it. - The
noq-gated compile assertion cannot constructNoInitialCipherSuitefrom outside noq-proto (private field), so the test is an existence proof viamatches!onOption<TlsError>— compiles only when the variant + its#[from]source exist. Cargo.tomlunchanged — the scaffold's TOML already matched ADR-003's block exactly (featuresdefault = []/noq/tcp/acme;noqwithdefault-features = false, features = ["rustls"]). Verified against ADR-003 line-by-line; no edits needed.
Summary
Agent fills this on completion. Brief description of what was implemented, files changed, and any follow-up needed.
What landed
src/lib.rs: crate docs + the ADR-002TlsErrorverbatim (six variants,#[non_exhaustive],#[source]chains;NoqWrapnoq-gated) + module declarations + a compile-assertion test for the enum (#[from]conversions +AcmeConfigdisplay) and the noq-gatedNoqWrapexistence test.- The seven module files (
identity,credentials,fingerprint,server,client,pem,signing) with//!doc headers only — no bodies, per "what does NOT land here". - Feature matrix verified: default,
noq,tcp,acme,--all-features.
Verification
cargo build(default) ✓;cargo test✓ (1 test);cargo test --features noq✓ (2 tests);cargo check --features tcp|acme✓;cargo test --all-features✓;cargo clippy --all-targets --all-features -- -D warnings✓;cargo fmt --check✓;cargo doc --no-deps✓.
Follow-up
- ADR-002 amendment note for the
VerifierBuilderErrorpath (review-impl docs sync).