Rehome the symbols the dead set still owes surviving code (#227) - #361
Merged
Conversation
Four groups of symbols live in files phase 7 is about to delete, but surviving code still needs them. This moves them out first, so the deletion can be a deletion rather than a deletion plus a scramble. No behaviour changes and no test coverage is lost. | symbol | left | arrived | | --- | --- | --- | | `ResourceControlLevers` | `resources/resolveResource.ts` | `resources/resourceCatalog.ts` | | `VULCANUS_CLIFF_BLOCKING_TILES` | `preview/renderVulcanusCliffs.ts` | `cliffs/cliffCatalog.ts` | | `LAND_RGBA`, `WATER_RGBA`, `TREE_MAP_COLOR` | `preview/renderElevation.ts`, `preview/renderTrees.ts` | new `preview/palette.ts` | | `PlacedCliffCell` | `cliffs/cliffPlacement.ts` | inlined into `cliffs/cliffConnections.ts` | Measured effect: files outside the dead set that still import from it drop from 14 to 6, and 11 of the 6 remaining edges belong to one file, `preview/elevationRenderRequest.ts`, which the deletion PR has to rewrite anyway. ## Why each target `resourceCatalog.ts` and `cliffCatalog.ts` were chosen because both have zero imports of their own, so neither can form a cycle, and two of the three consumers of `ResourceControlLevers` already imported from `resourceCatalog.ts`. `palette.ts` is new because there was nowhere to put these. The repo keeps per-domain leaf catalogs rather than one palette module, and the obvious home for `TREE_MAP_COLOR` would have been a trees catalog - but every file in `src/noise/trees/` is in the dead set, so that directory disappears. A one-constant `trees/` directory whose name promises tree math that no longer exists is worse than grouping the three render colours together. It also keeps the colour out of the tree field's import graph, which pulls `moisture` and `temperature` behind it. `LAND_RGBA` and `WATER_RGBA` are not game data. They are the two colours this repo picked to paint a sign test on the elevation tree, which is why they have no domain catalog to belong to. `TREE_MAP_COLOR` is game data, from `utility-constants.lua:201`, and its doc comment carries that. These three stay in `src/` rather than moving into `test/` even though the only readers left are two parity specs. They are hand-written oracles for the Rust output, and an oracle that lives in the file it grades is a weaker check. ## `PlacedCliffCell` is a required inline, not a tidy-up `cliffConnections.ts` is kept deliberately: it has no importers at all since #360, and it survives because `crates/fmw-noise/src/cliffs/connections.rs:4` names it as the file the Rust was ported from. `tsconfig.json` includes `src/**/*` by glob rather than by reachability, so a file with zero importers is still fully type-checked. Leave the type-only import of `PlacedCliffCell` pointing at `cliffPlacement.ts` and the dead-set deletion turns `verify:lint` red on the one file it is trying to preserve. Its two doc comments also cited `test/cliffConnections.spec.ts`, which #360 deleted along with the rest of the 23-spec investigation corpus. They now point at the Rust that runs over the same fixture. A file kept as a human-readable reference is not worth much with dead citations in it. ## Two corrections `test/cliffCatalog.spec.ts` re-pins that `VULCANUS_CLIFF_BLOCKING_TILES` is exactly `["lava", "lava-hot"]`. #360 stripped the block that asserted this when it armed `cliffOreDirection.spec.ts`, and nothing replaced it, so the constant survived with its value ungraded. The Rust holds the same pair inlined twice, with no shared definition - worth its own issue. `CLAUDE.md` said `cliffConnections.ts` has "zero `src/` consumers - only 23 investigation specs import it". Those 23 are gone; it now has no consumers of any kind. The sentence justifying the file no longer described the tree. ## What this deliberately does not do Five parity specs still import from the dead set: `wasmNauvisParity` (15 edges), `wasmMultioctaveParity` (2), `wasmPrimitiveParity` (2), `wasmEvalParity` (1) and `wasmVulcanusParity` (1). Every block that would have to be cut from them compares the TypeScript against the Rust, and all of them pass today. They only become impossible when the TypeScript goes, so they are cut in the deletion's own commit rather than a PR early - removing the evidence before taking the step it justifies would be the wrong order. The rehome made five of the ten specs that were deferred for this work need no edit at all, and saved three blocks that were slated for deletion only because the constants they read were assumed to die. ## Verification Full `pnpm run verify`, `VERIFY_RC=0`: - static: all 387 files formatted, 360 files with no warning, lint error or type error, `vue-tsc` clean - vitest: 162 files, 1,595 passed, 3 skipped, 606.83s. The count is up one from #360's 1,594, which is the re-pinned lava assertion running. - preview-service worker: 4 files; `node --test`: 10 tests - Rust: 440 and 35 crate tests, 2 doc-tests, the anti-vacuity check still fails against a deliberately broken port, `engine.wasm` matches its source, and `cargo deny` clean on advisories, bans, licenses and sources Claude-Session: https://claude.ai/code/session_01KLPHLUpGn1cqN46xwhmev8 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.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.
Four groups of symbols live in files phase 7 is about to delete, but surviving
code still needs them. This moves them out first, so the deletion can be a
deletion rather than a deletion plus a scramble. No behaviour changes and no
test coverage is lost.
ResourceControlLeversresources/resolveResource.tsresources/resourceCatalog.tsVULCANUS_CLIFF_BLOCKING_TILESpreview/renderVulcanusCliffs.tscliffs/cliffCatalog.tsLAND_RGBA,WATER_RGBA,TREE_MAP_COLORpreview/renderElevation.ts,preview/renderTrees.tspreview/palette.tsPlacedCliffCellcliffs/cliffPlacement.tscliffs/cliffConnections.tsMeasured effect: files outside the dead set that still import from it drop from
14 to 6, and 11 of the 6 remaining edges belong to one file,
preview/elevationRenderRequest.ts, which the deletion PR has to rewriteanyway.
Why each target
resourceCatalog.tsandcliffCatalog.tswere chosen because both have zeroimports of their own, so neither can form a cycle, and two of the three
consumers of
ResourceControlLeversalready imported fromresourceCatalog.ts.palette.tsis new because there was nowhere to put these. The repo keepsper-domain leaf catalogs rather than one palette module, and the obvious home
for
TREE_MAP_COLORwould have been a trees catalog - but every file insrc/noise/trees/is in the dead set, so that directory disappears. Aone-constant
trees/directory whose name promises tree math that no longerexists is worse than grouping the three render colours together. It also keeps
the colour out of the tree field's import graph, which pulls
moistureandtemperaturebehind it.LAND_RGBAandWATER_RGBAare not game data. They are the two colours thisrepo picked to paint a sign test on the elevation tree, which is why they have
no domain catalog to belong to.
TREE_MAP_COLORis game data, fromutility-constants.lua:201, and its doc comment carries that.These three stay in
src/rather than moving intotest/even though the onlyreaders left are two parity specs. They are hand-written oracles for the Rust
output, and an oracle that lives in the file it grades is a weaker check.
PlacedCliffCellis a required inline, not a tidy-upcliffConnections.tsis kept deliberately: it has no importers at all since#360, and it survives because
crates/fmw-noise/src/cliffs/connections.rs:4names it as the file the Rust was ported from.
tsconfig.jsonincludessrc/**/*by glob rather than by reachability, so a file with zero importers isstill fully type-checked. Leave the type-only import of
PlacedCliffCellpointing at
cliffPlacement.tsand the dead-set deletion turnsverify:lintred on the one file it is trying to preserve.
Its two doc comments also cited
test/cliffConnections.spec.ts, which #360deleted along with the rest of the 23-spec investigation corpus. They now point
at the Rust that runs over the same fixture. A file kept as a human-readable
reference is not worth much with dead citations in it.
Two corrections
test/cliffCatalog.spec.tsre-pins thatVULCANUS_CLIFF_BLOCKING_TILESisexactly
["lava", "lava-hot"]. #360 stripped the block that asserted this whenit armed
cliffOreDirection.spec.ts, and nothing replaced it, so the constantsurvived with its value ungraded. The Rust holds the same pair inlined twice,
with no shared definition - worth its own issue.
CLAUDE.mdsaidcliffConnections.tshas "zerosrc/consumers - only 23investigation specs import it". Those 23 are gone; it now has no consumers of
any kind. The sentence justifying the file no longer described the tree.
What this deliberately does not do
Five parity specs still import from the dead set:
wasmNauvisParity(15 edges),wasmMultioctaveParity(2),wasmPrimitiveParity(2),wasmEvalParity(1) andwasmVulcanusParity(1). Every block that would have to be cut from themcompares the TypeScript against the Rust, and all of them pass today. They only
become impossible when the TypeScript goes, so they are cut in the deletion's
own commit rather than a PR early - removing the evidence before taking the step
it justifies would be the wrong order.
The rehome made five of the ten specs that were deferred for this work need no
edit at all, and saved three blocks that were slated for deletion only because
the constants they read were assumed to die.
Verification
Full
pnpm run verify,VERIFY_RC=0:error,
vue-tsccleanDelete the ported TypeScript specs (#227) #360's 1,594, which is the re-pinned lava assertion running.
node --test: 10 testsagainst a deliberately broken port,
engine.wasmmatches its source, andcargo denyclean on advisories, bans, licenses and sourcesClaude-Session: https://claude.ai/code/session_01KLPHLUpGn1cqN46xwhmev8
Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com