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/.
| Location | Role today |
|---|---|
Cargo.toml | Root workspace; members already globs packages/rust/* — vendored crates auto-join |
packages/rust/ | Existing shared crates: dir-aspect, platform-core |
apps/zoo/MIGRATION.md | Precedent for dependency reconciliation on workspace adoption (the links = "sqlite3" lesson; additive-only lock changes) |
LIBRARIES.md | Documents 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 namedaugmented-common— no rename needed. - Both crates use
serde = { workspace = true }andthiserror = { workspace = true }. The source workspace pinsthiserror = "1.0"; this workspace pinsthiserror = "2". frontmatter-validatorships a binvalidate-frontmatterand 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.
Proposed
Section titled “Proposed”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).
Approach
Section titled “Approach”- Clone the pinned rev to a scratch directory; copy the two crate dirs
into
packages/rust/(dircommon/→augmented-common/to match its crate name; drop any per-crateCargo.lock). - Reconcile
{ workspace = true }deps:serde,serde_json,serde_yamlmatch existing pins. Forthiserror(1.0 → 2): migrate the derive usage to thiserror 2 if trivial; otherwise declarethiserror = "1"directly in the crate and note it. cargo check -p augmented-common -p frontmatter-validator, thencargo testandcargo clippy -- -D warningsfor both.- Add a thin
moon.ymlper crate mirroring the existingpackages/rust/*members if they carry one.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
packages/rust/augmented-common/ | new | Vendored crate (dir renamed from common/ to match crate name) |
packages/rust/frontmatter-validator/ | new | Vendored crate + validate-frontmatter bin |
Cargo.lock | modify | Additive absorption of the two crates’ dep trees |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
cargo check -p augmented-common -p frontmatter-validatorexits 0 from the repo root. - AC-2:
cargo test -p augmented-common -p frontmatter-validatorandcargo clippy -p augmented-common -p frontmatter-validator -- -D warningspass. - AC-3:
cargo run -p frontmatter-validator --bin validate-frontmatter -- --helpprints usage. - AC-4:
git diffonCargo.lockshows additions only — no existing pinned version changed.
Out of scope
Section titled “Out of scope”- Wiring any consumer to these crates (none exist today).
- The keep/fold/retire verdict versus
markdown-contract— that’sT-JCML’s call. - The WASM sqlite runner (
packages/runners/sqlitein the source repo) — it travels with the desktop app inT-JV2A.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”- Part of the augmented_books adoption (owner decision 2026-07-18); see
T-LVLYfor the TS-side counterpart.
Post-mortem
Section titled “Post-mortem”Captured by /sdlc:task-work on 2026-07-18. PR: pending.
Acceptance criteria coverage
Section titled “Acceptance criteria coverage”- AC-1: auto —
cargo check -p augmented-common -p frontmatter-validatorexits 0. - AC-2: auto —
cargo test(1 test in augmented-common, 3 in frontmatter-validator) andcargo clippy … -- -D warningspass for both. - AC-3: agent-manual —
cargo run -p frontmatter-validator --bin validate-frontmatter -- --helpprints 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).
What worked
Section titled “What worked”thiserror1.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.mdheld — unlike zoo’slinks = "sqlite3"collision, neither crate forced an existing pin to move. moon.ymlmirroreddir-aspect(fmt/lint/test scoped-p <crate>); both crates register via thepackages/rust/*glob.
Friction and automation gaps
Section titled “Friction and automation gaps”- Quality baseline not seeded into the worktree —
.sdlc/quality-baselines/<sha>.jsonis gitignored runtime state thatgit worktree adddoes not propagate, sosdlc quality run --diff-against-baselinefailed withbaseline not founduntil 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 byT-LAKY.) - No AC blockers; the vendored
main.rshad one over-width line thatcargo fmt(behavior-neutral) resolved so therust-fmt-checkpre-commit hook passed.