Generated Artifact Drift And Repair
Purpose
Generated artifacts are checked-in files that must be refreshed by their owner command, not edited by hand. The artifact registry records each generated output, its source inputs, the command that checks drift, the optional command that repairs drift, and which quality-gate profiles should run it.
Use this workflow when a checked-in manifest, protocol document, environment template, generated token list, or generated JSON registry differs from what the current source code would emit.
Artifact Registry
crates/generated-artifacts is the shared source of artifact descriptors. xtask adapts those descriptors into quality-gate steps, drift probes, and repair plans. The aether-generated-artifact binary owns generated JSON outputs such as:
authoring_bake_products_manifest;ui_layout_asset_manifest;- game data item family manifests.
Other descriptors route to their own commands, such as realtime registry generation or config environment documentation.
Steps
- Identify the stale artifact id from the failing check or quality-gate output.
- Run the check command first. For generated JSON artifacts, use
cargo run -p aether --bin aether-generated-artifact -- --check <artifact-id>. - If the check reports drift, run the matching write command, such as
cargo run -p aether --bin aether-generated-artifact -- --write <artifact-id>. - Review the generated diff together with the source diff that caused it.
- Rerun the generated-artifact check and the relevant quality gate profile.
Expected Outputs
A clean check exits without rewriting files. A repair writes deterministic output and should leave a small, explainable diff. xtask should be able to include the artifact in its stale check plan, repair plan, drift plan when one exists, and quality-gate report plan.
Common Mistakes
Do not edit generated JSON, Markdown, or registry files directly to silence a drift failure. Do not add a new generated output without adding a descriptor, check command, repair command if possible, and quality-gate profile coverage. Do not treat a generated file with no repair command as optional; it still needs an explicit owner and review path.
Recovery Paths
If a repair command writes unexpected content, fix the generator or descriptor source instead of patching the output. If aether-generated-artifact rejects an id, add the renderer and descriptor together. If a quality gate misses an artifact, check the descriptor gate profiles and the xtask adapter tests.