|
| 1 | +# PLAN_PR_RUNTIME_ASSET_LOADER |
| 2 | + |
| 3 | +## Goal |
| 4 | +Define a strict runtime asset loader and execution model that consumes packaged project output and resolves |
| 5 | +runtime-ready assets deterministically without changing engine core APIs. |
| 6 | + |
| 7 | +## Context |
| 8 | +The project baseline now includes: |
| 9 | +- registry-aware editors |
| 10 | +- additive project-level asset dependency graph |
| 11 | +- enforced asset validation engine |
| 12 | +- assistive remediation system |
| 13 | +- strict project packaging/export system |
| 14 | + |
| 15 | +The next architectural layer is runtime execution. This system must load packaged outputs in a predictable, |
| 16 | +fail-fast way under the assumption that strict packaging already guaranteed correctness. |
| 17 | + |
| 18 | +## Strict Runtime Intent |
| 19 | +This PR is intentionally strict. |
| 20 | +Runtime loading should assume packaged data is valid and fail fast when required packaged contracts are violated. |
| 21 | + |
| 22 | +## Scope |
| 23 | +- Define packaged-input runtime contracts |
| 24 | +- Define runtime manifest consumption rules |
| 25 | +- Define deterministic asset load ordering |
| 26 | +- Define loader lifecycle states |
| 27 | +- Define runtime failure boundaries for invalid packaged input |
| 28 | +- Define handoff contract from packaging system to runtime loader |
| 29 | + |
| 30 | +## Non-Goals |
| 31 | +- No engine core API changes |
| 32 | +- No editor-side packaging redesign |
| 33 | +- No defensive missing-asset fallback layer |
| 34 | +- No runtime repair/remediation system |
| 35 | +- No support for invalid packaged content |
| 36 | + |
| 37 | +## Runtime Inputs |
| 38 | +- strict package manifest |
| 39 | +- dependency-resolved packaged assets |
| 40 | +- stable export layout from packaging system |
| 41 | + |
| 42 | +## Runtime Outputs |
| 43 | +- loaded runtime asset table |
| 44 | +- resolved startup dependency set |
| 45 | +- deterministic loader state/reporting |
| 46 | +- runtime-ready project bootstrap data |
| 47 | + |
| 48 | +## Proposed Loader State Model |
| 49 | +```json |
| 50 | +{ |
| 51 | + "runtimeLoader": { |
| 52 | + "status": "idle | loading | ready | failed", |
| 53 | + "loadedAssets": [], |
| 54 | + "failedAt": null, |
| 55 | + "reports": [] |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +## Core Contracts |
| 61 | +1. Runtime loader only accepts strict packaged output as input. |
| 62 | +2. Package manifest is the runtime authority for packaged asset enumeration. |
| 63 | +3. Load order must be deterministic enough for repeatable startup behavior. |
| 64 | +4. Missing or invalid required packaged assets must fail fast. |
| 65 | +5. Runtime loader does not repair invalid packages. |
| 66 | +6. Registry/graph concepts remain authoring-time sources; packaged manifest is runtime entry authority. |
| 67 | +7. Loader reports must be stable and human-readable for debugging. |
| 68 | + |
| 69 | +## Runtime Categories |
| 70 | +- manifest ingestion |
| 71 | +- package layout validation |
| 72 | +- deterministic load sequencing |
| 73 | +- startup dependency resolution |
| 74 | +- fail-fast boundary reporting |
| 75 | +- runtime bootstrap handoff |
| 76 | + |
| 77 | +## Shared Responsibilities |
| 78 | +- runtime loading logic should be centralized where practical |
| 79 | +- packaged manifest consumption should not be reimplemented ad hoc across samples/tools |
| 80 | +- reporting should be stable enough for validation and future automation |
| 81 | + |
| 82 | +## Manual Validation Checklist |
| 83 | +1. Valid packaged project loads successfully. |
| 84 | +2. Repeated loads of unchanged package produce stable load order. |
| 85 | +3. Missing required packaged asset fails fast. |
| 86 | +4. Invalid manifest/package contract fails fast. |
| 87 | +5. Ready state only occurs after all required startup dependencies resolve. |
| 88 | +6. Loader reports clearly identify failure boundaries. |
| 89 | +7. Engine core APIs remain unchanged. |
| 90 | + |
| 91 | +## Next Command |
| 92 | +BUILD_PR_RUNTIME_ASSET_LOADER |
0 commit comments