Skip to content

T-F0B2-vendor-augmented-rust-crates

Status: closed/done · Impact: low · Complexity: small

augmented_books carries two small Rust crates: augmented-common (shared types for the books domain) and frontmatter-validator (a CLI that validates YAML frontmatter against a JSON schema). Vendor both into packages/rust/ as root Cargo workspace members so the books pipeline can reach them and the convergence audit (T-JCML) can judge them against markdown-contract.

Source: https://github.com/sksizer/augmented_books at pinned rev acedcf77652e2e7c481e95123c486c2befe2c423, paths packages/rust/common/ and packages/rust/frontmatter-validator/.

LocationRole today
Cargo.tomlRoot workspace; members already globs packages/rust/* — vendored crates auto-join
packages/rust/Existing shared crates: dir-aspect, platform-core
apps/zoo/MIGRATION.mdPrecedent for dependency reconciliation on workspace adoption (the links = "sqlite3" lesson; additive-only lock changes)
LIBRARIES.mdDocuments markdown-contract, the TS markdown-as-data validator that frontmatter-validator conceptually overlaps

Facts about the source crates at the pinned rev:

  • The crate under packages/rust/common/ is already named augmented-common — no rename needed.
  • Both crates use serde = { workspace = true } and thiserror = { workspace = true }. The source workspace pins thiserror = "1.0"; this workspace pins thiserror = "2".
  • frontmatter-validator ships a bin validate-frontmatter and its own deps: clap 4.5, glob 0.3, serde_json, serde_yaml 0.9, jsonschema 0.27.
  • Neither crate has an in-repo consumer today; nothing in the source repo’s apps depends on either.

packages/rust/augmented-common/ and packages/rust/frontmatter-validator/ exist as workspace members, compile clean against this workspace’s pinned dependency set, and their tests pass. The root Cargo.lock absorbs their trees additively — no existing pinned version moves (zoo precedent).

  1. Clone the pinned rev to a scratch directory; copy the two crate dirs into packages/rust/ (dir common/augmented-common/ to match its crate name; drop any per-crate Cargo.lock).
  2. Reconcile { workspace = true } deps: serde, serde_json, serde_yaml match existing pins. For thiserror (1.0 → 2): migrate the derive usage to thiserror 2 if trivial; otherwise declare thiserror = "1" directly in the crate and note it.
  3. cargo check -p augmented-common -p frontmatter-validator, then cargo test and cargo clippy -- -D warnings for both.
  4. Add a thin moon.yml per crate mirroring the existing packages/rust/* members if they carry one.
LocationKindChange
packages/rust/augmented-common/newVendored crate (dir renamed from common/ to match crate name)
packages/rust/frontmatter-validator/newVendored crate + validate-frontmatter bin
Cargo.lockmodifyAdditive absorption of the two crates’ dep trees
  • AC-1: cargo check -p augmented-common -p frontmatter-validator exits 0 from the repo root.
  • AC-2: cargo test -p augmented-common -p frontmatter-validator and cargo clippy -p augmented-common -p frontmatter-validator -- -D warnings pass.
  • AC-3: cargo run -p frontmatter-validator --bin validate-frontmatter -- --help prints usage.
  • AC-4: git diff on Cargo.lock shows additions only — no existing pinned version changed.
  • Wiring any consumer to these crates (none exist today).
  • The keep/fold/retire verdict versus markdown-contract — that’s T-JCML’s call.
  • The WASM sqlite runner (packages/runners/sqlite in the source repo) — it travels with the desktop app in T-JV2A.
  • none
  • Part of the augmented_books adoption (owner decision 2026-07-18); see T-LVLY for the TS-side counterpart.

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

  • AC-1: auto — cargo check -p augmented-common -p frontmatter-validator exits 0.
  • AC-2: auto — cargo test (1 test in augmented-common, 3 in frontmatter-validator) and cargo clippy … -- -D warnings pass for both.
  • AC-3: agent-manual — cargo run -p frontmatter-validator --bin validate-frontmatter -- --help prints usage (exit 0).
  • AC-4: auto — git diff Cargo.lock = 178 insertions, 0 deletions; a name+version comparison confirms 0 existing pins moved (17 new packages added, none of the 783 baseline packages lost or version-changed).
  • thiserror 1.0→2 (the workspace pin) needed no code change — both crates use only #[derive(Error)] / #[error(...)] / #[from], all thiserror-2 compatible; kept { workspace = true }.
  • The additive-lock precedent from apps/zoo/MIGRATION.md held — unlike zoo’s links = "sqlite3" collision, neither crate forced an existing pin to move.
  • moon.yml mirrored dir-aspect (fmt/lint/test scoped -p <crate>); both crates register via the packages/rust/* glob.
  • Quality baseline not seeded into the worktree — .sdlc/quality-baselines/<sha>.json is gitignored runtime state that git worktree add does not propagate, so sdlc quality run --diff-against-baseline failed with baseline not found until copied in by hand. Fix: task-work worktree init should seed/symlink .sdlc/quality-baselines/ into new worktrees, or the quality CLI should fall back to the main checkout’s baseline dir. (Same gap hit by T-LAKY.)
  • No AC blockers; the vendored main.rs had one over-width line that cargo fmt (behavior-neutral) resolved so the rust-fmt-check pre-commit hook passed.

← Back to Tasks