|
| 1 | +# BUILD_PR — LEVEL 09_09 — ASSET PIPELINE TOOLING |
| 2 | + |
| 3 | +## Objective |
| 4 | +Finish the next dependency-ordered asset/tooling lane by introducing a shared asset pipeline surface under `tools/shared` that converts validated tool-authored data into clean runtime-facing asset outputs. |
| 5 | + |
| 6 | +This PR follows and depends on: |
| 7 | +- 09_04 asset structure simplification |
| 8 | +- 09_05 shared asset handoff enforcement |
| 9 | +- 09_06 tool launch contract alignment |
| 10 | +- 09_07 tool boundary normalization |
| 11 | +- 09_08 tool data contracts |
| 12 | + |
| 13 | +09_08 established explicit shared tool data contracts and validation. 09_09 now uses those contracts to define and implement the shared pipeline layer that performs load → validate → normalize → emit for runtime assets. |
| 14 | + |
| 15 | +## Why This PR Exists |
| 16 | +The repo now has: |
| 17 | +- cleaner asset ownership |
| 18 | +- shared handoff enforcement |
| 19 | +- normalized tool boundaries |
| 20 | +- contractable tool data |
| 21 | + |
| 22 | +What is still missing is the actual shared pipeline layer that turns authoring data into deterministic runtime outputs. |
| 23 | + |
| 24 | +Without this PR: |
| 25 | +- each tool may evolve its own export logic |
| 26 | +- normalization may drift across tools |
| 27 | +- runtime asset emission remains inconsistent |
| 28 | +- contract enforcement exists, but output flow is still fragmented |
| 29 | + |
| 30 | +## Core Principle |
| 31 | +Tools author data. |
| 32 | +The shared pipeline validates and transforms data. |
| 33 | +Games consume clean runtime assets. |
| 34 | + |
| 35 | +## In Scope |
| 36 | +- define a shared asset pipeline surface under `tools/shared` |
| 37 | +- centralize pipeline stages for tool-authored asset processing |
| 38 | +- use the 09_08 data contracts as the validation gate |
| 39 | +- normalize authoring data before runtime emission |
| 40 | +- define or implement shared emit behavior for runtime-facing assets |
| 41 | +- add focused pipeline validation/tests |
| 42 | +- document the runtime-vs-tool-data handoff pattern |
| 43 | + |
| 44 | +## Out of Scope |
| 45 | +- no engine changes |
| 46 | +- no gameplay/runtime feature work |
| 47 | +- no UI redesign |
| 48 | +- no broad asset moves |
| 49 | +- no speculative multi-format expansion beyond the active tool lane |
| 50 | +- no production build system work outside the shared tool pipeline boundary |
| 51 | + |
| 52 | +## Architectural Target |
| 53 | +Preferred shared structure: |
| 54 | +- `tools/shared/pipeline/` |
| 55 | +- `tools/shared/pipeline/loaders/` |
| 56 | +- `tools/shared/pipeline/normalizers/` |
| 57 | +- `tools/shared/pipeline/emitters/` |
| 58 | +- `tools/shared/pipeline/contracts/` (only if needed as a pipeline-facing layer) |
| 59 | +- `tools/shared/pipeline/validation/` (only if needed by the pipeline surface) |
| 60 | + |
| 61 | +Exact names may vary, but the pipeline must remain clearly separated from: |
| 62 | +- tool UI code |
| 63 | +- game runtime code |
| 64 | +- engine code |
| 65 | + |
| 66 | +## Required Pipeline Responsibilities |
| 67 | +The shared pipeline should support a clean staged flow: |
| 68 | + |
| 69 | +1. Load |
| 70 | +- load tool-authored data from domain-specific tool/data locations |
| 71 | +- resolve references deterministically |
| 72 | +- avoid tool-to-tool coupling |
| 73 | + |
| 74 | +2. Validate |
| 75 | +- run data-contract enforcement from the shared contract layer |
| 76 | +- stop or flag invalid inputs before emission |
| 77 | + |
| 78 | +3. Normalize |
| 79 | +- sanitize shared fields |
| 80 | +- align naming/shape rules |
| 81 | +- produce deterministic runtime-ready structures |
| 82 | +- keep normalization centralized, not per-tool scattered |
| 83 | + |
| 84 | +4. Emit |
| 85 | +- produce runtime-facing outputs in the domain folder |
| 86 | +- preserve the runtime vs authoring split: |
| 87 | + - runtime asset in `assets/<domain>/` |
| 88 | + - authoring/tool data in `assets/<domain>/data/` |
| 89 | + |
| 90 | +## Required Data Ownership Pattern |
| 91 | +This PR should align to the approved structure: |
| 92 | + |
| 93 | +- root game coordinator/manifest at `games/<game>/assets/<game>.assets.json` |
| 94 | +- runtime assets in `games/<game>/assets/<domain>/` |
| 95 | +- tool/editor data in `games/<game>/assets/<domain>/data/` |
| 96 | + |
| 97 | +Example: |
| 98 | +- `sprites/ship.png` |
| 99 | +- `sprites/data/ship.sprite.json` |
| 100 | + |
| 101 | +The pipeline should be the shared boundary that understands this distinction. |
| 102 | + |
| 103 | +## Active Domains To Support First |
| 104 | +Prioritize the active tool lane only: |
| 105 | +- sprites |
| 106 | +- tilemaps |
| 107 | +- parallax |
| 108 | +- vectors |
| 109 | + |
| 110 | +Support tilesets if directly required by active shared flow. |
| 111 | + |
| 112 | +## Implementation Guidance |
| 113 | +Keep this PR surgical and dependency-ordered: |
| 114 | +- prefer exact-cluster extraction |
| 115 | +- centralize export logic that is already repeated or clearly belongs in shared pipeline space |
| 116 | +- do not pull UI/editor workflow code into the pipeline |
| 117 | +- do not create a giant monolithic pipeline file if clean staged modules are warranted |
| 118 | + |
| 119 | +## Validation Expectations |
| 120 | +At minimum: |
| 121 | +- touched pipeline/shared files parse cleanly |
| 122 | +- pipeline uses the shared contract validation from 09_08 |
| 123 | +- invalid tool data is surfaced cleanly |
| 124 | +- normalized output shape is deterministic |
| 125 | +- runtime emission targets remain in domain folders, not `data/` |
| 126 | +- existing launch-contract / asset integration checks are not regressed |
| 127 | + |
| 128 | +## Acceptance Criteria |
| 129 | +- a shared asset pipeline surface exists under `tools/shared` |
| 130 | +- tool-authored data flows through shared contract validation before emit |
| 131 | +- runtime vs tool-data separation is preserved |
| 132 | +- active tool domains use consistent pipeline behavior |
| 133 | +- no engine/runtime feature scope expansion occurs |
| 134 | +- focused tests/checks pass |
| 135 | + |
| 136 | +## Deliverables |
| 137 | +Codex should return a repo-structured ZIP at: |
| 138 | +`<project folder>/tmp/BUILD_PR_LEVEL_09_09_ASSET_PIPELINE_TOOLING.zip` |
| 139 | + |
| 140 | +Include: |
| 141 | +- docs/pr/BUILD_PR_LEVEL_09_09_ASSET_PIPELINE_TOOLING.md |
| 142 | +- docs/dev/codex_commands.md |
| 143 | +- docs/dev/commit_comment.txt |
| 144 | +- docs/dev/next_command.txt |
| 145 | +- docs/dev/reports/change_summary.txt |
| 146 | +- docs/dev/reports/validation_checklist.txt |
0 commit comments