Skip to content

Rehome the symbols the dead set still owes surviving code (#227) - #361

Merged
wormeyman merged 1 commit into
mainfrom
feat/227-rehome-the-surviving-symbols
Aug 30, 2026
Merged

Rehome the symbols the dead set still owes surviving code (#227)#361
wormeyman merged 1 commit into
mainfrom
feat/227-rehome-the-surviving-symbols

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

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
    Delete the ported TypeScript specs (#227) #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

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>
@wormeyman
wormeyman merged commit 82262bc into main Aug 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant