Xtask Content Gates And Plans
Purpose
xtask owns repeatable workspace checks that authors and operators can run before content reaches runtime. The important rule is that gate plans are descriptors, not copied shell snippets: the same metadata drives CLI output, control-panel actions, JSON reports, and nested pack-export checks.
Commands And Profiles
Use quality-gate for workspace-wide checks and pack-export-gate for standalone content bundle readiness. Both support plan mode with Markdown or JSON output. Quality-gate profiles are standard, ci-cleanup, editor-client, services, protocol-config, and full. Pack-export profiles are local and server-smoke.
doctor reports local developer workspace readiness. engine-health can be run directly when you need source inventory, drift, or cleanup-budget detail without running the full quality gate.
Steps
- Start with a plan:
cargo run -p xtask -- quality-gate --root . --plan --format markdown. - Pick the narrowest profile that owns the code or content you changed.
- For standalone work, inspect
cargo run -p xtask -- pack-export-gate --root . --plan --format markdown. - Run the gate without
--planonce the command list matches the change. - Keep JSON plan output for tools and control-panel integrations.
Expected Outputs
Plan mode should render stable Markdown and JSON with step ids, commands, outputs, assertions, profile metadata, and nested gate references. Real gate mode should run the descriptor-backed steps and report failures with the gate failure class, not just raw command text.
Common Mistakes
Do not paste a local command list into a new UI or script when an xtask descriptor already exists. Do not run full by reflex when a scoped profile gives faster feedback. Do not skip the plan when debugging pack-export failures; the plan often shows missing bake outputs, smoke scenarios, or report paths before the expensive step runs.
Recovery Paths
If a gate command is wrong, fix the descriptor and its rendering tests. If a plan omits a generated artifact or bake output, update the registry that owns the output. If a control-panel gate action drifts from CLI behavior, compare the action descriptor with the shared xtask command spec.