- Rewrote em dash prose across the whole tree outside docs/reviews/ (the historical reviews stay verbatim, matching the alktunnels and alktty precedent): src doc comments and inline comments (587), docs/architecture (319), docs/research + sdd_process (484), tests (361), tasks (899), fuzz (28), README/CHANGELOG/Cargo.toml (77), AGENTS.md (85), and the .opencode/agents prompts (109) - Fenced content follows the precedent: comments, ASCII-diagram label separators, and template placeholders rewritten; wire data, JSON/BAST documents, byte diagrams, and transcripts survive verbatim; assert, expect, panic, error-display, and format message literals rewritten as prose; no code, fixture, or test data change - src/rfc1928/LICENSE: the two dashes in alksocks' own provenance header rewritten; the MIT legal text untouched - AGENTS.md adds Project Convention 18: no em dashes in prose; varied restructure, no spaced-hyphen substitutes, fenced prose rule, en dash numeric ranges exempt, docs/reviews/ exempt from the greps - tasks/*.md frontmatter: the name values rewritten by the sweep are now quoted (a raw colon inside an unquoted YAML scalar parsed as null); taskgraph validate reports 37 tasks, no issues Verification: cargo test; cargo clippy --all-targets -D warnings; cargo fmt --check; cargo doc --no-deps; fuzz corpus replay (cargo test --manifest-path fuzz/shared/Cargo.toml); wasm check and clippy for wasm32-unknown-unknown with -D warnings; em dash grep over the repo returns matches only in docs/reviews/ and the bast.md BAST JSON data fence
132 lines
6.3 KiB
Markdown
132 lines
6.3 KiB
Markdown
---
|
||
id: implementation/core-crate-deps
|
||
name: "Core: crate dependencies + module skeleton (alkcall wiring)"
|
||
status: completed
|
||
depends_on: []
|
||
scope: narrow
|
||
risk: low
|
||
impact: project
|
||
level: implementation
|
||
---
|
||
|
||
## Description
|
||
|
||
Add the dependency surface the wrapper layers need and the module
|
||
skeleton so the batch-1 core tasks have their targets. This is the
|
||
batch-1 analogue of the vendor scaffolding task: the crate gains
|
||
`alkcall` (its substrate, and first consumption of the 0.8.0 surface) and
|
||
the module files named in overview.md §Module Map, born wasm-clean.
|
||
|
||
Deliverables:
|
||
|
||
1. **`Cargo.toml` `[dependencies]`**: add to the existing trio
|
||
(tokio wasm-clean subset, tracing, thiserror):
|
||
- `alkcall = "0.8.0"` (pinned per AGENTS.md convention 11; bump
|
||
deliberately, never transitively)
|
||
- `serde = { version = "1", features = ["derive"] }`,
|
||
`serde_json = "1"` (the params schema + spec builder)
|
||
- `bytes = "1"` (the wire codec's buffer types)
|
||
- `futures = { version = "0.3", default-features = false,
|
||
features = ["std"] }` (BoxFuture for the seam callbacks, the
|
||
alktunnels precedent; verify the wasm-clean subset compiles)
|
||
- tokio stays `default-features = false` with the wasm-clean
|
||
subset (`rt`, `sync`, `io-util`, `macros`, `time`); **never
|
||
`features = ["full"]`** (AGENTS.md convention 4). No
|
||
`tokio/net`, no `socket2`: those ride `local` in batch 2.
|
||
- `[features]` stays `default = []`, `local = []`,
|
||
`composed = []`, declared empty by design (ADR-009); populated
|
||
by their modules' batch-2 tasks.
|
||
2. **`src/lib.rs`**: keep `#![forbid(unsafe_code)]` and the crate
|
||
docs; declare the module skeleton per overview.md §Module Map:
|
||
`params`, `wire`, `producer`, `consumer`, `egress`, `error`;
|
||
one-line stub files, each with a module doc naming its filling
|
||
task (the vendor-scaffolding precedent). `rfc1928` stays as is.
|
||
3. **Re-export posture**: `lib.rs` re-exports public API per
|
||
convention 15; for now the module declarations only, and each
|
||
implementation task adds its own re-exports.
|
||
|
||
## Acceptance Criteria
|
||
|
||
- [x] `cargo test` passes
|
||
- [x] `cargo clippy --all-targets -- -D warnings` clean
|
||
- [x] `cargo fmt --check` clean
|
||
- [x] `cargo check --target wasm32-unknown-unknown` clean; the wasm
|
||
gate stays green with alkcall + serde + bytes + futures in the
|
||
graph (alkcall 0.8.0's default crate is wasm-clean; verify, do
|
||
not assume)
|
||
- [x] `cargo clippy --target wasm32-unknown-unknown -- -D warnings`
|
||
clean
|
||
- [x] No `tokio/net`, `socket2`, `mio` in the default dependency
|
||
graph (`cargo tree` spot-check)
|
||
- [x] `alkcall` pinned at `"0.8.0"` (not a range)
|
||
- [x] Module skeleton matches overview.md §Module Map (module names
|
||
and file layout)
|
||
|
||
## References
|
||
|
||
- docs/architecture/overview.md §Dependencies, §Module Map
|
||
- docs/architecture/decisions/009-feature-gates.md (the feature
|
||
layout; no `net` feature)
|
||
- AGENTS.md conventions 4 (tokio subset), 11 (alkcall pin), 15
|
||
(module structure)
|
||
- Sibling posture: `/workspace/@alkdev/alktunnels/Cargo.toml`
|
||
(alkcall 0.8.0 consumer; the futures/bytes/serde dep set)
|
||
|
||
## Notes
|
||
|
||
- Verified before implementing that alkcall 0.8.0 (the crates.io
|
||
artifact, same resolution alktunnels uses) is wasm-clean with no
|
||
`[patch]`/RUSTFLAGS need: its `getrandom 0.4 + wasm_js` is
|
||
self-contained on `wasm32-unknown-unknown`. The `futures = {
|
||
default-features = false, features = ["std"] }` subset compiles in
|
||
the same graph (probe build in `/tmp/opencode/wasm-probe`).
|
||
- **Cargo.toml**: added `alkcall = "0.8.0"` (pinned, not a range, per
|
||
convention 11), `serde = { version = "1", features = ["derive"] }`,
|
||
`serde_json = "1"`, `bytes = "1"`, and
|
||
`futures = { version = "0.3", default-features = false, features =
|
||
["std"] }` (the BoxFuture seam shape; the std-only subset, not
|
||
default features. The latter is the same set in practice, but the
|
||
explicit subset is the documented posture). tokio unchanged (the
|
||
wasm-clean subset, `default-features = false`; never `full`); the
|
||
full-tokio dev-dep stays native-only. `[features]` untouched
|
||
(`default = []`, `local = []`, `composed = []`; ADR-009, populated
|
||
by batch-2).
|
||
- **lib.rs**: kept `#![forbid(unsafe_code)]` + crate docs; declared
|
||
the six skeleton modules per overview.md §Module Map: `params`,
|
||
`wire`, `producer`, `consumer`, `egress`, `error` (alphabetical
|
||
declaration order after `rfc1928`; rustfmt-sorted). No re-exports
|
||
yet (convention 15 posture: each implementation task adds its own).
|
||
- **Stub files**: one-line module docs (2–5 lines) each naming its
|
||
filling task: `params`/`error` → core-params-errors, `wire` →
|
||
core-wire-codec, `egress` → core-seam-types, `producer` →
|
||
core-producer-connect (+ associates/bind), `consumer` →
|
||
core-consumer-connect (+ associates/bind). `door.rs`, `local/`,
|
||
`composed/` are deliberately absent, being feature-gated batch-2 modules
|
||
born with their features, per the overview module map's local/
|
||
composed posture.
|
||
- Dep-graph spot checks: `cargo tree --target
|
||
wasm32-unknown-unknown -e normal -i mio` and `-i socket2` print
|
||
nothing (not in the wasm normal graph); the normal-only tokio
|
||
feature set on both native and wasm targets is exactly
|
||
`bytes/default io-util macros rt sync time` (the `net`/`full`
|
||
features appear only via the dev-dependency tokio, which is the test-only
|
||
surface, by design).
|
||
|
||
## Summary
|
||
|
||
Added the batch-1 dependency surface and the module skeleton:
|
||
`Cargo.toml` gains `alkcall = "0.8.0"` (the substrate pin,
|
||
convention 11), `serde`/`serde_json`, `bytes`, and the std-only
|
||
`futures` subset, with tokio's wasm-clean subset and the empty
|
||
`local`/`composed` features unchanged; `src/lib.rs` declares the six
|
||
skeleton modules (`params`, `wire`, `producer`, `consumer`, `egress`,
|
||
`error`) per overview.md §Module Map, each a stub with a module doc
|
||
naming its filling task (the vendor-scaffolding precedent); no
|
||
re-exports yet. Wasm-cleanliness verified before and after: alkcall
|
||
0.8.0's crates.io artifact compiles clean on
|
||
`wasm32-unknown-unknown` with no patching (probe build), and the
|
||
crate's checks all pass: `cargo test` (39+37 tests, 2 doc-ignored),
|
||
`cargo clippy --all-targets -- -D warnings`, `cargo fmt --check`,
|
||
`cargo doc --no-deps`, both wasm checks, and the `mio`/`socket2`/
|
||
`tokio::net` absence spot-checks on the default (normal) dependency
|
||
graph. |