Skip to content

T-R9WT-model-ontogen-codegen-as-moon-task

Status: closed/done · Impact: medium · Complexity: medium

Model pumice’s ontogen code-generation pipeline (run by src-tauri/build.rs on every cargo build) as a first-class moon task with correct inputs/outputs, and carry pumice’s codegen-drift check into this repo’s gates — so moon’s cache stays correct and a schema change without a regenerate fails CI.

Pumice’s build.rs invokes ontogen and writes committed generated files under several */generated/ dirs plus src-nuxt/app/generated. Pumice already has a just codegen-drift recipe and a manual-dispatch codegen-drift.yml workflow.

LocationRole today
apps/pumice/src-tauri/build.rsRuns ontogen on every cargo build
apps/pumice/**/generated/**Committed generated .rs/.ts
apps/pumice/scripts/codegen_drift.shRegenerates and diffs against HEAD
PUMICE_SKIP_SERVER_CODEGENEnv that disables the specta side-car in CI (disk)

A moon codegen task whose inputs are the schema/API sources and whose outputs are the committed generated dirs, plus a codegen-drift task wired into moon ci (see T-T2HB) that fails on stale generated files.

  1. Enumerate inputs/outputs. Inputs: src-tauri/src/schema/**, src-tauri/src/api/v1/**, and other codegen sources. Outputs: every */generated/ dir plus src-nuxt/app/generated, app/admin/generated.
  2. Add the moon codegen task. cargo check/build that triggers build.rs, with inputs/outputs declared so moon caches and invalidates correctly.
  3. Wire the drift gate. Add a codegen-drift task shelling to pumice’s existing scripts/codegen_drift.sh (or a git diff --exit-code over the generated paths) for moon ci.
  4. Preserve the side-car env. Keep PUMICE_SKIP_SERVER_CODEGEN semantics so the specta side-car does not exhaust CI runner disk.
LocationKindChange
apps/pumice/moon.ymleditAdd codegen + codegen-drift tasks with inputs/outputs
  • AC-1: A moon codegen task declares the schema sources as inputs and the generated dirs as outputs; re-running with no schema change is a cache hit.
  • AC-2: A codegen-drift task fails when a generated file is stale and passes when the corpus is regenerated.
  • AC-3: The specta side-car’s disk behavior is preserved via PUMICE_SKIP_SERVER_CODEGEN in the CI path.
  • CI runner wiring / system depsT-T2HB.
  • Rust toolchain reconciliationT-P4LZ.
  • T-P4LZ (hard): the crates must build under moon before codegen can be modeled as a task.

T-P4LZ


← Back to Tasks