Skip to content

Towns with estates are built again; every name in the game is declared (undef.test) - #515

Closed
k06a wants to merge 1 commit into
mainfrom
claude/project-thread-sm9ka7
Closed

k06a wants to merge 1 commit into
mainfrom
claude/project-thread-sm9ka7

Conversation

@k06a

@k06a k06a commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

What

A fix forward for the seam between two PRs that met on main in the combined merge (#506): the generator version floor (#466) and the estates (gw 72).

  • 🏘️ Towns and villages with estates are built again. The estates code in 34_settle.js was written while the constant STR still gated planned street profiles. The floor deleted that gate (it is always on now). Each PR was green alone; together every town or village with an estate threw ReferenceError: STR is not defined while it was planned. The estate lanes now take the street profile as every street does.
  • 🔎 New rule 7 in docs/ARCHITECTURE.md: every name is declared, with tools/undef.test.mjs. The game is one script, so a name deleted by one PR can still be read by code another PR wrote before. The test finds any name in src/game that no scope declares. It runs in under 2 s.
  • 🧪 tools/farrec.test.mjs builds worlds of the current numbers. It pinned gh 2, gl 2, gw 9, below the floor, so tools/genv.test.mjs was red on main and the test never met the estates.

Proof

  • On main (13b30fb): node tools/estate.test.mjs and node tools/farrec.test.mjs stop with ReferenceError: STR is not defined; node tools/genv.test.mjs names the three pins of farrec.
  • On this branch: estate.test: all passed (5 estates in 18 towns, 10 of 48 villages are one estate), farrec OK 195 checks, genv: ok, golden: 1028 checks (no world hash moved), dupkeys ok.
  • tools/undef.test.mjs is red on main's sources (STR is not declared anywhere: 34_settle.js:451, 454) and green here (174 files, 53 555 lines). Its own cases cover hoisting, block scopes, patterns, classes, switch blocks, typeof guards and the fault itself.

Sources

Screenshots

tools/shots/482.mjs reuses two scenes of the estates' own recipe (an estate inside a town, a village that is one estate); the release workflow adds them to the release and comments them here.


Generated by Claude Code

…version floor had deleted; undef.test guards every name

The estates (gw 72, 34_settle.js) were written while STR still gated planned street profiles; the generator version floor
deleted that gate, and the two met only on main: ReferenceError in every town or village with an estate.
- 34_settle.js: the estate lanes take the street profile as all streets do now.
- tools/undef.test.mjs: no name in src/game is used without being declared (the rule of ESLint's no-undef over the
  language's scopes, with acorn; build names from build/build.mjs and build/items).
- tools/farrec.test.mjs builds worlds of the current numbers (it pinned gh 2, gl 2, gw 9, below the floor).
- docs/ARCHITECTURE.md: rule 7, every name is declared.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m

k06a commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Closing: main already has this fix. Commit 571951f (build 482) made the same change in 34_settle.js, lifted tools/farrec.test.mjs to the current numbers and added its own tools/undef.test.mjs (terser's scopes over the built source), which the merge queue now runs on every combine. Nothing in this PR is left to land.


Generated by Claude Code

@k06a k06a closed this Dec 2, 2026
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.

2 participants