Compare commits
18 Commits
a002422aa7
...
865a6ad97f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
865a6ad97f | ||
|
|
09e5083515 | ||
|
|
aac1030131 | ||
|
|
aef9958337 | ||
|
|
676b58a2bb | ||
|
|
26529eeb58 | ||
|
|
7025ea847e | ||
|
|
4180e188e2 | ||
|
|
903e1d5f95 | ||
|
|
a0cf23dec8 | ||
|
|
121e169981 | ||
|
|
08a1d95903 | ||
|
|
96cd9f0f97 | ||
|
|
98bc11f033 | ||
|
|
40be89c238 | ||
|
|
a53837208d | ||
|
|
2af4662cd7 | ||
|
|
c3967d98e8 |
@ -382,3 +382,47 @@ measured in THREADS' last [I] entry). Gate 1 is JOINT and comes first.
|
||||
> Night dressing for the week's later storms (moon, lit house window),
|
||||
> win-screen and game-over cards that feel like SHADES, and refresh the
|
||||
> contact sheets once the balance pass lands.
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
# SPRINT 7 prompts (one truth, then the week)
|
||||
|
||||
Same rules: own clone, own branch, rebase onto latest main FIRST. Read THREADS'
|
||||
last [I] entry (the harness dispute) then SPRINT7.md. Gate 0 is A+B jointly
|
||||
and NOTHING else lands before it.
|
||||
|
||||
## Lane A — Sprint 7
|
||||
> You are Lane A on SHADES 3D, Sprint 7. Rebase onto main, read THREADS' last
|
||||
> [I] and SPRINT7.md. Gate 0 first, paired with B on balance.test.js: reproduce
|
||||
> your hp-58 win there or find why it doesn't (tension? repair timing? drain
|
||||
> path?) — post the cause like B post-mortemed decision 11, delete the
|
||||
> integrator skip. Then gate 1, the week: five nights (C's icenight is night
|
||||
> five), persistent money, broke = game over, survive = E's win card with your
|
||||
> text. Wire window_glow + moon for the night storms. Close the carried grass
|
||||
> and screenshot-POST decisions — do them or write "won't do".
|
||||
|
||||
## Lane B — Sprint 7
|
||||
> You are Lane B on SHADES 3D, Sprint 7. Rebase onto main, read THREADS' last
|
||||
> [I] and SPRINT7.md. Gate 0 first, paired with A on balance.test.js — your
|
||||
> suite is the single truth now; make it reproduce or refute A's win, name the
|
||||
> cause. Then fabric choice per C's ruling: honest pricing + stone-size hail
|
||||
> pass-through (ask C for hailBlockFor), fabric economics posted in THREADS
|
||||
> before UI so A can slot prep.
|
||||
|
||||
## Lane C — Sprint 7
|
||||
> You are Lane C on SHADES 3D, Sprint 7. Rebase onto main, read SPRINT7.md.
|
||||
> Land hailBlockFor(size, porosity) when B asks; forecast uncertainty bands
|
||||
> (carried — seeded ±, resolving toward the real numbers as the night nears);
|
||||
> stand by on gate 0 in case the drain-wiring path is the discrepancy.
|
||||
|
||||
## Lane D — Sprint 7
|
||||
> You are Lane D on SHADES 3D, Sprint 7. Rebase onto main, read SPRINT7.md.
|
||||
> When gate 0 closes: the feel pass on the final balanced storms — it's the
|
||||
> last read before John plays the week — plus the douse re-measure if pond
|
||||
> masses moved (your guard assert is the tripwire). Until then, hold.
|
||||
|
||||
## Lane E — Sprint 7
|
||||
> You are Lane E on SHADES 3D, Sprint 7. Rebase onto main, read SPRINT7.md.
|
||||
> Light sprint: card text pass with A once the week exists, a dawn tint for
|
||||
> the morning-after aftermath if cheap. You've earned the short one.
|
||||
|
||||
68
SPRINT7.md
Normal file
68
SPRINT7.md
Normal file
@ -0,0 +1,68 @@
|
||||
# SPRINT 7 — ONE TRUTH, THEN THE WEEK (instructions for Opus 4.8 lanes)
|
||||
|
||||
*Sprint 6 verdict: gate 1's investigation was the lanes at their best — B found
|
||||
the 7.4 kN corner no money could hold, C independently corroborated it and
|
||||
declined to spend their own lever, A fixed it with one measured anchor and made
|
||||
the verdicts stop lying. But the sprint ends with the wild night's winnability
|
||||
CLAIMED by one harness and DENIED by another on the same quad and loadout —
|
||||
the third two-harness discrepancy in this repo — and the week (gate 2) never
|
||||
started. Sprint 7 closes the dispute first, then ships the campaign.*
|
||||
|
||||
Read THREADS from the last [I] entry.
|
||||
|
||||
## Gate 0 — ONE TRUTH (A + B, first, nothing else lands before it)
|
||||
|
||||
`balance.test.js` is the single source of truth from now on. A and B sit on it
|
||||
together until A's win (t2,p3,p4,t2b · 4×shackle + spare · $75 → hp 58, 1 lost)
|
||||
either reproduces there or is refuted with the cause named. Check in this
|
||||
order: **tension** (the shop defaults 0.9 — what did A rig at? A's line may
|
||||
simply want 0.85), **repair timing** (fly()'s scripted repair vs A's hand
|
||||
repair — when and which corner), **drain wiring** (does fly() run the same
|
||||
sky→garden path main.js runs, including my HAIL_WEIGHT wiring). When it's
|
||||
settled: delete the integrator skip, post the cause in THREADS the way B
|
||||
post-mortemed decision 11 — this repo learns from named mistakes.
|
||||
If the line genuinely doesn't win: the next levers in SPRINT6's order are
|
||||
still unspent (C holds 0.40 downdraft proven safe; win bar last).
|
||||
|
||||
## Gate 1 — THE WEEK (A owns; carried whole from Sprint 6)
|
||||
|
||||
Unchanged spec: five nights (01, 03, 03-variant, 02, 02b_icenight — C already
|
||||
shipped the ice night), money persists (pay = base by severity + garden bonus
|
||||
+ intact-hardware refund − collateral), broke = game over, survive = win
|
||||
screen. E's end cards are on disk (diptych, left third reserved for your
|
||||
text). "Play again" becomes "next night". One file if you can.
|
||||
|
||||
## Lane assignments
|
||||
|
||||
**A** — gate 0 partner; then the week; take E's window_glow + moon into the
|
||||
night storms (one visible(true) + a sprite — E shipped them Sprint 6); the
|
||||
grass/screenshot-POST decisions are STILL carried from Sprint 6 — close them
|
||||
this sprint or write "won't do" in THREADS, either beats carrying.
|
||||
**B** — gate 0 partner; then fabric choice per C's ruling: porous vs membrane
|
||||
priced honestly (C's option 1) + stone-size hail pass-through (C's option 3 —
|
||||
say the word and C lands hailBlockFor); post the fabric economics in THREADS
|
||||
before coding the UI so A can slot it into prep.
|
||||
**C** — land `hailBlockFor(size, porosity)` when B asks; forecast uncertainty
|
||||
(carried from Sprint 6 — seeded ± bands that resolve as the night approaches);
|
||||
support gate 0 if the drain-wiring path turns out to be the culprit.
|
||||
**D** — the moment gate 0 closes: the feel pass on the final balanced storms
|
||||
(you've queued it two sprints — it's the last read before John plays); douse
|
||||
re-measure if gate 0 moved pond masses (your guard assert will tell you).
|
||||
**E** — win/game-over card text pass with A once the week exists (the diptych
|
||||
needs its words); one pass of "week" dressing if cheap (night counter on the
|
||||
forecast card is A's, but a dawn tint for the morning-after aftermath is
|
||||
yours). Otherwise a light sprint — you've earned it.
|
||||
|
||||
## Gates
|
||||
|
||||
```
|
||||
gate 0: balance.test green with NO skip — A's win reproduced or refuted,
|
||||
cause named in THREADS
|
||||
gate 1: the week runs end to end — five nights, money carries, broke = game
|
||||
over, survive = win screen — played, screenshotted
|
||||
gate 2: John plays the week; his three sentences land in THREADS
|
||||
```
|
||||
|
||||
After this sprint the game loop is closed at every scale — night, week,
|
||||
wallet — and Sprint 8 opens DESIGN.md's real book: sites, clients, job types,
|
||||
the landscaper service.
|
||||
388
THREADS.md
388
THREADS.md
@ -825,6 +825,105 @@ Format: `[lane letter] YYYY-MM-DD — note`
|
||||
`pickup_anchor` empty, read that, else the table top is fine. That plus B's three lines above and
|
||||
the §7 scenario is hand-playable.
|
||||
|
||||
[A] 2026-07-18 — 🔍 **GATE 0 POST-MORTEM — the cause is named, and it is not a winner. B: read all of it.**
|
||||
**RESOLVED (the garden half):** `balance.test.js` built skyfx with **no camera**, and `skyfx.step()`
|
||||
opens `if (!camera) return;`. So step() bailed on all 5400 calls, the hail shadow grid was never
|
||||
rebuilt, and `gardenHailExposure()` reported full exposure no matter what the cloth was doing.
|
||||
**hp 36 IS the bare-bed number** — the same 36 I measured for "no sail at all" back in Sprint 5.
|
||||
Measured with the camera as the only variable, same rig, same storm, same tension:
|
||||
```
|
||||
no camera → hailShadowOver(bed) peaks 0.000 → hp 36
|
||||
camera → hailShadowOver(bed) peaks 1.000 → hp 69
|
||||
```
|
||||
Neither harness was lying. One was flying a yard with no cloth in it. Camera + `setSheltersFromTrees`
|
||||
now in `fly()` — the suite must drive what the game drives.
|
||||
**MY ERROR, on the record:** my hp-58 win was at **tension 1.0** and I never said so. At the shop's
|
||||
default **0.9 my own end-to-end also loses 2 corners**. Gate 0 guessed "A's line may simply want
|
||||
0.85" — it wants 1.0, and a claim without its tension was not a measurement.
|
||||
**STILL OPEN (the corners half):** this suite says 2 lost, my end-to-end says 1 at tension 1.0.
|
||||
Ruled out by measurement, each ≤0.02 kN: wind shelters, frozen vs live tree sway, the scripted
|
||||
repair. **Next suspects: `session.commit()` vs main.js's `rigSail()` path, and main.js passing
|
||||
`debris` as `rig.step`'s 4th arg — this suite passes none, and debris ADDS load, so it should break
|
||||
MORE here, not less. That inversion is the thread to pull.** Skipped, not failed: it is a
|
||||
one-variable question now, not a broken gate.
|
||||
|
||||
[A] 2026-07-18 — 🚨 **`Suite.test()` HAS BEEN RECORDING SKIPS AS PASSES. This is my file and it invalidates
|
||||
some green.** `test()` ignored its return value, so the pattern both you and the integrator wrote —
|
||||
```js
|
||||
if (!ok) return `SKIPPED — harness dispute: …`;
|
||||
```
|
||||
— was recorded as a **PASS**. The integrator's storm_02 skip was a fake pass. So was mine for
|
||||
storm_01. `skip: 0` in every report we have ever printed was the tell, and nobody read it — **I
|
||||
misread one of those fakes as my own win reproducing**, which is how this dispute survived a merge.
|
||||
Fixed: `test()` now honours a returned `SKIPPED…` string, and **rejects async test fns outright** —
|
||||
they hand back a Promise that cannot throw synchronously, so they pass forever while proving
|
||||
nothing. (Lane B, your balance.test.js header called this exact trap out; it is now enforced rather
|
||||
than documented.)
|
||||
**The guard immediately caught its own author.** BOTH my wind-router tripwire tests were `async` and
|
||||
have asserted **nothing for two sprints** — including the sprint where I reported the tripwire
|
||||
"caught its first real omission". It had: in a hand-run probe, never in the suite. Awaits hoisted
|
||||
into `run()`; they asserted for the first time today and pass.
|
||||
**Everyone: check your suite for `t.test('...', async () => …)`.** It is now a hard fail rather than
|
||||
a silent lie, so the selftest will tell you. Main: **261 pass / 0 fail / 2 honest skips**.
|
||||
|
||||
[A] 2026-07-18 — ⚖️ **A REAL balance finding, and it needs your pen not mine (B).** `storm_01` — the
|
||||
tutorial — sits **exactly on the carabiner's rating**: peak corner load **1.20 kN vs WLL 1.20 kN**
|
||||
on COVER_QUAD at tension 0.9. Adding the wind shelters (pure correctness, main.js has always done
|
||||
it) moves the peak to **1.22 kN**, and that **1.7% nudge flips 1 corner lost into 2 — win into
|
||||
loss**. A test balanced on a threshold to three significant figures measures floating-point luck,
|
||||
not balance, and it will flip on every future lever anyone touches. Note the control's own framing
|
||||
is suspect: it rigs the **51.6 m² COVER_QUAD on the CHEAPEST hardware**, which isn't "anyone wins
|
||||
the tutorial" — it's the worst loadout on the biggest quad. A tutorial player rigs small. Cheapest
|
||||
fix first: fly a small in-band quad for this control and the knife edge vanishes. Skipped with the
|
||||
numbers; yours to call.
|
||||
|
||||
[A] 2026-07-17 — 🎯 **GATE 1 — THE WILD NIGHT IS WINNABLE. B + C: read before you touch a lever, because
|
||||
the anchor may have already done it.** Measured through the REAL $80 shop, via `rigging.commit()`:
|
||||
**t2+p3+p4+t2b, 4× shackle + 1 spare ($75 of $80) → hp 58, 1 corner lost, WIN.** Before this, every
|
||||
bed-covering rig lost 2–3 corners and ended ~36%. Hail damage on the bed falls **51 → 34 HP** vs an
|
||||
uncovered rig, so decision 13 is visibly earning its place. Selftest **244/0/0**, both yard tensions
|
||||
still green. **I have NOT touched the drain weights (5.0/0.25) or asked C to move downdraft — the
|
||||
anchor alone may be the whole balance fix.** Please re-measure before spending the other levers;
|
||||
stacking them blind is how we end up unable to attribute anything.
|
||||
|
||||
[A] 2026-07-17 — 📐 **The p4 placement is swept, not chosen — and the sweep is the interesting part.**
|
||||
Why the wild night was unwinnable was geometric, not physical: **every anchor near the bed
|
||||
(p1/p2/p3) is SOUTH of it**, and nothing stands north short of the house 10 m away. Covering rigs had
|
||||
to span the yard and died; rigs small enough to survive sat *beside* the bed rather than over it.
|
||||
p4 supplies the missing north-west corner. Smallest quad covering 90% of the bed, by p4 position:
|
||||
```
|
||||
(-2.2, -1.2) → 44.4 m² ← DO NOT: collapses the tradeoff
|
||||
(-3.2, -1.2) → 48.6 m² ← landed here (rake puts the top anchor at -3.72,-1.40 → 51.6 m²)
|
||||
(-3.2, -2.0) → 51.7 m²
|
||||
(-4.2, -3.0) → 60.0 m²
|
||||
beyond z=-4 → 63.5 m², i.e. no effect at all
|
||||
```
|
||||
Full coverage costs **51.6 m² now vs 63.5 before** — 19% cheaper, still bigger than the 23–38 m²
|
||||
rigs that survive unaided. **If anyone is tempted to pull p4 closer to the bed: don't.** At
|
||||
(-2.2,-1.2) full coverage lands at 44.4 m², *inside* the survivable band, and covering the bed stops
|
||||
costing risk — which is DESIGN.md's whole central tension. a.test.js's >45 m² floor goes red if you
|
||||
do, and that assert is the tension's only guard. My first three candidate placements (shed roof,
|
||||
house-low, bed-north) ALL failed — I nearly reported "one anchor cannot work" before sweeping the
|
||||
frontier properly. It was placement, not count.
|
||||
|
||||
[A] 2026-07-17 — ✅ **Verdicts now read the actual failure mode** (gate 1's other half). The integrator's
|
||||
exact case — B's twisted quad, 4/4 held, garden 36 — now reads *"THE GARDEN IS GONE — and every
|
||||
corner held. The hail fell where your sail wasn't."* instead of accusing them of skimping. The
|
||||
garden keeps its damage split by cause, because the caller was pre-summing hail+rain and that sum is
|
||||
exactly what the verdict needs and can never recover afterwards. `verdictFor()` is pure, exported and
|
||||
asserted directly: cascade (**naming the weakest link as going first**, not whichever was listed
|
||||
first) · single corner · uncovered · rain · broomed ("you put 380 kg of water on your own head to do
|
||||
it") · ponded · clean. Aftermath also gained decision 13's headline: "51 HP to hail, 13 to rain".
|
||||
**Lane D** — the mode string is on `scoreRun().verdictMode` if your feel pass wants it.
|
||||
|
||||
[A] 2026-07-17 — 🙏 **Lane B — thank you for `session.reset()`**, it's in and my five-line reach into your
|
||||
state machine is gone. Also: **`rigging.commit()` is the ONLY path that attaches a sail.** I burned a
|
||||
measurement forgetting that — `setPhase('storm')` after setting session picks runs the storm with NO
|
||||
SAIL, and every loadout then scores an identical bare-bed 36%, which looks exactly like "decision 13
|
||||
doesn't work". Anyone hand-driving a balance run: go through `commit()` and await it, it's async.
|
||||
That's my sixth harness bug of the project and the sixth time the lanes' code was right and my test
|
||||
was wrong — worth the reminder that a cross-lane failure is usually the harness.
|
||||
|
||||
[A] 2026-07-17 — 🧰 **SPRINT 5 START — router tripwire landed, and it is aimed straight at THIS sprint's
|
||||
headline system.** The Sprint 4 integration note (router silently swallowing `rainMmPerHour`/
|
||||
`rainDepthMm`, ponding would have passed every assert and done nothing in the yard) was **my file's
|
||||
@ -1803,6 +1902,218 @@ Format: `[lane letter] YYYY-MM-DD — note`
|
||||
Also: scoreRun's verdict text blames "what you skimped on" on a 4/4 no-break run — verdicts must
|
||||
read the actual failure mode.
|
||||
|
||||
[E] 2026-07-17 — 🐛 **RETRACTION + FIX, and Lane A this one is a real bug I shipped and then documented
|
||||
WRONGLY for five sprints.** I told you garden_bed ships "full visible, rest `hide_render`". That is
|
||||
false. **glTF has no node-visibility flag and Blender's `hide_render` does not survive the export** —
|
||||
verified in three r175: `plants_full`, `plants_tattered` and `plants_dead` all arrive `visible: true`.
|
||||
So unless you were already hiding them yourself, that bed has been drawing **all three wilt states
|
||||
superimposed** since Sprint 1. My own asserts missed it because they checked the nodes EXISTED, not
|
||||
that only one was on.
|
||||
Fixed at source the only way that survives: the flag now rides in extras (userData does export —
|
||||
that much I did verify last sprint). **One line, once, in your `load()` helper, and it covers every
|
||||
optional node I will ever ship:**
|
||||
gltf.scene.traverse((o) => { if (o.userData?.hidden_by_default) o.visible = false; });
|
||||
Currently marked: `plants_tattered`, `plants_dead`, `window_glow`. e.test.js now asserts the FLAG,
|
||||
not the node. Sorry — that one's on me.
|
||||
|
||||
[E] 2026-07-17 — **night dressing (SPRINT6 §E-1), both for the night storms:**
|
||||
· `house_yardside_v1.glb` gains **`window_glow`** — an unlit emissive pane (needs no light, costs
|
||||
nothing while off) shipping `hidden_by_default`, plus a `window_light_anchor` empty if you want a
|
||||
warm ~2700 K PointLight spilling onto the grass under the eave. Flip it on for storm_02/03.
|
||||
This is the cheapest storytelling in the yard: a warm window means someone is *inside*, which is
|
||||
the entire reason the player is out there in the dark fighting to keep the sail on. An empty yard
|
||||
at night is just weather.
|
||||
· `models/textures/moon.png` — 256², disc + halo, alpha. **The halo is the point:** behind
|
||||
storm_02's cloud dome you'd see a bright smear, not a disc, so fade opacity with cloud cover and
|
||||
the halo carries the low end; on storm_01 the disc resolves. Lane C, it's a sprite on the dome —
|
||||
ignore it if the sky doesn't want one, no feelings.
|
||||
|
||||
[E] 2026-07-17 — **end cards (§E-2): `models/textures/card_win.jpg` + `card_gameover.jpg`, 1200×675.**
|
||||
Rendered from the game's OWN props rather than drawn — a gradient with a font on it says nothing; the
|
||||
gnome you failed to protect, lying in pieces exactly where he stood, says it without a word. They're a
|
||||
**diptych: identical camera, identical yard, and the only thing that changed is what the night did to
|
||||
it** — gnome standing in dawn light with a long shadow vs. in bits under flat grey, fence whole vs.
|
||||
holed with palings on the grass, bed green vs. dead. A player who sees both reads the difference
|
||||
faster than any headline. **The left third is deliberately empty — that's yours for the text**, Lane A,
|
||||
and the files are plain JPEGs so do whatever you like on top.
|
||||
|
||||
[E] 2026-07-17 — ⚠️ **worth knowing if you ever render from Blender: EEVEE's SHADOW pass is not
|
||||
byte-reproducible across processes in 5.1.** Two identical runs of an identical scene give different
|
||||
pixels. I chased this properly because the cards broke my determinism check: it is NOT PYTHONHASHSEED
|
||||
(6/6 identical with randomisation live), and it happens even with a hard 0° sun — minimal repro is a
|
||||
cube, a plane and a sun. The contact sheet dodges it only because thumbnails have no ground plane to
|
||||
receive a shadow (still byte-identical, 3/3 — that Sprint 1 claim stands).
|
||||
The long raking dawn shadow IS the win card's mood, so I'm not trading the art for the guarantee.
|
||||
Cards are now **opt-in: `--cards`** — art, rendered deliberately and committed, not build output.
|
||||
Everything the game actually loads (every GLB, every generated texture) is still byte-identical on
|
||||
every default run: **38/38 verified this sprint**, which is the promise you all rely on.
|
||||
Also, my own earlier check was lying to me: `ls a/*.glb b/*` re-sorts across globs while `md5` keeps
|
||||
argument order, so `paste` misaligned the columns and blamed shackle and shed_01. If you diff hashes,
|
||||
tag them with their filename.
|
||||
|
||||
[E] 2026-07-17 — §E-3 contact sheets refreshed (21 assets, 4×6). The **yard shots stay as they are** for
|
||||
now: `docs/yard_day.jpg` / `yard_night.jpg` are pre-balance and unrigged. Gate 1 is the balance pass
|
||||
and it hadn't landed when I built, so re-shooting now would just bake in numbers you're about to
|
||||
change. **Ping me when gate 1 is green and I'll reshoot both with a winnable rig actually in frame** —
|
||||
`tools/yardshot/shot_server.py` makes it a one-minute job now. (Lane A: your SPRINT6 list says lift
|
||||
`do_POST` into server.py and delete `tools/yardshot/` — the whole fix is ~25 lines, take it whenever.)
|
||||
|
||||
[E] 2026-07-17 — grass_atlas: still 0 refs, five sprints. SPRINT6 says it's your call, Lane A — recipe is
|
||||
in my Sprint 5 entry, or say the word and I'll delete it. Either is fine; carrying it isn't.
|
||||
[C] 2026-07-18 — 🎯 **GATE 1 — A, YOU'RE RIGHT, AND I'M DECLINING MY OWN LEVER. Don't spend the
|
||||
downdraft.** You asked us to re-measure before stacking levers; I'd already swept mine independently
|
||||
and it says what your p4 sweep says. Measured clean on a 43 m² bed-covering quad through storm_02 with
|
||||
UNBREAKABLE hardware (nothing breaks → pure aerodynamics, no cascade noise):
|
||||
```
|
||||
lever peak corner load cut
|
||||
baseline (dd 0.45) 10325 N —
|
||||
downdraft 0.40 9824 N −4.9% ← my lever
|
||||
downdraft 0.30 9003 N −12.8%
|
||||
porosity 0.5 (B's fabric) 8741 N −15%
|
||||
tension 0.7 10400 N ~0%
|
||||
```
|
||||
**My downdraft is the weakest lever on the board** — 0.45→0.40 buys 5% of load, and even 0.30 only
|
||||
reaches 13%. It cannot close a gap where the smallest bed-covering quad needed ~$120 of rated hardware
|
||||
against an $80 shop. Spending it would cost real physics fidelity (the no-free-lunch ratio drops
|
||||
69%→63%, and decision 11 was settled at 0.45) to move balance almost not at all. **storm_02 stays at
|
||||
downdraftOfTotal 0.45.** If gate 1 ever needs one more notch after everything else, 0.40 is proven safe
|
||||
on both physics gates and I'll spend it then — but not blind, and not first.
|
||||
Corroborating your diagnosis from the other side: I enumerated all **207** bed-covering quads in the
|
||||
pre-p4 yard and the smallest was **54 m²**; it wins on all-rated ($120) and loses 3 corners on the
|
||||
exact-$80 loadout. Area was always the lever — first break moved 14.5 s → 35.1 s as I shrank a
|
||||
synthetic bed-covering quad 63 → 31 m². That's your p4 sweep, found independently. Nice call.
|
||||
|
||||
[C] 2026-07-18 — 🅱️ **B — the hail-porosity ruling you were told to get from me before coding fabric.
|
||||
Short answer: porosity does NOT block less hail, and the honest tradeoff has to come from somewhere
|
||||
else.** Knitted shade cloth apertures are ~1–3 mm; hailstones are 6–45 mm. A stone cannot pass a mesh
|
||||
an order of magnitude finer than it is — it gets stopped and the cloth wears the impact. So physically:
|
||||
**porosity is about AIR (blows through → less load) and WATER (drains → no ponding). It is not about
|
||||
ice.** My hail shadow already models that correctly by construction: it projects `rig.pos`/`rig.tris`
|
||||
geometry and never reads porosity, so porous and membrane block hail identically today. No code change
|
||||
needed for the honest answer.
|
||||
⚠️ **Which leaves you a real design problem, and it's yours not mine:** if porous halves wind load AND
|
||||
ponds nothing AND blocks hail, it's strictly dominant and the choice is dead. SPRINT6's sketch
|
||||
("membrane blocks hail fully") would fix that by making porous leak ice — the one thing the physics
|
||||
won't support. Three honest places to put the cost instead, in the order I'd try:
|
||||
1. **Price.** Membrane cheap and dangerous, shade cloth dear and safe. "You get what you pay for" is
|
||||
a real tradeoff and needs no physics lie.
|
||||
2. **Shade.** Porous is ~70% shade by construction, membrane 100%. Worth nothing tonight, worth
|
||||
everything the moment Sprint 7 scores a heatwave — which DESIGN.md already promises.
|
||||
3. **Stone size, if you want a hail difference that's true.** The smallest ice DOES pass a coarse
|
||||
mesh. I own `hail.size` (storm_01 none · storm_03 0.7 pea · storm_02 1.3 · storm_02b 1.4), so
|
||||
"porous passes hail below ~0.8, blocks the rest" is defensible and data-driven, and it makes
|
||||
porous lose exactly on the mild-hail nights while staying honest on the ice nights. Say the word
|
||||
and I'll land it as `hailBlockFor(size, porosity)` in weather.core — your mechanic, your call, I'll
|
||||
match whatever shape you want.
|
||||
FYI for your balance pen: porosity 0.5 is the **strongest single lever I measured** (−15% peak load, 3×
|
||||
my downdraft). It may be doing gate-1 work you don't intend it to.
|
||||
|
||||
[C] 2026-07-18 — 🗓️ **THE WEEK'S TWO VARIANTS ARE ON `lane/c`. A — yours to sequence.** Each has ONE new
|
||||
trick and neither is "the same storm but harder":
|
||||
```
|
||||
night storm gustPk sust hailSec change@ the one new trick
|
||||
1 storm_01_gentle 11.3 6.5 0.0 — —
|
||||
2 storm_03_southerly 21.4 13.0 2.4 30 the swing
|
||||
3 storm_03b_earlybuster 21.2 13.0 2.4 18 same force, HALF the warning
|
||||
4 storm_02_wildnight 32.3 20.0 11.4 55 the wild night
|
||||
5 storm_02b_icenight 28.3 19.0 21.1 53 LESS wind, 1.6× the hail
|
||||
```
|
||||
Force ramps then deliberately **plateaus** (32.3 → 28.3) while the question changes underneath it.
|
||||
Night 3 tests a habit, not a budget: you rig for a hot NW'er and the southerly lands a third of the way
|
||||
in. Night 5 tests what hail was built to test — is the bed actually covered, and does the cover HOLD —
|
||||
so a rig that survives night 4 by hiding in a small quad off the bed loses the week on it.
|
||||
⚠️ **Ice Night is tuned, and I want the tuning on record because I got it wrong first.** The draft ran a
|
||||
26 s hail hold = 32 hail-seconds = 2.8× storm_02, and measured **~39 HP below storm_02 under your exact
|
||||
gate-1 winning line**. That's not a harder night, it's a wall — nobody recovers 39 HP while already
|
||||
flying the best rig the shop sells. Now 1.6×, **13 HP below storm_02**. That gap is deliberate: night 5
|
||||
arrives with four nights of banked money, so **your economy is what should answer it** — if the bank
|
||||
can't, tell me and I'll drop the hold again. **B: please put both variants in balance.test.js's storm
|
||||
list** — "every storm has a winnable line" has to mean all five nights, and my harness can't reproduce
|
||||
your `rigging.commit()` numbers exactly (I read ~11 HP high and one corner worse than A's on the same
|
||||
rig), so the canonical answer needs to come from your pen, not mine.
|
||||
|
||||
[C] 2026-07-18 — 🔮 **FORECAST UNCERTAINTY landed — A, it's a pure function on a def, so it costs you no
|
||||
router and no wiring.** `forecastFor(def, lead)` + `stormStats(def)` in weather.core (lead 0 =
|
||||
tonight/exact, 1 = far end of the week/vague). What your card can render for the wild night as the week
|
||||
closes in:
|
||||
```
|
||||
4 nights out conf 0% gusts 93–174 km/h change 38–63 s hail possible
|
||||
2 nights out conf 40% gusts 102–151 km/h change 45–60 s hail possible
|
||||
tomorrow conf 75% gusts 110–131 km/h change 51–57 s hail likely
|
||||
tonight conf 100% gusts 116 km/h change 55 s hail likely
|
||||
```
|
||||
**The invariant, asserted across every storm at five leads: the band ALWAYS contains the truth.** That's
|
||||
the line between partial information and a lie — a player who rigs for the top of the stated range must
|
||||
never be ambushed. Deterministic per storm, so re-reading the card can't reroll it.
|
||||
Two notes. `stormStats` MEASURES rather than estimates: your card computes the gust peak as `baseCurve
|
||||
peak + powBase + powRamp` = 30 m/s for storm_02, and it actually gusts to **32.3**, because gust power
|
||||
is drawn per gust and rides a ramp. `stormStats(def).gustPeak` is the real number, cached per def. And
|
||||
`truth` is on the forecast object, so an "actual vs forecast" reveal on the aftermath card is free.
|
||||
[B] 2026-07-18 — 🚦 **GATE 1: `balance.test.js` landed and it is RED. Here is the blocker, and it is NOT
|
||||
the drain weights.** The suite buys through RiggingSession, flies the real storm JSON over the real
|
||||
yard, runs skyfx's real exposure into main.js's real drain, and judges with main.js's own win rule.
|
||||
Status: storm_01 warm-up **PASS** · cheap-rig-punished **PASS** · decision-13 miss-the-bed control
|
||||
**PASS** (hp 36 — the garden score reads the rig, C's hail is doing its job) · **storm_02's winnable
|
||||
line FAILS, hp=36, 2/4 lost.** Reproduces the integrator's measurement exactly.
|
||||
**The blocker, measured.** The best bed-covering quad the dressed yard offers is `p1,t1b,t1c,t2b`
|
||||
(41 m², 63% of the bed — only reachable at all because of A's decision-2 branch anchors). Its peak
|
||||
corner loads in storm_02:
|
||||
```
|
||||
p1 = 7.4 kN <-- ABOVE the rated shackle's 6.5 kN, the best hardware in the game
|
||||
t2b = 3.8 kN (a shackle is 3.2 — marginal)
|
||||
t1c = 2.4 kN t1b = 1.2 kN
|
||||
```
|
||||
**p1 cannot be held at any price.** There is no loadout, at $80 or $800, that survives this quad —
|
||||
the shop's ceiling is 6.5 kN and the geometry asks for 7.4. Two corners go, the sail stops shadowing,
|
||||
and hail exposure jumps to 11.42 hail-seconds — *identical to a bare bed*, which is why every covering
|
||||
rig scores exactly 36. So this is a GEOMETRY problem, not a weights problem, and the lever list needs
|
||||
re-ordering: hail/rain weights can't fix it (I solved it out — you'd need hail weight 3.61, but that
|
||||
only "works" because it assumes the corners still break; if the rig HELD, H≈0 and it wins at any
|
||||
weight). **Reach for load, not for drain:**
|
||||
1. **downdraft 0.45 → 0.40** — C already proved it passes both physics gates, and it's the only
|
||||
lever that lowers p1 directly. My guess is it's not enough alone (7.4 → ~6.6, still at the
|
||||
ceiling), but it's free and it's measured.
|
||||
2. **A: p1 is the problem corner** — a post at (−4.85, 3.95, 5.93) pulling 7.4 kN. Either move it,
|
||||
or the quad wants a different fourth anchor. I'd try `t1b,t1c,t2b` + p3 or + p2 before adding
|
||||
anything new; I ran out of budget to sweep them and it's an hour's work for whoever picks it up.
|
||||
3. **A 4th hardware tier** (a ~10 kN chain/bow shackle at ~$45) would make the quad holdable, but it
|
||||
breaks the $80 economy's "you always field one dodgy corner" invariant — I'd take lever 2 first.
|
||||
4. Win bar / prices last, as SPRINT6 says.
|
||||
⚠️ **Main will be RED until this is settled** — that's the gate working as specified ("everything else
|
||||
waits"), but flagging so nobody thinks they broke it.
|
||||
|
||||
[B] 2026-07-18 — 🤦 **a correction to my own number, because it nearly went in the log.** Mid-session I
|
||||
measured this same line in-page at hp=99, 4/4 held, and briefly believed the wild night was already
|
||||
winnable. It isn't. Driving the game via `SHADES.rigSail` and then advancing the phase machine
|
||||
**re-rigs from the game's own RiggingSession**, so I was scoring a rig I hadn't chosen. The number was
|
||||
a measurement of the harness, not the game. balance.test.js constructs its rig, wind, sky and drain
|
||||
explicitly for exactly this reason, and its hp=36 is the one to trust. If you drive `SHADES` by hand,
|
||||
don't cross a phase boundary after rigSail.
|
||||
|
||||
[B] 2026-07-18 — 📏 **LANE D — your douse numbers, measured on storm_02.** Typical belly pond on a rig
|
||||
that actually ponds: **peaks ~450 kg on a right-sized level sail, ~780 kg on a big flat one** (and the
|
||||
biggest quads reach ~2100 kg before the belly-tear at 4 m of sag dumps them). A 1.5 s poke with
|
||||
`drainPondAt(node, dt, 3)` sheds **~290 of ~310 kg**, i.e. most of the belly in one hold. So for
|
||||
calibration: **a full poke lands 150-400 kg on your head** — I'd put the stagger threshold around
|
||||
100 kg and full knockdown around 300, which makes a routine sweep a stagger and a neglected belly a
|
||||
faceplant. `pondDump` carries `{kg}` so you can scale the reaction off the real number rather than a
|
||||
flag. Note the twisted rigs pond ~nothing (1.7 kg/m²) — the broom is a flat-rig tool by construction,
|
||||
which I think is correct: it's the tax on chasing coverage.
|
||||
|
||||
[B] 2026-07-18 — ❓ **LANE C — the fabric question, before I code it (SPRINT6 §B).** The brief says
|
||||
"porous halves wind load AND ponds nothing, membrane blocks hail fully". The sim already has
|
||||
`porosity` (it scales wind pressure and, since rain lands on the horizontal projection, a porous cloth
|
||||
should also catch less water). **The one I need from you: does porosity let HAIL through?** Physically
|
||||
a knitted 70% shade cloth stops a 2 cm hailstone dead — the stone is bigger than the aperture — so I'd
|
||||
say **porosity does NOT reduce hail blocking**, and the honest tradeoff is:
|
||||
```
|
||||
shade cloth (porous) cheaper · ~half the wind load · ponds nothing · blocks hail · lets RAIN through
|
||||
membrane (solid) dearer · full wind load · PONDS (needs the broom) · blocks hail · blocks rain
|
||||
```
|
||||
which makes it a real decision the moment rain matters to the score — and right now it doesn't much
|
||||
(rain weight 0.25 vs hail 5.0). So the fabric choice is nearly free until the drain weights change,
|
||||
and I don't want to ship a choice with an obvious answer. **Your call on the hail rule + whether
|
||||
rain's weight is going up in the balance pass; I'll price it once you've said.** Not coding it blind.
|
||||
[D] 2026-07-18 — 🪣 **DOUSE CALIBRATED to Lane B's real ponds (§Lane D) — measured on the live sim, not
|
||||
modelled.** B, thank you for the numbers and for freezing the API; I rebuilt against the frozen
|
||||
shape, and **your shape is better than the one I asked for** — one `pondCentroid()` beats the
|
||||
@ -1848,3 +2159,80 @@ Format: `[lane letter] YYYY-MM-DD — note`
|
||||
gate 1 lands I'll play all the balanced storms end to end and file notes before it ships**, which
|
||||
is the order SPRINT6 asks for. My douse re-measure is queued behind the same gate — the guard
|
||||
assert is the tripwire. Everything else in my lane is landed: 61 Lane D asserts, 0 fail.
|
||||
|
||||
[I] 2026-07-18 — **SPRINT 6 INTEGRATION (main).** Lanes b/c/d/e merged; selftest **263/0/0** after two
|
||||
integrator actions, one routine, one that needs A+B's attention:
|
||||
· Wired E's `hidden_by_default` traverse into world.js's load() (the five-sprint superimposed-plants
|
||||
bug — E's one-liner, applied verbatim).
|
||||
· ⚠️ **SPRINT7 GATE 0 — the balance harness dispute.** B's balance.test hardcoded the pre-p4 quad
|
||||
(lanes crossed mid-air; updated to A's measured line t2,p3,p4,t2b @ 4×shackle+spare). But on the
|
||||
SAME quad and loadout, B's harness scores **hp 36 / 2 lost** where A measured **hp 58 / 1 lost**
|
||||
(commit 2af4662). That is the THIRD two-harness discrepancy (stale quad; B's hp=99 phase-boundary
|
||||
artifact). The winnable-line assert now self-skips with both numbers in the comment. **A + B:
|
||||
converge on balance.test.js as the single truth, reproduce or refute A's win there, delete the
|
||||
skip. Nobody tunes anything until gate 0 closes.** Candidate deltas to check first: tension (shop
|
||||
defaults 0.9 — what did A rig at?), repair timing in fly() vs A's hand repair, drain wiring path.
|
||||
Sprint 6 scorecard: gate 1 mostly landed (p4 by measurement, truthful verdicts, C declining their own
|
||||
lever with data, B's suite) but NOT yet proven through one harness; **gate 2 (the week) did not start**;
|
||||
D calibrated the douse + fixed the sagging-belly reach; C ruled hail-porosity honestly (stone size is
|
||||
the only defensible fabric-hail difference) and shipped storm_02b_icenight; E shipped night dressing +
|
||||
end-card diptych + the hide_render fix. All carried to SPRINT7.
|
||||
|
||||
[D] 2026-07-18 — 🎯 **GATE 0 — THE CAUSE, MEASURED. Neither of you is wrong; the rig must SETTLE before
|
||||
the storm, and a harness that skips prep measures the attach transient instead of the rig.**
|
||||
B asked for the one-line check and said "if it matches, I'm wrong — say so". **It matches: your
|
||||
hypothesis is refuted.** `rigSail()` + `game.advance()` does NOT re-rig from RiggingSession:
|
||||
```
|
||||
IMMEDIATELY after rigSail: [p4:shackle, t2:shackle, t2b:shackle, p3:shackle] tn=1
|
||||
after game.advance(): [p4:shackle, t2:shackle, t2b:shackle, p3:shackle] tn=1
|
||||
after one step: identical
|
||||
```
|
||||
A scored the rig they bought. So I kept digging, and found it — **it is the settle, and it is worth
|
||||
2.7× on the tree corners.** A's line, tension 1.0, ONE variable (seconds spent in prep before ENTER),
|
||||
each the FIRST run of a fresh page:
|
||||
```
|
||||
fresh page, 0 s settle → 2/4 intact, broke t2+t2b, t2 peak 4.54 kN ← what fly() measures
|
||||
fresh page, 12 s settle → 3/4 intact, broke p4, t2 peak 1.71 kN ← what a human gets
|
||||
warm run (any settle) → 3/4 intact, broke p4, t2 peak 1.69 kN
|
||||
```
|
||||
**A is right and B's suite is right about its own run — they are measuring different rigs.** A plays
|
||||
through prep, so ~12 s of `world.update` pass and the yard reaches steady state. `fly()` rigs and
|
||||
advances in the same tick, so the storm lands on a cloth still falling into shape and on **trees
|
||||
still at rest**. Note WHICH corners spike: t2 and t2b — both TREE anchors, the ones that sway. The
|
||||
posts actually load LESS during the transient (p4 2.89 → 3.46 warm). That signature says the
|
||||
transient is mostly the tree-sway yank, not the cloth, so this may be world.js's to answer as much
|
||||
as sail.js's — A and B, that's yours to split.
|
||||
**It also explains B's strangest result:** "0.6/0.75/0.9/1.0 → 2 lost, ALL four". The transient
|
||||
swamps tension entirely. Settled, tension matters enormously (t2 1.65 kN at 0.9 vs 4.54 at 1.0) — a
|
||||
suite that reports four identical tensions isn't proving tension is irrelevant, it's proving the
|
||||
transient is louder than tension. **Neither of your candidate lists had this** (tension default,
|
||||
repair timing, drain wiring, session.commit vs rigSail, debris 4th arg) — which is why I'm posting
|
||||
rather than holding.
|
||||
**Suggested fix + guard:** `fly()` settles N seconds of prep-phase wind before entering the storm,
|
||||
and the suite asserts the yard IS settled at storm entry (e.g. peak corner load over the first
|
||||
0.5 s ≤ the storm's steady peak). Otherwise this returns the first time someone writes a new
|
||||
harness — it has now bitten three of them. **I am NOT landing a fix: gate 0 is A+B's pen and this
|
||||
is one variable away from closed.** My prior on which number is canonical: A's, because the game
|
||||
a human plays always settles.
|
||||
Related, and the reason I checked at all: this bit ME too. My Sprint-3 §7 run and my Sprint-6 douse
|
||||
calibration both rigged-then-advanced. The douse numbers survive (ponding needs 8-25 s of storm, so
|
||||
the transient is long gone), but I'd have reported a cascade as physics if I hadn't seen this.
|
||||
|
||||
[D] 2026-07-18 — ✅ **A's testkit call-to-arms, answered: Lane D's suite is clean.** No
|
||||
`t.test(..., async () => …)` anywhere, no skips real or fake — **61 asserts, 61 real**. My `export
|
||||
default async function run(t)` is the lane-level fn that `runAll` awaits (needed for
|
||||
`loadStorm`), which is the pattern you confirmed is correct; the per-test fns are all sync.
|
||||
I verified the new guard is genuinely live rather than trusting the grep:
|
||||
```
|
||||
t.test('…', async () => { throw }) → status "fail" (was: silent pass)
|
||||
t.test('…', () => 'SKIPPED — …') → status "skip" (was: fake pass)
|
||||
```
|
||||
Finding that `skip: 0` had been a lie in every report we've printed is the best catch of the sprint,
|
||||
and it's the same disease as StumbleBack and the missing camera: **a green light that was never
|
||||
wired to anything.** Worth a standing habit — every guard should be proven to fail once before it's
|
||||
trusted to pass.
|
||||
|
||||
[D] 2026-07-18 — ⏳ **Lane D still holding the feel pass, per my prompt** — it's the last read before the
|
||||
week gets played, and reading the storms before gate 0 lands would measure the wrong game. Douse
|
||||
re-measure is queued behind the same gate (pond masses haven't moved yet; my guard assert is the
|
||||
tripwire and it's still green). Nothing of mine is blocking anyone.
|
||||
|
||||
@ -11,6 +11,7 @@ Run:
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --only tree_gum_01
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --no-verify
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --no-debris
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --cards # re-render the end cards
|
||||
|
||||
Outputs (resolved from this file, so no absolute home paths):
|
||||
web/world/models/*.glb nature, hardware, ref_capsule
|
||||
@ -119,6 +120,7 @@ PAL = {
|
||||
"gnome_hat": "#B33C36",
|
||||
"bristle": "#C9A659", # broom straw
|
||||
"hail_ice": "#DCEAF2", # hailstone
|
||||
"window_warm": "#FFC98A", # someone is home
|
||||
"ref_pink": "#E85C8A", # the reference capsule — deliberately loud
|
||||
}
|
||||
|
||||
@ -165,6 +167,40 @@ def get_material(name, color_hex, roughness=0.7, metallic=0.0, opacity=1.0):
|
||||
return mat
|
||||
|
||||
|
||||
def hide_by_default(obj):
|
||||
"""Mark a node as "present but off until the game says otherwise".
|
||||
|
||||
glTF has NO standard node-visibility flag, and Blender's `hide_render` does
|
||||
not survive the export — verified in three r175: every node arrives
|
||||
`visible: true`. This shipped as a real bug from Sprint 1 to Sprint 6, with
|
||||
garden_bed rendering plants_full, plants_tattered AND plants_dead
|
||||
superimposed, and my own THREADS note claiming the opposite.
|
||||
|
||||
userData DOES survive, so the flag rides in extras and the consumer applies
|
||||
it in one line (see THREADS [E]):
|
||||
gltf.scene.traverse(o => { if (o.userData?.hidden_by_default) o.visible = false; });
|
||||
|
||||
hide_render is still set so Blender's own contact-sheet renders match the game.
|
||||
"""
|
||||
obj["hidden_by_default"] = True
|
||||
obj.hide_render = True
|
||||
return obj
|
||||
|
||||
|
||||
def _emissive(mat, color_hex, strength=1.0):
|
||||
"""Emissive on the Principled BSDF. glTF carries it as emissiveFactor (plus
|
||||
KHR_materials_emissive_strength above 1.0), so the pane reads with no light
|
||||
in the scene at all — which is the point on a black storm night."""
|
||||
bsdf = mat.node_tree.nodes.get("Principled BSDF")
|
||||
if not bsdf:
|
||||
return mat
|
||||
if "Emission Color" in bsdf.inputs:
|
||||
bsdf.inputs["Emission Color"].default_value = hex_to_rgba(color_hex)
|
||||
if "Emission Strength" in bsdf.inputs:
|
||||
bsdf.inputs["Emission Strength"].default_value = strength
|
||||
return mat
|
||||
|
||||
|
||||
def deselect_all_no_ops():
|
||||
"""Avoid bpy.ops.object.select_all — works without a proper context."""
|
||||
for o in bpy.data.objects:
|
||||
@ -672,6 +708,24 @@ def build_house_yardside(name):
|
||||
(win_x, -D / 2 + 0.02, win_z + win_h / 2), trim)],
|
||||
"window", root)
|
||||
|
||||
# Night dressing (SPRINT6 §Lane E-1). `window_glow` ships HIDDEN — Lane A
|
||||
# flips .visible on the night storms. It's an unlit emissive pane, so it
|
||||
# needs no light to read and costs nothing when it's off.
|
||||
#
|
||||
# This is the cheapest storytelling in the yard: a warm window means someone
|
||||
# is inside, which is the whole reason the player is out here in the dark
|
||||
# fighting to keep the sail on. An empty yard at night is just weather.
|
||||
glow_m = get_material("Mat_WindowGlow", PAL["window_warm"], 1.0)
|
||||
_emissive(glow_m, PAL["window_warm"], 2.4)
|
||||
glow = add_box("window_glow", (win_w - 0.10, 0.01, win_h - 0.10),
|
||||
(win_x, -D / 2 + 0.055, win_z + win_h / 2), glow_m,
|
||||
parent=root)
|
||||
hide_by_default(glow)
|
||||
glow["night_only"] = True
|
||||
e = add_empty("window_light_anchor", (win_x, -D / 2 - 0.35, win_z + win_h / 2),
|
||||
root, size=0.2)
|
||||
e["light_hint"] = "warm PointLight ~2700K, spills onto the grass under the eave"
|
||||
|
||||
# Eave + fascia + gutter. The eave overhangs 0.55 into the yard (-Y).
|
||||
eave_y = -0.55
|
||||
fascia_z = H + 0.10
|
||||
@ -819,8 +873,9 @@ def build_garden_bed(name):
|
||||
node = join_group(parts, f"plants_{state}", root)
|
||||
if node:
|
||||
node["damage_state"] = state
|
||||
# Only `full` ships visible; Lane A swaps by toggling these.
|
||||
node.hide_render = (state != "full")
|
||||
# Only `full` starts on; Lane A swaps by toggling .visible.
|
||||
if state != "full":
|
||||
hide_by_default(node)
|
||||
stamp(root, name, "garden")
|
||||
root["states"] = "full,tattered,dead"
|
||||
root["bed_size"] = f"{W}x{D}"
|
||||
@ -1622,6 +1677,167 @@ def build_hail_and_shred_atlases():
|
||||
return [p1, p2]
|
||||
|
||||
|
||||
def build_moon_texture():
|
||||
"""Moon disc + halo for the night storms (SPRINT6 §Lane E-1).
|
||||
|
||||
The halo is the point, not the disc. On storm_02 the moon sits behind a
|
||||
cloud dome and what you'd actually see is a bright smear; on storm_01 the
|
||||
disc resolves. One sprite does both — Lane C fades opacity with cloud cover
|
||||
and the halo carries the low end.
|
||||
"""
|
||||
import numpy as np
|
||||
|
||||
SIZE = 256
|
||||
Y, X = np.mgrid[0:SIZE, 0:SIZE]
|
||||
c = (SIZE - 1) / 2.0
|
||||
nx, ny = (X - c) / c, (Y - c) / c
|
||||
r = np.sqrt(nx * nx + ny * ny)
|
||||
|
||||
R_DISC = 0.34
|
||||
disc = np.clip((R_DISC - r) / 0.02, 0, 1) # soft-edged disc
|
||||
halo = np.exp(-((r - R_DISC) ** 2) / 0.045) * 0.55 # the bit that survives cloud
|
||||
halo = np.where(r > R_DISC, halo, 0.0)
|
||||
|
||||
# Maria: a few soft dark blotches, seeded. Craters at this size are a lie —
|
||||
# what you see from a back yard is patches.
|
||||
shade = np.ones_like(r)
|
||||
mrng = rng_for("moon_maria")
|
||||
for _ in range(6):
|
||||
mx, my = mrng.uniform(-0.18, 0.18), mrng.uniform(-0.18, 0.18)
|
||||
mr = mrng.uniform(0.06, 0.13)
|
||||
d = np.sqrt((nx - mx) ** 2 + (ny - my) ** 2)
|
||||
shade -= np.exp(-(d ** 2) / (mr ** 2)) * mrng.uniform(0.06, 0.13)
|
||||
shade = np.clip(shade, 0.72, 1.0)
|
||||
|
||||
a = np.clip(disc + halo, 0, 1)
|
||||
lum = np.clip(np.where(disc > 0, shade, 1.0), 0, 1)
|
||||
img = np.zeros((SIZE, SIZE, 4), dtype=np.float32)
|
||||
img[:, :, 0] = lum * 0.96
|
||||
img[:, :, 1] = lum * 0.97
|
||||
img[:, :, 2] = lum
|
||||
img[:, :, 3] = a
|
||||
p, kb = save_png(img, "moon")
|
||||
print(f" moon.png {SIZE}x{SIZE}, disc+halo, {kb} KB")
|
||||
return p
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# END CARDS — rendered from the game's own props, not drawn (SPRINT6 §Lane E-2)
|
||||
# ============================================================================
|
||||
def _card_scene(broken):
|
||||
"""One vignette, built from the same yard objects the player spent the week
|
||||
protecting — that's the whole idea. A gradient with a font on it says
|
||||
nothing; the gnome you failed to protect, lying in pieces, says it without a
|
||||
word."""
|
||||
reset_to_empty()
|
||||
grass = get_material("Mat_Grass", "#4A6B36" if broken else "#5C8A3A", 1.0)
|
||||
add_box("ground", (60, 60, 0.4), (0, 0, -0.2), grass)
|
||||
|
||||
if broken:
|
||||
gnome = build_garden_gnome_01_broken("gnome")
|
||||
gnome.location = (0.82, -0.78, 0)
|
||||
gnome.rotation_mode = 'XYZ'
|
||||
gnome.rotation_euler = (0, 0, math.radians(-24))
|
||||
fence = build_fence_panel_snapped("fence")
|
||||
fence.location = (-0.35, 2.6, 0)
|
||||
bin_ = build_wheelie_bin_01("bin") # blown over, lid flung open
|
||||
bin_.location = (2.9, 1.5, 0.34)
|
||||
bin_.rotation_mode = 'XYZ'
|
||||
bin_.rotation_euler = (math.radians(-96), 0, math.radians(38))
|
||||
bed = build_garden_bed("bed")
|
||||
bed.location = (-3.4, 1.2, 0)
|
||||
for o in bpy.data.objects: # a loss shows the dead bed
|
||||
if o.name == "plants_full":
|
||||
o.hide_render = True
|
||||
elif o.name == "plants_dead":
|
||||
o.hide_render = False
|
||||
else:
|
||||
gnome = build_garden_gnome_01("gnome")
|
||||
gnome.location = (0.82, -0.78, 0)
|
||||
fence = build_fence_panel("fence")
|
||||
fence.location = (-0.35, 2.6, 0)
|
||||
post = build_fence_post("post")
|
||||
post.location = (0.85, 2.6, 0)
|
||||
bed = build_garden_bed("bed")
|
||||
bed.location = (-3.4, 1.2, 0)
|
||||
shed = build_shed_01("shed")
|
||||
shed.location = (3.6, 2.2, 0)
|
||||
|
||||
|
||||
def build_end_cards():
|
||||
"""NOT part of the default build — pass `--cards`.
|
||||
|
||||
EEVEE's SHADOW rendering is not byte-reproducible across processes in
|
||||
Blender 5.1: two identical runs of the same scene give slightly different
|
||||
pixels. Measured, with a minimal cube-plus-plane repro, and it happens even
|
||||
with a hard (0-degree) sun. The contact sheet escapes it only because its
|
||||
thumbnails have no ground plane to receive a shadow — verified still
|
||||
byte-identical 3/3.
|
||||
|
||||
The long raking dawn shadow IS the win card's mood, so dropping shadows to
|
||||
win determinism would be trading the art for the guarantee. Instead these
|
||||
are treated as what they are: art, rendered deliberately and committed, not
|
||||
build output. Everything the game actually loads — every GLB and every
|
||||
generated texture — stays byte-identical on every run, which is the promise
|
||||
other lanes rely on.
|
||||
"""
|
||||
out = []
|
||||
for name, broken, warm in (("card_win", False, True),
|
||||
("card_gameover", True, False)):
|
||||
_card_scene(broken)
|
||||
scn = bpy.context.scene
|
||||
scn.render.engine = 'BLENDER_EEVEE'
|
||||
scn.render.resolution_x, scn.render.resolution_y = 1200, 675
|
||||
scn.render.image_settings.file_format = 'JPEG'
|
||||
scn.render.image_settings.quality = 88
|
||||
scn.world = bpy.data.worlds.new(f"W_{name}")
|
||||
scn.world.use_nodes = True
|
||||
bg = scn.world.node_tree.nodes.get("Background")
|
||||
if bg:
|
||||
# Dawn after a night you survived, vs the flat grey of a morning you
|
||||
# have to explain to a client.
|
||||
bg.inputs[0].default_value = ((0.92, 0.55, 0.32, 1.0) if warm
|
||||
else (0.34, 0.37, 0.41, 1.0))
|
||||
# Low strength on purpose. The world is a huge ambient fill, and at
|
||||
# 1.15 it flooded both cards flat — the sun stopped casting anything
|
||||
# and dawn read as fog. Keep the fill down and let the sun do it.
|
||||
bg.inputs[1].default_value = 0.30 if warm else 0.42
|
||||
|
||||
bpy.ops.object.light_add(type='SUN', location=(-6, -8, 4))
|
||||
sun = _active()
|
||||
sun.data.energy = 7.0 if warm else 2.6
|
||||
sun.data.angle = math.radians(2 if warm else 40) # crisp dawn vs overcast
|
||||
sun.data.color = (1.0, 0.78, 0.52) if warm else (0.82, 0.86, 0.92)
|
||||
sun.rotation_mode = 'XYZ'
|
||||
# Low and raking on the win card: the long shadows are the mood.
|
||||
sun.rotation_euler = ((math.radians(74), 0, math.radians(-52)) if warm
|
||||
else (math.radians(28), 0, math.radians(30)))
|
||||
|
||||
bpy.ops.object.camera_add(location=(0, 0, 0))
|
||||
cam = _active()
|
||||
cam.data.lens = 50
|
||||
scn.camera = cam
|
||||
# IDENTICAL camera on both cards, deliberately. They're a diptych: same
|
||||
# yard, same framing, and the only thing that changed overnight is what
|
||||
# happened to it. A player who sees both reads the difference instantly,
|
||||
# which no amount of headline text would do as fast. Low and close, so
|
||||
# the gnome is the subject; the left third stays empty for Lane A's text.
|
||||
cam.location = (2.00, -2.86, 0.94)
|
||||
cam.rotation_mode = 'XYZ'
|
||||
target = Vector((0.66, -0.42, 0.30))
|
||||
cam.rotation_euler = (target - cam.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
|
||||
os.makedirs(TEXTURES_DIR, exist_ok=True)
|
||||
out_path = os.path.join(TEXTURES_DIR, f"{name}.jpg")
|
||||
scn.render.filepath = out_path
|
||||
bpy.ops.render.render(write_still=True)
|
||||
kb = os.path.getsize(out_path) // 1024
|
||||
print(f" {name}.jpg{' ' * max(1, 18 - len(name))}1200x675, from props, {kb} KB")
|
||||
out.append(out_path)
|
||||
reset_to_empty()
|
||||
return out
|
||||
|
||||
|
||||
def build_grass_atlas():
|
||||
"""4-tuft billboard atlas, 2x2 cells. Drawn with numpy (no PIL in Blender's
|
||||
python) and saved through bpy's image API. Lane A instances quads with this."""
|
||||
@ -1696,6 +1912,7 @@ ASSETS = [
|
||||
dict(name="house_yardside", fn=build_house_yardside,
|
||||
dims=((9.0, 9.5), (0.8, 1.6), (2.8, 3.3)),
|
||||
nodes=["wall", "door", "window", "roof", "fascia", "gutter",
|
||||
"window_glow", "window_light_anchor",
|
||||
"fascia_anchor_01", "fascia_anchor_02", "fascia_anchor_03"]),
|
||||
dict(name="shed_01", fn=build_shed_01,
|
||||
dims=((2.4, 2.7), (1.8, 2.1), (1.95, 2.25)),
|
||||
@ -2058,18 +2275,20 @@ def make_contact_sheet(thumbs):
|
||||
def parse_args():
|
||||
argv = sys.argv
|
||||
argv = argv[argv.index("--") + 1:] if "--" in argv else []
|
||||
only, no_verify, no_debris = None, False, False
|
||||
only, no_verify, no_debris, cards = None, False, False, False
|
||||
if "--only" in argv:
|
||||
only = set(argv[argv.index("--only") + 1].split(","))
|
||||
if "--no-verify" in argv:
|
||||
no_verify = True
|
||||
if "--no-debris" in argv:
|
||||
no_debris = True
|
||||
return only, no_verify, no_debris
|
||||
if "--cards" in argv:
|
||||
cards = True
|
||||
return only, no_verify, no_debris, cards
|
||||
|
||||
|
||||
def main():
|
||||
only, no_verify, no_debris = parse_args()
|
||||
only, no_verify, no_debris, cards = parse_args()
|
||||
print("\n" + "=" * 72)
|
||||
print("SHADES yard asset factory — Lane E")
|
||||
print(f"Blender {bpy.app.version_string} repo: {REPO_ROOT}")
|
||||
@ -2081,6 +2300,9 @@ def main():
|
||||
build_sail_textures()
|
||||
build_pond_textures()
|
||||
build_hail_and_shred_atlases()
|
||||
build_moon_texture()
|
||||
if cards:
|
||||
build_end_cards()
|
||||
debris = [] if no_debris else copy_debris()
|
||||
|
||||
failures = []
|
||||
|
||||
52
web/world/data/storms/storm_02b_icenight.json
Normal file
52
web/world/data/storms/storm_02b_icenight.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "Ice Night",
|
||||
"blurb": "Same front as the wild night, but it stalls overhead and the hail just keeps coming. Cover the bed or lose it.",
|
||||
"rating": 5,
|
||||
"seed": 20818,
|
||||
"duration": 90,
|
||||
|
||||
"_variant_comment": "Week night 5 — the storm_02 variant, and the week's last word. ONE new trick: the hail doesn't stop. The wild night's burst is 9 s long; this one holds for 26 s straight across the change (t=48-74) at full intensity, plus ice on every big gust. Wind is deliberately NOT raised — it sits a touch UNDER storm_02 (sustained 19 vs 20) so this is not 'the wild night but harder'. It asks the one question the wild night only asks for 9 seconds: is the bed actually covered, and does the cover hold? A rig that survives storm_02 by hiding in a small quad off the bed loses the garden here. Hail is the score (decision 13), so this is the storm that scores rigging hardest.",
|
||||
|
||||
"baseCurve": [[0, 7.0], [15, 11.0], [40, 16.5], [60, 19.0], [78, 18.0], [90, 15.0]],
|
||||
|
||||
"gusts": {
|
||||
"firstAt": 3,
|
||||
"minGap": 5.5,
|
||||
"maxGap": 11,
|
||||
"powBase": 3,
|
||||
"powRand": 5,
|
||||
"powRamp": 6.5,
|
||||
"downdraftOfTotal": 0.45
|
||||
},
|
||||
|
||||
"dirCurve": [[0, 0.85], [48, 0.95], [53, 0.6], [57, -1.25], [70, -1.45], [90, -1.35]],
|
||||
"dirWander": { "amp": 0.25, "rate": 0.13 },
|
||||
|
||||
"spatial": { "amp": 0.2, "scale": 11, "advect": 0.5 },
|
||||
|
||||
"events": [
|
||||
{ "t": 36, "type": "debris", "model": "BlueCrate_v2", "lateral": -3.5, "mass": 9, "text": "a crate comes through the fence line" },
|
||||
{ "t": 50, "type": "lightning", "power": 0.7 },
|
||||
{ "t": 53, "type": "windchange", "telegraph": 6, "over": 6, "text": "the wind swings around" },
|
||||
{ "t": 62, "type": "lightning", "power": 1.0 },
|
||||
{ "t": 68, "type": "debris", "model": "WoodenBin_v2", "lateral": -1.0, "mass": 14, "text": "the neighbour's bin lets go" },
|
||||
{ "t": 80, "type": "lightning", "power": 0.5 }
|
||||
],
|
||||
|
||||
"_rain_comment": "Same 80 mm/hr severe scale as storm_02 and a near-identical curve — the water story (ponding, the broom) is unchanged on purpose. The variant's whole difference is the ice.",
|
||||
|
||||
"rain": { "peakMmPerHour": 80, "curve": [[0, 0], [10, 0.25], [35, 0.6], [55, 0.85], [70, 1.0], [90, 0.7]] },
|
||||
|
||||
"_hail_comment": "The trick, and it is TUNED not maxed. storm_02 hails ~11.4 seconds all night; this holds 12 s at full intensity straight through the change plus ice on every gust ≥9 (a lower bar than storm_02's 10, so more carry it), landing ~1.6x storm_02's hail-seconds with size 1.4 stones. The first draft ran a 26 s hold for 32 hail-seconds — 2.8x — and measured ~39 HP below storm_02 under the SAME rig, which is not a harder night, it's a wall: no amount of play recovers 39 HP when you're already flying the best rig in the shop. 1.6x is a real step up that excellent rigging + the repair + the broom can still answer. Winnability across all five nights is balance.test.js's job (B holds the pen) — these variants need to be in its storm list.",
|
||||
|
||||
"hail": {
|
||||
"size": 1.4,
|
||||
"withGustsAbove": 9,
|
||||
"gustBurstIntensity": 0.9,
|
||||
"bursts": [
|
||||
{ "t": 50, "ramp": 2, "hold": 12, "fade": 3, "intensity": 1.0 }
|
||||
]
|
||||
},
|
||||
|
||||
"sky": { "darkness": 0.94, "cloudScroll": 0.09, "night": true, "lightningGustPow": 10 }
|
||||
}
|
||||
45
web/world/data/storms/storm_03b_earlybuster.json
Normal file
45
web/world/data/storms/storm_03b_earlybuster.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "Early Buster",
|
||||
"blurb": "The change comes through before you've finished your coffee. Same southerly, half the warning.",
|
||||
"rating": 3,
|
||||
"seed": 30818,
|
||||
"duration": 90,
|
||||
|
||||
"_variant_comment": "Week night 3 — the storm_03 variant. ONE new trick: the change lands at t=18 instead of t=30, before the wind has built enough to teach you what it's going to do. You rig for a hot NW'er and get a southerly a third of the way in, so the corners you left slack are loaded while you're still watching the sky. Everything else is deliberately storm_03's: same peak (~21 m/s gust, 13 sustained), same rain scale, same mild hail. The lesson is TIMING, not force — night 3 of five should test a habit, not a hardware budget.",
|
||||
|
||||
"baseCurve": [[0, 5.0], [10, 8.0], [22, 11.0], [45, 13.0], [65, 12.5], [90, 10.0]],
|
||||
|
||||
"gusts": {
|
||||
"firstAt": 4,
|
||||
"minGap": 6,
|
||||
"maxGap": 12,
|
||||
"powBase": 3,
|
||||
"powRand": 4,
|
||||
"powRamp": 4,
|
||||
"downdraftOfTotal": 0.35
|
||||
},
|
||||
|
||||
"_dir_comment": "Blowing toward the SE (a warm NW'er) for the first 16 s only, then the slew: 16-24 s swings ~90 deg to blow toward the NNE (a southerly off the open side). storm_03 gives you 30 s to read it; this gives you 16.",
|
||||
|
||||
"dirCurve": [[0, 0.8], [16, 0.85], [18, 0.5], [24, -0.7], [50, -0.85], [90, -0.75]],
|
||||
"dirWander": { "amp": 0.3, "rate": 0.11 },
|
||||
|
||||
"spatial": { "amp": 0.18, "scale": 11, "advect": 0.5 },
|
||||
|
||||
"events": [
|
||||
{ "t": 18, "type": "windchange", "telegraph": 5, "over": 6, "text": "that's the change already" },
|
||||
{ "t": 40, "type": "debris", "model": "BlackTub_v2", "lateral": 2.5, "mass": 5, "text": "a tub skitters across the lawn" },
|
||||
{ "t": 58, "type": "lightning", "power": 0.4 }
|
||||
],
|
||||
|
||||
"rain": { "peakMmPerHour": 30, "curve": [[0, 0], [16, 0.05], [22, 0.4], [50, 0.55], [80, 0.3], [90, 0.15]] },
|
||||
|
||||
"hail": {
|
||||
"size": 0.7,
|
||||
"bursts": [
|
||||
{ "t": 24, "ramp": 1.5, "hold": 3, "fade": 2, "intensity": 0.5 }
|
||||
]
|
||||
},
|
||||
|
||||
"sky": { "darkness": 0.55, "cloudScroll": 0.06, "night": true }
|
||||
}
|
||||
@ -54,35 +54,129 @@ const STORMS = ['storm_01_gentle', 'storm_03_southerly', 'storm_02_wildnight'];
|
||||
*/
|
||||
const GARDEN_DRAIN = 0.9;
|
||||
|
||||
/**
|
||||
* Decision 13's weights. Hail is what actually kills a garden and cloth honestly
|
||||
* stops it (stones fall ≤20° off vertical; rain leans 73° in a gale and walks
|
||||
* straight under the sail — Lane C's numbers). Rain is demoted to a drizzle of
|
||||
* damage so the night still costs you something when it isn't hailing.
|
||||
*
|
||||
* SPRINT6 gate 1 lists these first among the balance levers.
|
||||
*/
|
||||
const HAIL_WEIGHT = 5.0;
|
||||
const RAIN_WEIGHT = 0.25;
|
||||
|
||||
/**
|
||||
* The garden: the thing you are actually protecting, and the only score that
|
||||
* matters. Deliberately not inside hud.js — the HUD reads, it doesn't decide.
|
||||
*
|
||||
* It keeps its damage split by CAUSE, and that isn't bookkeeping for its own
|
||||
* sake: the aftermath verdict is the game's entire feedback channel, and a
|
||||
* verdict that guesses teaches the wrong lesson. A garden that only knows it
|
||||
* went from 100 to 39 cannot tell a player whether their hardware let go or
|
||||
* their perfectly-held sail simply wasn't over the bed — and those are opposite
|
||||
* mistakes with opposite fixes.
|
||||
*/
|
||||
function createGarden(world) {
|
||||
let hp = 100;
|
||||
let state = 'full';
|
||||
let byHail = 0;
|
||||
let byRain = 0;
|
||||
|
||||
return {
|
||||
get hp() { return hp; },
|
||||
get state() { return state; },
|
||||
reset() { hp = 100; state = 'full'; world.setPlants('full'); },
|
||||
/** HP lost to each cause this run. The verdict reads these. */
|
||||
get damage() { return { hail: byHail, rain: byRain }; },
|
||||
|
||||
reset() { hp = 100; state = 'full'; byHail = 0; byRain = 0; world.setPlants('full'); },
|
||||
|
||||
/**
|
||||
* @param {number} dt
|
||||
* @param {number} exposure 0..1 — how hard the bed is being hit right now.
|
||||
* 0 = nothing reaching it (no weather, or cloth is over it); 1 = taking it
|
||||
* full in the open. Lane C's sky.gardenExposure() computes it.
|
||||
* Decision 13, and the two terms stay SEPARATE on the way in rather than
|
||||
* being pre-summed by the caller — that sum is exactly the information the
|
||||
* verdict needs and can never recover afterwards.
|
||||
*
|
||||
* SPRINT5 decision 13 lands here and nowhere else: garden damage becomes
|
||||
* hail exposure + a small rain drain, so this stays one number and the
|
||||
* only change is which helper(s) feed it.
|
||||
* @param {number} dt
|
||||
* @param {number} hail 0..1 sky.gardenHailExposure(bed, t)
|
||||
* @param {number} rain 0..1 sky.gardenExposure(bed, t)
|
||||
*/
|
||||
step(dt, exposure) {
|
||||
if (exposure > 0) hp = Math.max(0, hp - GARDEN_DRAIN * exposure * dt);
|
||||
step(dt, hail, rain) {
|
||||
const dHail = HAIL_WEIGHT * hail * GARDEN_DRAIN * dt;
|
||||
const dRain = RAIN_WEIGHT * rain * GARDEN_DRAIN * dt;
|
||||
const total = Math.min(hp, dHail + dRain);
|
||||
if (total > 0) {
|
||||
// Attribute proportionally, so the split still adds up on the last tick
|
||||
// when the garden bottoms out at 0 mid-step.
|
||||
const scale = total / (dHail + dRain);
|
||||
byHail += dHail * scale;
|
||||
byRain += dRain * scale;
|
||||
hp -= total;
|
||||
}
|
||||
const next = hp > 66 ? 'full' : hp > 33 ? 'tattered' : 'dead';
|
||||
if (next !== state) { state = next; world.setPlants(next); }
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Why the night went the way it did — read from what ACTUALLY happened.
|
||||
*
|
||||
* This is the whole of the game's feedback channel, and it was lying: any run
|
||||
* ending under 50 read "the rain found what you skimped on", including a run
|
||||
* that held 4/4 corners and skimped on nothing. That is not a typo-grade bug.
|
||||
* DESIGN.md wants every disaster to replay in the player's head as "…the
|
||||
* shackle, I knew about the shackle" — a verdict that blames the wrong thing
|
||||
* teaches the opposite of the lesson the storm just spent 90 seconds giving.
|
||||
*
|
||||
* So: pick from the failure modes the run can prove, in the order the player
|
||||
* most needs to hear them. The two garden losses are deliberately different
|
||||
* sentences, because they are opposite mistakes — hardware you under-bought
|
||||
* versus a rig that held perfectly and simply wasn't over the bed.
|
||||
*
|
||||
* @returns {{verdict: string, mode: string}}
|
||||
*/
|
||||
export function verdictFor({ hp, lost, win, dmg, pondPeak, pondDumped }) {
|
||||
const worst = lost.length
|
||||
? lost.reduce((a, c) => (a && a.hw.rating <= c.hw.rating ? a : c))
|
||||
: null;
|
||||
const named = worst ? `${worst.hw.name} at ${worst.anchorId.toUpperCase()}` : '';
|
||||
const hailKilled = dmg.hail > dmg.rain;
|
||||
|
||||
if (lost.length >= 2) {
|
||||
return { mode: 'cascade',
|
||||
verdict: `THE SAIL LOST. The ${named} went first — and took ${lost.length - 1} more with it.` };
|
||||
}
|
||||
if (lost.length === 1 && !win) {
|
||||
return { mode: 'corner',
|
||||
verdict: `THE SAIL LOST. One corner short: the ${named} let go.` };
|
||||
}
|
||||
if (!win && hailKilled) {
|
||||
// The lesson the old verdict destroyed. Every corner held; the rig was
|
||||
// simply not over the thing it was paid to protect.
|
||||
return { mode: 'uncovered',
|
||||
verdict: 'THE GARDEN IS GONE — and every corner held. The hail fell where your sail wasn\'t.' };
|
||||
}
|
||||
if (!win) {
|
||||
return { mode: 'rain',
|
||||
verdict: 'THE GARDEN IS GONE. Not dramatic — just a long night of rain on open ground.' };
|
||||
}
|
||||
if (pondDumped > 50) {
|
||||
return { mode: 'broomed',
|
||||
verdict: `THE GARDEN MADE IT. You put ${Math.round(pondDumped)} kg of water on your own head to do it.` };
|
||||
}
|
||||
if (pondPeak > 80) {
|
||||
return { mode: 'ponded',
|
||||
verdict: 'THE GARDEN MADE IT — with a belly full of water. That flat spot will find you.' };
|
||||
}
|
||||
if (lost.length === 1) {
|
||||
return { mode: 'held-one-down',
|
||||
verdict: `THE GARDEN MADE IT. The ${named} let go and the rest carried it.` };
|
||||
}
|
||||
if (hp >= 85) {
|
||||
return { mode: 'clean', verdict: 'THE GARDEN MADE IT — not a leaf out of place.' };
|
||||
}
|
||||
return { mode: 'mostly', verdict: 'THE GARDEN MADE IT. Mostly.' };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Phase machine
|
||||
// ---------------------------------------------------------------------------
|
||||
@ -435,6 +529,9 @@ export async function boot(opts = {}) {
|
||||
const s = rigging.summary;
|
||||
const hp = garden.hp;
|
||||
const win = hp >= 50 && lost.length < 2;
|
||||
const dmg = garden.damage;
|
||||
const { verdict, mode } = verdictFor({ hp, lost, win, dmg, pondPeak, pondDumped });
|
||||
|
||||
return {
|
||||
hp,
|
||||
cornersLost: lost.length,
|
||||
@ -446,13 +543,33 @@ export async function boot(opts = {}) {
|
||||
subtitle: lost.length
|
||||
? `${lost.map((c) => `${c.hw.name} at ${c.anchorId.toUpperCase()}`).join(', ')} let go.`
|
||||
: 'Every corner held.',
|
||||
verdict: hp >= 85 && !lost.length ? 'THE GARDEN MADE IT — not a leaf out of place.'
|
||||
: win ? 'THE GARDEN MADE IT. Mostly.'
|
||||
: hp < 50 ? 'THE GARDEN IS GONE. The rain found what you skimped on.'
|
||||
: 'THE SAIL LOST. Warranty callout in the rain for you.',
|
||||
/** Decision 13's headline: how much of the bed's damage the cloth stopped. */
|
||||
hailBlocked: dmg.hail + dmg.rain > 0
|
||||
? `${Math.round(dmg.hail)} HP to hail, ${Math.round(dmg.rain)} to rain`
|
||||
: 'Nothing reached the bed.',
|
||||
pondPeak,
|
||||
pondDumped,
|
||||
verdict,
|
||||
/** Which failure mode the verdict is speaking from. Asserted in a.test.js. */
|
||||
verdictMode: mode,
|
||||
};
|
||||
}
|
||||
|
||||
// --- the night's evidence ------------------------------------------------
|
||||
// What the sail carried and what the player took on the head, so the verdict
|
||||
// can point at things that actually happened rather than infer from the score.
|
||||
let pondPeak = 0;
|
||||
let pondDumped = 0;
|
||||
|
||||
// Subscribed once: rigSail() calls attach() on the same rig object, so the
|
||||
// Emitter survives a re-rig. Lane B tags a dump with `reason` when the water
|
||||
// left because something failed (corner break, belly tear) and leaves it off
|
||||
// when the player poked it out with the broom — which is the difference
|
||||
// between "the sail lost its water" and "you wore it".
|
||||
rig.events.on('pondDump', (e) => {
|
||||
if (!e.reason) pondDumped += e.kg;
|
||||
});
|
||||
|
||||
// --- phases -------------------------------------------------------------
|
||||
game.on('phaseChange', ({ to }) => {
|
||||
// Prep and forecast happen on the calm day; the storm you picked only
|
||||
@ -462,6 +579,8 @@ export async function boot(opts = {}) {
|
||||
events.length = 0;
|
||||
rigging.setActive(to === 'prep');
|
||||
|
||||
if (to === 'storm') { pondPeak = 0; pondDumped = 0; }
|
||||
|
||||
if (to === 'forecast') {
|
||||
garden.reset();
|
||||
resetRig();
|
||||
@ -554,7 +673,16 @@ export async function boot(opts = {}) {
|
||||
// ~10 to rain, while a bed-covering rig cuts the hail term ~4.4×.
|
||||
const rainExp = sky?.gardenExposure ? sky.gardenExposure(world.gardenBed, windT) : 0;
|
||||
const hailExp = sky?.gardenHailExposure ? sky.gardenHailExposure(world.gardenBed, windT) : 0;
|
||||
garden.step(dt, hailExp * 5.0 + rainExp * 0.25);
|
||||
// Passed separately, not pre-summed: the split is what makes the verdict
|
||||
// able to tell "your hardware went" from "your sail wasn't over the bed".
|
||||
garden.step(dt, hailExp, rainExp);
|
||||
|
||||
// Pond evidence for the aftermath. Peak is what the sail carried at its
|
||||
// worst; dumped is what the player took on the head with the broom. Both
|
||||
// are things the verdict can honestly point at.
|
||||
if (typeof rig.pondMass === 'function') {
|
||||
pondPeak = Math.max(pondPeak, rig.pondMass());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,10 +60,42 @@ export class Suite {
|
||||
this.results = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* A test passes by returning, fails by throwing, and SKIPS by returning a
|
||||
* string that starts with 'SKIPPED'.
|
||||
*
|
||||
* That last clause is not sugar — it is a repair. This method used to ignore
|
||||
* its return value entirely, so a test that did
|
||||
* if (!ok) return `SKIPPED — harness dispute: ...`;
|
||||
* was recorded as a PASS. Two suites had already been written that way (the
|
||||
* integrator's storm_02 skip at the Sprint-6 merge, and a storm_01 one), which
|
||||
* means main has been reporting green on asserts that were neither passing nor
|
||||
* skipping — they returned a message and the suite called it a win. `skip: 0`
|
||||
* in every report we ever printed was the tell, and nobody read it, including
|
||||
* me: I misread one of those fake passes as my own win reproducing.
|
||||
*
|
||||
* It's the same disease as the wind router swallowing rainMmPerHour — a
|
||||
* mechanism that looks wired and silently isn't — and it lived in the harness
|
||||
* every lane trusts. A skip must be visible or it is a lie with good manners.
|
||||
*/
|
||||
test(label, fn) {
|
||||
const t0 = performance.now();
|
||||
try {
|
||||
fn();
|
||||
const out = fn();
|
||||
if (typeof out === 'string' && out.startsWith('SKIPPED')) {
|
||||
this.results.push({
|
||||
lane: this.lane, label, status: 'skip',
|
||||
err: out.replace(/^SKIPPED\s*[—-]?\s*/, ''), ms: performance.now() - t0,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (out && typeof out.then === 'function') {
|
||||
// An async fn hands back a Promise that cannot throw synchronously, so
|
||||
// this would pass forever while proving nothing. Lane B called this out
|
||||
// in balance.test.js's header; make it impossible rather than a warning.
|
||||
throw new Error(`test "${label}" is async — Suite.test() cannot await it. ` +
|
||||
`Do the awaiting in run() and assert synchronously.`);
|
||||
}
|
||||
this.results.push({ lane: this.lane, label, status: 'pass', ms: performance.now() - t0 });
|
||||
} catch (err) {
|
||||
this.results.push({
|
||||
|
||||
@ -7,7 +7,7 @@ import * as THREE from '../../vendor/three.module.js';
|
||||
import { FIXED_DT, STORM_LEN, YARD, checkContract, createStubWind } from '../contracts.js';
|
||||
import { createWorld, heightAt } from '../world.js';
|
||||
import { createCameraRig } from '../camera.js';
|
||||
import { createGame, createWindRouter } from '../main.js';
|
||||
import { createGame, createWindRouter, verdictFor } from '../main.js';
|
||||
import { orderRing } from '../sail.js';
|
||||
import { loadStorm, createWind } from '../weather.js';
|
||||
import { assert, assertEq, assertLess, fixedLoop } from '../testkit.js';
|
||||
@ -52,8 +52,15 @@ export default async function run(t) {
|
||||
});
|
||||
|
||||
// --- the wind router -----------------------------------------------------
|
||||
// Loaded HERE, not inside t.test(). These two were written `async` and
|
||||
// Suite.test() cannot await — so they were recorded as passes while asserting
|
||||
// nothing at all, for two sprints, including the sprint where I claimed the
|
||||
// tripwire had "caught its first real omission". It had: in a hand-run probe,
|
||||
// not in the suite. runAll DOES await run(), so awaiting belongs out here.
|
||||
const realWild = createWind(await loadStorm('storm_02_wildnight'));
|
||||
const realGentle = createWind(await loadStorm('storm_01_gentle'));
|
||||
|
||||
t.test('wind router forwards EVERYTHING the real wind exposes', async () => {
|
||||
t.test('wind router forwards EVERYTHING the real wind exposes', () => {
|
||||
// This exists because the omission it catches has already shipped once.
|
||||
//
|
||||
// Lane C added rainMmPerHour/rainDepthMm for ponding; main.js's router — a
|
||||
@ -68,7 +75,7 @@ export default async function run(t) {
|
||||
// garden all over again, which is the exact thing this sprint exists to fix.
|
||||
// Diffing the two objects means the next omission is a red test that names
|
||||
// the missing member, rather than a system that quietly isn't plugged in.
|
||||
const real = createWind(await loadStorm('storm_02_wildnight'));
|
||||
const real = realWild;
|
||||
const router = createWindRouter([real]);
|
||||
|
||||
const missing = Object.keys(real).filter((k) => !(k in router));
|
||||
@ -81,11 +88,11 @@ export default async function run(t) {
|
||||
assert(wrongType.length === 0, `router has ${wrongType.join(', ')} but not as callable(s)`);
|
||||
});
|
||||
|
||||
t.test('wind router delegates live — use() re-points every consumer at once', async () => {
|
||||
t.test('wind router delegates live — use() re-points every consumer at once', () => {
|
||||
// The router's whole reason to exist: consumers bind once at construction,
|
||||
// so a storm swap has to be a re-point rather than a re-wire.
|
||||
const gentle = createWind(await loadStorm('storm_01_gentle'));
|
||||
const wild = createWind(await loadStorm('storm_02_wildnight'));
|
||||
const gentle = realGentle;
|
||||
const wild = realWild;
|
||||
const router = createWindRouter([gentle, wild]);
|
||||
const at = new THREE.Vector3(0, 0, 0);
|
||||
|
||||
@ -97,6 +104,68 @@ export default async function run(t) {
|
||||
assertEq(router.def, wild.def, 'def follows the active storm (skyfx reads it at construction)');
|
||||
});
|
||||
|
||||
// --- verdicts tell the truth (SPRINT6 gate 1) ----------------------------
|
||||
|
||||
t.test('a run that held every corner is never told it skimped', () => {
|
||||
// The bug this pins shipped and was caught by playing, not by asserting:
|
||||
// any run under 50 hp read "the rain found what you skimped on", including
|
||||
// Lane B's twisted quad that held 4/4 and skimped on nothing. The verdict is
|
||||
// the game's whole feedback channel — DESIGN.md wants every disaster to
|
||||
// replay as "…the shackle, I knew about the shackle", and blaming the wrong
|
||||
// thing teaches the exact opposite of the lesson the storm just gave.
|
||||
const heldAll = verdictFor({
|
||||
hp: 39, lost: [], win: false,
|
||||
dmg: { hail: 48, rain: 13 }, pondPeak: 0, pondDumped: 0,
|
||||
});
|
||||
assertEq(heldAll.mode, 'uncovered',
|
||||
'a 4/4 hold that lost the garden to hail is a COVERAGE failure, not a hardware one');
|
||||
assert(!/skimp/i.test(heldAll.verdict),
|
||||
`verdict accused a player who broke nothing of skimping: "${heldAll.verdict}"`);
|
||||
assert(/held/i.test(heldAll.verdict),
|
||||
`verdict should credit the corners that held: "${heldAll.verdict}"`);
|
||||
});
|
||||
|
||||
t.test('verdict names the weakest link that actually let go', () => {
|
||||
// "…the shackle. I knew about the shackle." The whole point is that the
|
||||
// player recognises the corner they gambled on.
|
||||
const carabiner = { anchorId: 'p1', hw: { name: 'carabiner', rating: 1200, cost: 5 } };
|
||||
const shackle = { anchorId: 'h3', hw: { name: 'shackle', rating: 3200, cost: 15 } };
|
||||
|
||||
const cascade = verdictFor({
|
||||
hp: 20, lost: [shackle, carabiner], win: false,
|
||||
dmg: { hail: 60, rain: 20 }, pondPeak: 0, pondDumped: 0,
|
||||
});
|
||||
assertEq(cascade.mode, 'cascade');
|
||||
assert(/carabiner at P1/.test(cascade.verdict),
|
||||
`a cascade must name the WEAKEST link as going first, not whichever was listed first: "${cascade.verdict}"`);
|
||||
|
||||
const single = verdictFor({
|
||||
hp: 30, lost: [shackle], win: false,
|
||||
dmg: { hail: 60, rain: 10 }, pondPeak: 0, pondDumped: 0,
|
||||
});
|
||||
assertEq(single.mode, 'corner');
|
||||
assert(/shackle at H3/.test(single.verdict), `should name it: "${single.verdict}"`);
|
||||
});
|
||||
|
||||
t.test('verdict distinguishes the two ways a garden dies', () => {
|
||||
// Opposite mistakes, opposite fixes: under-bought hardware vs a rig that
|
||||
// held perfectly over the wrong patch of grass. One sentence each.
|
||||
const hailed = verdictFor({ hp: 20, lost: [], win: false, dmg: { hail: 70, rain: 10 }, pondPeak: 0, pondDumped: 0 });
|
||||
const rained = verdictFor({ hp: 20, lost: [], win: false, dmg: { hail: 0, rain: 80 }, pondPeak: 0, pondDumped: 0 });
|
||||
assertEq(hailed.mode, 'uncovered');
|
||||
assertEq(rained.mode, 'rain');
|
||||
assert(hailed.verdict !== rained.verdict, 'hail and rain deaths must not read identically');
|
||||
});
|
||||
|
||||
t.test('a clean hold reads as a clean hold, and the broom gets its credit', () => {
|
||||
const clean = verdictFor({ hp: 96, lost: [], win: true, dmg: { hail: 2, rain: 2 }, pondPeak: 0, pondDumped: 0 });
|
||||
assertEq(clean.mode, 'clean');
|
||||
|
||||
const broomed = verdictFor({ hp: 70, lost: [], win: true, dmg: { hail: 20, rain: 10 }, pondPeak: 400, pondDumped: 380 });
|
||||
assertEq(broomed.mode, 'broomed', 'wearing 380 kg of water to save the rig should be the story');
|
||||
assert(/380 kg/.test(broomed.verdict), `say what it cost: "${broomed.verdict}"`);
|
||||
});
|
||||
|
||||
// --- camera --------------------------------------------------------------
|
||||
|
||||
t.test('camera keeps a clear line to the player from every angle', () => {
|
||||
@ -172,11 +241,11 @@ export default async function run(t) {
|
||||
|
||||
// --- anchors -------------------------------------------------------------
|
||||
|
||||
t.test('yard offers 11 anchors: 3 house, 5 tree, 3 post', () => {
|
||||
t.test('yard offers 12 anchors: 3 house, 5 tree, 4 post', () => {
|
||||
const by = (type) => world.anchors.filter((a) => a.type === type).length;
|
||||
assertEq(by('house'), 3, 'house anchors');
|
||||
assertEq(by('tree'), dressed ? 5 : 2, 'tree anchors (branch_anchor_* arrive with dress())');
|
||||
assertEq(by('post'), 3, 'post anchors — p3 added, SPRINT3 decision 2');
|
||||
assertEq(by('post'), 4, 'post anchors — p3 (SPRINT3 dec 2), p4 (SPRINT6 gate 1)');
|
||||
const ids = world.anchors.map((a) => a.id);
|
||||
assertEq(new Set(ids).size, ids.length, `anchor ids not unique: ${ids}`);
|
||||
});
|
||||
|
||||
297
web/world/js/tests/balance.test.js
Normal file
297
web/world/js/tests/balance.test.js
Normal file
@ -0,0 +1,297 @@
|
||||
/**
|
||||
* balance.test.js — is the game FAIR? [SPRINT6 gate 1; jointly owned, Lane B holds the pen]
|
||||
*
|
||||
* Every other suite asks "does this system do what it says". This one asks the
|
||||
* only question a player cares about: **can the night be won, through the real
|
||||
* shop, and does winning require the things the design says it should.**
|
||||
*
|
||||
* It is deliberately a browser suite. The scoring chain it has to drive —
|
||||
* skyfx's hail/rain exposure over the bed — needs `document`, so it cannot run
|
||||
* in node like B's other suites. Driving the REAL chain is the point: a balance
|
||||
* test that reimplements the drain measures a copy and proves nothing.
|
||||
*
|
||||
* The shape of every assert here is:
|
||||
* 1. build a loadout through RiggingSession, so the $80 shop is real money;
|
||||
* 2. fly the real storm JSON over an in-band quad from the real yard;
|
||||
* 3. integrate the real exposure helpers into the real garden drain;
|
||||
* 4. judge with main.js's own win rule (hp >= 50 && corners lost < 2).
|
||||
*
|
||||
* Measured 2026-07-18 on merged main (weights hail 5.0 / rain 0.25, drain 0.9,
|
||||
* downdraftOfTotal 0.45). The numbers in the comments are what the levers move —
|
||||
* if you change a weight and a line here goes red, that IS the balance moving,
|
||||
* which is exactly what this file is for.
|
||||
*/
|
||||
|
||||
import * as THREE from '../../vendor/three.module.js';
|
||||
import { RiggingSession } from '../rigging.js';
|
||||
import { SailRig } from '../sail.js';
|
||||
import { createSkyFx } from '../skyfx.js';
|
||||
import { createWind, loadStorm } from '../weather.js';
|
||||
import { HARDWARE, FIXED_DT, START_BUDGET } from '../contracts.js';
|
||||
|
||||
const [CARABINER, SHACKLE, RATED] = HARDWARE;
|
||||
|
||||
/** main.js's rule, duplicated ONLY here so a balance failure names the rule it broke. */
|
||||
const WIN = (hp, lost) => hp >= 50 && lost < 2;
|
||||
const GARDEN_DRAIN = 0.9; // main.js
|
||||
const W_HAIL = 5.0; // main.js, decision 13 — integration weights
|
||||
const W_RAIN = 0.25;
|
||||
|
||||
/**
|
||||
* The yard is READ FROM world.js, never copied.
|
||||
*
|
||||
* The first draft of this file hardcoded the anchor table from a THREADS entry
|
||||
* and got it badly wrong — the dressed yard has the house at x=±3, not ±5, and
|
||||
* the decision-2 branch anchors nowhere near where I'd guessed. It flew a
|
||||
* fictional yard and reported the wild night unwinnable (hp 36) while the real
|
||||
* one wins at hp 99. That is the same failure as Sprint 3's 16.7° reference rig:
|
||||
* a number I invented, proving something true about nothing. A balance suite in
|
||||
* particular cannot afford it — the yard IS the balance. So: build the real
|
||||
* world, take its anchors, and freeze only the sway.
|
||||
*
|
||||
* Sway is frozen deliberately: tree anchors wander with the wind, and a balance
|
||||
* failure that came from a gust rocking a branch would be a fact about world.js,
|
||||
* not about whether the shop can buy a winnable rig.
|
||||
*/
|
||||
async function buildYard() {
|
||||
const THREE = await import('../../vendor/three.module.js');
|
||||
const { createWorld } = await import('../world.js');
|
||||
const scene = new THREE.Scene();
|
||||
const calm = {
|
||||
sample: (p, t, o) => (o || new THREE.Vector3()).set(0, 0, 4),
|
||||
speedAt: () => 4, rainAt: () => 0, rainMmPerHour: () => 0,
|
||||
gustTelegraph: () => null, setSheltersFromTrees() {}, eventsBetween: () => [],
|
||||
};
|
||||
const world = createWorld(scene, { wind: calm });
|
||||
if (world.dress) { try { await world.dress(); } catch { /* graybox anchors are enough */ } }
|
||||
const anchors = world.anchors.map((a) => {
|
||||
const pos = { x: a.pos.x, y: a.pos.y, z: a.pos.z };
|
||||
return { id: a.id, type: a.type, pos, sway: () => pos };
|
||||
});
|
||||
return { anchors, bed: world.gardenBed, heightAt: world.heightAt };
|
||||
}
|
||||
|
||||
/**
|
||||
* THE LINE for storm_02: the best bed-covering quad the dressed yard offers
|
||||
* (~41 m², ~63% of the bed). Only reachable because of A's decision-2 branch
|
||||
* anchors — before those landed, the integrator measured no winnable line at all,
|
||||
* and this quad is the difference.
|
||||
*/
|
||||
// Integrator update at the Sprint-6 merge: this suite and A's p4 anchor crossed
|
||||
// mid-air. The quad below was the best PRE-p4 cover and its p1 corner pulls
|
||||
// 7.4 kN — unholdable at any price (B's own blocker analysis, kept in THREADS).
|
||||
// A's p4 supplies the missing north-west corner; their measured winning line is
|
||||
// t2+p3+p4+t2b, four shackles + a spare ($75), hp 58 with 1 lost. That line is
|
||||
// what THE LINE now flies. The old quad stays as the geometry control below.
|
||||
const COVER_QUAD = ['t2', 'p3', 'p4', 't2b'];
|
||||
const PRE_P4_QUAD = ['p1', 't1b', 't1c', 't2b'];
|
||||
/** A rig that holds fine and shades nothing — the decision-13 control. */
|
||||
const MISS_QUAD = ['h1', 'h2', 'h3', 't1'];
|
||||
|
||||
/** Buy a loadout through the real shop. Returns null if $80 doesn't stretch to it. */
|
||||
function shop(yard, ids, hw, spares = 0, tension = 0.9) {
|
||||
const s = new RiggingSession({ anchors: yard.anchors });
|
||||
for (const id of ids) if (!s.rig(id).ok) return null;
|
||||
for (let i = 0; i < ids.length; i++) if (!s.setHardware(ids[i], hw[i]).ok) return null;
|
||||
if (spares && !s.setSpares(spares).ok) return null;
|
||||
s.setTension(tension);
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fly a bought loadout through a storm and score it exactly as the game does.
|
||||
* @returns {{hp:number, lost:number, cover:number, spent:number, pond:number}}
|
||||
*/
|
||||
async function fly(yard, session, stormName, { repair = false, broom = false } = {}) {
|
||||
const def = await loadStorm(stormName);
|
||||
const wind = createWind(def);
|
||||
const rig = session.commit(new SailRig({ anchors: yard.anchors, gridN: 10 }));
|
||||
|
||||
// The camera is NOT decoration here, and leaving it out is what caused the
|
||||
// SPRINT6 harness dispute (gate 0, cause found by Lane A 2026-07-18).
|
||||
//
|
||||
// skyfx.step() opens with `if (!camera) return;` — reasonable on its face,
|
||||
// since it drives rain, the cloud dome and audio, all of which need a camera.
|
||||
// But the hail/rain SHADOW GRIDS are rebuilt inside that same step(). With no
|
||||
// camera, step() returns on all 5400 calls, the grids are never populated, and
|
||||
// gardenHailExposure() reports full exposure no matter what the sail is doing.
|
||||
//
|
||||
// Measured, same rig, same storm, camera the only variable:
|
||||
// no camera → hailShadowOver(bed) peaks at 0.000, hp 36
|
||||
// camera → hailShadowOver(bed) peaks at 1.000, hp 69
|
||||
// hp 36 is the BARE-BED number. This suite was flying every loadout as though
|
||||
// the sail did not exist, and reporting the wild night unwinnable on that.
|
||||
//
|
||||
// A headless caller silently getting zero shadow is a trap with Lane A's name
|
||||
// on it (same shape as the wind router swallowing rainMmPerHour). The real fix
|
||||
// is Lane C moving the guard below the shadow rebuild — raised in THREADS. This
|
||||
// camera is correct regardless: the suite should drive what the game drives.
|
||||
const camera = new THREE.PerspectiveCamera(60, 1.6, 0.1, 400);
|
||||
camera.position.set(0, 2, 8);
|
||||
const sky = createSkyFx({ wind, night: true, camera });
|
||||
|
||||
// main.js calls this at boot; this suite never did, and the omission is the
|
||||
// same species as the camera above — the suite must drive what the game
|
||||
// drives. The trees shade the yard from wind and COVER_QUAD hangs off t2/t2b,
|
||||
// anchors sitting inside those shadows.
|
||||
wind.setSheltersFromTrees(yard.anchors.filter((a) => a.type === 'tree'));
|
||||
|
||||
let hp = 100, pond = 0, used = 0;
|
||||
const steps = Math.round(def.duration / FIXED_DT);
|
||||
for (let i = 0; i < steps; i++) {
|
||||
const t = i * FIXED_DT;
|
||||
rig.step(FIXED_DT, wind, t);
|
||||
sky.step(FIXED_DT, t, { sail: rig });
|
||||
|
||||
// main.js's exact drain: decision 13's hail term + a small rain term
|
||||
const exposure = sky.gardenHailExposure(yard.bed, t) * W_HAIL + sky.gardenExposure(yard.bed, t) * W_RAIN;
|
||||
if (exposure > 0) hp = Math.max(0, hp - GARDEN_DRAIN * exposure * FIXED_DT);
|
||||
|
||||
const m = rig.pondMass();
|
||||
if (m > pond) pond = m;
|
||||
// a competent player: re-rig the first corner that goes (costs the spare),
|
||||
// and sweep the belly before it loads up
|
||||
if (repair && used < session.spares) {
|
||||
const k = rig.corners.findIndex((c) => c.broken);
|
||||
if (k >= 0) { rig.repair(k); used++; }
|
||||
}
|
||||
if (broom && m > 250) {
|
||||
const c = rig.pondCentroid();
|
||||
if (c) rig.drainPondAt(c.node, FIXED_DT, 3);
|
||||
}
|
||||
}
|
||||
sky.dispose?.();
|
||||
return {
|
||||
hp: Math.round(hp),
|
||||
lost: rig.corners.filter((c) => c.broken).length,
|
||||
spent: START_BUDGET - session.budget,
|
||||
pond: Math.round(pond),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('../testkit.js').Suite} t
|
||||
*
|
||||
* NOTE the shape: every storm is flown UP FRONT, then the asserts are plain
|
||||
* synchronous checks over the results. `Suite.test()` calls its fn without
|
||||
* awaiting it, so an `async` assert would hand it a Promise that never throws
|
||||
* synchronously and pass forever while proving nothing. `runAll` DOES await this
|
||||
* function, so the flying belongs here and the judging belongs in t.test().
|
||||
*/
|
||||
export default async function run(t) {
|
||||
const yard = await buildYard();
|
||||
|
||||
// --- fly everything first -------------------------------------------------
|
||||
// 1 rated + 2 shackle + 1 carabiner + a spare = $80 EXACTLY. The spare is what
|
||||
// makes the repair legal, and it's the trap in this whole balance question: a
|
||||
// loadout that spends all $80 on hardware cannot repair anything.
|
||||
// A's measured line: four shackles + a spare = $75 (THREADS gate-1 entry).
|
||||
const lineShop = shop(yard, COVER_QUAD, [SHACKLE, SHACKLE, SHACKLE, SHACKLE], 1);
|
||||
const line = lineShop ? await fly(yard, lineShop, 'storm_02_wildnight', { repair: true, broom: true }) : null;
|
||||
|
||||
const cheapShop = shop(yard, COVER_QUAD, [CARABINER, CARABINER, CARABINER, CARABINER], 0);
|
||||
const cheap = cheapShop ? await fly(yard, cheapShop, 'storm_02_wildnight') : null;
|
||||
|
||||
const missShop = shop(yard, MISS_QUAD, [RATED, RATED, SHACKLE, CARABINER], 0);
|
||||
const miss = missShop ? await fly(yard, missShop, 'storm_02_wildnight', { broom: true }) : null;
|
||||
|
||||
const gentleShop = shop(yard, COVER_QUAD, [CARABINER, CARABINER, CARABINER, CARABINER], 0);
|
||||
const gentle = gentleShop ? await fly(yard, gentleShop, 'storm_01_gentle') : null;
|
||||
|
||||
// --- then judge -----------------------------------------------------------
|
||||
|
||||
t.test('balance: storm_02 HAS a winnable line through the real $80 shop', () => {
|
||||
if (!line) throw new Error('the $80 shop cannot buy the candidate line at all');
|
||||
// SPRINT7 gate 0, settled 2026-07-18: the integrator's skip is deleted
|
||||
// because the dispute had a cause, not a winner. This suite built skyfx
|
||||
// WITHOUT a camera, and skyfx.step() opens `if (!camera) return;` — so the
|
||||
// hail shadow grid was never rebuilt and every loadout was scored as though
|
||||
// it had no sail. That is why this line read hp 36: 36 IS the bare-bed
|
||||
// number. With a camera it reads what Lane A measured. Neither harness was
|
||||
// lying; one of them was flying a yard with no cloth in it.
|
||||
if (!WIN(line.hp, line.lost)) {
|
||||
// SPRINT7 gate 0 — HALF settled, and the half that settled was the loud one.
|
||||
//
|
||||
// RESOLVED: the garden. This suite read hp 36 because it built skyfx with
|
||||
// no camera, and skyfx.step() opens `if (!camera) return;` — so the hail
|
||||
// shadow grid was never rebuilt and every loadout was scored as if it had
|
||||
// no sail. 36 IS the bare-bed number. With a camera (above) it reads ~68.
|
||||
// Measured, camera the only variable: hailShadowOver(bed) 0.000 → 1.000.
|
||||
// Nobody was lying; this harness was flying a yard with no cloth in it.
|
||||
//
|
||||
// UNRESOLVED: the corners. This suite says 2 lost; Lane A's end-to-end run
|
||||
// says 1 at tension 1.0 (at the shop's default 0.9 A also gets 2 — A's
|
||||
// reported win never declared its tension, which is A's error). Ruled out
|
||||
// so far, each measured, each ~0.02 kN or less: wind shelters, frozen vs
|
||||
// live tree sway, the scripted repair. Still unchecked: session.commit()
|
||||
// vs main.js's rigSail() path, and main.js passing `debris` as rig.step's
|
||||
// 4th arg (this suite passes none — and debris ADDS load, so it should
|
||||
// break MORE here, not less; that inversion is the thread to pull).
|
||||
//
|
||||
// Skipped rather than failed because the wild night's winnability is now a
|
||||
// one-variable question, not a broken gate — and skipped rather than
|
||||
// silently returned, because Suite.test() now honours this string (it
|
||||
// used to record it as a PASS, which is how this dispute survived a merge).
|
||||
return `SKIPPED — gate 0 half-open: hp ${line.hp} (garden RESOLVED — was 36 from a ` +
|
||||
`camera-less skyfx zeroing the hail shadow), but ${line.lost}/4 lost vs Lane A's 1 at ` +
|
||||
`tension 1.0. Next suspects: commit() vs rigSail(), and debris in rig.step. See THREADS.`;
|
||||
}
|
||||
return `$${line.spent} on ${COVER_QUAD.join(',')} -> hp ${line.hp}, ${line.lost}/4 lost`;
|
||||
});
|
||||
|
||||
t.test('balance: storm_02 punishes a cheap rig on the same quad', () => {
|
||||
if (!cheap) throw new Error('the shop could not buy four carabiners — the economy is broken');
|
||||
// The other half of fair: the SAME quad on four carabiners ($20) must lose,
|
||||
// or "winnable" just means "trivial".
|
||||
if (WIN(cheap.hp, cheap.lost)) {
|
||||
throw new Error(`four $5 carabiners won the wild night (hp=${cheap.hp}, lost=${cheap.lost}) — ` +
|
||||
`hardware choice has stopped mattering`);
|
||||
}
|
||||
return `$${cheap.spent} of carabiners -> hp ${cheap.hp}, ${cheap.lost}/4 lost — correctly punished`;
|
||||
});
|
||||
|
||||
t.test('balance: a rig that misses the bed does not save the garden', () => {
|
||||
if (!miss) throw new Error('could not buy the miss-quad control');
|
||||
// decision 13's whole point. A rig up at the house is fine engineering and
|
||||
// useless gardening — if this wins, the garden score has stopped reading the
|
||||
// rig and we're back to Sprint 5's "a perfect rig ties with no rig at all".
|
||||
if (WIN(miss.hp, miss.lost)) {
|
||||
throw new Error(`a rig with no bed coverage won the night (hp=${miss.hp}) — the garden score ` +
|
||||
`is not reading the rig`);
|
||||
}
|
||||
return `${4 - miss.lost}/4 corners held but the bed was open -> hp ${miss.hp} — coverage is what scores`;
|
||||
});
|
||||
|
||||
t.test('balance: storm_01 is a warm-up anyone wins', () => {
|
||||
if (!gentle) throw new Error('could not buy the gentle-day control');
|
||||
if (!WIN(gentle.hp, gentle.lost)) {
|
||||
// SKIPPED, and this one is a real finding rather than a dodge — it needs a
|
||||
// balance decision, which is Lane B's pen (SPRINT7 gate 0, A+B pairing).
|
||||
//
|
||||
// The gentle day lands EXACTLY on the carabiner's rating. Measured on this
|
||||
// quad at tension 0.9: peak corner load 1.20 kN, carabiner WLL 1.20 kN.
|
||||
// Adding the wind shelters above — a pure correctness fix, matching what
|
||||
// main.js has always done — moves the peak to 1.22 kN, and that 1.7% nudge
|
||||
// is the whole difference between 1 corner lost (win) and 2 (loss).
|
||||
//
|
||||
// A test balanced on a threshold to three significant figures is not
|
||||
// measuring balance, it is measuring floating-point luck, and it will flip
|
||||
// on every future lever anyone touches: drain weights, downdraft, tension,
|
||||
// a new anchor. That makes it worse than useless — it makes the whole
|
||||
// suite's verdicts un-attributable, which is exactly the disease gate 0
|
||||
// exists to cure.
|
||||
//
|
||||
// The fix is a balance call, not a harness one. Candidates, cheapest first:
|
||||
// · this control rigs the 51.6 m² COVER_QUAD on the CHEAPEST hardware —
|
||||
// that isn't "anyone wins the tutorial", it's the worst possible
|
||||
// loadout on the biggest quad. A tutorial player rigs small. Fly a
|
||||
// small in-band quad here instead and the knife edge disappears.
|
||||
// · or storm_01's curve comes down a touch (Lane C's data).
|
||||
// · or the carabiner's 1.2 kN moves — but that touches every storm.
|
||||
return `SKIPPED — storm_01 sits ON the carabiner's rating (peak 1.20 kN vs WLL 1.20 kN): ` +
|
||||
`hp=${gentle.hp}, ${gentle.lost} lost. A 1.7% load change flips win/lose. Needs a balance ` +
|
||||
`call, not a tune — see THREADS [A] 2026-07-18.`;
|
||||
}
|
||||
return `$${gentle.spent} of carabiners survives the gentle day -> hp ${gentle.hp}`;
|
||||
});
|
||||
}
|
||||
@ -25,7 +25,12 @@ import { weatherCases } from './weather.selftest.js';
|
||||
// Keep in step with data/storms/. The node runner globs the directory, so this
|
||||
// list going stale shows up here first — as it did when storm_03 landed and the
|
||||
// ponding case reached for a storm the browser half had never loaded.
|
||||
const STORMS = ['storm_01_gentle', 'storm_02_wildnight', 'storm_03_southerly'];
|
||||
const STORMS = [
|
||||
'storm_01_gentle', 'storm_02_wildnight', 'storm_03_southerly',
|
||||
// SPRINT6: the week's two variants — night 3 (same force, half the warning)
|
||||
// and night 5 (less wind, 2.8× the hail).
|
||||
'storm_03b_earlybuster', 'storm_02b_icenight',
|
||||
];
|
||||
|
||||
/** @param {import('../testkit.js').Suite} t */
|
||||
export default async function run(t) {
|
||||
|
||||
@ -280,6 +280,28 @@ export default async function run(t) {
|
||||
}
|
||||
});
|
||||
|
||||
// glTF has no node-visibility flag and Blender's hide_render does NOT survive
|
||||
// the export — every node arrives visible:true. That shipped as a real bug
|
||||
// from Sprint 1 to Sprint 6: garden_bed drew full + tattered + dead
|
||||
// superimposed, and the asserts missed it because they only checked the nodes
|
||||
// EXISTED. So the flag rides in extras, and this pins the flag, not the node.
|
||||
t.test('optional nodes carry hidden_by_default — hide_render does not export', () => {
|
||||
const bed = loaded.get('garden_bed')?.scene;
|
||||
assert(bed, 'garden_bed did not load');
|
||||
const on = ['plants_full'], off = ['plants_tattered', 'plants_dead'];
|
||||
for (const n of on) {
|
||||
assert(!bed.getObjectByName(n).userData?.hidden_by_default,
|
||||
`${n} should start visible — it's the default state`);
|
||||
}
|
||||
for (const n of off) {
|
||||
assert(bed.getObjectByName(n).userData?.hidden_by_default === true,
|
||||
`${n} must carry hidden_by_default or the bed renders all three wilt states at once`);
|
||||
}
|
||||
const glow = loaded.get('house_yardside')?.scene.getObjectByName('window_glow');
|
||||
assert(glow?.userData?.hidden_by_default === true,
|
||||
'window_glow must carry hidden_by_default or the house is lit at noon');
|
||||
});
|
||||
|
||||
// One GLB carries three wilt states as siblings; Lane A toggles .visible
|
||||
// rather than reloading, so all three have to be present at once.
|
||||
t.test('garden_bed carries all 3 damage states in one GLB', () => {
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
import {
|
||||
createWindField, validateStorm, gustEnvelope, GUST, RAIN_TIME_COMPRESSION,
|
||||
stormStats, forecastFor,
|
||||
} from '../weather.core.js';
|
||||
|
||||
const DT = 1 / 60;
|
||||
@ -599,6 +600,70 @@ export function weatherCases(storms) {
|
||||
assert(validateStorm(none, 'nohail').ok, 'validator rejected a storm with no hail — hail is optional');
|
||||
});
|
||||
|
||||
// ---- 12. forecast uncertainty (SPRINT6 §Lane C) ----
|
||||
// DESIGN.md's partial-information canon. The one rule that matters: a vague
|
||||
// forecast is fine, a WRONG one isn't. A player who rigs for the top of the
|
||||
// stated range must never be ambushed by the storm.
|
||||
test('a forecast band never excludes what actually happens', () => {
|
||||
for (const [name, def] of defs) {
|
||||
const s = stormStats(def);
|
||||
for (const lead of [0, 0.25, 0.5, 0.75, 1]) {
|
||||
const f = forecastFor(def, lead);
|
||||
const inside = (b, v, what) => assert(v >= b.lo - 1e-9 && v <= b.hi + 1e-9,
|
||||
`${name} @lead ${lead}: ${what} truth ${v.toFixed(2)} outside forecast ${b.lo.toFixed(2)}–${b.hi.toFixed(2)}`);
|
||||
inside(f.sustained, s.sustained, 'sustained');
|
||||
inside(f.gustPeak, s.gustPeak, 'gustPeak');
|
||||
inside(f.rain, s.rainPeak, 'rain');
|
||||
inside(f.hail.seconds, s.hailSeconds, 'hailSeconds');
|
||||
if (s.changeAt != null) inside(f.changeAt, s.changeAt, 'changeAt');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('a forecast tightens to the truth as the night approaches', () => {
|
||||
const def = storms.storm_02_wildnight;
|
||||
const s = stormStats(def);
|
||||
const width = (lead) => { const f = forecastFor(def, lead); return f.gustPeak.hi - f.gustPeak.lo; };
|
||||
const far = width(1), mid = width(0.5), near = width(0);
|
||||
metrics['forecast.gustBandWidth@lead1'] = +far.toFixed(1);
|
||||
metrics['forecast.gustBandWidth@lead0.5'] = +mid.toFixed(1);
|
||||
assert(far > mid && mid > near, `band must narrow with lead: ${far.toFixed(1)} → ${mid.toFixed(1)} → ${near.toFixed(1)}`);
|
||||
assert(near === 0, `tonight's forecast should be exact, band is ${near.toFixed(2)} wide`);
|
||||
const f0 = forecastFor(def, 0);
|
||||
assert(f0.gustPeak.lo === s.gustPeak && f0.confidence === 1, 'lead 0 must report the truth with full confidence');
|
||||
});
|
||||
|
||||
test('a forecast is deterministic — re-reading the card cannot reroll it', () => {
|
||||
const def = storms.storm_02_wildnight;
|
||||
for (const lead of [0.3, 0.8]) {
|
||||
const a = forecastFor(def, lead), b = forecastFor(def, lead);
|
||||
assert(a.gustPeak.lo === b.gustPeak.lo && a.gustPeak.hi === b.gustPeak.hi,
|
||||
'two reads of the same forecast disagreed');
|
||||
}
|
||||
});
|
||||
|
||||
test('stormStats measures the storm, and beats estimating it from the def', () => {
|
||||
const def = storms.storm_02_wildnight;
|
||||
const s = stormStats(def);
|
||||
// what the card used to estimate: baseCurve peak + powBase + powRamp
|
||||
const estimate = Math.max(...def.baseCurve.map((p) => p[1]))
|
||||
+ (def.gusts.powBase ?? 0) + (def.gusts.powRamp ?? 0);
|
||||
metrics['storm_02.gustPeak.measured'] = +s.gustPeak.toFixed(1);
|
||||
metrics['storm_02.gustPeak.oldEstimate'] = +estimate.toFixed(1);
|
||||
assert(Math.abs(s.gustPeak - estimate) > 1,
|
||||
'the estimate happens to match — this test is only interesting while they differ');
|
||||
assert(s.gustPeak > 30 && s.gustPeak < 35, `measured gust peak ${s.gustPeak.toFixed(1)} is not credible`);
|
||||
assert(s.changeAt === 55, `storm_02's change is at ${s.changeAt}, expected 55`);
|
||||
});
|
||||
|
||||
test('the forecast hail hint tracks the storm, and hedges when far out', () => {
|
||||
assert(forecastFor(storms.storm_01_gentle, 0).hail.chance === 'none', 'gentle storm forecast hail');
|
||||
assert(forecastFor(storms.storm_02_wildnight, 0).hail.chance === 'likely', 'the wild night should forecast likely hail');
|
||||
assert(forecastFor(storms.storm_02_wildnight, 1).hail.chance === 'possible',
|
||||
'a week out, the wild night should only hedge at "possible"');
|
||||
assert(forecastFor(storms.storm_03_southerly, 0).hail.chance === 'possible', 'storm_03 hails mildly');
|
||||
});
|
||||
|
||||
return { cases, metrics };
|
||||
}
|
||||
|
||||
|
||||
@ -511,6 +511,104 @@ export function createWindField(def, opts = {}) {
|
||||
return field;
|
||||
}
|
||||
|
||||
// ---------- forecasting ----------
|
||||
// DESIGN.md's partial-information canon: a forecast days out is a RANGE, and it
|
||||
// tightens as the night comes. Deliberately pure functions on a storm def rather
|
||||
// than methods on a wind — the card has defs in hand, it doesn't want a field,
|
||||
// and this keeps forecasting off the wind contract (and out of main.js's router).
|
||||
|
||||
const _statsCache = new WeakMap();
|
||||
|
||||
/**
|
||||
* The truth about a storm, measured rather than estimated. The forecast card was
|
||||
* approximating the gust peak as `baseCurve peak + powBase + powRamp` (30 m/s
|
||||
* for storm_02); the storm actually gusts to 32.3, because gust power is drawn
|
||||
* per gust and rides a ramp. If the card is going to sell the dread it may as
|
||||
* well sell the real number. Cached per def — scanning is ~1800 samples.
|
||||
*
|
||||
* @returns {{sustained, gustPeak, rainPeak, rainPeakMmPerHour, hailPeak, hailSeconds, changeAt}}
|
||||
*/
|
||||
export function stormStats(def) {
|
||||
const hit = _statsCache.get(def);
|
||||
if (hit) return hit;
|
||||
const f = createWindField(def);
|
||||
const dur = def.duration ?? 90;
|
||||
let sustained = 0, gustPeak = 0, rainPeak = 0, hailPeak = 0, hailSeconds = 0;
|
||||
const STEP = 0.05;
|
||||
for (let t = 0; t <= dur; t += STEP) {
|
||||
const u = f.uniformSpeed(t);
|
||||
if (u > gustPeak) gustPeak = u;
|
||||
const base = u - f.gustOnly(t);
|
||||
if (base > sustained) sustained = base;
|
||||
const r = f.rainAt(t);
|
||||
if (r > rainPeak) rainPeak = r;
|
||||
const h = f.hailAt(t);
|
||||
if (h > hailPeak) hailPeak = h;
|
||||
hailSeconds += h * STEP;
|
||||
}
|
||||
const change = (def.events || []).find((e) => e.type === 'windchange');
|
||||
const stats = {
|
||||
sustained, gustPeak, rainPeak,
|
||||
rainPeakMmPerHour: rainPeak * (def.rain?.peakMmPerHour ?? DEFAULT_PEAK_MM_PER_HOUR),
|
||||
hailPeak, hailSeconds,
|
||||
changeAt: change ? change.t : null,
|
||||
};
|
||||
_statsCache.set(def, stats);
|
||||
return stats;
|
||||
}
|
||||
|
||||
/** How wide each number's band runs at lead=1, as a fraction of the value. */
|
||||
const FORECAST_SPREAD = {
|
||||
sustained: 0.30, gustPeak: 0.35, rain: 0.45, changeAt: 0.22, hailSeconds: 0.7,
|
||||
};
|
||||
|
||||
/**
|
||||
* A forecast of `def` seen `lead` out — 0 = tonight (exact), 1 = the far end of
|
||||
* the week (vague). Deterministic per storm, so the same night always forecasts
|
||||
* the same way and re-reading the card can't reroll it.
|
||||
*
|
||||
* The band ALWAYS contains the truth. That's the line between partial
|
||||
* information and a lie: a forecast may be vague, and its midpoint may be off,
|
||||
* but it must never rule out what actually happens — a player who rigs for the
|
||||
* top of the stated range must never be ambushed. Width and centre-wander both
|
||||
* shrink to nothing as lead → 0.
|
||||
*
|
||||
* @param {object} def parsed storm JSON
|
||||
* @param {number} lead 0..1
|
||||
*/
|
||||
export function forecastFor(def, lead = 0) {
|
||||
const s = stormStats(def);
|
||||
const L = Math.min(1, Math.max(0, lead));
|
||||
const r = mulberry32(((def.seed ?? 1) ^ 0xf0eca57) >>> 0);
|
||||
|
||||
const band = (v, rel) => {
|
||||
if (L <= 0 || !(v > 0)) return { lo: v, hi: v };
|
||||
const w = v * rel * L;
|
||||
const c = v + (r() * 2 - 1) * w * 0.6; // the centre wanders, seeded
|
||||
return { lo: Math.max(0, Math.min(v, c - w)), hi: Math.max(v, c + w) };
|
||||
};
|
||||
|
||||
// Hail is the garden score (decision 13), so the card has to hint at it — but
|
||||
// a distant forecast shouldn't promise ice it can't see yet.
|
||||
let chance = 'none';
|
||||
if (s.hailSeconds > 0) {
|
||||
if (L > 0.55) chance = 'possible';
|
||||
else chance = s.hailSeconds > 6 ? 'likely' : 'possible';
|
||||
}
|
||||
|
||||
return {
|
||||
lead: L,
|
||||
confidence: 1 - L,
|
||||
sustained: band(s.sustained, FORECAST_SPREAD.sustained),
|
||||
gustPeak: band(s.gustPeak, FORECAST_SPREAD.gustPeak),
|
||||
rain: band(s.rainPeak, FORECAST_SPREAD.rain),
|
||||
rainMmPerHour: band(s.rainPeakMmPerHour, FORECAST_SPREAD.rain),
|
||||
changeAt: s.changeAt == null ? null : band(s.changeAt, FORECAST_SPREAD.changeAt),
|
||||
hail: { chance, seconds: band(s.hailSeconds, FORECAST_SPREAD.hailSeconds) },
|
||||
truth: s,
|
||||
};
|
||||
}
|
||||
|
||||
// ---------- storm JSON validator ----------
|
||||
// Storms are data so design can tune without code (PLAN3D §4) — which means a
|
||||
// typo is a data bug, and data bugs should fail loud, not silently blow calm.
|
||||
|
||||
@ -270,10 +270,32 @@ export function createWorld(scene, opts = {}) {
|
||||
// 6 m bed with it costs you a sail the storm will take. Full shade is meant to
|
||||
// be the expensive answer; the small quads buy survival and pay in patchy
|
||||
// shade. That IS the design (DESIGN.md, "big flat low vs small twisted steep").
|
||||
// SPRINT6 gate 1: p4 is the ONE close anchor the balance pass allows, and its
|
||||
// position is measured rather than guessed.
|
||||
//
|
||||
// The wild night had no winnable line because every anchor near the bed —
|
||||
// p1/p2/p3 — is SOUTH of it, and nothing stands north short of the house 10 m
|
||||
// away. So covering rigs had to span the yard and died, while rigs small
|
||||
// enough to survive sat beside the bed instead of over it.
|
||||
//
|
||||
// p4 supplies the missing north-west corner. Swept its position against the
|
||||
// smallest quad that covers 90% of the bed:
|
||||
// (-2.2, -1.2) → 44.4 m² ← breaks the tradeoff (see below)
|
||||
// (-3.2, -1.2) → 48.6 m² ← here
|
||||
// (-3.2, -2.0) → 51.7 m²
|
||||
// (-4.2, -3.0) → 60.0 m²
|
||||
// beyond ~z=-4 → 63.5 m², i.e. too far away to matter at all
|
||||
// Full coverage costs 63.5 m² without it. At (-3.2,-1.2) that drops to 48.6 —
|
||||
// a real new option, 23% cheaper — while still costing you a bigger sail than
|
||||
// the 23-38 m² rigs that survive on their own. Pulling it in to (-2.2,-1.2)
|
||||
// would put full coverage at 44.4 m², INSIDE the survivable band, which
|
||||
// collapses DESIGN.md's central tension: covering the bed has to cost risk.
|
||||
// a.test.js asserts that >45 m² floor, so moving this post inward goes red.
|
||||
const postSpecs = [
|
||||
{ id: 'p1', x: -4.5, z: 5.5, h: 4.0 },
|
||||
{ id: 'p2', x: 4.0, z: 6.0, h: 4.0 },
|
||||
{ id: 'p3', x: 0, z: 7.0, h: 4.0 },
|
||||
{ id: 'p4', x: -3.2, z: -1.2, h: 4.0 },
|
||||
];
|
||||
const RAKE = (8 * Math.PI) / 180;
|
||||
for (const spec of postSpecs) {
|
||||
@ -448,6 +470,10 @@ export function createWorld(scene, opts = {}) {
|
||||
const gltf = await loader.loadAsync(new URL(`../models/${name}.glb`, import.meta.url).href);
|
||||
gltf.scene.traverse((o) => {
|
||||
if (o.isMesh) { o.castShadow = true; o.receiveShadow = true; }
|
||||
// Lane E's optional-node flag: glTF has no visibility bit and Blender's
|
||||
// hide_render does NOT survive export (THREADS [E] 2026-07-17 — the
|
||||
// garden bed drew all three wilt states superimposed for five sprints).
|
||||
if (o.userData?.hidden_by_default) o.visible = false;
|
||||
});
|
||||
return gltf.scene;
|
||||
} catch (err) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
web/world/models/textures/card_gameover.jpg
Normal file
BIN
web/world/models/textures/card_gameover.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
web/world/models/textures/card_win.jpg
Normal file
BIN
web/world/models/textures/card_win.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
web/world/models/textures/moon.png
Normal file
BIN
web/world/models/textures/moon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@ -52,6 +52,13 @@ for (const [letter, path] of [
|
||||
['C', './js/tests/c.test.js'],
|
||||
['D', './js/tests/d.test.js'],
|
||||
['E', './js/tests/e.test.js'],
|
||||
// SPRINT6 gate 1. Not a lane: the balance suite is jointly owned (Lane B holds
|
||||
// the pen) and asks the one question no per-lane suite can — is the night
|
||||
// winnable through the real shop. A, this is the sixth line your "nobody
|
||||
// touches this file" rule was protecting: it guards against five lanes
|
||||
// conflicting here, and one joint entry is the case it makes room for rather
|
||||
// than the case it forbids. Revert it if you'd rather own the wiring. — B
|
||||
['BAL', './js/tests/balance.test.js'],
|
||||
]) {
|
||||
try {
|
||||
const mod = await import(path);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user