chore(deps): install base Rust crates (task 07)#4
Conversation
Install the Sprint 0 minimal Rust dependency set in src-tauri/ via `cargo add` (per ADR-015 — manifest never hand-edited): - tokio --features full (ADR-008 multi-thread async runtime) - thiserror (lib errors via #[derive(Error)]) - anyhow (binary entry-point error coalescing) - tracing (structured logging API) - tracing-subscriber --features fmt,env-filter,json - tracing-appender (rolling-file sink for future logs) - uuid --features v4,serde (TaskId/RunId/AgentId) - time --features serde,formatting,parsing (domain/shared Timestamp) serde + serde_json were already present from T05 scaffold. Verification: - cargo build : OK (46.61s, no warnings) - cargo clippy -D warnings : OK - cargo fmt --check : OK - cargo test --workspace : 0 tests, 0 failures (scaffold) - cargo deny check licenses: ok (only unused-allowance warnings) - cargo audit : exit 0 (only known-ignored transitive RUSTSEC) - cargo tree --duplicates : none of our added deps duplicated; thiserror v1.0.69 transitive via cairo-rs/gdk/gtk/wry — out of our control until Tauri migrates to webkit2gtk-6.0 (tauri-apps/tauri#9777) Unblocks: T08 (hexagonal layout uses serde/thiserror/uuid/time), T10 (cargo deny check across installed deps), T15 (specta/ts-rs codegen).
Replace 280-word run-on paragraph with a one-line dep list whose density matches the surrounding [Unreleased]/Added bullets (Sprint 0 task 06 entries average 30-60 words, single dash + comma-separated facts). Same information, no facts dropped — just less prose. Identified by /simplify code-quality review on commit 896f60d.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDependencies for async runtime, error handling, and observability instrumentation (tokio, thiserror, anyhow, tracing, uuid, time) are added to ChangesAsync Runtime and Observability Dependencies
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 19 minutes and 19 seconds. Comment |
* feat(interfaces): add TauriEventPublisher EventPublisher adapter (task T-115)
Bridges the in-process broadcast::Sender<AppEvent> to the Tauri renderer
via tauri::Emitter::emit. Construction subscribes to the bus and spawns a
forwarder tokio task; emit failures log via tracing::error! without
panicking, RecvError::Lagged warns and resumes (matches event_bus
overflow contract), RecvError::Closed exits cleanly. publish() drops on
no-subscribers via let _ = bus_tx.send(event) so producers stay
non-blocking when the renderer has not attached yet during boot.
Variant-to-event-name mapping lives in a pure event_name() helper
(TaskCreated -> "task:created", TaskMoved -> "task:moved") that is
exhaustive against the #[non_exhaustive] AppEvent — adding a future
variant will fail the match arm at compile time, forcing the wire
contract to be updated alongside.
4 unit tests cover event_name mapping for both variants, publish returns
Ok with no subscribers, and publish routes events through the bus to a
manually-attached subscriber. Full Tauri-runtime integration is deferred
to S2 once a tauri::test harness lands. Coverage publisher.rs 75.36%
lines / 83.33% functions (interfaces target >=70%).
Re-exported via pub use publisher::{TauriEventPublisher, event_name} in
interfaces/tauri_events/mod.rs so T-116 AppContainer can construct the
publisher without reaching into the submodule.
Refs: ARCHI.md #4 (driving adapters), #6.2 (listen wrappers).
* feat(app): add AppContainer composition root (task T-116)
Replaces the Sprint 0 placeholder header in `application/di.rs` with
the production composition root documented in ARCHI §4.3 / §5.3:
pub struct AppContainer {
task_repo: Arc<dyn TaskRepository + Send + Sync>,
event_publisher: Arc<dyn EventPublisher + Send + Sync>,
events: broadcast::Sender<AppEvent>,
config: Arc<AppConfig>,
db: Arc<libsql::Database>,
}
pub async fn build(cfg, app) -> Result<Self, AppError>
Build chains `Pool::open` (connect + V001 migration), `make_bus(1024)`,
`TauriEventPublisher::new`, `LibsqlTaskRepo::new`, then assembles the
struct with `Arc::new(cfg)` so every Tauri command reaches its
dependencies through `tauri::State<Arc<AppContainer>>`.
Two notes versus the literal task-spec snippet:
- The spec called `pool::connect` + `pool::run_migrations` directly,
but both helpers are `pub(super)` to enforce the invariant "every
caller routes through `Pool::open` so migrations always follow the
connection." The composition root respects the encapsulation by
going through `Pool::open` + `Pool::database()` instead, with the
same observable side effects (DB opened, WAL on, V001 applied,
history row recorded).
- `build` is a thin outer wrapper over a private `build_inner(cfg,
events, publisher)` helper. The Tauri-runtime dependency stays in
the wrapper (one line `TauriEventPublisher::new(app, events.clone())`
already covered by T-115's tests); the testable assembly logic lives
in `build_inner` so unit tests can exercise it with a stub
`EventPublisher` instead of pulling `tauri::test::mock_app` (gated
behind a feature the production build does not opt into).
5 tests cover: tempdir-config happy path + repo wired to migrated DB,
V001 schema actually landed (`sqlite_master` introspection through
`container.db`), event bus handle is the same channel passed in
(subscribe pre-build, publish post-build, recv equal), config
preserved inside the `Arc`, and `AppContainer: Send + Sync` (compile-
time, guards the `tauri::State<Arc<AppContainer>>` shape T-118+ needs).
Acceptance criteria from issue #31:
- cargo build clean
- build succeeds against tempdir AppConfig (test)
- migration V001 runs as part of build (test)
- cargo clippy -- -D warnings clean
- no .unwrap()/.expect() outside #[cfg(test)] mod tests
Refs: ARCHI.md §4.3, §5.3 / ADR-011. Closes #31.
---------
Co-authored-by: Mathieu Piton <27002047+mpiton@users.noreply.github.com>
* docs: add Sprint 1 quickstart + smoke probe to README (T-135, closes #49) - Replace generic Setup with "Quickstart" section: clone, install-hooks, `pnpm exec tauri dev` boot flow targeting the ARCHI.md §23 onboarding criterion (< 5 min on a fresh clone). - Add "Verify the Sprint 1 smoke flow" subsection mirroring `scripts/smoke-e2e.sh` (pilot-gated dev server + `tauri-pilot ipc tasks_list --args '{}'` probe with the v0.5 `--args` form, not the v0.4 positional `'{}'` referenced in the issue body). - Add "What works in Sprint 1" section enumerating the landed deliverables (hexagonal layout, libsql + V001, `AppContainer::build`, `tasks_list` IPC, `TauriEventPublisher`, `tracing` redaction, Sidebar/WelcomeScreen, Zustand `useTaskStore`, i18n FR+EN, codegen-types, llvm-cov 75 gate, smoke E2E gate) so the README delta after Sprint 0 is visible without diffing CHANGELOG. - Add explicit link "ARCHI.md §4 — Layout du repo" (GFM anchor `#4-layout-du-repo`) for full architecture rationale. - Pin `tauri-pilot-cli` install hint to `=0.5.1 --locked` to match `tauri-plugin-pilot = "0.5.1"` in `src-tauri/Cargo.toml` (same hardening rationale as PR #66 CodeRabbit fix). - Add Smoke E2E badge alongside CI / Release / CodSpeed. - Update Status line from "Sprint 0 closure" to "Sprint 1 closure — smoke E2E gate green on main". - Replace pre-existing broken `[AGPL-3.0](LICENSE)` link with the canonical `gnu.org/licenses/agpl-3.0` URL (no `LICENSE` file in repo; matches the badge target). Adding the file itself is out of scope. CHANGELOG `[Unreleased]` already enumerates Sprint 1 additions (130 entries, verified each spec-required entry present: hexagonal, AppConfig, ensure_dirs, tracing redaction, libsql V001, domain/tasks, EventPublisher, AppContainer, tasks_list, codegen-types, Sidebar/WelcomeScreen/useTaskStore/i18n, UI primitives, llvm-cov gate). No CHANGELOG change needed. Tests: doc-only (per T-135 spec). * docs(readme): address PR #67 review (CodeRabbit / cubic / qodo) - Windows shell note for `./scripts/install-hooks.sh` (run via Git Bash or WSL; PowerShell/cmd.exe will not execute the bash script). Per CodeRabbit comment on L44. - Reword smoke verification block: explicit "terminal 1" / "terminal 2" labels, drop the ambiguous "instead of" phrasing. Apply CodeRabbit suggested diff on L56 verbatim. - Correct CI trigger claim: `.github/workflows/smoke-e2e.yml` is `workflow_dispatch` only — README previously said "runs in CI on every push" which is wrong. Per qodo finding on L61. - Drop links to `ARCHI.md` (`§23` onboarding ref + `§4` architecture link) and `PRD.md` (roadmap ref) because both files are intentionally gitignored at `.gitignore:55-56` ("Specs"). Cubic and qodo correctly flagged the broken internal links. The "Architecture" section now inlines the dependency rule + composition-root invariants that previously lived behind the ARCHI.md §4 link, so the design rationale is still surfaced without depending on a local-only spec file. T-135 spec mentioned an `ARCHI.md §4` link as a sub-criterion, but that pre-dated the deliberate gitignore policy on the specs files. Honoring the gitignore wins — the AC "no broken markdown link" is the stronger constraint. --------- Co-authored-by: Mathieu Piton <27002047+mpiton@users.noreply.github.com>
Summary
Add 8 base Rust dependencies to
src-tauri/Cargo.tomlviacargo add(ADR-015): tokio multi-thread runtime, thiserror + anyhow error handling, tracing structured logging, uuid/time utility types. Unblocks T08 hexagonal layout, T10 cargo deny, T15 specta codegen. Sprint 0 bootstrap tooling.Why
Sprint 0 goal: minimal scaffold only. These crates are the foundation for domain/application error handling (thiserror lib errors, anyhow bin errors), async/threading (tokio ADR-008), observability (tracing API + subscribers), and domain value objects (uuid, time). Deferred larger deps (libsql, git2, portable-pty, reqwest, etc.) to S1+.
Changes
src-tauri/Cargo.toml— 8 direct deps installed viacargo add:tokio 1.52.1featuresfull(ADR-008 multi-thread runtime, optimized later)thiserror 2.0.18,anyhow 1.0.102(error handling layers per ADR-018)tracing 0.1.44logging API,tracing-subscriber 0.3.23withfmt,env-filter,json,tracing-appender 0.2.5(rolling log sinks)uuid 1.23.1featuresv4,serde(TaskId, RunId, AgentId)time 0.3.47featuresserde,formatting,parsing(domain/shared Timestamp)src-tauri/Cargo.lock— auto-updated (164 lines, ~14 new transitive deps mostly from tracing-subscriber ecosystem)CHANGELOG.md— [Unreleased]/Added entry documenting each dep + features + rationaleTesting
Related Issues
.claude/output/sprints/sprint-2026-05-01/tasks/07-cargo-add-base-crates.mdNotes for Reviewer
tokio features = ["full"]is by design per ARCHI.md §3.1 line 294. Sprint 0 pragmatism; will be tightened to["rt-multi-thread", "macros", "fs", "process", "io-util", "sync", "time", "net"]later once all S1+ crate needs are clear.thiserror v1.0.69co-exists with our directv2.0.18due to Tauri's internal GTK3 dep tree (cairo-rs/gdk/gtk/wry). Not our problem; Tauri should migrate to webkit2gtk-6.0 (feat(tray): addenter,moveandleaveevents tauri-apps/tauri#9777). In the meantime, the v1 and v2 lines are separate by crate boundary, so no macro/derive collision.cargo addonly. Hookscripts/no-manual-deps.shwill enforce this at pre-commit.Checklist
cargo addonly (ADR-015)cargo test --workspace)cargo clippy -D warnings)cargo deny check licensesgreencargo auditgreenSummary by CodeRabbit
Release Notes