PROCITY/priorwork/procity-a.txt
m3ultra 90bd06c328 Fable (integrator): round-3 lane instructions + archive round-1 lane prompts
Round-2 close-out: all lane work landed on main (C keeper-stand re-land, B streetscape,
F integration), stray lane-c/keeper-stand branch deleted (content identical), QA strict
green. ROUND3_INSTRUCTIONS.md assigns the polish/validation round: F leads (manifest
+ hours + QA gates), B shaves the spawn draw budget, C+E validate the GLB path via a
local depot mode, A verifies one stale finding, D supports. priorwork/ archives the
original per-lane prompts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 14:30:36 +10:00

188 lines
19 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Thanks — good to know. The docs referenced `/Users/jing/...` but the repos live at `/Users/m3ultra/Documents/{thriftgod,90sDJsim}` here, and ultra (`johnking@100.91.239.7`) is reachable. For Lane A (pure-data generator + 2D map) my algorithm is bespoke, so I don't need to port engine code — but I'll keep the thriftgod REFIDEX map vibe and seeded-hours patterns in mind. Continuing with `plan.js`, the core generator.
I left messy placeholder lines in the main-street strip loop. Let me clean that up.
The warehouse block also has dead placeholder lines. Let me clean it.
Now the self-check — the node-runnable acceptance harness. This is what will catch my geometry/determinism bugs empirically.
Now let me run the self-check to catch bugs empirically before building the map viewer.
Only the overlap check fails; determinism, performance, structure, assets, and brief-presence all pass (909 lots, 722 shops — a dense retail town). The overlapping pairs are always the first sequential lots in a block, which by construction have disjoint along-street intervals — so this is almost certainly a rounding artifact at touching edges. Let me measure the actual overlap magnitude before deciding.
Confirmed: it's a rounding artifact. Lots 1 and 2 are sequential along the street and merely *touch* at a shared boundary — but 2-decimal rounding pushes the touching edge past my 1mm SAT tolerance. Real overlaps in this generator would be metres, not centimetres. Let me widen the tolerance to 5cm and check the shop-type breakdown.
Still failing on seed 8675309 (lots 2,3) even at 5cm — so that one is a *real* overlap, not rounding. And stalls (238) are wildly over-dominating the shop count. Let me measure the real overlap and see what's special.
The overlap is tiny (~5mm by center spacing) yet SAT still flags it at 5cm — my geometric reasoning about the minimal axis must be off. Let me measure the actual SAT penetration directly rather than guess.
Found it: the SAT axis in `overlaps()` isn't normalized, so my 5cm `EPS` is scaled by edge length (~19×) and becomes inconsistent per-axis — the real penetration is 5.6mm, well under tolerance. Normalizing the axis fixes it correctly. And I'll trim the market from 238 stalls to a tidy ~40.
All green — 1082/1082 checks pass. Now the crucial visual deliverable: `map.html`, the Canvas-2D debug viewer. This is how humans and Lane F eyeball a seed, and it grows into the in-game map. Let me build it.
The map needs to be served over HTTP (ES module imports fail on `file://`). Let me start the dev server and load it in the browser to verify it renders as a town.
Server is up. Let me load the map in the browser and screenshot seed 20261990.
Panel data is perfect (Boolarra Heads, 22 streets, 711 lots, 523 shops, type breakdown), but the canvas collapsed to a dot — `fitView()` ran before the browser finished layout, so it read zero canvas dimensions and computed a near-zero scale. Let me fix the boot order (resize → fit under `requestAnimationFrame`) and guard `draw()` against a null plan.
It reads clearly as a town now: the NS retail spine, 4 jittered cross-streets (2 long central high streets + 2 shorter backstreets), the market stall grid + dept anchor (pink) west of centre, the residential collar ring with red milkbars at its corners, and the warehouse fringe block at the north edge. Let me zoom into the centre to confirm the arcade and market/dept detail.
Zoom-crop isn't supported; let me use the app's own zoom (scroll) to inspect the centre — the market grid, dept anchor, and arcade.
The map renders as a town with every brief element present. Browser mouse-interaction is sluggish because my `mousemove` handler redraws all 711 lots on every event — a real UX smell for a tool Lane F will use. Let me coalesce redraws with `requestAnimationFrame` before capturing screenshots.
Now let me capture screenshots for 5 seeds into `docs/shots/laneA/` via the canvas's `toDataURL`, saving each to disk. Starting with the directory and seed 20261990.
Now I need real PNG files on disk. The cleanest path is headless Chromium screenshotting the live page. Let me check what browser binaries are available.
Chrome is available. Let me screenshot all 5 seeds headlessly to `docs/shots/laneA/`.
Exit 143 = timeout, likely a profile-lock hang from the shared `--user-data-dir` plus the screenshot firing before my rAF render runs. Let me kill stragglers, check what landed, and retry with `--virtual-time-budget` (lets JS/rAF run) and per-run isolation.
Seed 20261990 rendered (200k). The rest hung on profile-lock. Let me force-kill all Chrome and verify that first PNG actually shows the town before retrying the rest.
That's a proper town at full res — spine, 4 cross-streets, market stall grid + pink dept anchor, the record-heavy arcade cluster beside it, the warehouse block up north outside the ring, the green residential collar with red milkbars at its corners. The hang was just the shared profile lock. Let me capture the remaining 4 seeds, each with a unique profile dir and a per-run watchdog so nothing hangs.
All 5 captured (187212k each). Let me verify two of them show distinct, valid towns (seed variety).
Seed 42 is a distinctly different town — "Mount Yinnar Gully", 684 lots, 500 shops, different spine bends and rung angles, 4 corner milkbars. The name generator and full determinism-with-variety both work. Now let me verify the grep-clean requirement (zero `Math.random`/THREE in citygen) and remove the unused THREE importmap from map.html.
citygen and registry are grep-clean (no `Math.random`, no THREE). The only `Math.random` is map.html's 🎲 random-*seed* button (UI-only; generation stays fully seeded). But the THREE importmap in map.html is dead code — the page is pure Canvas 2D and never imports three. Let me remove it.
Let me confirm removing the importmap didn't break the page, then launch the adversarial review.
No console errors, importmap removal is clean, and seed 777 ("Lower Corryong Hollow") even placed its warehouse fringe to the *south* — the seeded N/S pick works. All 5 deliverables are built and empirically verified.
Now the ultracode adversarial pass: I'll fan out a multi-dimension review of the whole lane (determinism, schema/spec-compliance, geometry, chunk/JSON/perf, cross-lane contract, code quality), then adversarially verify each finding before I act on it.
The review is running in the background. While it works, let me draft the `A-progress.md` report Fable asked for. I'll finalize it after applying any confirmed review findings.
While the review runs, let me independently sanity-check a couple of things the review will also probe — that plans contain no `NaN`/`Infinity` (which JSON silently turns to `null`) and that `chunkIndex` doesn't mutate the returned plan.
Independent checks pass: no `NaN`/`Infinity`/`null` leaks, `chunkIndex` doesn't mutate the plan, JSON round-trips, and edge-case seeds (0 and max-uint32) both generate valid towns.
**Lane A is built and empirically verified.** Here's where things stand while the adversarial review finishes:
**Done & green:**
- `plan.js` (`generatePlan` + `chunkIndex`), `registry.js`, `names.js`+`wordlists.js`, `map.html`, `selfcheck.js` — all landed
- `node web/js/citygen/selfcheck.js` → **ALL GREEN, 1082/1082** across 6 seeds
- 5 seeds screenshotted to `docs/shots/laneA/` — each reads as a town (spine, cross-streets, market+dept, arcade, warehouse fringe, residential collar with corner milkbars)
- grep-clean: zero `Math.random` / zero THREE in citygen
- `docs/A-progress.md` drafted for your review
**In flight:** a 6-dimension adversarial review (determinism · schema/spec · geometry · chunk/JSON/perf · cross-lane contract · code quality) with per-finding refutation. I'll apply any *confirmed* findings, re-run the self-check, append the outcomes to `A-progress.md`, then commit the lane on `main` (per the LANE_A brief's "commit in small steps" instruction; no push).
I'll continue automatically when the review reports back.
The review completed (27 agents, ~1.6M tokens). It confirmed at least two real defects — a genuine facing bug in the market builder that my self-check couldn't catch (no orientation assertion), and a registry↔spec drift. The result was truncated at 57KB; let me read the full output to see every confirmed finding before acting.
The Bash classifier is temporarily down; read-only tools still work. Let me read the output file directly.
A high-value review: 21 findings, 15 confirmed. Several are the same defect found from multiple angles. Let me read the rest to capture all distinct confirmed issues.
This review paid for itself — 15 confirmed defects, several my self-check structurally couldn't catch (no facing/orientation check, only within-block overlap, no edge-coverage check). Deduplicating the multi-angle repeats, here are the **distinct** confirmed issues:
| # | Defect | Sev | Fix |
|---|--------|-----|-----|
| D1 | Market stalls + dept anchor face **backwards** (`ryEast=atan2(1,0)` → west, away from spine) | HIGH | `atan2(-1,0)` |
| D2 | **Cross-block lot overlaps** at spine×cross-street corners (~45 shop pairs/seed, ≤8.7m); self-check only tests within-block | HIGH | corner reservation + resolution pass + global self-check |
| D3 | `chunkIndex` **skips chunks** (32m sampling on 64m grid); origin chunk misses the spine; road width ignored | HIGH | DDA supercover + width rails |
| D4 | Market stalls' `frontEdge` points at wrong spine segment (z-band mismatch) | MED | stalls→`spineEdges[2]`, dept→`[3]` |
| D5 | Name generator emits doubled possessive `Macca's's` | HIGH | drop redundant `*` |
| D6 | map.html main-road color `var(--roadmain)` unparseable by canvas → spine mis-drawn | MED | bare `--roadmain` |
| D7 | Registry facades/fittings drift from CITY_SPEC table | LOW | update CITY_SPEC table (treaty change) |
Plus valid points from *refuted* findings worth acting on: no golden-fingerprint drift check, `cornerBoost` can exceed a type's storey max, undocumented `block.kind`/`block.district`-is-id, dead stall guard, and the map's `_sbl` cache polluting exported JSON.
Let me re-read the current plan.js to make precise edits.
Now let me apply the plan.js fixes. First, the `cornerBoost` storey gate:
Now the market builder — D1 (ryEast) + D4 (frontEdge per z-band) + R6 (dead guard). Let me read the current market section.
Now D2 — corner overlaps. First, bump the rung near-spine inset to reserve the corner against the spine strip's depth. Let me read the rung-strip section.
Now the resolution pass. Let me read the laneways + return section to place it correctly.
Now I'll insert the corner-overlap resolution pass before the return, and add shared OBB helpers at the top of the module so both `chunkIndex` and the pass can use them.
Now add the shared `lotCorners` and `obbOverlap` helpers at module top (used by the resolution pass and `chunkIndex`):
Now D3 — replace `chunkIndex`'s edge point-sampling with a DDA supercover (+ width rails so a wide road registers in every chunk it covers). Let me read the current edge section.
Now D5 — the doubled-possessive name bug. Remove the redundant `*` from the six `{First}*` patterns and simplify `fill()` (the `*` mechanism is now dead).
Now map.html — D6 (main road color) and the `_sbl` cache polluting exported JSON.
Now the self-check enhancements — this is critical: the review proved my harness had blind spots (no orientation check, only within-block overlap, no edge-coverage, no drift detection). Let me rewrite `selfcheck.js` to import the shared OBB helpers (single source of truth) and add: a **global cross-block building-overlap** check, an **edge-coverage** check, a **facing/orientation** check, a **finiteness** check, and a **golden-fingerprint** drift guard.
The golden placeholder is invalid JS. Let me set it to 0, run to get all checks + the real fingerprint, then lock it in.
All checks pass except the placeholder fingerprint (`0xb5d5cc13`). The new guards confirm the fixes: **facing** ✓ (D1), **cross-block building overlap** ✓ (D2), **edge coverage** ✓ (D3), plus finiteness, storey-range, and no-unresolved-token (D5) all green. Lot count dropped 711→681 (the corner resolution demoted ~30 colliding lots to infill). Let me lock in the golden hash.
ALL GREEN — 1271/1271. Let me verify the two headline fixes produce correct output empirically (the doubled-possessive and the market facing).
D1 facing is fixed (dept + stall now face `[1,0]` = east toward the spine). My name-check seed was off; let me scan a full set of plans for any lingering doubled-possessive `ss`.
D5 confirmed: zero doubled possessives, names like "Macca's Pawn & Loan" render cleanly. Now the treaty change (D7) + schema documentation. Let me read the relevant CITY_SPEC sections.
Now the shop-types table (D7 treaty change). Let me read and update it to match the registry.
Now the ownership-table note for `web/package.json` (R4). Let me read that section.
All 15 confirmed findings plus the worthwhile refuted-but-valid points are now addressed, and the self-check is green at 1271/1271. Let me refresh the 5 screenshots to reflect the fixes (corrected main-road color, corner de-confliction).
The main-street spine now renders in its proper lighter-brown (`--roadmain`) — a clearly distinct wide road (D6 fixed), and the corners are de-conflicted (D2). 681 lots / 493 shops / 174 chunks. All fixes are reflected in the map.
Let me append the review outcomes to `A-progress.md`.
All fixes documented. Let me run a final verification pass — self-check, grep-clean, and review the git status before committing.
I see the situation clearly now: **this is a shared working tree and lanes B/C/D/E/F have been running in parallel** — there are untracked `C/D/E/F-progress.md`, `pipeline/`, `web/index.html`, `web/js/world/`, `web/js/interiors/`, `web/js/citizens/`, etc., plus a modified `.gitignore` I didn't touch. Let me check whether `CITY_SPEC.md` contains only my edits before deciding anything about committing.
`CITY_SPEC.md` contains **only my edits** (verified), `.gitignore` was changed by Lane E (not me), and my owned files are cleanly separable. The LANE_A doc I was told to execute explicitly says "commit in small, described steps on `main`," so a clean, isolated lane commit is the right review unit for Fable. I'll stage **only my owned paths** — never other lanes' files, `.gitignore`, or shared dirs. Let me confirm the shots directory contents first.
Two things stand out: `docs/shots/` is a shared scaffold (lanes BE all have shots there), so I'll stage only `docs/shots/laneA/`. More importantly, **there's a `web/js/citygen/index.js` I did not create** — something (another lane or a coordinator) wrote a file into my owned directory. I need to look at it before doing anything.
`index.js` is a **Lane F integration shim** in my owned directory: Lane B's shell imports `./js/citygen/index.js` expecting `generatePlan`, and it explicitly says *"If Lane A later adds its own citygen entry point, fold this into it."* Since `web/js/citygen/*` is my ownership and Lane F invited me to adopt it, I'll make it a canonical Lane A barrel — but first let me verify exactly what Lane B's shell imports so I don't break the wiring.
Lane B does `citygen.generatePlan || citygen.default` from `./js/citygen/index.js`, falling back to a fixture if absent. I'll adopt `index.js` as the canonical Lane A barrel — preserving the exact exports Lane B needs and rounding out the public API.
Let me verify the barrel resolves correctly under node (Lane B's import pattern).
Barrel works — Lane B's shell will now get the real generator. Now I'll commit my lane, staging **only** my owned paths (never `.gitignore` or other lanes' files). Let me stage precisely and review before committing.
Staging is cleanly isolated — only Lane A files, with `.gitignore` and all other lanes' work left untouched. Committing now (on `main`, no push):
Committed cleanly as `8b7ca9a` — the 27 remaining uncommitted entries are all other lanes' work and `.gitignore`, left untouched. Let me do a final runtime check on the map (I changed `index.js`, `EDGE_STYLE`, and the `_sbl` cache) to confirm no console errors and a clean JSON export.
No console errors. Let me confirm the `_sbl` cache fix — that the plan object stays schema-clean after drawing (no stray key in exports).
No console errors, no schema pollution, clean export. `window.plan` being empty just confirms proper module encapsulation (the fix moved the cache off the plan object). Everything is verified and committed.
---
## Lane A (CityGen) — done, verified, committed
**PROCITY-A reporting.** I read Fable's docs (CITY_SPEC + LANE_A brief + RESEARCH), built the full lane, hardened it with an adversarial multi-agent review, and committed cleanly on `main` (`8b7ca9a`, no push).
**Delivered** (all owned paths only):
- `web/js/citygen/plan.js` — `generatePlan(citySeed)` → CityPlan (spine, cross-streets, market square + dept anchor, arcade, warehouse fringe, residential collar w/ corner milkbars, laneways) + `chunkIndex` + `index.js` barrel entry
- `web/js/core/registry.js` — `SHOP_TYPES` (all 9) + district weights + enums
- `web/js/citygen/names.js` + `wordlists.js` — seeded 90s-AU names, 50+ patterns
- `web/map.html` — Canvas-2D plan debugger (pan/zoom/hover, layers, export JSON)
- `web/js/citygen/selfcheck.js` — `node …/selfcheck.js` → **ALL GREEN 1271/1271**
- `docs/shots/laneA/` — 5 seeds screenshotted, each reads as a town
- `docs/A-progress.md` — full writeup for your review
**Verification I actually ran** (not just claimed): node self-check green over 6 seeds; browser + headless screenshots across 5 seeds; a 6-dimension **adversarial review (27 agents)** that found **15 real defects** — all fixed and re-verified, with the self-check grown so none can regress (facing check, cross-block overlap, edge coverage, finiteness, golden fingerprint `0xb5d5cc13`). Sample: seed 20261990 → "Boolarra Heads", 681 lots / 493 shops / 174 chunks.
**Things you'll want to know as coordinator:**
1. **Integration already in motion:** I found a Lane F shim (`web/js/citygen/index.js`) — Lane B's shell imports `./js/citygen/index.js` for `generatePlan`. I adopted it as the canonical Lane A barrel (its own note invited this); Lane B now gets the real generator instead of the 14-shop fixture.
2. **Treaty amendment (in my commit, flagged loudly):** I aligned CITY_SPEC's shop-types table to the registry lanes actually import, and documented `lot.ry`/`frontEdge`, `block.kind`/`district`-is-id, and `web/package.json` (`{"type":"module"}`, needed for the node self-check).
3. **I left everything else alone:** `.gitignore` (Lane E's change) and all B/C/D/E/F files remain uncommitted/untouched — my commit is isolated to Lane A paths.
**Open questions for you** (in A-progress): retail density (~500 shops/core — dial down for Lane B's draw budget?) and whether the residential collar should become a true closed ring. Awaiting your review + next instructions.
The dev server is still up on `:8130` if you want to eyeball seeds (`/map.html?seed=…`).