Repository navigation
feat(web): request and arrival hooks for the split background packs (phase B step 3) - #124
Merged
Merged
Conversation
…phase B step 3) CityView now asks WebPackStream.request_path() on an asset miss instead of caching a permanent null: the scene cache, warm_scenes and _warm_one all pass through a pack gate that demands the pack once and records the wait, so a pending download no longer poisons the session cache. On pack_ready exactly the waiting paths are retried and stale null entries dropped; loaded scenes and their tuned materials are untouched. The one boot-breaking caller with its own exists() guard (tree props, which ride in the props pack) now demands through the same gate. FpContext carries the stream, GameBus gains pack_ready(pack), and FpMode forwards coordinator arrivals onto the bus before feature setup, disconnecting on teardown. midlod demands its pack on a baked-twin miss, keeps completed runtime twins across arrival, and lets fresh mesh_for calls pick up the baked files; render_opt passes the stream through from the context. Export side pins Option A as tests: zone/service geometry, hero and gameplay inputs stay in boot, the eight decorative packs classify as background, and a project-wide closure test fails on any static cross-pack reference (preload, class-level load or scene ext_resource) so the boot pack never depends on a download. A parity test keeps PACK_RULES aligned with WebPackStream.DEFAULT_ORDER. Gate quick + full PASS; tools/tests/pack_request_gate_test.gd covers the pending/arrival/genuine-miss/teardown matrix (20 checks); pytest 96 passed. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Automated reviewNo new findings on the 12 changed files (gdlint, complexity, TODO policy, dead code). Run |
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase B step 3 of the web split-pack plan (
docs/round3/web/phase-b-runtime-plan.mdimplementation order): Option A export classification tests + the runtime request/arrival hooks. Builds on #91 (loader hardening +WebPackStream, flag still off).Runtime hooks
CityViewasksWebPackStream.request_path()on an asset miss before anyResourceLoader.exists/cache decision (_scene,warm_scenes,_warm_oneall route through one_pack_gate). A pending pack returns null without writing the cache, so a download in flight no longer poisons_sceneswith a permanent null; the wait is recorded per pack.pack_ready, exactly the recorded paths are retried (warm_scenes), stale null entries are dropped, and loaded scenes keep their tuned materials. Genuine misses (no pack claims the path) and stream-less desktop runs keep the exact old behavior.exists()guard that could never register a miss — the tree props in_make_tree_kits, which ride in thepropspack — now demands through the gate. Re-kitting chunks on arrival is part of the step-4 feature coverage.FpContext.pack_stream(filled before player/collision/feature setup),GameBus.pack_ready(pack),FpModeforwards coordinator arrivals onto the bus and disconnects on teardown.midloddemands themidlodpack on a baked-twin miss, keeps completed runtime twins across arrival (no_meshes/_jobsclearing, no_activate), and lets freshmesh_forcalls pick up baked files.render_optpasses the stream through.Export classification (Option A pinned as tests)
tools/pytests/test_pack_closure.py: zone/service geometry, hero bodies/animation/roster/bonemaps, textures, fonts, UI sounds and all unmatched paths classify to boot; the eight decorative packs classify as background;BOOT_PATHSwins over prefix rules.preload, class-levelload, sceneext_resource) — the boot pack can never statically depend on a download. Current tree: zero violations.PACK_RULESpack names insideWebPackStream.DEFAULT_ORDERso no pack silently queues in the unknown tail.Tests
tools/tests/pack_request_gate_test.gd(20 checks): pending pack demands once + no null poisoning,_warm_oneyields without caching, arrival clears the wait set / drops stale nulls / the scene then loads and caches, genuine miss keeps the old completed-null behavior, no-stream desktop unchanged, teardown with a pending pack is safe, midlod demands once and the completed twin survives arrival.tools/gate.sh quickPASS,tools/gate.sh fullPASS, pytest 96 passed (coverage 97.11%), pre-commit checks pass (API docs regenerated).Second commit tracks the
people_pool.gd.uidthat #112 missed (import noise for every fresh worktree).Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>