Skip to content

Fix #522 — world-graph sorts use the §4.2 canonical comparators - #564

Merged
The-Running-Dev merged 1 commit into
mainfrom
fix-522-world-graph-comparators
Oct 7, 2026
Merged

The-Running-Dev merged 1 commit into
mainfrom
fix-522-world-graph-comparators

Conversation

@The-Running-Dev

Copy link
Copy Markdown
Owner

Closes #522.

World-graph sorted with argument-less localeCompare, which collates by the host locale and orders incident:10 before incident:2. 12 §4.2 already names the canonical orders; this applies them.

  • Runtime-entity projections (buildings, constructionSites, guests, staff, incidents, alerts, map.scenery) sort with compareRuntimeEntityId.
  • Every definition-id sort in view.ts, source.ts and tick/effects.ts uses compareDefinitionId.
  • Batch StateChange rows compare path and reason by ordinal code unit; 12 §12 now says so.
  • The determinism lint block rejects localeCompare with fewer than two arguments. The simulation kind's localeCompare(x, "en-US-POSIX") (10 §2.2) is still allowed.
  • Decision recorded in 90-decisions.md; one bullet added to the guide's determinism rules.

Verified

  • npm run typecheck, npm run lint: clean.
  • npm test: 110 files, 2040 tests passed. No fixture or golden changed order, because no shipped campaign has ten instances under one prefix.
  • The two new tests in kind.test.ts fail with the source fix reverted and pass with it.
  • The lint rule reports 25 violations with the source fix reverted, and none with it.
  • ./build/Test-Documentation.ps1: passed. git diff --check: clean.
  • ./docs.ps1 -BuildOnly not run locally; the Verify Documentation Build check covers it.

Argument-less localeCompare collated by the host locale and put incident:10
before incident:2. Runtime-entity projections now sort by numeric ordinal,
definition ids and StateChange path/reason by code unit (stated in 12 §12),
and the determinism lint block rejects localeCompare without a locale.
@The-Running-Dev
The-Running-Dev merged commit 18c9086 into main Oct 7, 2026
8 checks passed
@The-Running-Dev
The-Running-Dev deleted the fix-522-world-graph-comparators branch October 7, 2026 19:30
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.

World-graph sorts with host-locale localeCompare instead of the §9 canonical comparators

1 participant