Skip to content

T-UBPG-sdf-ontogen-backend-skeleton

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

Make SDF’s Rust↔TS contract generated rather than hand-kept: ontogen emits the Axum HTTP transport (browser mode), Tauri IPC transport (desktop), MCP tool registry (agents), and the typed TS client from one set of Rust schema structs — the D-0017-ontogen-shared-codegen-convergence convergence event, drift-gated from day one.

LocationRole today
apps/sdf/src-tauri/src/scaffold shell, hand-written commands only
apps/pumice/src-tauri/build.rsthe in-repo ontogen Pipeline precedent (paths, ClientsConfig, write_if_changed)
apps/pumice/scripts/codegen_drift.shdrift-gate protocol precedent (exit 0/1/2)
Cargo.tomlworkspace pins ontogen/ontogen-macros/markdown-store at rev 0c3a989
apps/sdlc/lib/model/entities/substrate entity schemas (markdown-contract/zod) — upstream truth for mirrored shapes

apps/sdf/src-tauri/build.rs runs an ontogen Pipeline over SDF’s schema structs (app-local entities first: registered projects, app settings; substrate read-model mirrors as needed by later phases). Generated committed surfaces: HTTP + IPC transports, MCP registry, TS transport.ts/types.ts. UI code targets the generated Transport interface; desktop binds IPC, browser binds HTTP. Two gates: codegen drift (pumice protocol as a moon task) and a schema-parity check asserting mirrored substrate shapes match the SDLC entity schemas.

  1. Bump/align the workspace ontogen rev if needed (origin/main is v0.4.0; coordinate with pumice/platform-core — accepted cost per D-0018).
  2. Define src-tauri/src/schema/*.rs entities; wire the build.rs Pipeline (dtos → store → api → servers HTTP/IPC/MCP → clients HttpTauriIpcSplit and AdminRegistry), write_if_changed everywhere.
  3. Swap T-6S37’s data access to the generated Transport seam (createIpcTransport() under window.__TAURI__, createHttpTransport() otherwise); keep @sdlc/dashboard-client solely for the upstream /api/state source until Phase 5 re-homes it.
  4. Add sdf:codegen-drift moon task (touch build.rs → cargo check → git diff —exit-code over generated paths); wire into sdf-ci.yml.
  5. Parity gate v0: script comparing ontogen-emitted JSON schemas for mirrored substrate entities against apps/sdlc/lib/model/entities/* schemas; CI-fails on mismatch; document the reconciliation contract.
  6. Naming hygiene: NamingConfig overrides for plural-tantum nouns (pumice precedent).
LocationKindChange
apps/sdf/src-tauri/build.rsmodifyontogen Pipeline
apps/sdf/src-tauri/src/schema/newentity structs
apps/sdf/src-tauri/src/api/newgenerated transports (committed)
apps/sdf/src-nuxt/app/generated/newtransport.ts, types.ts (committed)
apps/sdf/scripts/codegen_drift.shnewdrift gate
apps/sdf/moon.ymlmodifycodegen-drift task
Cargo.tomlmodifyontogen rev bump if required
  • AC-1: one cargo build regenerates all transports + TS client; sdf:codegen-drift moon task exits 0 clean / 1 on drift.
  • AC-2: the active-work view works identically in desktop (IPC) and browser (HTTP) through the generated Transport interface.
  • AC-3: MCP registry exposes SDF’s ops; a smoke test lists tools and round-trips one call.
  • AC-4: parity gate exists, runs in CI, and fails on a seeded mismatch (negative test) while passing on main.
  • Full single-source contract convergence (follow-up under D-0017).
  • New panels/views (T-0DLC).
  • T-WDXJ (hard). Stacks after T-QT7X in PR order.

T-WDXJ


← Back to Tasks