Files
settled-reach/server
jpmschweitzerandClaude Opus 5 fc55bd897f fix(simulation): PR #218 round 2 — the guard was spending D-211's spacing promise
Hoshe and Tyre independently found the same defect, neither having seen the
other's review. They were right.

THE SPACING REGRESSION. synthetic_attractor's walk picks a candidate that
satisfies MIN_SPACING against every already-placed city, and the ocean
correction then moves that candidate up to h/2 = 128 cells with no
re-validation. D-211 step 4 promises the synthetic attractor is placed "at a
position that respects minimum city spacing" — the fix was buying the land
half of that promise with the spacing half. road_graph::collapse_colocated is
no safety net either: it dedupes by name, not position.

The spacing predicate now goes INTO the ring walk (nearest_cell_matching)
rather than running before it, so the search returns the nearest cell
satisfying land AND spacing, with the same tie-break order and the same
degrade-to-skip. A predicate on the existing walk, not a second walk.

Unmeasured, and stated rather than implied: whether this was ever a LIVE
violation or only a latent one. The old behaviour was replaced before it was
measured. What the corpus does say is that 12 of the 13 bodies showing any
sub-MIN_SPACING pair carry no synthetic placement at all.

AND THE FIRST VERSION OF THAT FIX OVER-ASSERTED. Checking MIN_SPACING across
ALL placement pairs found 13 violations corpus-wide, none of them the guard's
doing: the promise is step 4's alone, and matched placements (Tier A greedy,
Tier B/C Hungarian) sit on their terrain attractor, never subject to it. Two
real river mouths 12 cells apart is geography. Shipping that assertion would
have failed the gate and blamed this guard for pre-existing placements. Both
checks are now scoped to pairs involving a synthetic placement, with the 13
matched-pair proximities recorded in-code so they are not re-litigated.

Corpus, both invariants: 267 bodies, 267 reaching Layer 3, 344 placements,
109 synthetic, 0 in water, 0 spacing violations.

ALSO FIXED:
- t1206_verification_scan could still pass vacuously (Hoshe). The fast test
  got bodies_loaded>0 / synthetic_seen>0 guards last round; the scan — the one
  test whose entire purpose is being the re-runnable evidence — did not, and
  !bodies.is_empty() only proves the directory listing worked. Both added.
- cascade_snapshot_for_body's doc-comment claimed the snapshot "still carries
  the transient TerrainAnalysis" (Tyre). It is always None for a full-cascade
  call. Corrected in place, with the re-derivation recipe and a note that this
  sentence cost a false-clean 267-body scan.
- The passthrough test's comment described a land-island fixture and claimed
  (0,0) is not returned; the fixture is ta_all_land and the test asserts (0,0)
  IS returned (both reviewers). Rewritten to match reality.
- max_land_search_ring's cost note said ~(h/2)^2 = 16k candidates (Hoshe).
  That is one quadrant's area, not cumulative ring cost: sum of 8r over
  1..=128 is 66,048. Conclusion unchanged; the arithmetic is the executable
  recalibration rationale, so it has to be right.
- The fast test ran 25.8s, close to the long pole of the whole --lib suite
  (Hoshe). Trimmed 6 bodies to 3: 13.0s. Not to one — synthetic_seen>0 needs
  only one body, but resting on one is how the first draft ended up depending
  on GJ903c alone.

RETRACTED: the shared-ring-search-helper finding. Round 1 ruled duplicate-
over-share CORRECT for this walk and said so "stated so it isn't
re-litigated"; round 2 asks to factor it with no new evidence and no change to
either implementation. Fixing the spacing gap by predicate rather than by a
second walk moves that direction anyway.

Full cargo test green (40 binaries).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 09:49:39 +02:00
..