Summary
Establish a repository-owned Rust build hygiene and tracing baseline by tightening workspace build profiles, adding repeatable cargo xtask rust audit/cleanup/trace workflows, and closing the documented UI tracing bootstrap gap without changing intended product behavior.
Problem Statement
The workspace target/ directory can grow to tens of gigabytes during normal development, and the repository currently lacks a first-class, repo-owned way to audit artifact growth, perform targeted cleanup, or standardize tracing/debug launch workflows. The root workspace manifest also does not yet encode the intended lean dev / opt-in rich debugging / stripped release profile policy. Separately, ui/README.md documents that the browser site entrypoint still only installs the panic hook and that desktop_tauri does not yet install the native JSON tracing subscriber expected by the architecture. That leaves build hygiene and structured diagnostics partially manual and inconsistently discoverable.
Proposed Solution
Add root Cargo profile policy for lean daily development, extend xtask with a dedicated rust command group for repeatable audit/cleanup/trace workflows, and extend shared/telemetry with shared runtime/environment typing plus browser/native tracing bootstrap helpers. Wire the browser and desktop entrypoints to install tracing bootstrap while preserving existing visible warning paths in desktop_runtime until end-to-end parity is verified. Keep the work additive, deterministic, and repo-owned rather than introducing external cache tooling or ad hoc scripts.
Primary Architectural Plane
cross-layer
Architectural References
AGENTS.md
ARCHITECTURE.md
docs/architecture/layer-boundaries.md
xtask/AGENTS.md
ui/README.md
docs/process/github-workflow-migration.md
DEVELOPMENT_MODEL.md
Owning Subsystem
- Root workspace Cargo policy
xtask repository-native tooling
shared/telemetry tracing bootstrap
ui/crates/site and ui/crates/desktop_tauri runtime entrypoints
Integration Boundaries
- Allowed: root
Cargo.toml, .cargo/config.toml, xtask/, shared/telemetry/, ui/crates/site/, ui/crates/desktop_tauri/, README.md, DEVELOPMENT_MODEL.md, ui/README.md, and matching plans/ execution artifacts.
- Allowed: shared tracing/bootstrap helpers consumed through typed workspace crates only.
- Non-goal: redesign runtime contracts or schema versions.
- Non-goal: add direct UI coupling to services, workflows, or SurrealDB.
- Non-goal: replace existing visible warning paths in
desktop_runtime with tracing-only diagnostics before parity is verified.
Impacted Domains
Affected Consistency Class
Not Applicable
Affected Risk Tier
high
Scope In
Scope Out
Acceptance Criteria
Validation Requirements
Validation Artifacts
Rollback Considerations
Rollback should revert the workspace profile policy, xtask command surface, telemetry bootstrap, UI entrypoint wiring, docs, and execution artifacts together so the repository does not retain mismatched command/documentation or partially enabled tracing assumptions.
Rollback Path
Revert the issue branch commit set as one unit, restoring the prior root manifest, xtask help/aliases, telemetry crate, UI entrypoints, and docs. If rollback occurs after follow-on work begins, revert this issue before any dependent tracing-only callsite migrations so the repository returns to the previous visible-diagnostics-only baseline cleanly.
Technical Notes
tokio-console support should remain native-host only and opt-in behind the cargo xtask rust trace desktop --tokio-console path.
- Audit and cleanup flows should stay on Cargo built-ins plus deterministic filesystem traversal; no external cleanup tool dependency should be added.
- Report artifacts should follow existing
xtask patterns and live under ignored output directories.
Related Issues
- Follow the repo-local execution artifact protocol for multi-plane / high-risk work.
- Shared observability alignment should remain compatible with the existing UI observability direction documented in
ui/README.md.
Summary
Establish a repository-owned Rust build hygiene and tracing baseline by tightening workspace build profiles, adding repeatable
cargo xtask rustaudit/cleanup/trace workflows, and closing the documented UI tracing bootstrap gap without changing intended product behavior.Problem Statement
The workspace
target/directory can grow to tens of gigabytes during normal development, and the repository currently lacks a first-class, repo-owned way to audit artifact growth, perform targeted cleanup, or standardize tracing/debug launch workflows. The root workspace manifest also does not yet encode the intended lean dev / opt-in rich debugging / stripped release profile policy. Separately,ui/README.mddocuments that the browsersiteentrypoint still only installs the panic hook and thatdesktop_tauridoes not yet install the native JSON tracing subscriber expected by the architecture. That leaves build hygiene and structured diagnostics partially manual and inconsistently discoverable.Proposed Solution
Add root Cargo profile policy for lean daily development, extend
xtaskwith a dedicatedrustcommand group for repeatable audit/cleanup/trace workflows, and extendshared/telemetrywith shared runtime/environment typing plus browser/native tracing bootstrap helpers. Wire the browser and desktop entrypoints to install tracing bootstrap while preserving existing visible warning paths indesktop_runtimeuntil end-to-end parity is verified. Keep the work additive, deterministic, and repo-owned rather than introducing external cache tooling or ad hoc scripts.Primary Architectural Plane
cross-layer
Architectural References
AGENTS.mdARCHITECTURE.mddocs/architecture/layer-boundaries.mdxtask/AGENTS.mdui/README.mddocs/process/github-workflow-migration.mdDEVELOPMENT_MODEL.mdOwning Subsystem
xtaskrepository-native toolingshared/telemetrytracing bootstrapui/crates/siteandui/crates/desktop_tauriruntime entrypointsIntegration Boundaries
Cargo.toml,.cargo/config.toml,xtask/,shared/telemetry/,ui/crates/site/,ui/crates/desktop_tauri/,README.md,DEVELOPMENT_MODEL.md,ui/README.md, and matchingplans/execution artifacts.desktop_runtimewith tracing-only diagnostics before parity is verified.Impacted Domains
Affected Consistency Class
Not Applicable
Affected Risk Tier
high
Scope In
dev, opt-indebugging, and strippedrelease.cargo xtask rust audit|clean|traceplus matching cargo aliases.shared/telemetrywith runtime/environment models and browser/native tracing bootstrap helpers.siteanddesktop_taurito initialize tracing bootstrap and emit initial lifecycle events.plans/<issue-id>-<slug>/execution artifacts.Scope Out
sccacheor remote artifact reuse.tracing.Acceptance Criteria
cargo xtask rust audit,cargo xtask rust clean, andcargo xtask rust traceexist with deterministic help and test coverage.siteinstalls wasm-compatible tracing alongside the panic hook, anddesktop_tauriinstalls the native JSON tracing subscriber before host startup.desktop_runtimevisible warning paths remain intact in this change set.Validation Requirements
cargo test -p xtaskcargo test -p telemetrycargo check -p desktop_tauricargo xtask verify profile uicargo verify-repocargo xtask ui-hardeningcargo xtask rust audit,cargo xtask rust clean incremental, andcargo xtask rust trace desktop --dry-runValidation Artifacts
xtasktests covering parsing/reporting/cleanup planning/trace presetstelemetrytests covering environment parsing and bootstrap configurationplans/<issue-id>-<slug>/Rollback Considerations
Rollback should revert the workspace profile policy,
xtaskcommand surface, telemetry bootstrap, UI entrypoint wiring, docs, and execution artifacts together so the repository does not retain mismatched command/documentation or partially enabled tracing assumptions.Rollback Path
Revert the issue branch commit set as one unit, restoring the prior root manifest, xtask help/aliases, telemetry crate, UI entrypoints, and docs. If rollback occurs after follow-on work begins, revert this issue before any dependent tracing-only callsite migrations so the repository returns to the previous visible-diagnostics-only baseline cleanly.
Technical Notes
tokio-consolesupport should remain native-host only and opt-in behind thecargo xtask rust trace desktop --tokio-consolepath.xtaskpatterns and live under ignored output directories.Related Issues
ui/README.md.