1 pack export content gate
forgejo-actions edited this page 2026-07-06 16:45:10 +00:00

Pack Export Content Gate

Pack export is the content preflight that proves authored source, generated artifacts, bake outputs, replay fixtures, smoke scenarios, and the standalone asset pack agree before content is shipped or handed to standalone/server packaging.

Purpose

Use this workflow before exporting a standalone pack, handing content to server/standalone packaging, or reviewing a content change that affects generated artifacts or runtime cache output. It keeps editable source, checked-in generated artifacts, aether-bake products, strict content diagnostics, replay fixtures, smoke scenarios, and the final asset pack in one review path.

Source Layers

Keep the layers separate when debugging gate failures:

  • Authored source is the editable truth: scene files, game-data shards, UI layout documents, dialogue, quests, cutscenes, source assets, and authoring manifests.
  • Generated artifacts are checked-in outputs derived from authored source or descriptors, such as generated game-data aggregate JSON, UI layout asset manifest JSON, authoring bake product manifest JSON, realtime protocol docs, and registry files.
  • Authoring bake outputs are runtime-cache products written by aether-bake, plus authoring_bake_manifest.json.
  • Pack outputs are produced by aether-pack, verified against source roots, and summarized by content preflight reports.

Do not fix source drift by editing generated output directly. Update the authored source or descriptor, then run the relevant repair command.

Steps

  1. Check generated artifacts that the change can stale.
  2. Run authoring bake with diagnostics promoted to failures.
  3. Review or run the pack/export gate plan.
  4. Build and verify the standalone pack with strict content diagnostics.
  5. Save the preflight JSON and reward dependency report.
  6. Escalate to the full quality gate when the change reaches code, descriptors, migrations, or release validation.

For a fast local content pass:

Use the authoring bake whenever a content edit must produce runtime cache output:

cargo run --bin aether-bake -- --fail-on-diagnostics

The bake CLI accepts:

cargo run --bin aether-bake -- --output-root target/pack-export-gate/runtime-cache --manifest target/pack-export-gate/runtime-cache/authoring_bake_manifest.json --fail-on-diagnostics

--fail-on-diagnostics promotes validation diagnostics to a failing command. The bake manifest records output IDs, schema versions, baker fingerprints, content hashes, dependency graph hashes, validation hashes, dependencies, source provenance, and validation issues.

Generated Artifact Drift

Use aether-generated-artifact for checked-in JSON artifacts owned by the aether crate:

cargo run -p aether --bin aether-generated-artifact -- --check authoring_bake_products_manifest
cargo run -p aether --bin aether-generated-artifact -- --check ui_layout_asset_manifest
cargo run -p aether --bin aether-generated-artifact -- --check game_data_catalog_aggregate

Repair stale generated artifacts with the same ID and --write, for example:

cargo run -p aether --bin aether-generated-artifact -- --write game_data_catalog_aggregate

The broader quality gate has a generated-artifacts step for the active profile. Use that when the changed files affect generated outputs beyond these three JSON artifacts, such as protocol docs or config docs.

Pack Gate

The pack/export gate is planned and run through xtask:

cargo run -p xtask -- pack-export-gate --root . --out target/pack-export-gate

Use a plan before long runs or when reviewing CI shape:

cargo run -p xtask -- pack-export-gate --root . --out target/pack-export-gate --plan --format markdown

The local profile runs these steps:

  1. Engine health: scans source and authored asset health signals.
  2. Protocol docs: checks generated realtime protocol registry/docs.
  3. Authoring bake: runs aether-bake with --fail-on-diagnostics.
  4. Replay fixtures: checks protocol and authored preview replay fixtures.
  5. Runtime manifest bake: runs runtime scene manifest tests.
  6. Smoke scenarios: runs local authored content/editor smoke checks.
  7. Bundle output: builds the standalone pack, verifies it, verifies strict content diagnostics, writes JSON/Markdown reports, and writes the content bundle manifest.

Use --profile server-smoke when server-backed smoke scenarios are required in addition to local smoke coverage.

Expected Outputs

The pack/export gate writes or expects these review artifacts under the output root:

  • target/pack-export-gate/runtime-cache/authoring_bake_manifest.json
  • runtime-cache bake products selected from the generated authoring bake product manifest for pack_export
  • target/pack-export-gate/content_bundle_manifest.json
  • target/pack-export-gate/standalone_content_preflight_report.json
  • target/pack-export-gate/reward_dependency_report.md

The preflight JSON includes pack_diagnostics, strict_diagnostics, reward_dependencies, reward_dependency_markdown, and economy_balance_markdown.

Pack Commands

aether-pack has four author-facing modes:

cargo run --bin aether-pack
cargo run --bin aether-pack -- --verify
cargo run --bin aether-pack -- --verify --strict-content-diagnostics
cargo run --bin aether-pack -- --preflight-report-json --output target/pack-export-gate/standalone_content_preflight_report.json
cargo run --bin aether-pack -- --reward-dependencies --output target/pack-export-gate/reward_dependency_report.md

Plain verify checks the asset pack structure, hashes, and required runtime dependency assets. Strict verify also runs strict content diagnostics and fails on blocking authored-content issues. The preflight JSON report contains pack diagnostics, strict diagnostics, reward dependency rows, and economy-balance data. The reward dependency Markdown report lists authored reward/drop references that must stay present in shipped game-data catalogs.

Smoke And Replay Fixtures

Replay fixture failures usually mean a wire contract, authored scene preview scenario, or runtime decoding path changed without updating fixtures. Smoke failures usually mean the exported content can be read but cannot satisfy an expected gameplay/editor scenario.

The local pack/export profile includes replay, authored scene preview, reward-chain, composed-catalog, and runtime-scene-manifest checks. The server-smoke profile appends live world_entry_smoke scenarios and writes smoke reports under the pack/export output root.

Treat fixture updates like generated artifacts: update the owning authored source or protocol/schema descriptor first, regenerate or re-record only through the owning workflow, then rerun the pack/export plan.

When To Run Full Quality Gate

Run the pack/export gate for content-only changes that affect shipped authored data, generated artifacts, bake outputs, runtime cache output, standalone assets, replay fixtures, or smoke scenarios.

Run the full quality gate when the change also touches Rust behavior, protocol/config descriptors, migrations, service runtime, CI gate descriptors, or anything that can change compile/test coverage beyond exported content:

cargo run -p xtask -- quality-gate --root . --profile full

For normal pre-merge confidence, use the standard quality gate; it includes generated artifacts, docs, engine health, login-server migration checks, and the nested pack/export gate.

Common Mistakes

  • Editing assets/generated or src/authoring_bake/products_manifest.json by hand instead of changing the source and running the writer.
  • Running aether-bake without --fail-on-diagnostics and treating warnings/errors as exportable.
  • Verifying the archive without --strict-content-diagnostics.
  • Updating bake products or consumers without regenerating the product manifest that pack/export reads.
  • Updating protocol or scene behavior without updating replay fixtures through the owning workflow.
  • Treating local smoke as enough for a change that needs server-smoke or the full quality gate.

Recovery Paths

  1. If a generated artifact check fails, run the matching --write command and review the diff.
  2. If authoring bake fails, fix the source asset named in the validation issue, then rerun bake with --fail-on-diagnostics.
  3. If strict content diagnostics fail during pack verify, inspect standalone_content_preflight_report.json and reward dependency output.
  4. If replay or smoke fails, identify whether the fixture or authored source is stale before changing test expectations.
  5. If bundle verification fails, compare the pack diagnostics with source roots and required runtime dependency assets.