feat(net): ADR-0029 repartition — move Service to net-http-api, add kernel Timer#58
Conversation
Final-review Minor: 'over the kernel' collided with oath-core-kernel; name the crate explicitly. Refs #57
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR splits the net adapter into a std-only kernel and a new HTTP transport crate, adds a runtime-neutral ChangesKernel Repartition and Service Migration
Planning and Design Documentation
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/superpowers/plans/2026-06-30-net-http-foundation.md`:
- Around line 131-135: The `Timer` bullet in the module-list doc comment is
malformed because the inline code fence is broken, so update the `lib.rs`
re-export/docs note to use valid Markdown for the `timer` item. Keep the `pub
use timer::Timer;` instruction unchanged, but rewrite the `//! - [...]` entry so
the `Timer` symbol is wrapped with a correctly closed inline code span and
remains copyable and markdownlint-clean.
In `@docs/superpowers/specs/2026-06-30-net-http-construction-surface-design.md`:
- Around line 373-380: The diagram block in the ADR reconciliation section is
missing the Mermaid fence label. Update the fenced code block identified by the
ADR reconciliation content so it uses a mermaid-tagged fence, keeping the block
location around the “ADR-0030 §3 + Consequences” text and the surrounding
diagram snippet intact.
- Around line 61-65: The scope summary still refers to a superseded Permit enum,
while the finalized model uses Guarded<B> carrying
Option<async_lock::SemaphoreGuardArc>. Update the opening bullets in the spec to
match the final permit shape and terminology, and keep the references to
AuthSource, Auth, NoAuth, and HttpError::Auth unchanged so implementers are
guided toward the current abstraction.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: aa97dd0c-0808-474d-9c5a-4fbe291552e8
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (12)
CHANGELOG.mdCargo.tomlREADME.mdcrates/adapter/net/api/Cargo.tomlcrates/adapter/net/api/src/compose.rscrates/adapter/net/api/src/lib.rscrates/adapter/net/api/src/timer.rscrates/adapter/net/http/api/Cargo.tomlcrates/adapter/net/http/api/src/lib.rscrates/adapter/net/http/api/src/service.rsdocs/superpowers/plans/2026-06-30-net-http-foundation.mddocs/superpowers/specs/2026-06-30-net-http-construction-surface-design.md
💤 Files with no reviewable changes (1)
- crates/adapter/net/api/Cargo.toml
Address review feedback: - compose.rs: the `Layer` trait heading was mechanically find-replaced from "Transform one Service into another Service" to "...one Layer into another Layer" when Service left the crate, which misdescribes the trait — a Layer wraps a value (S -> Self::Service), not a Layer. Reword accurately. - plan md: fix the malformed inline code span for the `timer` module-list bullet (markdownlint MD038) using a padded double-backtick span so it stays copyable (CodeRabbit). - spec md: the Scope-in summary and Definition-of-done still named the superseded `Permit` enum; the finalized model carries `Option<async_lock::SemaphoreGuardArc>` directly (CodeRabbit). CodeRabbit's third comment (add a `mermaid` fence in the ADR-reconciliation section) was refuted — that region is prose bullets, not a diagram. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cleanup from /simplify review (doc + test only, no behaviour change):
- compose.rs: drop residual "service"/request-centric wording on the now
transport-neutral composition types — `Layer::Service` ("wrapped type"),
`Identity` ("inner value"), `Stack` ("outermost wrapper") — so the docs match
the module's "composes anything" contract (Layer carries no Service bound).
- timer.rs: import `Future` in the test module instead of the fully-qualified
`std::future::Future`, matching how the module imports its std types.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
PR 1 of Slice 0 (the net-http foundation) — executes the ADR-0029 transport-split repartition, the structural gate the whole net-http construction surface sits on.
Timer— a runtime-neutral clock contract (Clone + Send + Sync;sleep -> impl Future + Send,now -> Instant) so timing middleware can be driven by a mock clock in tests without coupling the kernel to any async runtime (ADR-0029 §4).Servicemoves out of the kernel into the new per-transport contract crateoath-adapter-net-http-api—Serviceis a request/reply connection shape, not a kernel primitive (ADR-0029 §2). Its doc-comment is corrected: thecallfuture isSend(enforced), the service value isSend + Sync + 'staticenforced at the composition boundary (not the trait), plus a clone-to-spawn note.oath-adapter-net-apisheds all external deps and renames itsservice.rsmodule →compose.rs(keepingLayer/ServiceBuilder/Stack/Identity+ErrorKind/HasErrorKind+Timer). A dependency-free kernel is the signal the cut is clean (ADR-0029 §3).docs/superpowers/.Out of scope (later slices/PRs)
The HTTP data plane (
HttpError,HttpClient,ResponseBody, the resilience layers), thenet-http-mockharness, and the seam contracts (AuthSource,Guarded,RateKey) — PRs 2–4. The new crate is intentionally minimal (just the movedService, zero dependencies) at this stage. The README mermaid edgenet-http-api → net-apiis forward-looking (the Cargo dep lands in PR 2).Verification
just cigreen (fmt, fmt-toml, typos, lint, check, test + doctests, deny, doc, machete, gitleaks, actionlint, shellcheck). Nounsafe; kernel std-only; exactly oneServicedefinition after the branch.Process
Built subagent-driven: 4 tasks, each spec + code-quality reviewed, plus a clean whole-branch review (one trivial README wording fix applied).
Closes #57
🤖 Generated with Claude Code
Summary by CodeRabbit