- commit
- 946e8ddff5acb535a22ab7762049c207afdf2477
- parent
- 50e4d687990c223d77e5dab9c73834a9d8c861a2
- author
- Dami <dami.etoile@gmail.com>
| M | openspec/ | 12 | ++++++++++++ |
| M | openspec/ | 18 | +++++++++--------- |
@@ -49,3 +49,15 @@ Existing methods and return shapes remain compatible. Unknown stable IDs still
4949 return `undefined` from reads and `setActiveLevel` returns `false`. A removed5050 active ID is never left pointing at an unavailable level. Level ordering stays5151 registration order; identity resolution does not depend on array position.52+53+## Verification evidence54+55+`50e4d68` uses a direct ID map for single-level reads and invalidates cached56+pack summaries on catalog mutations. In a 64-level catalog, 2,000 reads of the57+last level took 16.55 ms through `getLevel(id)` versus 1,079.7 ms through the58+prior `getLevels().find(...)` path on the same local run (65.2×). The latter59+comparison includes the old full-list cloning cost; it is an architecture60+comparison, not a frame-time claim. The full Node suite passed 373/373,61+production build passed, and the world-index and pack/share browser flows62+passed without console or page errors. Delayed-win replacement/removal cases63+remain an explicit regression task before this change is archived.@@ -1,30 +1,30 @@
11 ## 1. Catalog identity and read boundaries22 3-- [ ] 1.1 Add stable-ID resolution helpers while preserving existing catalog3+- [x] 1.1 Add stable-ID resolution helpers while preserving existing catalog44 method signatures and return shapes.5-- [ ] 1.2 Track active level by `${packId}:${localId}` and define replacement,5+- [x] 1.2 Track active level by `${packId}:${localId}` and define replacement,66 removal, and empty-catalog fallback behavior.7-- [ ] 1.3 Replace repeated full-catalog work for single-level and active-level7+- [x] 1.3 Replace repeated full-catalog work for single-level and active-level88 reads with direct normalized-record lookup and safe boundary cloning.9-- [ ] 1.4 Add cache/generation invalidation for register, replace, and remove;9+- [x] 1.4 Add cache/generation invalidation for register, replace, and remove;1010 prove summaries and level counts never remain stale.1111 1212 ## 2. Application handoffs and progress1313 14-- [ ] 2.1 Migrate level loading, continue navigation, progress marking, and win14+- [x] 2.1 Migrate level loading, continue navigation, progress marking, and win1515 promotion to stable IDs while retaining numeric selection compatibility.1616 - [ ] 2.2 Handle pack replacement/removal during delayed win and gift/workshop1717 handoffs without promoting a stale level.18-- [ ] 2.3 Verify solved progress remains keyed by pack and local level IDs after18+- [x] 2.3 Verify solved progress remains keyed by pack and local level IDs after1919 registration order changes.2020 2121 ## 3. Regression and verification2222 23-- [ ] 3.1 Add catalog tests for replace, remove, active fallback, clone safety,23+- [x] 3.1 Add catalog tests for replace, remove, active fallback, clone safety,2424 direct reads, and cache invalidation.2525 - [ ] 3.2 Add application tests for progress and delayed Win handoffs across2626 replacement/removal and reused local IDs.27-- [ ] 3.3 Run the focused catalog/application tests, full Node suite, production27+- [x] 3.3 Run the focused catalog/application tests, full Node suite, production2828 build, and browser pack import/share flows.29-- [ ] 3.4 Run strict OpenSpec validation and record the measured catalog read29+- [x] 3.4 Run strict OpenSpec validation and record the measured catalog read3030 improvement before archiving the change.