Skip to content

T-JV2A-adopt-augmented-books-desktop

Status: closed/done · Impact: high · Complexity: large

Bring the Augmented Books product itself — apps/tauri_desktop in the source repo, a Tauri 2 + Vue 3 desktop app for reading interactive books — into the monorepo as apps/augmented-books/, following the apps/zoo/MIGRATION.md recipe. The dir is renamed because tauri_desktop says nothing at the top level; the crate is already well-named (augmented_books) and keeps its name.

Source: https://github.com/sksizer/augmented_books at pinned rev acedcf77652e2e7c481e95123c486c2befe2c423.

LocationRole today
apps/zoo/MIGRATION.mdThe adoption recipe this task follows: clean vendored copy, pnpm→Bun conversion, root Cargo membership, additive-only lock changes
Cargo.tomlRoot workspace members — needs two new explicit entries (the app crate and the runner builder; neither is covered by an existing glob)
.moon/workspace.ymlprojects.globs includes apps/* — the app registers by carrying its own moon.yml
moon.ymlDocuments the convention: tauri apps keep their own Bun workspaces (D-0016/D-0018) — this app does NOT join the root package.json workspaces
lefthook.ymlRepo git-hook driver; the source repo’s husky/lint-staged setup is dropped, not carried

Source app facts at the pinned rev:

  • apps/tauri_desktop/src-tauri/: crate augmented_books (lib augmented_books_lib, extra bin prepare-books). Deps include wasmtime 29 + wasmtime-wasi (it hosts sandboxed WASM problem runners), zip, walkdir, reqwest 0.12 { blocking }, serde_yaml, chrono. No rusqlite — no links = "sqlite3" conflict expected.
  • apps/tauri_desktop/src-frontend/: Vue 3 + Vite (not Nuxt), pnpm, multi-entry (index.html, editor.html, settings.html), deps @nuxt/ui, sql.js, marked, tailwindcss. Generated auto-imports.d.ts / components.d.ts are checked in.
  • packages/runners/sqlite/: the WASM (WASI) sqlite problem runner the desktop app executes via wasmtime; its builder/ crate is a cargo workspace member in the source repo. Building the runner .wasm requires the WASI SDK (see packages/runners/README.md there).
  • scripts/zip-books.sh (repo root there): zips content/books/* for distribution. content/books/ does not exist at the pinned rev — carry the script, note the absent content dir in the app README.
  • Backend module conventions are documented in the source repo’s README.md and docs/rust.md — carry docs/ with the app.
apps/augmented-books/
package.json Bun workspace root (workspaces: ["src-frontend"]), own bun.lock
moon.yml registers `augmented-books` (application/rust, tags: [tauri])
src-frontend/ Vue 3 + Vite frontend, converted pnpm→Bun
src-tauri/ crate `augmented_books` — member of the ROOT cargo workspace
runners/sqlite/ WASM sqlite runner (from packages/runners/sqlite), builder crate in root workspace
scripts/ zip-books.sh + any book-content tooling the app references
docs/ product docs carried over

Root Cargo.toml gains members apps/augmented-books/src-tauri and apps/augmented-books/runners/sqlite/builder. The per-app Cargo.lock is dropped; the root lock absorbs the tree additively.

  1. Clone the pinned rev; copy apps/tauri_desktop/apps/augmented-books/, packages/runners/sqlite/apps/augmented-books/runners/sqlite/, plus scripts/zip-books.sh and the app-relevant docs/.
  2. Bun conversion per zoo recipe: drop pnpm-lock.yaml / package-lock.json and any packageManager pin; translate the source root’s pnpm onlyBuiltDependencies (relevant subset) into trustedDependencies; switch tauri.conf.json before{Dev,Build}Command from pnpm … to bun run …; generate apps/augmented-books/bun.lock.
  3. Root cargo membership: add the two member entries. Opt into { workspace = true } only where the pin matches (tauri, tauri-build, serde, serde_json, tokio, anyhow, sha2, serde_yaml, chrono). Keep the app’s own reqwest declaration — the workspace pin is deliberately TLS-free (default-features = false) and this app fetches remote catalogs; expect cargo feature-union to add TLS features to the shared reqwest build, which is compile-time only.
  4. wasmtime 29 joins the lock additively. Verify no existing pin moves; if cargo forces a move, stop and record it in the PR rather than bumping silently.
  5. Write moon.yml (mirror apps/zoo/moon.yml shape) and relocate any backend lint/format/test scripts to apps/augmented-books/scripts/ following the zoo/pumice pattern.
  6. Do NOT carry husky/lint-staged — lefthook owns hooks here.
  7. Verify: root cargo check -p augmented_books (+ builder crate), clippy, bun install + bun run build (vite) in src-frontend. A full tauri build is a nice-to-have, not a gate.
  8. App README: note the runner-build WASI SDK prerequisite and the absent content/books/ dir.
LocationKindChange
apps/augmented-books/newThe vendored app (frontend, src-tauri, runners, scripts, docs)
Cargo.tomlmodifymembers += apps/augmented-books/src-tauri, apps/augmented-books/runners/sqlite/builder
Cargo.lockmodifyAdditive absorption of the app + runner dep trees (wasmtime et al.)
  • AC-1: cargo check -p augmented_books and clippy pass from the repo root; the runner builder crate checks clean.
  • AC-2: bun install + bun run build succeed in apps/augmented-books/src-frontend/ (all three HTML entries built).
  • AC-3: No Cargo.lock, pnpm-lock.yaml, or package-lock.json exists anywhere under apps/augmented-books/.
  • AC-4: moon query projects lists augmented-books.
  • AC-5: Root Cargo.lock diff is additive-only for existing pins; any forced move is called out in the PR body.
  • AC-6: The app README documents the WASI SDK prerequisite for building runners and the missing content/books/ state.
  • Building/shipping the runner .wasm in CI (WASI SDK provisioning is owner-gated).
  • Product/bundle-identifier renames — owner-gated, zoo precedent.
  • Porting the frontend to Nuxt or to shared UI packages (T-JCML surveys that).
  • The @augmented/* TS packages — the frontend doesn’t consume them.
  • none — the app has no deps on the vendored TS packages, so it can land in parallel with T-LVLY.
  • Part of the augmented_books adoption (owner decision 2026-07-18). The source repo’s most recently active app (last commits 2026-02).

Captured by /sdlc:task-work on 2026-07-19. PR: pending.

  • AC-1: auto — cargo check -p augmented_books -p sqlite-runner exits 0; cargo clippy -p augmented_books clean (no warnings).
  • AC-2: auto — bun install + bun run build in src-frontend/ pass (vue-tsc typecheck clean; vite built index/editor/settings entries).
  • AC-3: agent-manual — git ls-files apps/augmented-books shows no tracked Cargo.lock / pnpm-lock.yaml / package-lock.json; added an app .gitignore for dist/ / target/ / wasm output.
  • AC-4: auto — moon query projects lists augmented-books (source apps/augmented-books, tag tauri).
  • AC-5: agent-manual — root Cargo.lock is additive except three semver-compatible within-minor unifications (toml 0.8.2→0.8.23, toml_datetime 0.6.3→0.6.11 forced by wasmtime-cache 29; proc-macro-crate 2.0.2→2.0.0); no major pin moved. Called out in the PR body.
  • AC-6: agent-manual — apps/augmented-books/README.md documents the WASI SDK prerequisite (+ wasm32-wasip2 target) and the absent content/books/ dir at the pinned rev.
  • The apps/zoo/MIGRATION.md recipe covered the whole conversion end-to-end, including the rusqlite links = "sqlite3" collision (the builder crate’s rusqlite 0.31→0.32 bump is the exact zoo precedent).
  • sdlc quality run reported OK 10/10 on the first pass — the vendored code sits outside the SDLC-corpus gate scope and broke nothing.
  • Step 7’s baseline-gated gate failed with baseline not found when run from the worktree — the baseline is captured into the main repo’s .sdlc/quality-baselines/ but the worktree’s default --baseline-dir resolves to the (empty) worktree .sdlc/; task-work Step 7 should pass an explicit --baseline-dir <main-repo>/.sdlc/quality-baselines, or capture should target a checkout-shared location. → T-OLTA-task-work-step7-worktree-baseline-dir
  • The task spec assumed “no rusqlite → no links = sqlite3 conflict,” but the runner’s builder crate carries rusqlite and the collision surfaced only at cargo check — dep-reconciliation specs should enumerate transitive links-bearing crates from vendored sub-crates, not just the top-level app crate. → T-LQB3-adoption-recipe-enumerates-links-crates
  • origin/main advanced 18 commits between worktree creation and PR, making the pre-rebase two-dot Cargo.lock diff read as non-additive (phantom removals of already-merged crates). Handled by Step 9’s rebase; no action needed, but a reviewer reading the pre-rebase diff would misread it. (skipped — expected/handled, no action)

← Back to Tasks