@wildshard/engine 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/budgets/shard-size-baseline.json +10 -4
  3. package/index.html +6 -4
  4. package/lint/engine-sides.json +18 -0
  5. package/lint/ratchet.json +0 -68
  6. package/lint/ratchet.mjs +1 -4
  7. package/package.json +19 -15
  8. package/scripts/agent-sync.mjs +27 -8
  9. package/scripts/app-build/appCook.ts +8 -2
  10. package/scripts/app-build/catalogue.ts +10 -7
  11. package/scripts/app-build/gen.ts +33 -2
  12. package/scripts/app-build/isolation.d.mts +10 -0
  13. package/scripts/app-build/isolation.mjs +47 -0
  14. package/scripts/app-build/outputProducts.mjs +4 -0
  15. package/scripts/app-build/previousDeploy.d.mts +2 -0
  16. package/scripts/app-build/previousDeploy.mjs +10 -1
  17. package/scripts/app-build/serviceWorker.ts +10 -3
  18. package/scripts/app-build/splitOutput.mjs +4 -2
  19. package/scripts/app-build/standaloneOutput.d.mts +1 -1
  20. package/scripts/app-build/standaloneOutput.mjs +5 -3
  21. package/scripts/app-build/titlePreloads.d.mts +8 -0
  22. package/scripts/app-build/titlePreloads.mjs +69 -0
  23. package/scripts/app-build/worldMapAtlas.ts +10 -6
  24. package/scripts/app-build-pipeline.mjs +31 -3
  25. package/scripts/built-product.mjs +1 -1
  26. package/scripts/cell-mem-bench.mjs +83 -23
  27. package/scripts/check-custom-sections-zero.mjs +1 -1
  28. package/scripts/check-devserver.mjs +2 -0
  29. package/scripts/check-models.mjs +2 -0
  30. package/scripts/check-paths.allow.json +0 -115
  31. package/scripts/check-paths.mjs +2 -2
  32. package/scripts/check-platform-ratchets.mjs +2 -3
  33. package/scripts/chromium-keychain.d.mts +1 -1
  34. package/scripts/ci-static.sh +1 -1
  35. package/scripts/committed-fast-checks.mjs +0 -2
  36. package/scripts/content-sw-proof.mjs +2 -1
  37. package/scripts/cook-worker.mjs +9 -3
  38. package/scripts/cook.mjs +18 -5
  39. package/scripts/docs-inputs-proof.mjs +6 -6
  40. package/scripts/e7-voice-staging-proof.mjs +1 -1
  41. package/scripts/gate-related-tests.mjs +1 -1
  42. package/scripts/git-source-view.mjs +1 -1
  43. package/scripts/goldens/capture.mjs +17 -5
  44. package/scripts/grid-crossing-nightly.mjs +59 -0
  45. package/scripts/grid-crossing-qa.mjs +44 -0
  46. package/scripts/grid-crossing-ratchet.d.mts +6 -0
  47. package/scripts/grid-crossing-ratchet.mjs +52 -0
  48. package/scripts/grid-crossing-report.mjs +122 -0
  49. package/scripts/grid-crossing-stages.mjs +47 -0
  50. package/scripts/grid-crossing-tour.mjs +284 -0
  51. package/scripts/grid-crossing-walk-proof.mjs +126 -17
  52. package/scripts/host-ruler/roots.mjs +2 -2
  53. package/scripts/host-ruler.d.mts +91 -0
  54. package/scripts/host-ruler.mjs +565 -0
  55. package/scripts/land.mjs +2 -1
  56. package/scripts/live-prepush.py +3 -5
  57. package/scripts/loading-flow/benchmax.mjs +37 -12
  58. package/scripts/loading-flow/deskbench.mjs +276 -0
  59. package/scripts/loading-flow/stalls.d.mts +17 -3
  60. package/scripts/loading-flow/stalls.mjs +82 -3
  61. package/scripts/look-loop/test_look_loop.py +1 -38
  62. package/scripts/memory-proof.mjs +61 -6
  63. package/scripts/mmo-bots.mjs +8 -2
  64. package/scripts/net-lag-proof.mjs +219 -0
  65. package/scripts/night-market-kit-budget.mjs +2 -2
  66. package/scripts/nightly-model.ts +9 -6
  67. package/scripts/offline-proof-rules.d.mts +2 -2
  68. package/scripts/offline-proof-rules.mjs +15 -4
  69. package/scripts/offline-proof.mjs +80 -13
  70. package/scripts/{shard-platform-output.mjs → output-reader.mjs} +1 -1
  71. package/scripts/page-release/content.d.mts +9 -1
  72. package/scripts/page-release/content.mjs +131 -17
  73. package/scripts/page-release/flow.mjs +36 -10
  74. package/scripts/page-release/stamp-content.mjs +24 -0
  75. package/scripts/page-release.mjs +28 -6
  76. package/scripts/page-size.mjs +2 -1
  77. package/scripts/parity/boot-smoke.mjs +13 -2
  78. package/scripts/pin-format.ts +5 -2
  79. package/scripts/pin-packs.ts +1 -1
  80. package/scripts/pins-reuse.d.mts +1 -0
  81. package/scripts/pins-reuse.mjs +22 -0
  82. package/scripts/pins.ts +4 -4
  83. package/scripts/precommit-checks.mjs +1 -7
  84. package/scripts/precommit-jobs.mjs +0 -1
  85. package/scripts/precommit-source.py +1 -9
  86. package/scripts/program-discovery.mjs +1 -1
  87. package/scripts/ring-cook.mjs +2 -1
  88. package/scripts/ring-step.ts +1 -1
  89. package/scripts/scratch-dir.mjs +95 -0
  90. package/scripts/scratch-sweep.mjs +182 -0
  91. package/scripts/script-scenario-metrics.mjs +1 -1
  92. package/scripts/shard-output-content.d.mts +1 -1
  93. package/scripts/shard-output-content.mjs +2 -2
  94. package/scripts/shard-outputs.mjs +1 -1
  95. package/scripts/shard-public.mjs +1 -1
  96. package/scripts/shard-wire-meter.mjs +24 -9
  97. package/scripts/side-parity.mjs +4 -2
  98. package/scripts/standalone-smoke.mjs +8 -3
  99. package/scripts/tier-textures.mjs +22 -4
  100. package/scripts/tile-bake-report.mjs +1 -1
  101. package/scripts/tile-bakes.mjs +1 -1
  102. package/scripts/title-assets.generated.json +2 -0
  103. package/scripts/tsconfig.json +2 -14
  104. package/scripts/vendor/basisu/LICENSE +201 -0
  105. package/scripts/vendor/basisu/basis_encoder.cjs +2 -0
  106. package/scripts/vendor/basisu/basis_encoder.wasm +0 -0
  107. package/scripts/vitest-push-guards.config.ts +1 -1
  108. package/scripts/vps/harden-apply.sh +4 -1
  109. package/scripts/vps/harden-prometheus.sh +179 -0
  110. package/scripts/vps/harden.sh +16 -0
  111. package/scripts/vps/rebuild.sh +18 -0
  112. package/scripts/vps/wildshard-config +6 -2
  113. package/scripts/worker-client-play.mjs +6 -2
  114. package/scripts/worktree-reap.mjs +59 -13
  115. package/scripts/worktree.mjs +19 -5
  116. package/src/.oxlintrc.json +3 -182
  117. package/src/client/app/entry.ts +10 -2
  118. package/src/client/engine/anim/rigParser.ts +2 -2
  119. package/src/client/engine/boot/bootCache.ts +2 -2
  120. package/src/client/engine/boot/bootTrace.ts +12 -4
  121. package/src/client/engine/boot/browserChunkRecovery.ts +4 -0
  122. package/src/client/engine/boot/clearDownloads.ts +5 -2
  123. package/src/client/engine/boot/contentRead.ts +11 -0
  124. package/src/client/engine/boot/gpuFiles.ts +4 -2
  125. package/src/client/engine/boot/lastEnd.ts +99 -12
  126. package/src/client/engine/boot/texturePack.ts +2 -2
  127. package/src/client/engine/core/Game.ts +63 -19
  128. package/src/client/engine/core/gpuOnly.ts +10 -0
  129. package/src/client/engine/core/renderBudget.ts +134 -0
  130. package/src/client/engine/net/netPlayer.ts +19 -2
  131. package/src/client/engine/net/otherPlayers.ts +55 -8
  132. package/src/client/engine/net/predictor.ts +33 -9
  133. package/src/client/engine/net/redial.ts +68 -10
  134. package/src/client/engine/pwa/cacheNames.ts +58 -1
  135. package/src/client/engine/pwa/sw.js +41 -11
  136. package/src/client/engine/render/dataLook.ts +219 -44
  137. package/src/client/engine/render/families/detail.ts +89 -0
  138. package/src/client/engine/render/families/pbr.ts +9 -1
  139. package/src/client/engine/render/families/registry.ts +11 -2
  140. package/src/client/engine/render/families/sceneSurface.ts +116 -0
  141. package/src/client/engine/render/look.ts +12 -0
  142. package/src/client/engine/render/lookLight.ts +103 -11
  143. package/src/client/engine/render/lookRender.ts +105 -0
  144. package/src/client/engine/render/precompile.ts +4 -2
  145. package/src/client/engine/render/tiers.ts +4 -1
  146. package/src/client/engine/saves/indexed.ts +2 -2
  147. package/src/client/engine/telemetry/browserErrors.ts +24 -3
  148. package/src/client/engine/telemetry/staleBuildReport.ts +22 -1
  149. package/src/client/engine/ui/debugOptions.ts +1 -1
  150. package/src/client/engine/ui/lookLightOption.ts +10 -6
  151. package/src/client/engine/ui/namePrompt.ts +7 -0
  152. package/src/client/engine/world/declaredProps.ts +5 -1
  153. package/src/client/engine/world/skyRig.ts +4 -1
  154. package/src/client/engine/world/terrainTileView.ts +64 -23
  155. package/src/client/game/boot/audio.generated.ts +114 -114
  156. package/src/client/game/boot/bytes.generated.ts +118 -220
  157. package/src/client/game/boot/placedSpawn.ts +35 -0
  158. package/src/client/game/boot/spawnDownload.ts +25 -6
  159. package/src/client/game/boot/versions.generated.ts +7 -5
  160. package/src/client/game/devScene/hook.ts +428 -0
  161. package/src/client/game/devScene/liveLook.ts +21 -0
  162. package/src/client/game/grid/cellLoading.ts +12 -2
  163. package/src/client/game/grid/live.ts +152 -19
  164. package/src/client/game/grid/liveSession.ts +53 -3
  165. package/src/client/game/grid/mapAtlas.ts +18 -4
  166. package/src/client/game/grid/minimapBlend.ts +15 -5
  167. package/src/client/game/grid/oneWayIn.ts +5 -1
  168. package/src/client/game/grid/pageEntry.ts +12 -1
  169. package/src/client/game/grid/placedCells.ts +114 -12
  170. package/src/client/game/grid/placedContent.ts +85 -0
  171. package/src/client/game/grid/prefetch.ts +9 -1
  172. package/src/client/game/grid/productInputs.ts +23 -10
  173. package/src/client/game/grid/productLeases.ts +4 -1
  174. package/src/client/game/grid/products.ts +8 -4
  175. package/src/client/game/grid/roadLook.ts +24 -15
  176. package/src/client/game/grid/roadLookPlatform.ts +4 -2
  177. package/src/client/game/grid/roadResources.ts +24 -0
  178. package/src/client/game/grid/roadSign.worker.ts +4 -3
  179. package/src/client/game/grid/roadSignPaint.ts +16 -5
  180. package/src/client/game/grid/roadSignPreparation.ts +4 -3
  181. package/src/client/game/grid/roadSignScale.ts +8 -0
  182. package/src/client/game/grid/roadTileCapture.worker.ts +3 -1
  183. package/src/client/game/grid/roadTileCaptureWorker.ts +2 -1
  184. package/src/client/game/grid/roadTileWrite.worker.ts +4 -2
  185. package/src/client/game/grid/roadTileWriter.ts +2 -1
  186. package/src/client/game/grid/screenReports.ts +39 -0
  187. package/src/client/game/grid/session.ts +32 -7
  188. package/src/client/game/grid/softWallLook.ts +25 -8
  189. package/src/client/game/mainMenu.ts +6 -2
  190. package/src/client/game/plugin/context.ts +2 -1
  191. package/src/client/game/plugin/followedMovers.ts +7 -1
  192. package/src/client/game/quest/figures.ts +2 -0
  193. package/src/client/game/session/finish.ts +9 -0
  194. package/src/client/game/shardfile/assetCache.ts +4 -4
  195. package/src/client/game/shardfile/client.ts +28 -8
  196. package/src/client/game/shardfile/clientAssets.ts +9 -5
  197. package/src/client/game/shardfile/clientLibrary.ts +1 -1
  198. package/src/client/game/shardfile/clientPropMaterials.ts +4 -1
  199. package/src/client/game/shardfile/clientViews.ts +36 -8
  200. package/src/client/game/shardfile/clientWater.ts +51 -9
  201. package/src/client/game/shardfile/clientWorker.ts +19 -7
  202. package/src/client/game/shardfile/constructionCheckpoint.ts +2 -2
  203. package/src/client/game/shardfile/groundMerge.ts +57 -5
  204. package/src/client/game/shardfile/hybrid.ts +2 -0
  205. package/src/client/game/shardfile/look.ts +8 -3
  206. package/src/client/game/shardfile/product.ts +34 -7
  207. package/src/client/game/shardfile/productChecks.ts +2 -2
  208. package/src/client/game/shardfile/productCost.ts +2 -2
  209. package/src/client/game/shardfile/readAsset.ts +2 -2
  210. package/src/client/game/shardfile/reflectingWater.ts +73 -0
  211. package/src/client/game/shardfile/seatGrace.ts +9 -0
  212. package/src/client/game/shardfile/skinPlayback.ts +1 -1
  213. package/src/client/game/shardfile/slabLibrary.ts +115 -49
  214. package/src/client/game/shardfile/tileContent.ts +1 -1
  215. package/src/client/game/shardfile/tileDriver.ts +38 -11
  216. package/src/client/game/shardfile/wirePage.ts +7 -3
  217. package/src/client/game/shardfile/worldScenes.ts +17 -10
  218. package/src/client/game/systems/npc/figureRows.ts +9 -0
  219. package/src/client/host/online/doctor.ts +22 -7
  220. package/src/client/host/online/doctorView.ts +2 -0
  221. package/src/client/host/online/linkScreens.ts +109 -5
  222. package/src/client/host/online/shell.ts +13 -4
  223. package/src/client/host/standalone/shell.ts +40 -0
  224. package/src/cook/game/astc6Encode.ts +55 -0
  225. package/src/cook/game/astc6Wasm.ts +176 -0
  226. package/src/cook/game/cookJob.ts +30 -6
  227. package/src/cook/game/cookWorker.ts +38 -11
  228. package/src/cook/game/entryTotals.ts +51 -24
  229. package/src/cook/game/shardCook.ts +35 -7
  230. package/src/cook/game/spawnParts.ts +33 -8
  231. package/src/cook/game/tierTextures.ts +87 -14
  232. package/src/server/engine/ai/bossContenders.ts +27 -3
  233. package/src/server/engine/ai/phases.ts +1 -1
  234. package/src/server/engine/entities/creatureRefill.ts +9 -2
  235. package/src/server/engine/net/ledgerBook.ts +2 -0
  236. package/src/server/engine/net/room.ts +15 -0
  237. package/src/server/engine/sim/respawn.ts +8 -0
  238. package/src/server/game/boss/arenaRoomEntry.ts +5 -1
  239. package/src/server/game/boss/arenaRoomNative.ts +2 -0
  240. package/src/server/game/boss/native.ts +2 -1
  241. package/src/server/game/boss/nativeWake.ts +9 -5
  242. package/src/server/game/boss/openArenaNative.ts +2 -2
  243. package/src/server/game/boss/openArenaRoom.ts +3 -1
  244. package/src/server/game/grid/room.ts +44 -3
  245. package/src/server/game/grid/simulation.ts +23 -0
  246. package/src/server/game/population/mixedRoster.ts +11 -3
  247. package/src/server/game/population/nativeBake.ts +8 -3
  248. package/src/server/game/population/nativeReturns.ts +6 -3
  249. package/src/server/game/population/roster.ts +5 -3
  250. package/src/server/game/quest/eliteDrops.ts +18 -3
  251. package/src/server/game/quest/nativeChapter.ts +1 -1
  252. package/src/server/game/quest/nativeComposition.ts +5 -1
  253. package/src/server/game/riding/nativeTaming.ts +22 -7
  254. package/src/server/game/riding/wildRefill.ts +3 -2
  255. package/src/server/game/shardfile/bossRow.ts +4 -2
  256. package/src/server/game/shardfile/homeKeeper.ts +4 -2
  257. package/src/server/host/bake/headlessWorker.ts +1 -1
  258. package/src/server/host/dedicated/cellHost.ts +112 -18
  259. package/src/server/host/dedicated/cellProtocol.ts +18 -1
  260. package/src/server/host/dedicated/cellWorker.ts +8 -5
  261. package/src/server/host/dedicated/dedicatedRoom.ts +38 -11
  262. package/src/server/host/dedicated/gridCells.ts +15 -6
  263. package/src/server/host/dedicated/loopLag.ts +21 -0
  264. package/src/server/host/dedicated/main.ts +13 -5
  265. package/src/server/host/dedicated/packReader.ts +3 -3
  266. package/src/server/host/dedicated/placementFile.ts +3 -2
  267. package/src/server/host/dedicated/roadRoom.ts +34 -4
  268. package/src/server/host/dedicated/serverMetrics.ts +135 -0
  269. package/src/server/host/dedicated/socketPump.ts +21 -4
  270. package/src/server/host/dedicated/workerTable.ts +32 -14
  271. package/src/server/host/dedicated/world.ts +65 -7
  272. package/src/server/host/headless.ts +1 -1
  273. package/src/server/host/headlessRuntime.ts +1 -1
  274. package/src/server/host/standalone/roadWorld.ts +15 -3
  275. package/src/server/host/standalone/serverHost.ts +57 -8
  276. package/src/server/host/standalone/serverProduct.ts +48 -16
  277. package/src/server/host/standalone/serverRuntime.ts +1 -1
  278. package/src/shared/engine/ai/BossBrain.ts +8 -0
  279. package/src/shared/engine/core/framePacing.ts +12 -1
  280. package/src/shared/engine/physics/terrainTiles.ts +20 -4
  281. package/src/shared/game/boss/wake.ts +6 -0
  282. package/src/shared/game/devColliders.ts +107 -0
  283. package/src/shared/game/devGameplay.ts +41 -0
  284. package/src/shared/game/eliteSystem.ts +8 -0
  285. package/src/shared/game/grid/allocator.ts +3 -0
  286. package/src/shared/game/grid/placementRows.ts +5 -2
  287. package/src/shared/game/plugin/bossRecord.ts +3 -2
  288. package/src/shared/game/shardfile/ktx2Targets.ts +23 -3
  289. package/src/shared/game/shardfile/outputDescriptor.ts +9 -5
  290. package/src/shared/game/shardfile/packReads.ts +28 -3
  291. package/src/shared/game/shardfile/serverPack.ts +9 -0
  292. package/src/shared/game/systems/looks/trampleField.ts +2 -0
  293. package/src/shared/host/formatJsonSchema.ts +2 -2
  294. package/src/tsconfig.json +1 -27
  295. package/lint/host-reviews.json +0 -14
  296. package/lint/listed-view-code.json +0 -13
  297. package/lint/platform-pending-users.json +0 -2520
  298. package/lint/platform-pending-users.md +0 -18
  299. package/scripts/cell-mem/metrics-preload.mjs +0 -65
  300. package/scripts/check-closed-components.d.mts +0 -7
  301. package/scripts/check-closed-components.mjs +0 -87
  302. package/scripts/g571-hosts.d.mts +0 -3
  303. package/scripts/g571-hosts.mjs +0 -54
  304. package/scripts/host-ruler/register-migrate.mjs +0 -242
  305. package/scripts/listed-view-code.d.mts +0 -7
  306. package/scripts/listed-view-code.mjs +0 -93
  307. package/scripts/look-loop/fit-lut.py +0 -142
  308. package/scripts/look-loop/palette-delta.py +0 -183
  309. package/scripts/look-loop/regions/driftwood-isle.json +0 -25
  310. package/scripts/look-loop/regions/far-reach.json +0 -225
  311. package/scripts/look-loop/regions/open-plot-night-market.json +0 -855
  312. package/scripts/look-loop/regions/pine-hollow.json +0 -22
  313. package/scripts/look-loop/regions/sunscar-dunes.json +0 -281
  314. package/scripts/platform-chargebacks.d.mts +0 -9
  315. package/scripts/platform-chargebacks.mjs +0 -135
  316. package/scripts/shard-component-spans.d.mts +0 -15
  317. package/scripts/shard-component-spans.mjs +0 -18
  318. package/scripts/shard-components.d.mts +0 -16
  319. package/scripts/shard-components.mjs +0 -363
  320. package/scripts/shard-platform-hosts.d.mts +0 -2
  321. package/scripts/shard-platform-hosts.mjs +0 -93
  322. package/scripts/shard-platform-sections.d.mts +0 -2
  323. package/scripts/shard-platform-sections.mjs +0 -9
  324. package/scripts/shard-platform.d.mts +0 -76
  325. package/scripts/shard-platform.mjs +0 -1072
  326. package/src/.oxfmtrc.json +0 -48
  327. package/src/scripts/ask-new.sh +0 -29
  328. package/src/scripts/asks.mjs +0 -142
  329. package/src/scripts/herdr-prompt.sh +0 -34
  330. package/src/scripts/herdr-question-open.sh +0 -67
  331. package/src/scripts/md-wrap.mjs +0 -229
  332. /package/scripts/{shard-platform-format.d.mts → node-format.d.mts} +0 -0
  333. /package/scripts/{shard-platform-format.mjs → node-format.mjs} +0 -0
  334. /package/scripts/{shard-platform-output.d.mts → output-reader.d.mts} +0 -0
@@ -1,363 +0,0 @@
1
- // W1-M0: roles attribute existing G291/G294 contributions, never change their size.
2
- import { readFileSync } from 'node:fs';
3
- import { resolve } from 'node:path';
4
- import { parseSync } from 'vite';
5
- import { platformChargeback } from './platform-chargebacks.mjs';
6
-
7
- /** One milestone roster drives component collection and every report. */
8
- export const SHARD_WAVES = [
9
- { id:'W1',status:'current',current:true,shards:[{slug:'far-reach',name:'Sky'},{slug:'sunscar-dunes',name:'Signal'}] },
10
- { id:'W2',status:'next',current:false,shards:[{slug:'pine-hollow',name:'Pine'},{slug:'driftwood-isle',name:'Driftwood'}] },
11
- { id:'W3',status:'next',current:false,shards:[{slug:'nalati-grasslands',name:'Nalati'},{slug:'nine-dragon-stack',name:'Nine'}] },
12
- ];
13
- const waveRow = id => { const row=SHARD_WAVES.find(wave=>wave.id===id);if(row===undefined)throw new Error(`Unknown shard wave ${id}`);return row; };
14
- export const W1_SHARDS = waveRow('W1').shards.map(row=>row.slug);
15
- export const COMPONENT_SHARDS = SHARD_WAVES.flatMap(wave=>wave.shards.map(row=>row.slug));
16
- const currentWave = () => { const row=SHARD_WAVES.find(wave=>wave.current);if(row===undefined)throw new Error('No current shard wave');return row; };
17
- export const COMPONENTS = {
18
- C1: 'Static world', C2: 'Looks', C3: 'Effects', C4: 'Creatures',
19
- C5: 'NPCs and quests', C6: 'Items and combat', C7: 'Movers',
20
- C8: 'Audio', C9: 'Boot glue',
21
- };
22
- // Ordered semantic roles apply to owner APIs, declarations and imported bindings.
23
- // File roles supply a baseline; explicit owner declarations/calls split mixed code.
24
- const roles = [
25
- ['C3', /fireFx|gustFx|windFx|windLook|WIND_FIELDS|WIND_LOOKS|UPDRAFT_AXIS|wakeRibbon|discLayer|heroStoneDiscs|GUST_FX|RAY_WAKE/iu],
26
- ['C5', /quest|bindDirectorActions|signalStages|PivotNpc|NpcSurface|NpcLevel|scout|sefa|keeper|turnVanes|vaneFlag|QUEST|LATER_FLAGS|PAID_FLAG|SCOUT_FLAG|COMPLETE_FLAG/iu],
27
- ['C7', /mover|updraft|SocketLift|isletCalls|IsletCalls|RisingIslet|RISING_ISLETS|winch|commandSocketLift/iu],
28
- ['C6', /weapon|lash|whip|fan|strike|swings|cracks|worldCommands|heavy|released|bindRuntimeItemContexts|item/iu],
29
- ['C4', /species|creature|Animal|flock|brain|bossStages|undrawnRig|matriarch|stormRoc|rocBrain|bossOwner|BossView|SkySpecs|SKY_HOMES|GOAT_|\bray\b|skitterer|strider|setHome|bindPlayerPush|homes|encounter/iu],
30
- ['C8', /audio|cues|voices|score/iu],
31
- ['C2', /look|Glsl|shader|Material|scarfed|dusk|light|fog|paint|texture|SKY_SUN|SAND|SKIRT|Atmosphere|stormWeather/iu],
32
- ['C1', /terrain|ground|worldBuild|buildWorld|bakedWorld|BakedTerrain|meadow|mesh|geometry|collider|props|Primitives/iu],
33
- ];
34
- const questOwners=new Set([
35
- 'src/client/game/systems/npc/npcRig.ts',
36
- 'src/client/game/complete/ShardComplete.ts',
37
- ]);
38
- // Reviewed W2 baseline owners. Exact paths/exports only; mixed AST ownership below still applies.
39
- const reviewedW2Owners = new Map([
40
- ['src/shared/game/loot/tableRows.ts#readLootTables', 'C6'],
41
- ['src/format/lootEconomy.ts', 'C6'],
42
- ['src/shared/game/shard/declaredRows.ts#EconomyGrant', 'C6'],
43
- ['src/shared/game/shard/declaredRows.ts#DeclaredLootEconomy', 'C6'],
44
- ['src/shared/game/shard/declaredRows.ts#declaredLootEconomy', 'C6'],
45
- ['src/client/engine/models/ownedGeometry.ts', 'C1'],
46
- // Reviewed runtime tile views, lent looks, terrain admission and combat status.
47
- ['src/client/game/shardfile/runtimeProduct.ts#bindRuntimeProductProps', 'C1'],
48
- ['src/client/game/shardfile/hybridPresentation.ts#hybridPresentation', 'C2'],
49
- ['src/client/game/shardfile/runtimeProduct.ts#runtimePresentation', 'C2'],
50
- ['src/shared/engine/physics/bodies.ts#BodyLaunchRow', 'C6'],
51
- ['src/format/nativeItems.ts#BodyLaunchSchema', 'C6'],
52
- ['src/format/lootEconomy.ts#ClaimedPickupSchema', 'C6'],
53
- ['src/shared/engine/combat/effects/EffectService.ts#playerBindings', 'C6'],
54
- ['src/shared/engine/combat/effects/EffectService.ts#bindPlayerEffects', 'C6'],
55
- ['src/shared/game/bag/itemCatalog.ts#isItemId', 'C6'],
56
- ['src/client/game/plugin/ui.ts#STARTER_EFFECTS', 'C6'],
57
- ['src/client/game/plugin/ui.ts#StatusMovement', 'C6'],
58
- ['src/client/game/plugin/ui.ts#StarterContext', 'C6'],
59
- ['src/client/game/plugin/ui.ts#installStarterEffects', 'C6'],
60
- ['src/client/game/systems/effects/starter.generated.ts#STARTER_EFFECT_ROWS', 'C6'],
61
- ['src/client/game/systems/effects/view.ts#PATHS', 'C6'],
62
- ['src/client/game/systems/effects/view.ts#StatusIcons', 'C6'],
63
- // Graph look-material collection. The decoded texture loan is committed.
64
- ['src/client/game/plugin/shaderFamily.ts#lookGraphMaterials', 'C2'],
65
- ['src/client/game/plugin/shaderFamily.ts#SPLICER', 'C2'],
66
- ['src/client/game/plugin/shaderFamily.ts#spliceEdits', 'C2'],
67
- // Fixed authored site placement and metadata translation; actual sole-user charging is retained.
68
- ['src/client/engine/models/place.ts#ModelSiteLayout', 'C1'],
69
- ['src/client/engine/models/place.ts#ModelSite', 'C1'],
70
- ['src/client/engine/models/place.ts#placeModelSite', 'C1'],
71
- // Static scene geometry, placements, building assembly and their bake contracts.
72
- ['src/shared/engine/sim/shore.ts#SHORE_REVETMENT_INNER_FACE', 'C1'],
73
- ['src/client/game/shardfile/bakedKinds.ts#loadBakedKinds', 'C1'],
74
- ['src/shared/engine/physics/box.ts#FloorRect', 'C1'],
75
- ['src/client/game/shardfile/caveInterior.ts', 'C1'],
76
- // Material/rig look decoding and authored appearance rows.
77
- ['src/sharddev/bake/rig.ts', 'C2'],
78
- // Weather and visual fight effects.
79
- // C3 review: private ambient orchestration and weather remain counted custom.
80
- ['src/client/game/weather/forest.ts', 'C3'],
81
- ...['src/server/game/weather/continuation.ts', 'src/server/game/weather/reactions.ts', 'src/client/game/shardfile/weatherFields.ts'].map(path => [path, 'C3']),
82
- // Animal/boss goals, bodies, pose and ambient wildlife.
83
- ['src/client/engine/entities/lowpoly.ts#crestSpikes', 'C4'],
84
- ['src/sharddev/phasedBoss.ts#RoamingBossRow', 'C4'],
85
- ...['NativeCreaturePoseRecipe', 'NativeCreaturePose', 'attachNativeCreaturePose'].map(name => [`src/shared/game/plugin/animation.ts#${name}`, 'C4']),
86
- // Journal, onboarding, discovery and quest presentation.
87
- ['src/sharddev/interactions.ts#interactionRules', 'C5'],
88
- // Equipment, combat feel, held viewmodels, loot and owned rewards.
89
- ['src/shared/engine/combat/ammo.ts', 'C6'],
90
- ['src/client/engine/combat/cues.ts#resolveHitStop', 'C6'],
91
- ['src/shared/engine/combat/Firearm.ts#RangedAction', 'C6'],
92
- ['src/shared/engine/combat/Firearm.ts#RangedActionRow', 'C6'],
93
- ['src/client/engine/combat/view/projectile.ts#ProjectilePresentation', 'C6'],
94
- ['src/client/engine/combat/view/ranged.ts#weaponDisplay', 'C6'],
95
- ['src/client/engine/combat/view/ranged.ts#TRACER_ORDER', 'C6'],
96
- ['src/client/engine/combat/view/ranged.ts#TRACER_RED', 'C6'],
97
- ['src/client/engine/combat/view/ranged.ts#edgeWear', 'C6'],
98
- ['src/client/engine/combat/view/ranged.ts#makeBoltAtlas', 'C6'],
99
- ['src/client/engine/combat/view/ranged.ts#makeCord', 'C6'],
100
- ['src/client/engine/combat/view/ranged.ts#ViewmodelSet', 'C6'],
101
- ['src/client/engine/combat/view/ranged.ts#ViewmodelMaterialRow', 'C6'],
102
- ['src/client/engine/combat/view/ranged.ts#viewmodelRowMaterial', 'C6'],
103
- ['src/client/engine/combat/view/rangedFeel.ts', 'C6'],
104
- ['src/client/engine/player/Skins.ts#STATE', 'C6'],
105
- ['src/client/engine/player/Skins.ts#SkinState', 'C6'],
106
- ['src/client/engine/player/Skins.ts#applySkin', 'C6'],
107
- ['src/client/engine/player/Skins.ts#clearSkin', 'C6'],
108
- ['src/client/engine/player/Skins.ts#cloneWith', 'C6'],
109
- ['src/client/engine/player/Skins.ts#white', 'C6'],
110
- ['src/client/engine/player/Skins.ts#whiteTex', 'C6'],
111
- ['src/client/game/loot/tables.ts#registerLootTable', 'C6'],
112
- ['src/client/game/shard/retainedHooks.ts#installRetainedPlayerEffects', 'C6'],
113
- ['src/client/game/shard/retainedHooks.ts#playerBindings', 'C6'],
114
- ['src/client/game/systems/viewmodel/armClips.ts#SWIM_CLIPS', 'C6'],
115
- ['src/client/game/systems/viewmodel/rigArms.ts#CLIP', 'C6'],
116
- ['src/client/game/systems/viewmodel/rigArms.ts#RigArms', 'C6'],
117
- ['src/client/game/systems/viewmodel/rigArms.ts#RigMeta', 'C6'],
118
- ['src/client/game/systems/viewmodel/rigArms.ts#RigState', 'C6'],
119
- ['src/client/game/systems/viewmodel/rigArms.ts#VmFrame', 'C6'],
120
- ['src/client/game/systems/viewmodel/rigArms.ts#isMesh', 'C6'],
121
- ['src/client/game/systems/viewmodel/rigArms.ts#parsed', 'C6'],
122
- ['src/client/game/systems/viewmodel/rigArms.ts#rigScene', 'C6'],
123
- ['src/client/game/systems/viewmodel/rigArms.ts#swordArmsOf', 'C6'],
124
- // Loading, continuation parsing, lifecycle plumbing, instrumentation and localization.
125
- ['src/client/engine/core/assets.ts#gltfLoader', 'C9'],
126
- ['src/client/engine/core/assets.ts#loadGLTF', 'C9'],
127
- ['src/shared/engine/script/host.ts#preparationWait', 'C9'],
128
- ['src/shared/engine/script/host.ts#preparingOwners', 'C9'],
129
- ['src/shared/engine/script/host.ts#requirePreparationOwner', 'C9'],
130
- ['src/server/host/headlessRuntime.ts#HeadlessCommandPorts', 'C9'],
131
- ['src/server/host/headlessRuntime.ts#bindHeadlessCommands', 'C9'],
132
- ['src/client/game/plugin/context.ts#buildProgress', 'C9'],
133
- ['src/client/game/shard/retainedHooks.ts#installEnteredRuntimeAttachment', 'C9'],
134
- ['src/client/game/shard/retainedHooks.ts#installEnteredRuntimeObserver', 'C9'],
135
- ['src/client/game/shard/retainedHooks.ts#installEnteredRuntimeUpdate', 'C9'],
136
- ['src/shared/game/grid/pageMode.ts#gridPage', 'C9'],
137
- ]);
138
- function namedRole(name,path='') {
139
- const reviewed = reviewedW2Owners.get(`${path}#${name}`); if (reviewed !== undefined) return reviewed;
140
- return roles.find(([, pattern]) => pattern.test(name))?.[0] ?? null; }
141
- // W3 folder baselines describe the runtime owner; mixed declarations still split
142
- // through the existing AST rules. Build-time generators are outside this census.
143
- const w3Paths = [
144
- ['C5', /^(?:quest\/|adventure\.ts$|campPeople(?:Models)?\.ts$|models\/people\.ts$)/u],
145
- ['C6', /^(?:weapons\/|runtime\/(?:weapons|viewmodel)\/|vm\/|bag\.ts$|models\/gear\.ts$|runtime\/jian\.ts$)/u],
146
- ['C7', /^(?:ride\/|grapple\/|playground\/|runtime\/(?:tools|portals)\/|runtime\/(?:grapple|playerModes|headlessMounted)\.ts$|world\/(?:portalRide|portalVeil|portals|feats)\.ts$)/u],
147
- ['C3', /^(?:world\/(?:installWeather|weatherStep|WeatherFX|Lightning|rainProgram|Flutter)\.ts$|combat\/nightFx\.ts$|runtime\/looks\/(?:burstFx|ropeFilament|strandCloth)\.ts$)/u],
148
- ['C4', /^(?:species\/|creatures\/|models\/(?:creatures|ambientLife)\.ts$|runtime\/(?:enteredEnvironment|[a-zA-Z]+Keeper|[a-zA-Z]+Brain|headless(?:Creatures|Raid|Taming)|flockDeclared|groups?|group[A-Z][a-zA-Z]*|raidDirector|ghostVolleyDirector|tamingLaw)\.ts$|combat\/(?:stormTitan|goldenKing|ghostRiders|balbalWarriors|eliteRoster|elites|night)\.ts$|data\/(?:species\/|fauna|brains|eliteEncounters|crowds)\.ts$)/u],
149
- ['C6', /^combat\//u],
150
- ['C1', /^(?:world\/|runtime\/heightPatch\.ts$|assets\/contracts\/(?:modelPlacement|tangentRows)\.ts$|generators\/bakeWrite\.ts$|models\/|runtime\/(?:cull|kit|props)\/|(?:terrain|edge|wet|layout)\.ts$|data\/(?:layoutPlan|floorPlan|decks|casts|worldDressing|specimenDims|lod)\.ts$)/u],
151
- ['C2', /^(?:assets\/contracts\/signPlacement\.ts$|look\/|runtime\/(?:looks|signs)\/|data\/(?:aoLook|weaponLooks|arms|cloth|facadeModels|signs|specimenProfiles)\.ts$)/u],
152
- ['C9', /^(?:boot\/|runtime\/(?:index|state|baked|headless|headlessMounted|enteredEnvironment|facts)\.ts$|(?:manifest|plugin|roster|shard\.config|util|stealth)\.ts$|data\/(?:budgets|ledger|words|modes|campParams|(?:layout|poiLayout)\.generated\.d\.json)\.ts$)/u],
153
- ];
154
- // Sole-user platform contributions retain their canonical size. These reviewed
155
- // owners only distribute W3's existing charges into the component table.
156
- const w3SharedOwners = new Map([
157
- ...['src/shared/engine/combat/targets.ts', 'src/shared/engine/combat/effects/types.ts',
158
- 'src/client/engine/player/firstPersonArms.ts', 'src/client/game/weapons/heldLauncher.ts',
159
- 'src/client/game/systems/viewmodel/armRig.ts'].map(path => [path, 'C6']),
160
- ...['src/sharddev/crowds.ts',
161
- 'src/shared/game/shardfile/crowdRuntime.ts', 'src/sharddev/phasedBoss.ts'].map(path => [path, 'C4']),
162
- ...['src/client/engine/core/gpuOnly.ts', 'src/sharddev/kit/bakedGeometry.ts',
163
- 'src/sharddev/kit/geometryPack.ts'].map(path => [path, 'C1']),
164
- ['src/client/engine/core/ktx2.ts', 'C2'],
165
- ...['src/shared/game/plugin/quests.ts'].map(path => [path, 'C5']),
166
- ['src/server/game/shardfile/portalLinkProof.ts', 'C7'],
167
- ...['src/shared/game/grid/pageMode.ts', 'src/sharddev/assets.ts',
168
- 'src/sharddev/buildBehaviour.ts', 'src/client/engine/app/systems.ts'].map(path => [path, 'C9']),
169
- ]);
170
- function w3FileRole(path) {
171
- const match = /^src\/shards\/(?:nalati-grasslands|nine-dragon-stack)\/(.+)$/u.exec(path);
172
- return match === null ? null : w3Paths.find(([, pattern]) => pattern.test(match[1]))?.[0] ?? null;
173
- }
174
- /** Explicit file ownership; an unrecognised file stays visible and cannot close C9. */
175
- function fileRole(path, name = '') {
176
- const reviewed = reviewedW2Owners.get(name ? `${path}#${name}` : path) ?? reviewedW2Owners.get(path);
177
- if (reviewed !== undefined) return reviewed;
178
- const w3 = w3FileRole(path); if (w3 !== null) return w3;
179
- if (/\/systems\/life\//u.test(path)||path==='src/shared/engine/ai/ambientFlight.ts'||name==='installAmbientLife')return 'C4';
180
- if (path === 'src/shared/engine/world/waves.ts' && name === 'GERSTNER_TERMS') return 'C2';
181
- if (['src/format/materialGraph.ts', 'src/client/game/shardfile/clientMaterials.ts', 'src/client/game/shardfile/clientGraphs.ts'].includes(path)) return 'C2';
182
- if (path === 'src/client/game/shardfile/hybrid.ts') return 'C9';
183
- if(questOwners.has(path))return 'C5';
184
- if(path==='src/shared/engine/world/interact/flags.ts'&&name==='bindInteractionState')return 'C5';
185
- if (path === 'src/client/game/plugin/ui.ts' && ['WorldSceneBoundParts', 'bindWorldSceneParts'].includes(name)) return 'C1';
186
- if (path === 'src/client/game/plugin/ui.ts' && ['moverChannelValues', 'moverChannelView', 'moverChannelViews', 'moverChannelPrompts'].includes(name)) return 'C7';
187
- if (path === 'src/sharddev/questGraph.ts' && name === 'parseNpcRow') return 'C5';
188
- if (path === 'src/sharddev/bake/texture.ts') return 'C2';
189
- if (name && /PivotNpc|NpcSurface|NpcLevel/iu.test(name)) return 'C5';
190
- if (name && /SocketLift|Updraft/iu.test(name)) return 'C7';
191
- if (name && /bindRuntimeItemContexts/iu.test(name)) return 'C6';
192
- if (/fireFx|windFx|wakeRibbon|discLayer|skyCardsLook|cardField/iu.test(path)) return 'C3';
193
- if (/\/(?:quest|quests)\/|\/runtime\/quest\.ts$/u.test(path)) return 'C5';
194
- if (/\/(?:species|creatures)\/|brain|flock|\/ai\/|(?:models|combat)\/(?:creatures|matriarch|stormRoc)/iu.test(path)) return 'C4';
195
- if (/\/(?:weapons|items)\/|\/items\.ts$|lash|fan|\/models\/gear|weaponFamily/iu.test(path)) return 'C6';
196
- if (/mover|entries\.ts$|islets?\.ts$|risingIslet|isletLift|updraft/iu.test(path)) return 'C7';
197
- if (/audio|cues|voices/iu.test(path)) return 'C8';
198
- if (/\/look[s]?\/|Look|Glsl|\/render\/|Atmosphere|materialPreparation/iu.test(path)) return 'C2';
199
- if (/\/world\/|\/models\/|\/layout\.ts$|\/plugin\/geometry\.ts$/u.test(path)) return 'C1';
200
- if (/\/(?:boot|explore|thumbs)\/|\/(?:manifest|plugin|roster|budgets|budgetCeilings|shard\.config)\.ts$|\/runtime\/(?:index|headless|signalPlan|standalone|source|persistence)\.ts$|\/runtime\/shardfile\/markedBoss\.ts$|\/plugin\/(?:headless|simulation)\.ts$|\/game\/saves\.ts$/u.test(path)) return 'C9';
201
- return null;
202
- }
203
- const children = node => Object.values(node).flatMap(value => Array.isArray(value) ? value.filter(item => item?.type) : value?.type ? [value] : []);
204
- const nodeName = node => node?.name ?? (typeof node?.value === 'string' ? node.value : '');
205
- const calledName = node => node?.type === 'MemberExpression' ? nodeName(node.property) : nodeName(node);
206
- function runtimeTags(source, path, fallback) {
207
- const parsed = parseSync(path, source), starts = [0];
208
- let blanked = '', cursor = 0;
209
- for (const comment of parsed.comments) { blanked += source.slice(cursor, comment.start) + source.slice(comment.start, comment.end).replaceAll(/[^\n]/gu, ' '); cursor = comment.end; }
210
- blanked += source.slice(cursor);
211
- for (let i = 0; i < source.length; i++) if (source[i] === '\n') starts.push(i + 1);
212
- const tags = blanked.split('\n').map((line, index) => line.trim() ? { line:index + 1, component:fallback, priority:0, reason:'file owner', symbol:'' } : null);
213
- const lineOf = offset => { let low=0, high=starts.length-1; while(low<high){const mid=(low+high+1)>>1;if(starts[mid]<=offset)low=mid;else high=mid-1;}return low; };
214
- // R19: retain defining symbols without changing semantic ownership or counts.
215
- const symbol = (node, name) => {
216
- for (let i=lineOf(node.start);i<=lineOf(Math.max(node.start,node.end-1));i++) if(tags[i]) tags[i].symbol=name;
217
- };
218
- for (const statement of parsed.program.body) {
219
- const node=statement.type==='ExportNamedDeclaration'?statement.declaration:statement;
220
- if(!node)continue;
221
- if(node.type==='VariableDeclaration')for(const declaration of node.declarations)symbol(declaration,nodeName(declaration.id));
222
- else if(node.id) {
223
- const name=nodeName(node.id);symbol(node,name);
224
- if(node.type==='ClassDeclaration')for(const member of node.body.body)if(member.type==='MethodDefinition')symbol(member,`${name}.${nodeName(member.key)}`);
225
- }
226
- }
227
- const assign = (node, component, priority, reason) => {
228
- if (!component) return;
229
- const owner = fallback === 'C3' && (component === 'C1' || component === 'C2') ? 'C3' : component;
230
- for (let i=lineOf(node.start);i<=lineOf(Math.max(node.start,node.end-1));i++) {
231
- const row=tags[i]; if(row && priority>row.priority){row.component=owner;row.priority=priority;row.reason=reason;}
232
- }
233
- };
234
- const imports = new Map();
235
- for (const node of parsed.program.body) if(node.type==='ImportDeclaration') {
236
- const from=fileRole(node.source.value);
237
- for(const spec of node.specifiers) {
238
- // Shared cable construction is quest binding or static rest geometry, not a private mover law.
239
- const cable = ['ZiplineDriver', 'CableLayout', 'ZiplineSpec', 'ZiplineRideState'].includes(spec.local.name)
240
- && node.source.value === '@wildshard/sharddev/movers';
241
- const bindingOwner = /\/quest\//u.test(path) ? 'C5' : null;
242
- const admittedBoot = path === 'src/shards/driftwood-isle/shard.config.ts' && node.source.value === './data/movers';
243
- const owner = admittedBoot ? 'C9' : cable && bindingOwner !== null ? bindingOwner : namedRole(spec.local.name,path) ?? from;
244
- imports.set(spec.local.name, owner);
245
- }
246
- assign(node, node.specifiers.map(spec=>imports.get(spec.local.name)).find(Boolean),1,`import ${node.source.value}`);
247
- }
248
- const methods = { arm:'C6',armed:'C6',dress:'C6',enter:'C6',witnessed:'C4',ray:'C4',stage:'C5',build:'C1' };
249
- const wire = node => node === null || node === undefined || ['Identifier', 'Literal', 'ThisExpression'].includes(node.type)
250
- || (node.type === 'MemberExpression' && !node.computed && wire(node.object));
251
- const visit=(node,depth)=>{
252
- let role=null, reason='';
253
- if(node.type==='VariableDeclarator'||node.type==='FunctionDeclaration') {
254
- const name=nodeName(node.id);role=(node.type==='VariableDeclarator' && (node.init?.type!=='Literal' && wire(node.init) || node.init?.type==='CallExpression' && node.init.callee.type==='MemberExpression' && calledName(node.init.callee)==='get') ? null : (node.init?.type==='CallExpression' ? imports.get(calledName(node.init.callee)) ?? namedRole(calledName(node.init.callee),path) : null) ?? namedRole(name,path));reason=`declaration ${name}`;
255
- } else if(node.type==='MethodDefinition') { const name=nodeName(node.key);role=(Object.hasOwn(methods,name)?methods[name]:null)??namedRole(name,path);reason=`method ${name}`;
256
- } else if(node.type==='Property'||node.type==='PropertyDefinition') {
257
- const name=nodeName(node.key);
258
- // Borrowed service references and destructuring fields retain the enclosing
259
- // declaration/call owner. A literal tuning row still owns its semantics.
260
- const reference=node.type==='Property' && node.value?.type!=='Literal' && wire(node.value);
261
- role=reference?null:namedRole(name,path);reason=`property ${name}`;
262
- // A world's winch prompt and its anchor are quest interaction handles,
263
- // distinct from the kinematic mover command/pose owners.
264
- if (path === 'src/shards/driftwood-isle/shard.config.ts' && name === 'movers') role='C9';
265
- if (path.endsWith('/world/build.ts') && ['winch', 'winchAt'].includes(name)) role='C5';
266
- } else if(node.type==='CallExpression'||node.type==='NewExpression') {
267
- const name=calledName(node.callee);role=imports.get(name)??namedRole(name,path);reason=`owner API ${name}`;
268
- }
269
- assign(node,role,2+depth,reason);
270
- for(const child of children(node))visit(child,depth+1);
271
- };
272
- visit(parsed.program,0);
273
- // G515: dependency crumbs belong to the enclosing file's component. Keep
274
- // imported owners above for real calls, but don't turn wiring into a feature.
275
- const crumbs = node => {
276
- const field = (node.type === 'Property' || node.type === 'PropertyDefinition')
277
- && !node.computed && !node.method && node.kind !== 'get' && node.kind !== 'set'
278
- && lineOf(node.start) === lineOf(Math.max(node.start,node.end-1)) && wire(node.value)
279
- && !blanked.slice(starts[lineOf(node.start)],node.start).trim()
280
- && /^[,;]?\s*$/u.test(blanked.slice(node.end,starts[lineOf(node.end)+1] ?? source.length));
281
- if (node.type === 'ImportDeclaration'
282
- || (['ExportNamedDeclaration', 'ExportAllDeclaration'].includes(node.type) && !node.declaration)
283
- || field) assign(node,fallback,Number.MAX_SAFE_INTEGER,'file owner wiring');
284
- for (const child of children(node)) crumbs(child);
285
- };
286
- crumbs(parsed.program);
287
- return tags.filter(row=>row!==null);
288
- }
289
- /** Attribute each canonical contribution exactly once; ranges retain physical TS lines for auditing.
290
- * @param {string} root @param {string} shard @param {import('./shard-platform.mjs').CustomSource[]} sources
291
- * @param {number} canonical @returns {import('./shard-components.mjs').ComponentInventory} */
292
- export function componentInventory(root, shard, sources, canonical) {
293
- const counts=Object.fromEntries(Object.keys(COMPONENTS).map(key=>[key,0])), unknown=[], spans=[];
294
- for(const row of sources) {
295
- const reviewed = platformChargeback(row.path, row.name);
296
- if (reviewed !== null) {
297
- counts[reviewed] += row.lines;
298
- spans.push({path:row.path,symbol:row.name??null,kind:row.kind,component:reviewed,lines:row.lines,reason:'G520 fixture-only host; real second shard absent'});
299
- continue;
300
- }
301
- const ownerPath=row.ownerPath??row.path;
302
- const role=fileRole(ownerPath,row.name) ?? (/^(?:nalati-grasslands|nine-dragon-stack)$/u.test(shard) ? w3SharedOwners.get(ownerPath) ?? null : null);
303
- if(role===null)unknown.push(`${row.path}${row.name?`#${row.name}`:''}`);
304
- const owner=role??'C9';
305
- if(row.kind==='runtime-ts'||row.kind==='sole-module') {
306
- const tags=runtimeTags(readFileSync(resolve(root,row.path),'utf8'),ownerPath,owner).filter(tag=>!row.excludedLines?.includes(tag.line));
307
- if(tags.length!==row.lines)throw new Error(`Component line mismatch: ${row.path} ${tags.length}/${row.lines}`);
308
- for(const tag of tags) {
309
- counts[tag.component]++;
310
- const last=spans.at(-1);
311
- if(last && last.path===row.path && last.kind===row.kind && last.component===tag.component && last.end===tag.line-1 && last.reason===tag.reason && last.symbol===(tag.symbol||null)){last.end=tag.line;last.lines++;}
312
- else spans.push({path:row.path,symbol:tag.symbol||null,kind:row.kind,component:tag.component,start:tag.line,end:tag.line,lines:1,reason:tag.reason});
313
- }
314
- } else {
315
- // Additional GLSL is the canonical shader unit; sole exports already have deduplicated declaration spans.
316
- const component=row.kind==='additional-glsl'?(owner==='C3'?'C3':'C2'):namedRole(row.name??'',row.path)??owner;
317
- counts[component]+=row.lines;
318
- spans.push({path:row.path,symbol:row.name??null,kind:row.kind,component,lines:row.lines,reason:row.name?`G294 declaration ${row.name}`:'additional GLSL owner'});
319
- }
320
- }
321
- const total=Object.values(counts).reduce((sum,n)=>sum+n,0);
322
- if(total!==canonical)throw new Error(`${shard}: component total ${total} differs from canonical ${canonical}`);
323
- return {shard,counts,total,unknown,spans};
324
- }
325
- /** Known zero counts close independently. Unresolved ownership remains charged
326
- * to C9 and prevents that component from closing; no charge is discarded. */
327
- export function componentStates(rows, slugs, closing = []) {
328
- const shards = slugs.map(shard => rows[shard]?.components), known = shards.length > 0 && shards.every(row => row !== undefined);
329
- return Object.fromEntries(Object.keys(COMPONENTS).map(key => {
330
- const closed = known && shards.every(row => row.counts[key] === 0 && (key !== 'C9' || row.unknown.length === 0));
331
- return [key, { closed, state: closed ? 'closed' : closing.includes(key) ? 'closing' : 'open',
332
- lines: Object.fromEntries(slugs.map((slug, index) => [slug, shards[index]?.counts[key] ?? null])) }];
333
- }));
334
- }
335
- /** A component closes when all measured shards in its wave reach zero. */
336
- export function componentWave(rows, id=currentWave().id, closing = []) {
337
- const wave=waveRow(id),slugs=wave.shards.map(row=>row.slug),shards=slugs.map(shard=>rows[shard]?.components);
338
- const components=componentStates(rows,slugs,closing);
339
- return {id:wave.id,status:wave.status,current:wave.current,shards:slugs,names:Object.fromEntries(wave.shards.map(row=>[row.slug,row.name])),
340
- unknown:Object.fromEntries(slugs.map((slug,i)=>[slug,shards[i]?.unknown??null])),
341
- closed:Object.values(components).filter(row=>row.closed).length,total:Object.keys(COMPONENTS).length,components};
342
- }
343
- /** @param {Record<string,{components?:import('./shard-components.mjs').ComponentInventory}>} rows */
344
- export function componentMarkdown(rows) {
345
- const lines=[];
346
- for(const milestone of SHARD_WAVES.toSorted((a,b)=>Number(b.current)-Number(a.current))){
347
- const wave=componentWave(rows,milestone.id);
348
- lines.push('',`## ${wave.id} (${wave.status}) component checklist`,'',
349
- `Components closed ${wave.closed} of ${wave.total}. Unknown ownership stays charged to C9.`,
350
- 'Nine disjoint totals reconcile to canonical custom lines. Mixed TS uses AST declarations and owner calls;',
351
- 'each code line has one owner. Extra GLSL belongs to its look/effect owner.','',
352
- `| Component | ${wave.shards.map(slug=>`${wave.names[slug]} lines`).join(' | ')} | Closed across both |`,
353
- `|---|${wave.shards.map(()=>'---:').join('|')}|---|`,
354
- ...Object.entries(wave.components).map(([key,row])=>`| ${key} ${COMPONENTS[key]} | ${wave.shards.map(slug=>row.lines[slug]??'unavailable').join(' | ')} | ${row.state.toUpperCase()} |`),
355
- `| Total | ${wave.shards.map(slug=>rows[slug]?.components?.total??'unavailable').join(' | ')} | |`,'','### Custom contribution owners','',
356
- '| Shard | Source | Unit / span | Component | Lines | Owner rule |','|---|---|---|---|---:|---|');
357
- for(const slug of wave.shards){const report=rows[slug]?.components;if(!report)continue;
358
- for(const span of report.spans)lines.push(`| ${slug} | ${span.path} | ${span.kind}${span.start===undefined?'':`:${span.start}-${span.end}`} | ${span.component} | ${span.lines} | ${span.reason} |`);
359
- for(const path of report.unknown)lines.push(`Unknown owner: ${path}`);
360
- }
361
- }
362
- return lines;
363
- }
@@ -1,2 +0,0 @@
1
- /** Defining named host imports for emitted platform sections; custom JSON has none. */
2
- export function sectionHostImports(sections:readonly {name:string}[],sourcePrefix?:string):string;
@@ -1,93 +0,0 @@
1
- // G450 §5: output sections supply the defining host exports as G294 roots.
2
- // This is a census table, not a runtime installer. No authoring import supplies
3
- // a runtime user. Metadata-only sections have no independent executable host.
4
- const hosts = {
5
- 'explore/catalogue': ['game/client/models/explorerCatalogue#explorerRoster'],
6
- 'collections/displays': ['game/client/models/collectionDisplay#CollectionCatalogue'],
7
- 'models/island-library': ['game/client/models/islandLibrary#IslandLibrary'],
8
- 'world/trees': ['game/client/models/treeSet#productTreeSet', 'game/client/shardfile/forestPage#placeForestPageModels'],
9
- 'look/rigged-hulls': ['game/client/looks/riggedHulls#productRiggedHulls'],
10
- 'look/hull-book': ['game/client/looks/speciesBook#productHullBook'],
11
- 'look/painted': ['game/client/looks/paintedLook#productPaintedLook'],
12
- 'look/colour-functions': ['engine/client/render/graph/colourFunction#materialColourGraph'],
13
- 'look/toon': ['game/client/looks/toonLook#toonLook'],
14
- 'client/plan': ['game/client/shardfile/clientPlan#installClientPhase', 'game/client/shard/declaredEntry#declaredRuntimeEntry'],
15
- 'world/tiles': ['game/client/shardfile/clientViews#clientTileViews'],
16
- 'world/terrain': ['game/shared/shardfile/clientGround#clientGround'],
17
- 'world/edge': ['game/shared/shardfile/portalTraversal#createPortalTraversal'],
18
- 'world/collision': ['game/shared/shardfile/collisionBindings#installShardfileColliders'],
19
- 'world/navigation': ['game/client/shardfile/productNavigation#installProductNavigation'],
20
- 'world/props': ['game/shared/shardfile/props#propColliderDescriptors'],
21
- 'world/water': ['game/client/shardfile/clientWater#installClientWater', 'game/client/shardfile/water#shardfileWater'],
22
- 'world/movers': ['game/server/plugin/mover#createComposedMoverHost', 'game/client/shardfile/clientMoverOwners#installClientMoverOwners'],
23
- 'world/traversal': ['game/shared/shardfile/portalTraversal#createPortalTraversal'],
24
- 'world/spawn': [], // Level admission metadata.
25
- 'world/physics': [], // Handed to the runtime's explicitly imported native host.
26
- 'world/days': ['game/shared/shard/declaredRows#declaredDay'],
27
- 'world/weather': ['game/shared/shard/declaredRows#declaredWeather'],
28
- 'look/look': ['game/client/shardfile/look#shardfileLook'],
29
- 'look/map': ['game/client/shardfile/mapImage#reserveMapImage'],
30
- 'look/materials': ['game/client/shardfile/clientMaterials#clientMaterials'],
31
- 'look/keyed-sky': ['game/client/looks/keyedSky#keyedSkyBackdrop'],
32
- 'actors/spawn-scripts': ['game/server/population/spawnScript#SpawnScript', 'format/spawnScripts#parseSpawnScript'],
33
- 'player/stealth': ['game/client/stealth/controller#StealthController', 'format/stealth#StealthRowsSchema'],
34
- 'view/modules': ['format/scriptContract#ViewModulesSchema', 'format/scriptContract#admitScriptContract'],
35
- 'actors/return-scripts': ['game/shared/population/returnProgram#ReturnProgram', 'format/decisionScripts#parseDecisionScripts'],
36
- 'actors/moves': ['engine/server/ai/moves#ActorMoveRunner', 'format/actorMoves#parseActorMoves'],
37
- 'actors/creatures': ['game/server/shardfile/brainRuntime#installDeclaredBrains'],
38
- 'actors/crowds': ['game/shared/shardfile/crowdRuntime#prepareDeclaredCrowds'],
39
- 'actors/npcs': ['game/server/plugin/simulation#installDeclaredQuestHost'],
40
- 'actors/species': ['game/server/plugin/brain#speciesResolver', 'game/client/shardfile/clientRecipes#clientSpeciesLooks'],
41
- 'actors/spawns': ['game/server/shardfile/brainRuntime#installDeclaredBrains'],
42
- 'actors/strikes': [], // Consumed by the runtime's explicitly imported creature host.
43
- 'actors/species-programs': [], // Metadata lent to existing page/native species and hunt owners.
44
- 'held/arms': ['game/client/loadout/claims#HeldClaims', 'game/client/systems/viewmodel/heldView#HeldView'],
45
- 'held/equipment': ['game/client/plugin/heldEquipment#HeldEquipment'],
46
- 'held/loadout': ['game/client/loadout/held#installHeldLoadout'],
47
- 'held/finishes': ['game/client/loadout/finishes#HeldFinishes'],
48
- 'held/gear': ['game/client/models/heldGear#heldGear'],
49
- 'combat/items': ['game/server/shardfile/items#installDeclaredItems'],
50
- 'combat/encounters': ['game/server/plugin/simulation#createShardfileSim'],
51
- 'combat/strikes': ['game/server/plugin/simulation#createShardfileSim'],
52
- 'quests/quests': ['game/shared/quest/declared#DeclaredQuests'],
53
- 'quests/host': ['game/server/plugin/simulation#installDeclaredQuestHost'],
54
- 'quests/directors': ['game/shardfile/directorClient#installDeclaredDirector'],
55
- 'economy/ledger': ['game/shared/ledger#Ledger', 'game/shared/ledger#installLedgerEmitter'],
56
- 'economy/loot': ['game/shared/shard/declaredRows#declaredLootPresentation'],
57
- 'state/state': ['game/server/shardfile/scripts#numericScriptState'],
58
- 'state/migrations': ['game/shared/shardfile/logicalState#logicalStateFromLane'],
59
- 'state/modes': ['engine/shared/player/modes#playerModes'],
60
- 'sim/runtime-plan': ['game/server/shardfile/nativePlan#prepareProductRuntimePlan'],
61
- 'world/scenes': ['game/client/shardfile/worldScenes#installWorldScenes'],
62
- 'world/targets': ['game/shared/shardfile/worldTargets#WorldTargetHost'],
63
- 'sim/scripts': ['engine/server/script/decision#DecisionHost', 'format/decisionScripts#parseDecisionScripts'],
64
- 'sim/bodies': ['game/server/quest/bodyOps#DeclaredBodyOps', 'format/bodySlots#DeclaredBodyOpsSchema'],
65
- 'sim/sim': ['game/server/shardfile/scripts#createShardfileScriptLane'],
66
- 'sim/hooks': ['game/server/shardfile/scripts#createShardfileScriptLane'],
67
- 'sim/client-scripts': ['game/client/shardfile/clientScripts#createShardfileClientScripts'],
68
- 'sim/client-channels': ['game/client/plugin/ui#ClientScriptViews'],
69
- 'sim/plumbing': ['game/client/shard/declaredPlumbing#installDeclaredPlumbing'],
70
- 'audio/audio': ['engine/client/audio/declared#installDeclaredAudio'],
71
- 'ui/card': [], // Discovery metadata; no per-shard executable implementation.
72
- 'ui/level': [],
73
- 'ui/ui': ['game/client/shard/declaredUi#mountDeclaredUi', 'game/client/shard/declaredTargets#installDeclaredTargets'],
74
- 'ui/compendium': ['game/shared/shard/declaredRows#declaredProductCompendium'],
75
- 'ui/completion': ['game/client/complete/declared#installCompletion'],
76
- 'ui/strings': [], // Read by an explicitly imported consumer, not executed.
77
- };
78
-
79
- /** A synthetic import list seeds named reach without becoming counted code.
80
- * Unknown platform sections refuse so a new host cannot disappear from G294.
81
- * @param {readonly {name:string}[]} sections @param {string} sourcePrefix */
82
- export function sectionHostImports(sections, sourcePrefix = '../../src/') {
83
- const roots = new Set();
84
- for (const section of sections) {
85
- if (section.name.startsWith('custom/')) continue;
86
- if (!Object.hasOwn(hosts, section.name)) throw new Error(`No output host attribution: ${section.name}`);
87
- for (const host of hosts[section.name]) roots.add(host);
88
- }
89
- return [...roots].sort((a,b)=>a.localeCompare(b)).map((host, i) => {
90
- const [module, name] = host.split('#');
91
- return `import { ${name} as host${i} } from '${module.startsWith('format/') ? '@wildshard/' : sourcePrefix}${module}'; void host${i};`;
92
- }).join('\n');
93
- }
@@ -1,2 +0,0 @@
1
- /** Fatal count/byte ceilings plus one explicit exit row for every custom section. */
2
- export function customSectionFailures(root:string,measures:Record<string,{customSections:{name:string;bytes:number}[]}>):string[];
@@ -1,9 +0,0 @@
1
- import {readFileSync} from 'node:fs';
2
- import {resolve} from 'node:path';
3
- import {customSectionsZeroFailures} from './check-custom-sections-zero.mjs';
4
-
5
- /** Z15: every canonical product must have zero private/custom JSON. */
6
- export function customSectionFailures(root,measures) {
7
- const policy=JSON.parse(readFileSync(resolve(root,'lint/ratchet.json'),'utf8'));
8
- return customSectionsZeroFailures(policy.budgets??{},measures);
9
- }
@@ -1,76 +0,0 @@
1
- import type {OutputReader} from './shard-platform-output.mjs';
2
- import type { ComponentInventory } from './shard-components.mjs';
3
- import type {ListedViewInventory} from './listed-view-code.mjs';
4
-
5
- export interface PlatformModuleCharge {path:string;lines:number;excludedLines?:readonly number[]}
6
-
7
- /** G291's primary measure; native shards have no frozen denominator. */
8
- export interface ConversionMeasure {
9
- metric: 'runtime-vs-legacy' | 'native'; customRuntimeLines: number; shardRuntimeLines: number; rawGlslLines: number; additionalGlslLines: number;
10
- legacyLines: number | null; legacyFolder: string | null; legacyRevision: string | null;
11
- runtimeShare: number | null; passed: boolean | null;
12
- /**
13
- * G294/G312: transitive real primary users, deduplicated; templates and frozen copies never supply users. `modules` are
14
- * whole files one shard reaches without the game shell; `exports` are top-level declarations (`exported: false` for a
15
- * helper) that exactly one shard reaches inside a file multiple consumers reach. Entry/session/menu/loadout shell roots
16
- * are consumers through named reach for the documented control-plane modules and UI bridges only.
17
- * Loading species/models/rendering content never supplies a second content user.
18
- */
19
- gameSystemAttribution: { status: 'import-graph'; review: 'G294-primary-reach'; lines: number; modules: PlatformModuleCharge[];
20
- exports: { path: string; name: string; exported: boolean; lines: number }[]; pendingSecondUser?: PendingPlatformCharge[] };
21
- }
22
- export interface CustomSource {path:string;ownerPath?:string;kind:'runtime-ts'|'additional-glsl'|'sole-module'|'sole-export';lines:number;name?:string;excludedLines?:readonly number[]}
23
- export interface ShardLines {
24
- /** G570 additive labels only; custom totals, percentages and gates remain unchanged. */
25
- listedView?:ListedViewInventory;
26
- measurement?:'built-output'|'source';
27
- customSectionBytes?:number;
28
- customSections?:{name:string;bytes:number}[];
29
- oneUserBuildTools?:{lines:number;files:{path:string;lines:number;bytes:number}[]};
30
- components?:ComponentInventory;
31
- customSources?:CustomSource[];
32
- runtimeLines: number; trustedRuntimeLines: number; assemblyScriptLines: number; conversion: ConversionMeasure;
33
- /** G454 visibility only: AS must trend to <=10% of frozen TS, without a gate yet. */
34
- assemblyScriptBudget:{ceiling:number|null;share:number|null;passed:boolean|null;enforcement:'report-only'};
35
- }
36
- export interface ShardPlatformList { baseline: Record<string, number>; enforced: Record<string, number> }
37
- export interface MilestoneFlags { headless: boolean }
38
- export function codeLines(source: string, path?: string): number;
39
- /** AST-proven erased JSON module declarations; executable syntax stays custom. */
40
- export function jsonTypeContract(source: string, path: string): boolean;
41
- export function shardLines(root?: string, includeSources?: boolean): Record<string, ShardLines>;
42
- /** Strict output-only P4 measure; never falls back to an authoring closure. */
43
- export function outputShardLines(root?:string,includeSources?:boolean,products?:string,only?:string[]|null):Record<string,ShardLines>;
44
- /** Full source-basis inventory for progress/components, never canonical output credit. */
45
- export function sourceProgressInventory(root?:string,products?:string):Record<string,ShardLines>;
46
- /** Shared syntax facts; all attribution and component rules retain their own basis. */
47
- export function outputCensus(root?:string,products?:string,reader?:OutputReader):{measures:Record<string,ShardLines>;inventory:Record<string,ShardLines>;source:ReturnType<typeof sourceProgressLines>};
48
- /** G458 labelled source estimate only; never supplies output % or badges. */
49
- export function sourceProgressLines(root?:string,products?:string):Record<string,{basis:'source';customLines:number;legacyLines:number|null;assemblyScriptLines:number;assemblyScriptBudget:ShardLines['assemblyScriptBudget']}>;
50
- export function milestoneFlags(slug: string, row: ShardLines, root?: string): MilestoneFlags;
51
- export function checkShares(recorded: ShardPlatformList, lines: Record<string, ShardLines>): string[];
52
-
53
- /** Nonblank raw shader code lines, excluding comments and retaining quoted preprocessor paths. */
54
- export function shaderCodeLines(source: string): number;
55
- /** Raw GLSL in files or shader literals; declared graph nodes contribute zero. */
56
- export function rawShaderLines(source: string, path: string, program?: unknown): number;
57
-
58
- /** G390 headline, unavailable until the admitted product is present. */
59
- export interface PortHeadline {customPercent:number|null;world:'yes'|'partial'|'no'|'unavailable';percent:number|null}
60
- export function declarationOnlyConfig(source:string,path?:string):boolean;
61
- /** G423: only root manifest data declarations qualify; runtime logic stays custom. */
62
- export function declarationOnlyManifest(source:string,path?:string):boolean;
63
- export function portHeadline(customPercent:number|null,content:{status:string;tiles:{total:number}|null;privateBinaries:readonly string[]}):PortHeadline;
64
- export function portAverage(rows:Record<string,{port:PortHeadline}>):number|null;
65
-
66
- /** G419 planned user, or a day-one feature receipt. Neither fabricates an actual user. */
67
- export interface PendingPlatformUser {
68
- module:string; export?:string; shard?:'driftwood-isle'|'pine-hollow'|'nalati-grasslands'|'nine-dragon-stack';
69
- plan?:{path:string;row:string}; documentation:string; 'rechecked-by'?:'end of W3';
70
- approvedFeature?:{name:string;decision:{path:'docs/plans/decisions.md';row:'G473'|'G474'|'G475'|'G478'|'G483'|'G484'}};
71
- }
72
- export interface PendingPlatformCharge {path:string;name?:string;lines:number;status:'pending second user';users:PendingPlatformUser[]}
73
- export function pendingPlatformUsers(root:string):PendingPlatformUser[];
74
- export function partitionPendingPlatformUsers(slug:string,modules:PlatformModuleCharge[],exports:{path:string;name:string;exported:boolean;lines:number}[],allowances:PendingPlatformUser[]):{
75
- modules:PlatformModuleCharge[];exports:{path:string;name:string;exported:boolean;lines:number}[];pending:PendingPlatformCharge[];
76
- };