feat(arty_io_core): add injectable I/O driver contracts - #737
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
martintmk
left a comment
There was a problem hiding this comment.
[AI AGENT]: I reviewed all eight added public contracts (Driver, DriverContext, DriverInit, DriverProvider, Parker, Shutdown, SystemTask, and SystemTaskSpawner), their rustdoc, the example runtime, dependencies, naming, object safety, shutdown behavior, and the new public-surface tests. Two targeted probes reproduced lifecycle contradictions below. The remaining public surface is documented and intentionally narrow; I found no additional dependency, naming, performance, resilience, or test-weakening issue. CI was still running with no reported failures at the final check.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #737 +/- ##
========================================
- Coverage 100.0% 99.9% -0.1%
========================================
Files 583 587 +4
Lines 62930 62982 +52
========================================
+ Hits 62930 62979 +49
- Misses 0 3 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58677290-64b2-44fc-9e40-6c80b7e9e5c0
martintmk
left a comment
There was a problem hiding this comment.
[AI AGENT]: Pragmatic Rust public API review completed with no findings. Verified the all-features cargo public-api surface, generated rustdoc JSON, package tests, clippy, spelling, the two-driver example, and the 100% coverage gate.
Coverage: reviewed Driver, DriverContext, DriverProvider, DriverInit, Parker, SystemTasks, and SystemTask from the downstream consumer and evolution perspective. The audit cannot prove runtime behavior or soundness from API output alone; those were covered separately by tests and multi-model review.
The resulting surface removes speculative Clone from DriverInit, hides Arc<dyn ...> behind the cloneable SystemTasks handle, and documents the boxed shutdown future as the deliberate object-safe shape for Box<dyn Driver<Context = C>>.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 206cc953-3282-4edf-b114-ee2b7f518bdf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 206cc953-3282-4edf-b114-ee2b7f518bdf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 206cc953-3282-4edf-b114-ee2b7f518bdf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6a475d84-6296-497e-975b-7442019e433b
Summary
Introduces the initial stable
arty_io_corecontract for injecting I/O drivers after runtime startup.DriverContextselects its associated provider, soget_context::<MyContext>()needs no registration value.Driverremains thread-local, boxable asBox<dyn Driver<Context = C>>, and exposes only shared-reference callbacks.Parkerdefines the latched wait/wake contract.SystemTasksis a cloneable crate-owned handle that hides runtime shared-ownership plumbing.is_inertcontract.The crate includes
REQUIREMENTS.md,DESIGN.md, public-surface tests, and a modular two-worker example. The example registers two independent driver types after worker startup, performs in-memory I/O through both contexts, caches repeated lookups, drains all four driver instances, and rejects operations through retained contexts after shutdown.Review
ClonefromDriverInitand replacing exposedArc<dyn ...>plumbing withSystemTasks.Validation
just package=arty_io_core clippyjust package=arty_io_core formatjust package=arty_io_core readmejust package=arty_io_core spellcheckcargo test -p arty_io_corecargo run -p arty_io_core --example two_thread_runtimecargo coverage-gate --package arty_io_corecargo public-api --all-features --manifest-path crates/arty_io_core/Cargo.tomlCI infrastructure blocker
The Windows coverage job fails after all 6,867 tests pass.
cargo llvm-covgenerates a 33,956-characterllvm-cov.exe exportcommand for 445 objects, exceeding the Windows 32,767-character process limit (os error 206). The failed job was retried once and reproduced identically. Linux and Linux ARM coverage, Codecov, mutation tests, static analysis, MSRV, semver, external-type exposure, spelling, and other completed checks pass.