Compare commits

...

14 Commits

Author SHA1 Message Date
type-two
688e821fcb Sprint 12 integration: merge all lanes (335/0/0), skyfx effective-rating creak, [I] entry 2026-07-17 21:17:45 +10:00
type-two
4dce82268b Merge remote-tracking branch 'origin/lane/d'
# Conflicts:
#	THREADS.md
2026-07-17 21:13:57 +10:00
type-two
28ef4ef138 Merge remote-tracking branch 'origin/lane/b'
# Conflicts:
#	THREADS.md
2026-07-17 21:13:57 +10:00
type-two
3df0d0c5d0 Merge remote-tracking branch 'origin/lane/c'
# Conflicts:
#	THREADS.md
2026-07-17 21:13:57 +10:00
type-two
aff0020148 Merge remote-tracking branch 'origin/lane/e'
# Conflicts:
#	THREADS.md
2026-07-17 21:13:57 +10:00
type-two
ec45e7b465 THREADS: Sprint 12 replay — trap fires at default tension, ladder trip live, weak-link honest, C's wall judged; fuse-line and night-2 cover discrepancies flagged 2026-07-17 21:12:33 +10:00
type-two
38b6fe9c87 Rule the gutter $90 (E's proposal adopted); teach collateralFor/wreckStructure the house; action B's effective-rating flag
Gate 3.3: collateralFor('gutter') returns {90, 'the gutter'} — canonical in
backyard_01.json beside the reasoning, GLB extras as fallback, per E's
collateralKey chain. House wreck wired on the carport's swap contract
(no-op until lane/e's GLB merges; window_glow state copied). site_02 stays
null: no house, no gutter. hud.js bars + main.js verdict now read
rating × ratingHint, matching sail.js's failure line (B's flag).
selftest 319/0/0.
2026-07-17 20:45:49 +10:00
type-two
807de80969 Wire the kid's bike: site key + loader, gnome pattern; decline the $60
Gate 3.2: bike_kid_01_v1 on backyard_01's south fence, rotYDeg 180 so the
baked -Z lean lands ON the fence — bars measured to the rail (0.286 m
reach, z 9.69 -> grip at 9.98), tyres 0.31 m clear, between posts. Unpriced
by ruling: the sim can't knock a bike over, and billing an unseen event is
the lie the invoice kills; the windward-fence pose is the honest one.
a.test pins lean direction, standoff band, and the ruling. 318/0/0.
2026-07-17 20:34:47 +10:00
type-two
2b1c8cf15e Re-audit both yards with hints live; fix the dump's 5 mm lie; THREADS tables
audit.mjs's hand-typed backyard dump goes full-precision: the 2-dp rounding
moved t2 ~5 mm against t1's shelter cone and swung its ice-night peak
4.8 -> 9.3 kN — the node and browser front-ends disagreed by one whole
winnable line until the positions matched to the float. Reconciled by
measurement (node on full floats reproduces the browser exactly).

Re-audit verdict (THREADS, full tables): every night still passes, no retune
proposed — E's numbers stand. backyard: hints move exactly one number (night
2 honest $30 -> $40; fascia appears in zero bed-covering quads so its 0.35
is audit-invisible). site_02: 64/66 -> 23/66 affordable, every cheap carport
line dead, cheapest now $40 honest steel, cheapest >=70% line $45 through a
$30-rated carport post — the trap is priced, not fenced off.

Selftest 319/0/0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:32:33 +10:00
type-two
3d89ce8fe8 Paste E's letterhead/invoice kit into hud.js; rule HARD YARDS + sequential ABN
Gate 3.1: the CUT block from tools/jobsheet verbatim — letterhead, billto,
brief, sched, .void, AMOUNT DUE, terms. Docket numbers shared across the
pair (JOB/INV 1040+night); week.js nights carry an addr. Cards scroll when
taller than the window (safe center + overflow). Both rulings adopted and
pinned by DOM asserts; selftest 317/0/0.
2026-07-17 20:27:18 +10:00
type-two
a52e2377fb THREADS: gutter price proposal ($90) for A's ruling, wreck contract + wiring seam, negative-control receipt, ratings position for B/C's audit
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:24:17 +10:00
type-two
b7f065cd57 e.test: pin the gutter price band, the DOWN/UP swap truth, and anchor absence in the wreck
Five new asserts (Lane E 67 -> 72; selftest 315 -> 320):
- price exists, sits between gnome and carport, keyed to the anchors'
  collateral string, wreck carries the same bill and names its twin
- the torn gutter is DOWN in the wreck and UP in the intact house — negative
  control run: rebuilt with the ground run at eave height, selftest went red
  ('gutter_down tops out at y=2.68', 1 failed / 319 passed) while the Blender
  verify PASSed the same bad file (plan position unmoved, no box span changed);
  restored build round-tripped to identical hashes
- wreck height equals house height (a house does not fall when its gutter does)
- no fascia_anchor_* survives into the wreck
- house pair added to the shared ground-plane test

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:21:40 +10:00
type-two
4d1a2d7aa9 Gutter priced and wrecked: GUTTER_COLLATERAL=90 baked with reasoning; torn-gutter house wreck, carport pattern
The fascia anchors have said collateral:"gutter" since Sprint 6 and nobody
priced one — collateralFor('gutter') returns null, backyard_01's house is a
free failure. Proposal rides in the asset like the carport's did: 90, between
the gnome (25) and the carport (180), with the band reasoning next to the
constant. A rules the number.

house_yardside_wrecked_v1: same origin/footprint/facade (shared _house_facade
helper — intact house BIN chunk byte-identical to the committed GLB, only the
three new price extras differ), fascia torn through the anchored span, left
run hanging by its last bracket, right run kinked ON the grass, downpipe out
of plumb, offcuts flat on the lawn. No fascia_anchor_* empties survive — you
cannot re-tie to a ripped eave.

collateral_key is new and explicit: unlike the carport, the structure and the
thing you take have different names, so the key names which collateral string
the value prices.

All 33 GLBs byte-identical across two full factory runs; the house pair also
byte-identical between --only and full runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:21:24 +10:00
type-two
9700b40a30 Wire ratingHint into the failure threshold: the ratings are real (A's ruling)
sail.js _checkFailure now fails a corner on load > hw.rating * anchor.ratingHint
(read live from the anchor — dress() mutates in place). Consequence asserted,
not the formula: on site_02's carport line (uniform rated shackles, funnel on,
12 s calm settle) a cb corner blows before any q corner — at DEFAULT tension
(t~29 s into the storm, honest posts hold) and at max. In-suite control pins
the attribution: the same rig with every hint forced to 1 holds 4/4, so the
break is the hint, not the load. Mutation-checked: unwiring the line fails both.

rigging.js weak-link (D's #7): summary.weakest reduces on rating * ratingHint
via _effRating, not bare hw.rating — uniform hardware now flags the genuinely
worst steel instead of the first click. Mutation-checked.

site_audit prices the anchor, not just the steel: tierFor(peak, hint) needs
h.rating * hint >= peak, both front-ends carry ratingHint through (browser off
world.anchors, node dump extended with the live-dumped hints), rows print the
hint. sweep.selftest asserts hints reprice without touching peaks and land
over-ceiling corners in unholdable. Mutation-checked.

Selftest 319/0/0 (315 + 4).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:19:01 +10:00
23 changed files with 1513 additions and 109 deletions

View File

@ -3967,6 +3967,196 @@ anchors are your GLB), but the tooling is now waiting, not TODO.
gone: the week is playable end to end.** §BROKE_BELOW watch: if the bank runs away, A's
declared first cut is the $20 clean bonus, not feeFor/gardenBonusMax.
[A] 2026-07-17 — 📄 **E's letterhead/invoice kit is PASTED (SPRINT12 gate 3.1), and both rulings are made.**
The CUT block went into hud.js verbatim — CSS and markup shape both — replacing my Sprint 11
placeholder rules that were holding the seat for exactly this. `.void` survives, exactly as E built
it: the forfeited clean bonus renders struck-through at the QUOTED amount, not zeroed and not
hidden. Both documents now carry the same letterhead and share a docket number (JOB 1043's morning
is INV 1043; `docketNo = 1040 + night`), the client moved into E's bill-to block, and week.js grew
an `addr` per night ("14 Kurrajong St — the backyard" / "2 Bight Rd — the corner block") because a
letterhead bills somebody somewhere. AMOUNT DUE landed with it: pay spent, 20px, red when
negative — the invoice finally has a conclusion, and the bank line under it stays because "what the
night was worth" and "where that leaves you" are different facts. Both terms lines shipped; the
invoice's collateral variant amended from E's "back up by Thursday" to "made right by Friday" so it
reads against any broken thing and lands on the Hendersons' return day.
**RULING — the masthead is HARD YARDS, adopted as proposed.** E's reasoning holds on all three
legs: it's the game's own joke ("nobody thanks you for the storm that did nothing" IS the hard
yards), it's literally about yards, and it's one word at letterhead size. Their caveat is adopted
with it: if a future sprint names the player, a surname mark is the better answer and one constant
changes. Not renaming the outfit in a juice pass either.
**RULING — the ABN stays sequential, and this is now pinned by an assert.** Any plausible 11-digit
number is potentially a real business's tax identity; sequential digits read as "example" the way
555 numbers do. Deliberate, not lazy — a.test now FAILS if someone "fixes" it realistic.
Two things the paste taught, both logged as warnings elsewhere and both ignored by me anyway:
· **The card CSS is a template literal and I put backticks in a comment** ("engines that don't
know `safe`"). node --check PASSED — the stray pair re-paired with a later literal into
accidentally-valid JS — and the browser's import of hud.js died on "Unexpected identifier
'safe'", which took boot down with it. The dawn block's own comment has warned about exactly
this since E wrote it. Caught by the browser, not the linter; `node -e "import(...)"` is the
honest check and --check is not.
· **E's kit made the tall cards taller than a short window** — at 800×450 the RIG IT button was
below the fold of an unscrollable overlay, a soft-lock with good typography. #hud-card is now
`place-items:safe center` + `overflow-y:auto` (plain `center` clips BOTH ends of overflow; the
un-safe value stays above it as fallback). Seen in the pane, invisible to every assert.
Verified by LOOKING, per the standing rule: job sheet night 1 and the carport invoice both rendered
in the browser against E's four preview PNGs — letterhead, bill-to, struck $20, red $130 due,
terms lines, all there. Plus two new a.test DOM renders asserting the kit's load-bearing pieces
(mark, docket, sequential ABN, .void at quoted amount WITH line-through actually drawing, due
arithmetic, neg class) — because both of last sprint's card bugs were invisible to a suite that
never rendered a card. hud.dispose() also stops leaking the dawn div. selftest **317/0/0**
(315 + the two card renders).
[A] 2026-07-17 — 🚲 **The bike is WIRED (SPRINT12 gate 3.2), and the $60 is ruled: DECLINED, for E's own
reason.** site-JSON key + loader line, the gnome pattern exactly — `bike` is a named top-level key
in backyard_01, world.js loads it in the same Promise.all and drops it at `heightAt`. Not in
solids, not billed.
**Placement is measured, not reasoned** (the numbers live in the site JSON's `_why`): I parsed the
GLB in node before placing anything — the bars' grip reaches 0.286 m past the tyre-contact line
toward the baked lean, so at rotYDeg 180 (local Z → global +Z, per E's exporter note, read FIRST
as instructed) and z = 9.69, the grip lands on the south fence rail's inner face at 9.98 and the
tyres stand 0.31 m clear. x = 7 sits between fence posts so bars meet rail, not post. Verified by
LOOKING: walked the player over in the browser — it reads as a kid's bike leaning on the palings,
step-through diagonal doing the work E said it would. New a.test pins the placement side of E's
axis trap: rotYDeg must point the baked lean at the fence (dot > 0.95) and the standoff must stay
in the bars-touch band — drag it mid-yard or flip the rotation and the suite reddens with the
right sentence.
**RULING — no collateralValue, and an assert enforces the reasoning.** E's framing decides it:
"a bike that ignores that gust is a worse lie than no bike." Priced, the lie gets WORSE — the sim
cannot knock a bike over, so the $60 would bill for an event the player never sees, which is the
exact species of unearned consequence the invoice exists to kill (the carport bills because the
roof visibly leaves). The placement is the mitigation: leaning on the WINDWARD fence is the one
pose a southerly can't falsify — the gust pins it harder into the palings, so standing still is
physically honest in every storm the backyard hosts. The tripwire assert fails if anyone prices
the bike without building the fall, and says so: build the fall first, then bring the $60 back —
it's the right number (under the gnome-to-carport span, and the one loss the client's kid would
notice).
selftest **318/0/0** (317 + the placement pin). Landing pushed.
[A] 2026-07-17 — 💰 **RULING: THE GUTTER IS $90 — E's proposal ADOPTED unchanged — and it BILLS as of
this commit. `collateralFor('gutter')` stops returning null (SPRINT12 gate 3.3 closed on A's
side).** E's case decides it on its own terms: the band is established (gnome 25, carport 180,
ceiling ~250) and the gutter is between ornament and structure because that's what it IS; at 90
the night the fascia trap fires is wiped — kit and fee together — which prices the fascia's whole
lesson ("the free anchors were the dearest kit in the yard"); under ~50 the trap can't wipe its
own night, over ~130 the tutorial yard outbids half a carport for a smaller lie. The full
reasoning is in backyard_01.json's `_collateral`, beside the number, the carport pattern exactly.
**The wiring seam E named, closed by TEACHING, not restructuring.** collateralFor()/
wreckStructure() iterate `structures` and the house is not a structure — E offered "move the house
into structures[]" or "teach the two functions". Taught: the house is the one building with extra
jobs (graybox stand-in, north boundary, `site.house` read by validateSite and other lanes), and
re-homing it mid-sprint to save two small branches is churn. E's `collateralKey` field does
exactly what they built it for — names WHICH collateral string the house's price answers, since
"house" and "gutter" aren't the same word the way "carport" and "carport" are. Site JSON is
canonical (collateralKey/Value/Label on `house`), GLB extras stay proposal-and-fallback, and
site_02 — no house — still returns null for 'gutter', which the old pin now proves is per-site
truth rather than a global free pass.
· `wreckedModel: house_yardside_wrecked_v1` is wired on the same swap contract as the carport —
loaded at dress, parked invisible, flipped by `wreckStructure('gutter')`. In THIS clone the GLB
404s (it lives on origin/lane/e until integration), so the swap no-ops false and the bill still
lands — the exact offline contract the carport already honours. E's window_glow warning is in
the code: the swap copies the intact house's glow state onto the wreck's same-named node.
· scoreRun needed NOTHING: its generic loop (anchor.collateral → collateralFor → wreckStructure)
picks the gutter up the moment the price exists. The mechanism was always one price short.
🔧 **B's under-read flag, actioned same-day in my two files** (skyfx.js is C's): hud.js's corner
bars and label now draw off the EFFECTIVE rating (`hw.rating × (anchor.ratingHint ?? 1)`) — off
the bare rating a fascia corner showed 35% margin it didn't have and blew mid-green, which steals
the exact "…I KNEW about the shackle" beat the world-anchored bars exist for. main.js's verdictFor
picks "the weakest link that went first" on the same effective number, matching B's
summary.weakest fix — bare-rating it names the wrong culprit when a rated shackle dies on the
beam. One expression, B's exact shape, credited.
📊 **B's re-audit: read, nothing routed for ruling** — "NO RETUNE NEEDED: E's numbers stand" is
B's own verdict with the tables as evidence, E's position pre-stated agrees, and C's cross-harness
first readings confirm prediction 1. The system worked without me, which is the system working.
Noted for gate 4: B's flag that the fascia trap is invisible to the audit lens (h1..h3 cover no
quads in band) and only COSTS via tonight's gutter — the two landings are one mechanic now.
selftest **319/0/0** (318 + the gutter ruling pin). Pushed.
[E] 2026-07-17 — 💰 **LANE A — the gutter has a price to rule on: $90, and the reasoning is baked
beside it in the asset, the carport ruling's shape exactly.** `GUTTER_COLLATERAL = 90` in
build_yard_assets.py, carried as root extras on BOTH house GLBs. The case, to argue with rather
than adopt:
· the band is established now — gnome 25 at the floor, carport 180, my stated ceiling ~250.
The gutter goes between the ornament and the structure, because that's what it is;
· a night's shop budget is 80 and the wild night's fee is ~76 (feeFor at a 32 m/s peak). At 90
the night the trap fires on is WIPED, kit and fee together — the fascia's lesson in one
number: the "free" anchors were the dearest kit in the yard;
· under ~50 it's a shrug (less than the fee alone — the trap couldn't even wipe its own
night); over ~130 the backyard outbids half a carport for a smaller lie: the fascia (0.35)
is honestly better steel than the beam (0.22), it's three anchors not four, and it's the
tutorial yard — the first trap a player can hit should cost them a night, not the week.
**One NEW field, and it exists because the carport never needed it:** the GLBs also carry
`collateral_key: "gutter"`. There, the structure and the thing you take share a name; here the
structure is a house and the thing you take is the gutter, so the key names WHICH collateral
string the value prices — your wiring never has to guess. e.test pins the chain
(anchor.collateral === root.collateral_key) and the band (gnome < gutter < carport), not the
digit — if you rule a different number, change it in the factory and re-export so site JSON and
the GLB never tell two prices. Adoption shape is the carport's: the canonical number goes in
site JSON (sites are data), the GLB stays proposal-and-fallback. Your a.test line 375
(`collateralFor('gutter')` is null) is yours to flip when you wire it.
[E] 2026-07-17 — 🏚 **`house_yardside_wrecked_v1.glb` — the torn-gutter wreck, the carport pattern,
second time around.** 9.46 × 2.10 × 2.92 m, 340 tris, 33 KB. Same origin, same footprint, same
façade — mesh-for-mesh swap, and this time it's structural: both variants build their walls/
door/window/glow/roof through one shared `_house_facade()`, so they CANNOT drift. Proof the
refactor moved nothing: the re-exported intact house's binary chunk is byte-identical to the
committed GLB — the only diff is the three new price extras — and all 33 factory GLBs hashed
byte-identical across two full runs (house pair `a77d7536…`/`228e9d14…`, identical between
--only and full runs too).
**It fails the way DESIGN.md always said it would** ("holds until the first real gust, then
rips off taking the gutter with it") — and unlike the carport, the HOUSE does not fall. A
gutter unzips: the fascia is torn through the span the fixings held (splintered ends past each
break, the gap is where fascia_anchor_02 was), the left run still hangs off the surviving board
by its last bracket with its torn end sagged to ~1.3 m, the right run is ON the grass out in
the yard, kinked where it landed, the downpipe leans out of plumb, and the offcuts lie flat on
the lawn (the carport wreck's sunk-corner lesson — nothing sinks). I LOOKED before shipping —
three close renders from the yard side, per last sprint's lesson that the verify can't answer
"is this the right shape".
**NO fascia_anchor_* empties survive into the wreck.** You cannot re-tie to a ripped eave, and
an anchor that outlived its fascia would be the free-failure bug back again wearing a wreck for
a costume. e.test pins the absence.
**LANE A — the wiring seam, named so it doesn't bite you:** `collateralFor()` and
`wreckStructure()` iterate `structures`, and the house is NOT a structure — `site.house` is its
own top-level key, loaded by its own block in dress(). So the gutter stays unpriced and
unswappable until you either move the house into `structures[]` (it already fits the shape:
model + wreckedModel + anchors + solid) or teach those two functions about the house entry.
The wreck is built for the same swap the carport uses — load at dress, park invisible, flip
visible on the event. `window_glow` ships in the wreck too (hidden_by_default, same name): if
the swap lands mid-night, re-flip it or the client's lights go out with the gutter.
[E] 2026-07-17 — 🔒 **the DOWN assert failed before it passed, on purpose.** The wreck's whole
message is vertical — the gutter that was UP at the eave is DOWN — so the test measures both
halves and the intact house is the control that proves the measurement measures. Negative
control, the bike-lean discipline: rebuilt the wreck with the ground run parked back at eave
height ("someone quietly un-tore it"), and the selftest went red — **1 failed / 319 passed,
"gutter_down tops out at y=2.68 — the run is not on the grass"** — while the Blender verify
said `[PASS] 9.46 × 2.10 × 2.92` on the SAME bad file, because only z moved and no box span
changed. That's the axis-blindness this suite exists for, third time it's earned its keep.
Restored build round-tripped to the identical hashes. Status: selftest **320/0/0** (315 + 5),
Lane E is 72 asserts.
[E] 2026-07-17 — 📊 **B, C — on the ratings, position stated BEFORE the audit lands so nobody
argues with a ghost.** Read C's envelope entry (origin/lane/c) — it's the second harness the
repo rule wants, and one flag in it needs an answer now: **the branch-anchor ladder is
deliberate, not drift.** t1b/t2b/tr1b = 0.88 and t1c = 0.76 are the `1.0 0.12·i` descent I
baked in Sprint 7 — the fork is honest steel, the limb thins as you climb, and that gradient is
the intel DESIGN.md wants inspection to buy. Audit against the DRESSED anchors, as C says, not
the sprint doc's "tree 1.0" shorthand — the doc compressed, the assets didn't. My stance for
the re-audit: **0.22 / 0.30 / 0.35 and the ladder stand until a measured night has no winnable
$80 line through the real shop.** If that day comes, the agreed order still holds — C's gain
drop first, and the tree-move stays CANCELLED (integrator's call, sprint 11) — and softening
the ratings stays last, because the ratings ARE the site: e.test pins them with the reasons
attached. Propose retunes here with the audit as evidence and I'll move my own numbers in the
factory; nudge them in site JSON and two sources of truth will tell two lies.
[C] 2026-07-17 — 📐 **B — gate 2.4, the STORM side of the failure envelope. My numbers, measured now,
posted first; put yours next to them when the wiring lands.** New harness `tools/storm_envelope/`
(envelope.html dresses the yard the way the game does and reads `world.anchors`; venturi + tree
@ -4089,3 +4279,235 @@ anchors are your GLB), but the tooling is now waiting, not TODO.
peak. The peak-timing comparison in my prediction 3 applies to your resetPeaks peak-load
tables on lines that HOLD — when you post the full re-audit of both yards, that's the number
to put beside my tPeak column. If THOSE disagree, then we hunt the variable.
[B] 2026-07-17 — ⚡ **THE RATINGS ARE WIRED. A's ruling, implemented, mutation-checked, and the trap
now fires at DEFAULT tension.** SPRINT12 gate 2 item 1, plus D's #7. Selftest 319/0/0 (315 + 4).
`sail.js _checkFailure` now fails a corner on `load > c.hw.rating * (c.anchor.ratingHint ?? 1)`
read LIVE from the anchor each check, not captured at attach, because dress() adopts E's hints by
MUTATING anchors in place and a rig must see the dressed number. Asserted as CONSEQUENCE, per the
sprint: D's exact carport line (cb1 cb2 q2 q3), uniform RATED shackles, 12 s calm settle (funnel
on — the gap doesn't switch off for prep), then the whole early buster:
· **default tension 1.0: cb1 blows at t≈29 s into the storm; both honest posts hold** (q2/q3
peak 1.8/2.5 kN under a bare 6.5 kN shackle). D — your measured fork is dead: the anchor
decides now, not the dial. Your #6 follows: a cb corner IS likelier to blow than a q.
· max tension 1.4: cb1 goes at t≈0.5 s — **a drum-tight sail rips the beam off in PREP, on the
calm day.** Not a bug; 6.5 kN × 0.22 = 1.43 kN and the standing load at 1.4 exceeds it. The
carport now punishes greed before the storm even arrives. D: worth feeling on your replay.
· in-suite control: same rig, every hint forced to 1, holds 4/4 — so the break IS the hint, not
the load. Mutation-checked the honest way: revert the sail.js line and both tests go red
(nothing blows at either tension).
**Weak-link tie-break (D's #7): `summary.weakest` now reduces on rating × ratingHint** via
`_effRating`, so uniform hardware flags the genuinely worst steel, not the first click — and a
rated shackle on the beam (6.5 × 0.22 = 1.43 kN) correctly loses the label to a carabiner on an
honest post (1.2 kN). Ties still keep first pick: equal products really are interchangeable.
Mutation-checked (old reduce flags q1 when cb1 is clicked last; test clicks honest steel first).
⚠️ **A, C — three consumers of `hw.rating` in YOUR files now under-read the failure point** (not
touching them, file ownership): hud.js:352/359 draws the tension bar off `load / hw.rating`, so a
fascia corner shows 35% margin it doesn't have and blows at "0.4/1.2kN"; main.js:166 picks the
verdict's "weakest link that went first" among lost corners by bare rating; skyfx.js:875 scales
an effect off `c.hw.rating`. All three want `hw.rating * (anchor.ratingHint ?? 1)` — the corner
carries `c.anchor`, so it's one expression. Happy to hand any of you the sail-side read if you
want it as a method instead.
[B] 2026-07-17 — 🔬 **TWO HARNESSES DISAGREED BY ONE WINNABLE LINE, AND THE VARIABLE WAS FIVE
MILLIMETRES.** Found re-auditing, worth its own entry because it's the repo's oldest lesson at a
new scale. The node front-end's hand-typed backyard dump (2 decimals) and the browser's dressed
`world.anchors` (full float) disagreed on the ICE night: dump said 1 affordable line, browser
said 2. Same sweep, same storm, same hints. The 2-dp rounding moves t2 ~5 mm, which sits it
differently against t1's shelter cone, and its peak on the 58% quad swings **4.8 → 9.3 kN**
NONE-able vs $30-able. Reconciled by measurement: node re-run on the full-precision positions
reproduces the browser exactly (ice 2 winners, wild 4, same lines, same prices). The dump now
carries full floats with a warning comment. **C — this bites your gate-2 harness directly: pull
anchor positions from `world.anchors` (or my dump/sail.selftest fixture, now full-precision),
never from a rounded table, or our envelopes will disagree by design near shelter edges.**
[B] 2026-07-17 — 📊 **RE-AUDIT, BOTH YARDS, ALL FIVE NIGHTS, FUNNEL ON, HINTS LIVE. Verdict: every
night still PASSES, the escalation survives, and the corner block's $20 carport decoy is dead —
which is the design working, not breaking. NO RETUNE NEEDED: E's numbers stand.** Browser
front-end off dressed `world.anchors`; node front-end agrees exactly post-reconcile (above).
| n | site | storm | fee | winners | cheap line | honest rig (≥70% cover) | net* |
|---|--------------|--------------|----:|------------:|-----------------|------------------------------|-----:|
| 1 | backyard_01 | gentle | $42 | 12/12 | $20 @58% | $20 +$15 = **$35** (@71%) | +$62 |
| 2 | backyard_01 | southerly | $57 | 12/12 | $20 @29% | $40 +$15 = **$55** (@75%) | +$67 |
| 3 | **corner blk** | early buster | $57 | **23/66** | **$40 @63%** | $45 +$15 = **$60** (@75%) | +$65 |
| 4 | backyard_01 | wild night | $73 | 4/12 | $65 @25% | $120 +$15 = $135 ⚠ over $80 | +$43 |
| 5 | backyard_01 | ice night | $71 | 2/12 | $75 @58% | $120 +$15 = $135 ⚠ over $80 | +$41 |
*net = fee + garden(hp100) + half hardware back (rig + spare), same formula as my sprint-11
table, clean bonus excluded for comparability. Deltas vs sprint 11: n2 $5, n3 $7, rest equal.
**What the hints actually moved, attributed by strip-runs (same sweep, hints forced to 1):**
· **backyard_01 — one number.** Night 2's honest line: $30 → $40 (t2b's 0.88 uptiers one
corner $5→$15... then ring assignment shuffles a $15 to p4). Nights 1, 4, 5: byte-identical
verdicts. **The fascia's 0.35 changes NOTHING in the audit — h1..h3 appear in zero
bed-covering quads in the 1845 m² band.** The house is simply out of position to shade the
bed. So the fascia trap today is a UI-reachable storm failure (a carabiner on h2 now lets go
at 0.42 kN), not an audit-visible economy. E, A: your gate-3 gutter work is what makes that
failure COST something; the audit lens won't see it either way. Flagging so nobody expects
the backyard's audit table to move when the gutter lands.
· **site_02 — the trap grew teeth and the yard stayed winnable.** Hints off: 64/66 affordable,
cheapest $20 @25% THROUGH the carport (q3+q4+cb1+cp2 on carabiners) — sprint-11's numbers
exactly, good continuity. Hints on: **23/66 affordable, 42 lines unholdable, and every
cheap carport line is gone** — cb demands peak/0.22, so the shop's ceiling can't hold a
beam corner that pulls >1.43 kN effective. Cheapest is now honest steel + tree ($40 @63%),
and the cheapest ≥70% line ($45 @75%) runs through **cp1 at $30 rated** — you can still buy
the carport post, it just costs what lying steel costs. 16 of 23 winners still touch
carport anchors: the trap is priced, not fenced off. DESIGN's sentence is now true in the
sim: four free-looking anchors, and tying real load to them either prices you into rated
steel or takes the roof off.
**Retune verdict, formally: none proposed.** The criteria were "unwinnable or defanged" —
neither occurred. Every night has an affordable line; night 3's honest rig ($60 all-in against a
$57 fee, +$65 net) sits $5 above night 2's, which preserves "looks like night 2 and isn't"
without pricing the block up; nights 45 still only rig honestly off a banked wallet, which is
the week's spine doing its job. E's 0.22/0.30/0.35/1.0 (and the branch taper 1.0/0.88/0.76
nobody talks about, which is doing quiet good work uptiering high-branch corners) all stay.
**C — your gate-2 handshake, so our harnesses can meet:** my failure envelope is measured
through `auditSweep` (12 s calm settle w/ venturi, resetPeaks, full storm, porosity 0.30,
tension 1.0, static sway) off full-precision dressed anchors; the two consequence tests in
sail.selftest.js carry the exact site_02 fixture + venturi verbatim. If your storm-side numbers
(speedAt × time) disagree with any peak in the tables above, the mm entry above is suspect #1
and the settle window is #2 — find the variable in THREADS before anyone touches a constant.
[D] 2026-07-17 — 🎮 **I REPLAYED THE FORK, AND THE FORK IS DEAD. The trap fires at default tension,
the ladder trip fires by itself, the label points at real steel, and C's wall reads as sky.**
Sprint 12 items 14 + the blurb, judged in play on a scratch merge of origin/lane/b +
origin/lane/c + origin/lane/a (which had pushed the letterhead paste — judged as the bonus).
Merged selftest **328/0/0** before I touched anything. Method as sprint 11: real boot path
(`boot({site:'site_02_corner_block'})` — A's honoured hook, and it WORKS now, night 3 at its own
$80 bank), real cards, real clicks into `rigging`, storm driven by `SHADES.step(1/60)` because
the shared pane still throttles rAF dead. Nothing of mine is on lane/d this sprint but this entry.
**1. THE TRAP, my exact sprint-11 line (cb1 cb2 q2 q3, carabiners, tension 1.0).** Sprint 11:
"garden 83%, +$82, THE GARDEN MADE IT." Now: **cb1 blows t=0.72, cb2 t=1.32 — in the CALM, wind
0.0** — settle load ≈311 N against carabiner-on-beam 1200×0.22=264 N effective. q3 follows at
t=49.6 (the funnel-alignment window), and dawn reads: collateral **$205** (carport $180 + the
gnome), AMOUNT DUE **$128**, bank $80→$0, **game over.** Same clicks, opposite morning. Verdict
as playtester: at carabiner prices this is no longer even a trap — it's a DEMONSTRATION. The
beam sheds the cheap steel in front of you, in the quiet, with 88 s left to fix it; the $180
lands only if you then walk away. The trap B measured (blows ~29 s, mid-storm) needs $30 rated
steel on the beam, which is exactly right: **the beam now costs you either up front or at dawn.**
· Fair-warning check on the temptation the shop can actually SELL: 4× rated is $120 — over the
$80 bank, so B's uniform-rated fixture is unbuyable at night 3. The buyable temptation is
**cb1/cb2 rated + q2/q3 carabiner = $70**, and it is a hell of a ride: q3's carabiner blew AT
the change (t=18.07), shed the quad, and **cb1 peaked 1350 N against its 1430 N line — the
carport held by 80 N** and paid +$147. B: your sweep should look at mixed-hardware lines —
the cheap post corner acts as a FUSE that protects the beam, and I suspect the fuse line is
now night 3's best net. If that's intended, it's brilliant; if unswept, it's unpriced.
· **Max tension 1.4: three corners rip at t≈0.5 on the calm day** (q3, cb1-rated, q2 — only cb2
survived, its load shed). B's PREP-rip confirmed and extended: at 1.4 the standing load
(~1.41.5 kN/corner at 46 m²) kills every tier the shop sells except rated-on-honest. Reads
FAIR — you watch it happen, it's physics, you have the calm to re-rig — but note the panel
never shows standing kN at the chosen tension, so the first lesson always costs ~$60. A
one-line "≈0.3 kN/corner standing at this tension" on the prep panel is sprint-13 material.
· One panel honesty gap, same family as B's hud warning: the prep list prints the HARDWARE's
kN ("cb1 carabiner 1.2 kN") — the weak-link arrow knows about hints, the printed number
doesn't. A cold player sees four equal 1.2s and one unexplained arrow. Defensible as "you
know your gear, not their steel" — but then the arrow is leaking the answer. Pick one story.
**2. THE LADDER TRIP (my #6): FIRES BY ITSELF, and the funnel gives it teeth.** Standing under
blown cb1: *"the fascia needs the ladder — it's by the shed"* (greyed reason, interact.visible
doing its job). Full chain exercised in the live storm: take ladder → set under cb1 → spare in
hand (the spare is ALSO the disambiguator: empty hands at a planted ladder reads "take it back",
carrying the spare makes E climb — that's design, not accident) → climb to reachY 4.46 →
"re-rig corner" usable → **2.3 s into the 2.5 s hold, a funnel gust knocked me off the ladder
(t≈36) and the spare went with me.** Bracket work at height, in the throat, timed against the
change: the site's stated thesis, now playable. Two notes: ladder.js's label says "fascia" on a
carport bracket — my file, my wording, one-line fix next sprint (or grab it, B/A, if you're in
there); and where does a knockdown-dropped spare GO? It left my hands and I couldn't find it —
if it evaporates, that's $15 vanishing without an invoice line.
**3. THE WEAK-LINK LABEL (my #7): HONEST IN EVERY ORDER I THREW AT IT.** q-first uniform → cb1;
cb-first uniform → cb1; mixed rated-cb + carabiner-q clicked q-first → **q2** (1200 N effective
beats 1430 — the label correctly ignores the scary type and points at the cheap steel on the
honest post); tree line → **tr1b** (0.88 branch taper read live). B, the fix is real in the UI,
not just the suite. Ties on the cb pair resolve by ring order not click order — both are 264 N,
either is honest, no complaint.
**4. C'S FRONT WALL: it reads as WEATHER, and the bench is a good judging rig.** dev_skyfx.html
face-on (the bench aims you south already — don't touch the arrows, I turned 180° and spent five
minutes judging your prop slab; the razor-edged black rectangle in my first three screenshots
was scenery): t=8 a smudge you'd miss with rope in your hands — correct; t=15 (0.86) a smoky
bank with soft arc-ends and top, flat base ON the horizon — a shelf cloud, not a UI element.
Night 2 teaches it (18→30 s), night 3 stands the same wall at 6→18: same vocabulary, earlier
clock — "looks like night 2 and isn't", visible mid-yard. In play at t=13 in-game + the ticker's
"that's the change already" it LANDS. Answers to your three: (a) I looked south and it changed
my STANCE, not my rigging — by the time the wall rises you're committed; its actionable window
is repairs, bracing, where you stand, and on night 3 that's the window that matters (see the
knockdown above). It cannot re-order the rig, and it shouldn't — the card already prints
"southerly change at 18s"; the sky dramatizes what the paper said, which is reading the SKY,
not the data. Not spoiled. (b) covered. (c) ice night: the wall is buried under hail and an
already-black sky — neither bonus nor noise, just true. Keep it. And the missing lull did NOT
bother the cloth-watcher: the cloth stayed loaded through the change in every run, and a hush
the cloth contradicts would have been the repo's favourite kind of lie. Right call.
**5. THE ECONOMY: meaner-but-fair, leaning fair.** Cheap carport lines are dead as billed
(instant, visible, $205 if ignored), but the yard is decidable at $80: honest+tree $40, fuse
line $70, cp1-rated line $45 (B's audit). The beam's three tiers are three different lessons —
$5 dies at settle, $15 dies at the peak, $30 holds if a fuse pops first. That's a shop teaching,
not gouging. Week sampled by mouse+step nights 1→3: n1 gentle banked $116 (my own greed-quad of
156 m² snapped h2 at settle — the fascia's 0.35 bites the backyard now, and it was MY fault and
readable), n2 southerly +$131 clean, bank $212 into night 3.
· ⚠️ **B, one cross-harness disagreement to chase, mine vs your night-2 row:** your table says
cheap $20 @29%, honest ≥70% needs $40. I rigged **p1p2p3p4, 40 m², 4× carabiner, $20 flat**
and dawn paid **garden 39/45 (87% of bonus), clean $20, +$131**. Either the audit's cover%
and the sim's bed-HP measure different things (my bet — bonus is hail-through-time, not
geometric cover), or the flat posts quad is missing from your sweep's band. Two harnesses,
one number, find the variable — because if $20 honestly clears night 2 in-sim, the "$30→$40"
story is the dump's, not the game's. Receipts: my run, this entry; your table, your entry.
· Also for B, tiny: `rig.t` never resets between nights — my night-2 break event carried
t=696.5 (cumulative week seconds). Only bites anyone reading event.t as storm time.
**6. THE BLURB, on the rendered card: honest now.** HARD YARDS masthead → "the Hendersons / 14
Kurrajong St — the backyard" → "You've worked this one for years. You know where everything is,
which is the only advantage you get." The familiarity is the contractor's, not the owner's, and
it sits under a client's name without lying. The old "Your own place" would have been three
lines below the bill-to block calling the client's yard yours. A's paste judged in play, too:
job sheet and invoice share letterhead + docket (JOB 1043 / INV 1043), the ABN reads 555-style,
the struck-through clean $20 on the dead-bonus invoice is the best teaching line in the game,
AMOUNT DUE $128 in red concluded my own funeral correctly, and the card scrolls at 800×450
(place-items:safe center verified by scrolling to RIG IT). Bonus judged: **ship it.**
Gate-2 line for the integrator: **D confirms the trap fires at default tension · ladder trip
fires by itself · weak-link honest in every order · C's tell telegraphs without spoiling.**
New sprint-13 candidates from this pass, cheapest first: ladder.js "fascia" wording on bracket
anchors (mine) · standing-kN line on the prep panel (A/B) · panel kN column vs hint story (A+B
ruling) · knockdown-dropped spare's whereabouts (B/D) · B sweeps mixed-hardware fuse lines.
[I] 2026-07-17 — **SPRINT 12 INTEGRATION (main).** All five lanes merged, THREADS-only conflicts,
selftest **335/0/0** — again the exact per-lane sum (315 + A 4 + B 4 + C 7 + E 5). Every gate
delivered except the one only John can: gate 1 is still his.
**The sprint in one line: the trap is real now, and the paperwork looks like a business.**
B wired the ratings and re-audited both yards (verdict: no retune — E's numbers stand); C
second-harnessed the envelope and gave the change its wall; A pasted the kit, adopted HARD
YARDS, wired the bike, ruled the gutter at E's $90 and declined the bike's $60 with a tripwire;
E priced the gutter and built its wreck with a real negative control; D replayed everything and
filed the verdict that matters: fork dead, trap fires at default tension, ladder thesis playable,
wall telegraphs without spoiling, paperwork ships.
**One integration edit (the leadFor precedent):** skyfx.js's creak audio read bare `hw.rating`
B's flag, C's file, C had already wrapped. It now reads rating × ratingHint, in-file comment says
why: a creak keyed on the shackle alone goes quiet exactly where the steel is worst.
**Verified live at merge, not just green:** `collateralFor('gutter')` returns {cost:90} on the
backyard and stays null for the carport there (both correct); E's wreck GLB + A's wiring met for
the first time here and the plumbing holds; the bike stands at world (7, 9.69) against the south
fence; the card reads HARD YARDS / JOB SHEET. Zero console errors.
**Carried to SPRINT13's pool, none blocking (mostly D's replay finds):**
· prep shows no standing-kN, so max-tension's prep-rip lesson always costs ~$60 blind — a
readout is the obvious fix and it's A/B seam work;
· mixed-hardware "fuse" lines — cheap post corners protecting the beam is either emergent
depth or a hole; B to sweep (D's +$147 line is the exhibit);
· cover% (audit) vs bed-HP (sim) read differently on the same $20 rig — find-the-variable
posted B↔D, no retune till it's found;
· `rig.t` never resets between nights (break.t=696.5 in D's log) — B's file;
· ladder label says "fascia" on a carport bracket (D's file); the dropped spare's whereabouts
are unknown; C's bench aims you south (noted in the bench).
· Doc erratum: SPRINT12.md said "tree 1.0" — the branch ladder is 1.0/0.88/0.76, deliberate
Sprint-7 intel (C flagged twice, B confirmed).
**Gate 4 is OPEN: Sprint 13's branch — reputation/warranty vs site_03 vs heatwave — waits on
John's three sentences, and the game is the best argument for playing it that it has ever been.**

View File

@ -0,0 +1,28 @@
# License request — cortiz2894/stylized-components
Post at: https://github.com/cortiz2894/stylized-components/issues/new
(or email cortiz2894@gmail.com)
**Title:** Add a LICENSE file so the "free code" is formally free
---
Hey Christian — the WaterFloor breakdown is fantastic, and your video
describes this as a free resource to drop into our own projects. The repo
doesn't currently have a LICENSE file though, which under GitHub's terms
means it defaults to all-rights-reserved — so cautious folks (and any
company) legally can't use it despite your clear intent.
Would you consider adding one? MIT is the usual pick for "use it anywhere,
keep my copyright line" (it's what three.js itself uses). GitHub can add it
in two clicks: Add file → choose the MIT template.
Same goes for your other free-resource repos (flow-shield-effect,
hologram-particles, charged-blast-vfx, showcase-images, mouse-effects…) —
they all say "free open-source resource" in the description, and none has a
LICENSE file, so none of them is formally open source yet. One MIT file per
repo and the whole collection becomes actually usable by the community you
built it for.
Thanks for sharing the breakdowns — the F1SmoothF1 Voronoi write-up
especially is gold.

View File

@ -133,6 +133,31 @@
"status": "PASS",
"problems": []
},
{
"name": "house_yardside_wrecked",
"dims": [
9.4552,
2.1021,
2.9172
],
"tris": 340,
"nodes": [
"debris_fascia",
"door",
"downpipe_loose",
"fascia_torn",
"gutter_down",
"gutter_torn",
"house_yardside_wrecked",
"roof",
"wall",
"window",
"window_glow",
"window_light_anchor"
],
"status": "PASS",
"problems": []
},
{
"name": "carport_01",
"dims": [
@ -468,42 +493,5 @@
"problems": []
}
],
"debris": [
{
"file": "BlueCrate_v2.glb",
"dims": [
0.36,
0.36,
0.29
],
"sane": true
},
{
"file": "BlackTub_v2.glb",
"dims": [
0.36,
0.54,
0.2
],
"sane": true
},
{
"file": "WhiteTub_v2.glb",
"dims": [
0.36,
0.54,
0.2
],
"sane": true
},
{
"file": "WoodenBin_v2.glb",
"dims": [
0.35,
0.36,
0.31
],
"sane": true
}
]
"debris": []
}

View File

@ -684,10 +684,16 @@ def build_gate(name):
return root
def build_house_yardside(name):
"""Rear façade only — no interior. The fascia is the point: DESIGN.md says
it holds until the first real gust, then leaves with the gutter."""
root = add_empty(name)
def _house_facade(name, root):
"""The rear façade shared VERBATIM by the intact house and its torn-gutter
wreck wall ring, door, window, night glow, roof. Split out in Sprint 12
because a house does not fall down when a sail rips its eave line off (the
carport folds; brick veneer shrugs), so the two variants have to be the SAME
building or the aftermath swap reads as the house moving. One set of numbers,
two eave lines.
Returns the measurements and materials the eave line is built from, because
the eave is exactly the part that differs between the two callers."""
wall_m = get_material("Mat_Render", PAL["render_wall"], 0.9)
brick_m = get_material("Mat_Brick", PAL["brick"], 0.9)
trim = get_material("Mat_Timber", PAL["timber_dark"], 0.8)
@ -754,12 +760,47 @@ def build_house_yardside(name):
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).
# The roof and its eave. The eave overhangs 0.55 into the yard (-Y).
eave_y = -0.55
fascia_z = H + 0.10
join_group([add_box(f"{name}_roof", (W + 0.2, D + 0.75, 0.10),
(0, (eave_y + D / 2) / 2, H + 0.05), roof_m,
rot=(math.radians(-6), 0, 0))], "roof", root)
return dict(W=W, H=H, D=D, eave_y=eave_y, fascia_z=fascia_z,
trim=trim, gutter_m=gutter_m)
# What it costs to take the client's gutter — and the fascia it hangs off —
# with you. Same deal as CARPORT_COLLATERAL below, second time around: Lane A
# owns this number, it's a design call, not an art one. But the fascia anchors
# have said collateral:"gutter" since Sprint 6 and NOBODY has ever priced one —
# collateralFor('gutter') returns null, so backyard_01's house is a free
# failure: tie 25 m² to a 0.35 fascia, rip it off, pay for a shackle. My
# proposal and the reasoning, to argue with rather than adopt:
# · the band is established now: gnome 25 at the floor, carport 180, my
# stated ceiling ~250. The gutter goes between the ornament and the
# structure, because that is what it is;
# · a night's shop budget is 80 and the wild night's fee is ~76 (feeFor at a
# 32 m/s peak). At 90 the gutter costs slightly more than EITHER — the
# night it fires on is wiped, kit and fee together. That is the fascia's
# lesson in one number: the "free" anchors were the dearest kit in the yard;
# · under ~50 it's a shrug — less than the fee alone, so the trap couldn't
# even wipe its own night;
# · over ~130 the backyard outbids half a carport for a smaller lie: the
# fascia (0.35) is honestly better steel than the beam (0.22), it's three
# anchors not four, and it's the tutorial yard — the first trap a player
# can hit should cost them a night, not the week.
GUTTER_COLLATERAL = 90
def build_house_yardside(name):
"""Rear façade only — no interior. The fascia is the point: DESIGN.md says
it holds until the first real gust, then leaves with the gutter."""
root = add_empty(name)
f = _house_facade(name, root)
W, H, eave_y, fascia_z = f["W"], f["H"], f["eave_y"], f["fascia_z"]
trim, gutter_m = f["trim"], f["gutter_m"]
fascia = add_box("fascia", (W + 0.2, 0.035, 0.20), (0, eave_y, fascia_z),
trim, parent=root)
gutter = join_group([
@ -780,6 +821,109 @@ def build_house_yardside(name):
e["collateral"] = "gutter"
stamp(root, name, "structure")
root["facade_width"] = W
# The proposal rides in the asset, exactly like the carport's did (and A
# adopted that one into site JSON, where the canonical number now lives —
# sites are data; this is the fallback and the argument). collateral_key is
# NEW and explicit because the carport never needed it: there, the priced
# thing and the structure share a name. Here the structure is "house" and
# the thing you take is the GUTTER — the key names which collateral string
# this value prices, so Lane A's wiring never has to guess.
root["collateral_key"] = "gutter"
root["collateral_value"] = GUTTER_COLLATERAL
root["collateral_label"] = "the gutter"
return root
def build_house_yardside_wrecked(name):
"""The house after the fascia let go (SPRINT12 §gate 3.3) — DESIGN.md's line
made geometry: "holds until the first real gust, then rips off taking the
gutter with it".
Same origin, same footprint, same façade _house_facade, shared verbatim
because a house does not fall down when a sail takes its eave line; only
what the anchors betrayed changes. The fascia is torn through the span the
fixings held, and the gutter it carried is in two states at once: the left
run still hangs off the surviving board by its last bracket, torn end sagged
toward the grass, and the right run is ON the grass out in the yard, kinked
where it landed, with the downpipe leaning out of plumb after it. A gutter
doesn't shatter — it unzips, springs, and lands where the wind was going.
NO fascia_anchor_* empties survive into this file. You cannot re-tie to a
ripped eave, and an anchor that outlived its fascia would be the free-
failure bug back again wearing a wreck for a costume. e.test.js pins that,
and that the gutter is DOWN here while its intact twin's is UP at the eave.
"""
rng = rng_for(name)
root = add_empty(name)
f = _house_facade(name, root)
W, eave_y, fascia_z = f["W"], f["eave_y"], f["fascia_z"]
trim, gutter_m = f["trim"], f["gutter_m"]
# The fascia, minus what the sail took: a 3.4 m board survives on the left,
# a stub clings to the far right corner, and both torn ends splinter past
# the break. The gap in between is where fascia_anchor_02 used to be.
fascia = [
add_box(f"{name}_fascia_left", (3.4, 0.035, 0.20),
(-2.9, eave_y, fascia_z), trim),
add_box(f"{name}_fascia_stub", (0.6, 0.035, 0.20),
(4.3, eave_y, fascia_z), trim),
]
for i, (bx, ang) in enumerate(((-1.05, 14), (3.85, -18))):
fascia.append(add_box(f"{name}_fascia_splinter_{i}", (0.38, 0.028, 0.09),
(bx, eave_y, fascia_z + 0.02), trim,
rot=(0, math.radians(ang + rng.uniform(-3, 3)), 0)))
join_group(fascia, "fascia_torn", root)
# The left run: still bracketed at the healthy end, torn free at the break,
# hanging diagonally with the freed end sprung out over the grass.
join_group([add_tube_between(
f"{name}_gutter_hang",
(-4.4, eave_y - 0.05, fascia_z - 0.12),
(-0.55, eave_y - 0.34, 1.28), 0.055, gutter_m, verts=8)],
"gutter_torn", root)
# The right run went where the wind was going: out over the yard, down on
# the grass, kinked where it hit. Flat ON the grass — the carport wreck's
# first-pass lesson (a corner sunk to z=-0.41) is why nothing here sinks.
kx = 2.4 + rng.uniform(-0.3, 0.3)
join_group([
add_tube_between(f"{name}_gutter_ground_a",
(0.35, -1.35, 0.055), (kx, -1.72, 0.055),
0.055, gutter_m, verts=8),
add_tube_between(f"{name}_gutter_ground_b",
(kx, -1.72, 0.055), (4.85, -1.48, 0.055),
0.055, gutter_m, verts=8),
], "gutter_down", root)
# The downpipe keeps its bottom strap and loses the top one with the run —
# so it leans out of plumb into the yard. Cheapest possible "this eave is
# finished" tell: it reads from across the lawn at night.
join_group([add_tube_between(
f"{name}_downpipe_loose",
(W / 2 - 0.25, eave_y - 0.05, 0.02),
(W / 2 - 0.12, eave_y - 0.62, 2.58), 0.04, gutter_m, verts=8)],
"downpipe_loose", root)
# What a ripped fascia leaves on the lawn: offcuts scattered near where the
# run came down, every board flat on the grass.
debris = []
for i, (dx, dy, ln, ang) in enumerate(((1.35, -1.15, 0.85, 22),
(3.25, -1.58, 0.55, -34),
(2.15, -0.92, 0.34, 63))):
debris.append(add_box(f"{name}_fascia_bit_{i}", (ln, 0.20, 0.035),
(dx + rng.uniform(-0.08, 0.08),
dy + rng.uniform(-0.08, 0.08), 0.0175), trim,
rot=(0, 0, math.radians(ang + rng.uniform(-6, 6)))))
join_group(debris, "debris_fascia", root)
stamp(root, name, "structure")
root["broken_variant_of"] = "house_yardside"
root["facade_width"] = W
# Same price as the state it used to be, so scoring can read either —
# the carport wreck's rule, verbatim.
root["collateral_key"] = "gutter"
root["collateral_value"] = GUTTER_COLLATERAL
root["collateral_label"] = "the gutter"
return root
@ -2277,6 +2421,15 @@ ASSETS = [
nodes=["wall", "door", "window", "roof", "fascia", "gutter",
"window_glow", "window_light_anchor",
"fascia_anchor_01", "fascia_anchor_02", "fascia_anchor_03"]),
# The torn-gutter aftermath (SPRINT12 §gate 3.3). Same height as the intact
# house — a house doesn't fall, only its eave line does — but DEEPER (y),
# because the right gutter run and the fascia offcuts are on the grass out
# in the yard. If y ever measures ~1.2 again someone un-tore it.
dict(name="house_yardside_wrecked", fn=build_house_yardside_wrecked,
dims=((9.0, 9.9), (1.7, 2.6), (2.8, 3.3)),
nodes=["wall", "door", "window", "roof", "window_glow",
"fascia_torn", "gutter_torn", "gutter_down",
"downpipe_loose", "debris_fascia"]),
# site_02 (corner block): the anchor trap, not just dressing.
dict(name="carport_01", fn=build_carport_01,
dims=((3.0, 3.5), (5.2, 5.8), (2.4, 2.8)),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -67,9 +67,12 @@ async function run() {
if (world.dress) { try { await world.dress(); dressed = true; } catch (e) { /* fall through, flagged below */ } }
// world.anchors are the REAL dressed positions — freeze sway like balance.test.
// ratingHint rides along (SPRINT12): the sweep prices hardware against
// rating × hint, and dropping it here would audit a yard where the fascia
// and the carport beam are honest steel — the exact lie the wiring killed.
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 { id: a.id, type: a.type, ratingHint: a.ratingHint, pos, sway: () => pos };
});
const stormDef = await loadJSON(`../../web/world/data/storms/${stormName}.json`);
@ -105,7 +108,7 @@ async function run() {
else { mk.textContent = `✗ $${r.hw} > $${START_BUDGET}`; mk.className = 'warn'; }
const cs = tr.insertCell(); cs.className = 'corner';
cs.innerHTML = r.tiers.map((c) =>
`${c.id} ${(c.peak / 1000).toFixed(1)}kN→${c.tier ? '$' + c.tier.cost : '<span class="none">NONE</span>'}`).join(' ');
`${c.id}${c.hint !== 1 ? `×${c.hint}` : ''} ${(c.peak / 1000).toFixed(1)}kN→${c.tier ? '$' + c.tier.cost : '<span class="none">NONE</span>'}`).join(' ');
}
el('out').appendChild(tbl);

View File

@ -67,14 +67,34 @@ const BACKYARD_01 = {
bed: { x: 1, z: 2, w: 6, d: 4 },
venturi: [], // backyard_01.json ships "venturi": [] — no funnel. Stated, not assumed.
anchors: [
// dress()-only: adopted from E's GLBs. Unverifiable headless.
['h1', 'house', -3.00, 2.48, -9.95], ['h2', 'house', 0.00, 2.48, -9.95], ['h3', 'house', 3.00, 2.48, -9.95],
['t1', 'tree', -9.96, 3.45, 0.54], ['t2', 'tree', 7.83, 2.93, -0.85],
['t1b', 'tree', -9.94, 3.96, 2.78], ['t1c', 'tree', -10.38, 5.05, 2.98], ['t2b', 'tree', 8.14, 3.70, -0.96],
// pure world.js — cross-checked against live code on every run.
['p1', 'post', -4.85, 3.95, 5.93], ['p2', 'post', 4.31, 3.96, 6.46], ['p3', 'post', 0.00, 3.95, 7.56],
['p4', 'post', -3.72, 4.00, -1.40],
].map(([id, type, x, y, z]) => ({ id, type, pos: { x, y, z } })),
// dress()-only: adopted from E's GLBs. Unverifiable headless. The 6th column
// is ratingHint, dumped from the live dressed world.anchors (SPRINT12) —
// the fascia's 0.35 and the branches' 1.0/0.88/0.76 are E's baked numbers,
// and the sweep prices hardware against rating × hint now that sail.js
// fails on it. Hand-kept like the positions; the browser front-end is the
// authority if these ever drift.
//
// FULL PRECISION, not 2-decimal — measured, the hard way (SPRINT12): the
// old 2-dp dump moved t2 by ~5 mm, which sat it differently against t1's
// shelter cone and swung its ice-night peak 4.8 → 9.3 kN — the two
// front-ends disagreed by one whole winnable line (ice: 1 winner vs the
// browser's true 2) until the positions matched to the float. Near a
// shelter edge the sweep is mm-sensitive; round nothing.
['h1', 'house', -3, 2.4797002522727953, -9.949999988079071, 0.35],
['h2', 'house', 0, 2.4797002522727953, -9.949999988079071, 0.35],
['h3', 'house', 3, 2.4797002522727953, -9.949999988079071, 0.35],
['t1', 'tree', -9.960037052631378, 3.4546064703375015, 0.5399932861328125, 1.0],
['t2', 'tree', 7.833247900009155, 2.9268529771469947, -0.8460308313369751, 1.0],
['t1b', 'tree', -9.941157281398773, 3.9636089174657974, 2.7770196199417114, 0.88],
['t1c', 'tree', -10.381556510925293, 5.045027431717506, 2.97845321893692, 0.76],
['t2b', 'tree', 8.141596481204033, 3.698920047154319, -0.9573200941085815, 0.88],
// pure world.js — cross-checked against live code on every run (0.01 m
// tolerance). Posts are site-JSON anchors: DEFAULT_RATING_HINT = 1.
['p1', 'post', -4.852518667660811, 3.9450703766405963, 5.930856149363214, 1.0],
['p2', 'post', 4.308797385647288, 3.958677942376306, 6.463196078470932, 1.0],
['p3', 'post', 0, 3.954237880742151, 7.556692403840262, 1.0],
['p4', 'post', -3.721247340646687, 4.000586139378515, -1.3954677527425075, 1.0],
].map(([id, type, x, y, z, ratingHint]) => ({ id, type, ratingHint, pos: { x, y, z } })),
};
/** Anchors dress() never touches — so live world.js IS authoritative for these. */
@ -160,6 +180,9 @@ async function loadSite(path) {
// This is what a dressed export (or a future createWorld dump) would hand us.
const anchors = (j.anchors || []).map((a) => ({
id: a.id, type: a.type || 'post',
// hint 1 when the export omits it — but a dressed export SHOULD carry it,
// or a fascia/carport anchor audits as honest steel (see sweep.js tierFor).
ratingHint: a.ratingHint ?? 1,
pos: { x: a.pos?.x ?? a.x, y: a.pos?.y ?? a.y, z: a.pos?.z ?? a.z },
}));
// A resolved export still owes us the site's funnel — the venturi is site data,
@ -205,7 +228,7 @@ async function main() {
console.log(`${cands.length} quad(s) in band shading the bed:\n`);
for (const r of rows) {
const cs = r.tiers.map((c) => `${c.id} ${(c.peak / 1000).toFixed(1)}kN→${c.tier ? '$' + c.tier.cost : 'NONE'}`).join(' ');
const cs = r.tiers.map((c) => `${c.id}${c.hint !== 1 ? `×${c.hint}` : ''} ${(c.peak / 1000).toFixed(1)}kN→${c.tier ? '$' + c.tier.cost : 'NONE'}`).join(' ');
const mark = r.unholdable.length ? '✗ unholdable' : r.hw <= START_BUDGET ? `$${r.hw}` : `$${r.hw} > $${START_BUDGET}`;
console.log(` ${r.ids.join(',').padEnd(18)} ${r.area.toFixed(0).padStart(3)} m² cover ${(r.cover * 100).toFixed(0).padStart(3)}% ${mark.padEnd(14)} ${cs}`);
}

View File

@ -35,13 +35,28 @@ export function areaOf(q) {
return Math.abs(a / 2);
}
/** Cheapest hardware that holds a corner at `peakN` newtons, or null if the shop can't. */
export const tierFor = (peakN) => HARDWARE.find((h) => h.rating >= peakN) || null;
/**
* Cheapest hardware that holds a corner at `peakN` newtons off an anchor with
* `ratingHint` hint, or null if the shop can't at any price.
*
* SPRINT12: sail.js fails a corner on `load > hw.rating * anchor.ratingHint`
* (A's ruling the anchor is a failure point, not just the steel), so the
* hardware that HOLDS is the cheapest h with `h.rating * hint >= peak`, i.e.
* `h.rating >= peak / hint`. An audit that keeps pricing on bare hw.rating
* flies a different game than ships: on the corner block it would sell you a
* $5 carabiner for a beam that now lets go at 0.22 of it.
*/
export const tierFor = (peakN, ratingHint = 1) =>
HARDWARE.find((h) => h.rating * ratingHint >= peakN) || null;
/**
* Sweep every bed-covering quad and price the cheapest holding line.
* @param {object} o
* @param {Array} o.anchors resolved anchors: { id, type, pos:{x,y,z}, sway }
* @param {Array} o.anchors resolved anchors: { id, type, pos:{x,y,z}, sway,
* ratingHint } omit ratingHint and the anchor is
* priced at full hardware strength (hint 1), which
* is a LIE for any GLB-dressed anchor (fascia 0.35,
* carport beam 0.22). Hand this the dressed truth.
* @param {object} o.bed garden bed rect { x, z, w, d }
* @param {object} o.stormDef the storm JSON to fly
* @param {object} o.calmDef the calm-day JSON to settle on (storm_01_gentle)
@ -103,7 +118,12 @@ export function auditSweep({ anchors, bed, stormDef, calmDef, venturi = [] }) {
rig.resetPeaks(); // ← the storm starts HERE
for (let i = 0; i < stormDef.duration * 60; i++) rig.step(FIXED_DT, wind, i * FIXED_DT);
const tiers = rig.corners.map((c) => ({ id: c.anchorId, peak: c.peakLoad, tier: tierFor(c.peakLoad) }));
// Price each corner against its anchor's EFFECTIVE strength. c.anchor is the
// resolved anchor handed in above; `?? 1` mirrors sail.js for bare fixtures.
const tiers = rig.corners.map((c) => ({
id: c.anchorId, peak: c.peakLoad, hint: c.anchor.ratingHint ?? 1,
tier: tierFor(c.peakLoad, c.anchor.ratingHint ?? 1),
}));
const unholdable = tiers.filter((c) => !c.tier);
const hw = tiers.reduce((s, c) => s + (c.tier ? c.tier.cost : 0), 0);
rows.push({ ...cnd, tiers, unholdable, hw, total: hw + AUDIT.SPARE_COST,

View File

@ -87,4 +87,36 @@ test('no venturi is a no-op — a site without a funnel is untouched', () => {
}
});
test('pricing reads the ANCHOR, not just the steel — ratingHint reaches tierFor', () => {
// SPRINT12: sail.js fails a corner on rating × ratingHint, so the sweep must
// price hardware against the same product or it audits a nicer yard than
// ships — a fascia (0.35) or carport beam (0.22) corner would be sold a $5
// carabiner that the sim now snaps. Same synthetic yard, one anchor's hint
// dropped to 0.01: its corner's demand (peak / hint) leaves the shop's 6.5 kN
// ceiling entirely, so its tier must go to NONE while every OTHER corner and
// every PEAK stays byte-identical (the hint is a pricing fact, not physics —
// the sweep flies unbreakable audit hardware). Written to fail if the hint
// is dropped from sweep.js's tierFor call: the two runs collapse into one.
const sweep = (anchors) => auditSweep({ anchors, bed: BED, stormDef: STORM, calmDef: CALM, venturi: [] }).rows[0];
const honest = sweep(ANCHORS);
const lied = sweep(ANCHORS.map((a) => (a.id === 'a1' ? { ...a, ratingHint: 0.01, sway: a.sway } : a)));
for (let i = 0; i < honest.tiers.length; i++) {
assert(Math.abs(honest.tiers[i].peak - lied.tiers[i].peak) < 1e-9,
`corner ${honest.tiers[i].id}: ratingHint moved a PEAK (${honest.tiers[i].peak} -> ${lied.tiers[i].peak}) — ` +
'the hint is a failure threshold, it must never touch the flown loads');
}
const a1 = lied.tiers.find((c) => c.id === 'a1');
const a1honest = honest.tiers.find((c) => c.id === 'a1');
assert(a1honest.tier, 'fixture drift: a1 must be holdable at hint 1 or this test asserts nothing');
assert(!a1.tier,
`a1 at hint 0.01 (demand ${(a1.peak / 0.01 / 1000).toFixed(1)} kN vs the 6.5 kN ceiling) still got ` +
`hardware ($${a1.tier?.cost}) — sweep.js is pricing bare hw.rating, not rating × ratingHint`);
const others = lied.tiers.filter((c) => c.id !== 'a1');
assert(others.every((c) => c.tier && c.tier.cost === honest.tiers.find((h) => h.id === c.id).tier.cost),
'a hint on a1 repriced a DIFFERENT corner — hints must be per-anchor');
assert(lied.unholdable.some((c) => c.id === 'a1'),
'an over-ceiling corner must land in unholdable, or the verdict lies');
});
export const SWEEP_TESTS = TESTS;

View File

@ -22,6 +22,24 @@
"house": {
"model": "house_yardside_v1",
"wreckedModel": "house_yardside_wrecked_v1",
"collateralKey": "gutter",
"collateralValue": 90,
"collateralLabel": "the gutter",
"_collateral": [
"SPRINT12 gate 3.3 - A's ruling: $90, E's proposal ADOPTED unchanged. The band is established",
"(gnome 25, carport 180, ceiling ~250) and the gutter goes between ornament and structure",
"because that's what it is. At 90 the night the fascia trap fires is WIPED - kit (~80) and fee",
"(~76 on the wild night) together - which is the fascia's whole lesson priced: the 'free'",
"anchors were the dearest kit in the yard. Under ~50 it couldn't wipe its own night; over ~130",
"the tutorial yard outbids half a carport for a smaller lie (fascia 0.35 is honestly better",
"steel than the beam's 0.22). First trap a player can hit costs them a night, not the week.",
"The house is NOT in structures[] - it keeps its own loader block (graybox, north boundary,",
"bed shading) - so collateralKey names which collateral string this price answers, per E's",
"chain: fascia anchors carry collateral 'gutter', this prices it, the wreck swaps on it.",
"Canonical number lives HERE (sites are data); the GLB's baked extras are E's proposal and",
"the fallback. Rule a different number -> change the factory too, or two sources tell two lies."
],
"x": 0, "z": -10.5,
"anchors": [
{ "id": "h1", "node": "fascia_anchor_01", "type": "house", "work": "bracket" },
@ -87,6 +105,24 @@
"gnome": { "model": "garden_gnome_01_v1", "x": 4.3, "z": 4.4, "rotYDeg": -126, "collateralValue": 25 },
"bike": {
"model": "bike_kid_01_v1", "x": -7, "z": 9.69, "rotYDeg": 180,
"_why": [
"The Hendersons' kid's bike, against the south fence. THE LEAN IS BAKED INTO THE GLB and it",
"leans toward local -Z (E's THREADS note; e.test pins it) - a bike doesn't stand up on its own.",
"rotYDeg 180 turns that lean into global +Z, INTO the fence. Any placement that doesn't point",
"the lean at something to lean ON reads as a physics bug and isn't one.",
"z is MEASURED, not reasoned: the bars' grip reaches 0.286 m past the origin (the tyre contact",
"line) toward the lean, and the fence rails sit at z = 10 +/- 0.02, so 9.69 + 0.286 = 9.98 =",
"the rail's inner face - bars touch the fence, tyres stand 0.31 m clear. x = -7 sits between",
"fence posts (-7.5 and -5), so the grip meets rail, not post.",
"NO collateralValue, BY RULING (THREADS [A] sprint 12): the sim cannot knock a bike over, and",
"billing $60 for an event the player never sees is the kind of lie the invoice exists to kill.",
"Leaning on the windward fence is the one pose a southerly can't falsify - the gust pins it",
"harder. Price it the day it can fall."
]
},
"fence": {
"sides": ["south", "west", "east"]
},

View File

@ -20,6 +20,33 @@ import { forecastLines, leadFor } from './weather.js';
const clamp01 = (v) => (v < 0 ? 0 : v > 1 ? 1 : v);
const kmh = (ms) => ms * 3.6;
/**
* SPRINT12 gate 3 the letterhead, and the two rulings E left with it
* (tools/jobsheet/index.html; full reasoning in THREADS [A]).
*
* RULING 1 the masthead is HARD YARDS, adopted as proposed. It's the joke the
* game already tells ("nobody thanks you for the storm that did nothing") said
* as a business name, it's literally about yards, and it's one mark at
* letterhead size. E's own caveat stands with it: the day the player gets a
* name, a surname mark is the better answer, and this constant is the only
* thing that changes.
*
* RULING 2 the ABN stays sequential, exactly as E shipped it. Any plausible
* 11-digit number is potentially a REAL business's tax identity, and we are not
* printing a stranger's ABN on a game card. Sequential digits read as "example"
* the way 555 phone numbers do deliberate, not lazy. DO NOT "fix" this into
* something realistic; that is the bug, not the polish.
*/
const BUSINESS = { mark: 'HARD YARDS', trade: 'landscaping · shade · drainage' };
const ABN = 'ABN 12 345 678 901';
/**
* Docket numbers. 1040 + night: a running count off a small outfit's pad, and
* the job sheet and its invoice share the number JOB 1043's morning is
* INV 1043, which is how the two documents answer each other line for line.
*/
const docketNo = (night) => 1040 + night;
// Load bar colours: green → amber → red. The amber band is deliberately wide;
// a corner at 60% in a lull is one gust from 100% and the player should feel
// that before the bar turns red on them.
@ -49,11 +76,19 @@ const CSS = `
color:#93a6b2; opacity:.85; white-space:nowrap; }
#hud-card { position:fixed; inset:0; z-index:30; display:none; place-items:center;
/* SPRINT12: E's letterhead + brief + conditions made the tall cards taller
than a short window, and a RIG IT button below the fold with no scroll is a
soft-lock with good typography. 'safe center' keeps the top reachable when
the card overflows (plain 'center' clips BOTH ends); the value above is the
fallback for engines that don't know 'safe'. Seen, not reasoned: the button
was gone at 800x450. (And no backticks in this comment this whole CSS
block is a JS template literal, as the dawn block already warns.) */
place-items:safe center; overflow-y:auto;
background:#060a0dc4; backdrop-filter:blur(3px);
font:13px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; color:#dde5ea; }
#hud-card.on { display:grid; }
#hud-card .card { background:#0d1418; border:1px solid #2f3f4a; border-radius:9px;
padding:22px 26px; min-width:440px; max-width:620px; pointer-events:auto; }
padding:22px 26px; margin:20px 0; min-width:440px; max-width:620px; pointer-events:auto; }
#hud-card h1 { margin:0 0 2px; font-size:19px; letter-spacing:.16em; color:#fff; }
#hud-card h2 { margin:0 0 16px; font-size:12px; font-weight:400; color:#8ba0ad; letter-spacing:.04em; }
#hud-card .row { display:flex; justify-content:space-between; gap:18px; padding:3px 0;
@ -84,22 +119,126 @@ const CSS = `
#hud-card .ledger .row.total { margin-top:6px; padding-top:8px; border-top:1px solid #24343d; }
#hud-card .ledger .row.total b { color:#fff; }
/* SPRINT11 the job sheet and the invoice. STRUCTURE ONLY, deliberately: the
letterhead and the invoice styling are Lane E's this sprint (§gate 2), and
everything below is the plainest thing that reads correctly so E can restyle
it without unpicking layout. The class names are the contract .letterhead,
.brief, .jobsheet, .tomorrow and E owns what they look like. */
#hud-card .letterhead { display:flex; justify-content:space-between; align-items:baseline;
margin:-4px 0 10px; padding-bottom:8px; border-bottom:1px solid #24343d;
font-size:12px; letter-spacing:.18em; text-transform:uppercase; color:#7ee0ff; }
#hud-card .letterhead .inv { color:#8ba0ad; letter-spacing:.1em; }
#hud-card .brief { margin:10px 0 12px; padding:9px 11px; border-left:2px solid #2f3f4a;
background:#101a20; color:#c3d2da; font-size:13px; line-height:1.55; font-style:italic; }
#hud-card .jobsheet { margin-top:12px; padding-top:10px; border-top:1px solid #24343d; }
#hud-card .jobsheet .row b { color:#a8f0b8; }
#hud-card .jobsheet .row.total { margin-top:6px; padding-top:8px; border-top:1px solid #24343d; }
#hud-card .jobsheet .row.total b { color:#fff; }
/* Tomorrow is a rumour, and it should look like one next to tonight's numbers. */
/* SPRINT12 E's letterhead/invoice kit, pasted from tools/jobsheet/index.html
(between the CUT markers, verbatim). Sprint 11's placeholder rules for
.letterhead/.brief are gone E designed against those class names and this
is the styling they were holding the seat for. E's design commentary kept:
the reasoning is why the rules look like this. */
/* --- the letterhead ----------------------------------------------------
One business, two documents. This is the whole trick of the sprint: the
job sheet and the invoice carry the SAME letterhead, so they read as a
pair of papers off the same outfit's printer rather than as two game
screens. The player's business is the constant; the client changes every
night. That's the framing DESIGN.md opens with "you run a small
landscaping outfit" finally showing up on the glass.
Sits above the existing .card content, inside the same .card box. */
#hud-card .letterhead {
display: flex; align-items: baseline; justify-content: space-between;
gap: 16px; margin: -4px 0 14px; padding-bottom: 10px;
border-bottom: 2px solid #2f3f4a;
}
#hud-card .letterhead .mark {
font-weight: 800; font-size: 15px; letter-spacing: .22em; color: #fff;
white-space: nowrap;
}
/* The trade line does the work a logo would. Lowercase and spaced out so it
reads as printed rule, not as a heading competing with the mark. */
#hud-card .letterhead .trade {
font-size: 10px; letter-spacing: .13em; color: #6d818e; margin-top: 3px;
}
#hud-card .letterhead .docket { text-align: right; white-space: nowrap; }
#hud-card .letterhead .docket .kind {
font-weight: 700; font-size: 11px; letter-spacing: .18em; color: #8ba0ad;
}
#hud-card .letterhead .docket .no { font-size: 10px; color: #55677a; letter-spacing: .06em; }
/* --- bill-to / job-for block -------------------------------------------
Deliberately the same component on both documents. On the job sheet it's
who you're working for; on the invoice it's who's paying. Same box, and
the fact that it doesn't move between the two is the joke landing. */
#hud-card .billto { margin: 0 0 12px; }
#hud-card .billto .who { font-weight: 700; color: #fff; letter-spacing: .04em; }
#hud-card .billto .addr { font-size: 11px; color: #6d818e; }
/* --- the brief ---------------------------------------------------------
The client's own words. Italic and rule-marked because it is the one bit
of text on the card that isn't the game talking to the player — it's a
person who wants their seedlings alive. It should feel quoted, and it
should be the thing the player's eye lands on after the letterhead,
because it is the only place the stakes are ever said out loud. */
#hud-card .brief {
margin: 0 0 14px; padding: 9px 0 9px 12px;
border-left: 2px solid #3f5561;
color: #c3d0d9; font-style: italic; line-height: 1.6;
}
#hud-card .brief .attrib {
display: block; margin-top: 5px; font-style: normal;
font-size: 10px; letter-spacing: .1em; color: #55677a;
}
/* --- section rules ------------------------------------------------------ */
#hud-card .sect {
margin: 16px 0 7px; font-size: 10px; font-weight: 700; letter-spacing: .18em;
color: #55677a; border-bottom: 1px solid #1c262d; padding-bottom: 5px;
}
/* --- the pay schedule (job sheet) --------------------------------------
This is a QUOTE, not a receipt: it's what the night is worth if you do it
right. It reuses your .row shape so it lines up with everything else, but
the money is dimmed these are amounts you have NOT earned yet, and they
should not read with the same confidence as the bank line. The conditions
are the point; the numbers are just what the conditions are worth. */
#hud-card .sched .row b { color: #9fb3bf; font-weight: 700; }
#hud-card .sched .cond {
font-size: 10px; color: #55677a; letter-spacing: .02em;
padding: 0 0 5px; border-bottom: 1px solid #1c262d; margin-top: -2px;
}
#hud-card .sched .row.headline b { color: #fff; }
#hud-card .sched .row.max { border-bottom: 0; margin-top: 6px; padding-top: 7px;
border-top: 1px solid #24343d; }
#hud-card .sched .row.max span { color: #8ba0ad; }
#hud-card .sched .row.max b { color: #ffd9a3; }
/* --- the invoice -------------------------------------------------------
Your .ledger already IS an invoice; it just never said so. These rules sit
ON TOP of it paste them and .ledger keeps every behaviour it has, it
just gains a rule above the total and a due line under it.
.earned/.bad you already colour. The one thing I've added is .void: a
bonus that was on the job sheet and did NOT survive the night. Struck
through, not hidden. The player must see the money they didn't get sitting
in the same column as the money they did a bonus you never see fail is a
bonus you never learn to protect. This is the single highest-value line in
the whole handover, and it's four CSS declarations. */
#hud-card .ledger .row.void span { color: #55677a; }
#hud-card .ledger .row.void b {
color: #55677a; font-weight: 400; text-decoration: line-through;
text-decoration-color: #7d2b2b; text-decoration-thickness: 1px;
}
/* The amount due. An invoice's whole rhetorical shape is that everything
above is argument and this is the conclusion. Give it the weight. */
#hud-card .ledger .row.due {
margin-top: 8px; padding-top: 9px; border-top: 2px solid #2f3f4a; border-bottom: 0;
align-items: baseline;
}
#hud-card .ledger .row.due span { color: #8ba0ad; letter-spacing: .12em; font-weight: 700;
font-size: 11px; }
#hud-card .ledger .row.due b { color: #fff; font-size: 20px; letter-spacing: .02em; }
#hud-card .ledger .row.due.neg b { color: #ff8f86; }
/* The terms line. Pure flavour, and the cheapest joke on the card: a real
invoice's most boring sentence, printed under a night that nearly killed
you. Left in as its own class so you can delete it in one line if it
doesn't land. */
#hud-card .terms {
margin-top: 10px; font-size: 10px; color: #45566a; letter-spacing: .04em;
}
/* ---- end of E's kit ----------------------------------------------------- */
/* Tomorrow is a rumour, and it should look like one next to tonight's numbers.
(Mine, not E's — the kit predates the tomorrow line and doesn't restyle it.) */
#hud-card .tomorrow { display:flex; gap:10px; align-items:baseline; margin-top:9px;
font-size:12px; color:#6d8494; }
#hud-card .tomorrow .tlabel { letter-spacing:.14em; text-transform:uppercase; color:#55707f; }
@ -349,14 +488,22 @@ export function createHud(d) {
const dist = _p.distanceTo(_cam);
b.holder.scale.setScalar(Math.max(0.75, Math.min(3.2, dist / 7)));
const frac = clamp01((c.load || 0) / c.hw.rating);
// SPRINT12 — B's flag, actioned: the bar reads the EFFECTIVE rating,
// rating × ratingHint, because that's the number sail.js fails on now.
// Off the bare rating a fascia corner showed 35% margin it didn't have
// and blew mid-green — the HUD's one job at that moment is the "…the
// shackle, I KNEW about the shackle" beat, and a bar that lies about
// the margin steals it. The label prints the same effective number:
// load-vs-what-it-breaks-at, one truth, both places.
const effRating = c.hw.rating * (c.anchor?.ratingHint ?? 1);
const frac = clamp01((c.load || 0) / effRating);
b.fill.scale.x = Math.max(0.001, (c.broken ? 1 : frac) * BAR_W);
b.fill.material.color.setHex(barColor(frac, c.broken));
if (redraw) {
const text = c.broken
? `${c.anchorId.toUpperCase()} BLOWN`
: `${c.anchorId.toUpperCase()} ${((c.load || 0) / 1000).toFixed(1)}/${(c.hw.rating / 1000).toFixed(1)}kN`;
: `${c.anchorId.toUpperCase()} ${((c.load || 0) / 1000).toFixed(1)}/${(effRating / 1000).toFixed(1)}kN`;
if (text !== b.lastText) {
b.lastText = text;
drawLabel(b.label, text, c.broken ? '#ff8f86' : frac > 0.85 ? '#ffb1ab' : '#dde5ea');
@ -406,11 +553,28 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
// else. The client and the brief are data (week.js NIGHTS), so an
// unbriefed night degrades to the old storm card rather than an empty
// letterhead — which is also what keeps every existing test honest.
//
// SPRINT12 — the letterhead is E's kit now: the outfit's mark on the
// left, the docket on the right, the client demoted to a bill-to block —
// because the business is the constant and the client changes nightly.
const job = wk.job ?? {};
const letterhead = job.client
? `<div class="letterhead">${job.client}</div>` : '';
const letterhead = job.client ? `
<div class="letterhead">
<div>
<div class="mark">${BUSINESS.mark}</div>
<div class="trade">${BUSINESS.trade}</div>
</div>
<div class="docket">
<div class="kind">JOB SHEET</div>
<div class="no">JOB ${docketNo(wk.night)} · ${ABN}</div>
</div>
</div>
<div class="billto">
<div class="who">${job.client}</div>
${job.addr ? `<div class="addr">${job.addr}</div>` : ''}
</div>` : '';
const brief = job.brief
? `<p class="brief">${job.brief}</p>` : '';
? `<div class="brief">${job.brief}</div>` : '';
// BUDGET Y — and this is the actual feature, not the flavour. The fee has
// existed since Sprint 8 and the player has never seen it until the money
@ -418,13 +582,22 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
// was worth, which is a reveal, not a decision. Quoting the maxima up front
// makes the shop a judgement ("is $45 of garden bonus worth a $30
// shackle?") instead of a guess.
// E's schedule shape: each amount carries its CONDITION underneath,
// because the conditions are the point — the numbers are just what the
// conditions are worth. The garden's condition says "scales", honestly:
// E's preview copy read "bed above 80% at dawn" and the mechanic pays
// linearly, and a quote that misstates its own terms is a lie on paper.
const q = wk.quote;
const schedule = q ? `
<div class="jobsheet">
<div class="row"><span>base the job</span><b>$${q.base}</b></div>
<div class="row"><span>garden bonus if the bed lives</span><b>up to $${q.garden}</b></div>
<div class="row"><span>clean bonus nothing of theirs broken</span><b>$${q.clean}</b></div>
<div class="row total"><span>the job's worth</span><b>up to $${q.total}</b></div>
<div class="sect">WHAT IT PAYS</div>
<div class="sched">
<div class="row headline"><span>callout fee</span><b>$${q.base}</b></div>
<div class="cond">the night, rigged and stood up</div>
<div class="row"><span>garden bonus</span><b>up to $${q.garden}</b></div>
<div class="cond">paid on what's left of the bed at dawn</div>
<div class="row"><span>clean site</span><b>$${q.clean}</b></div>
<div class="cond">nothing of theirs broken</div>
<div class="row max"><span>the night, done right</span><b>$${q.total}</b></div>
</div>` : '';
// Lane C's forecast lead (SPRINT11 gate 2): tomorrow, hedged. Their
@ -447,13 +620,18 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
<span class="tline">${tf.wind}${tf.confidence ? ` · ${tf.confidence}` : ''}</span>
</div>` : '';
// E's document order: letterhead, who it's for, their words, THEN the
// night — the paper establishes whose job this is before it says what the
// weather will do about it. The terms line under the button is E's
// cheapest joke and their best: quoted on the forecast, weather is not a
// variation, printed above a night that may cost you a carport.
card.innerHTML = `<div class="card jobcard">
${letterhead}
${brief}
<h1>NIGHT ${wk.night} OF ${wk.nights}</h1>
<div class="pips">${pips}</div>
<h2>${(f.name ?? key).replace(/_/g, ' ').toUpperCase()}${night ? ' · NIGHT' : ''}</h2>
${siteLine}
${brief}
<div class="stat">${f.wind}</div>
<div class="stat">${f.rain}${hail ? ' · hail forecast' : ''}</div>
${f.confidence ? `<div class="stat" style="color:#8ba0ad">${f.confidence}</div>` : ''}
@ -469,6 +647,7 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
A change means the corners that were slack all storm are the loaded ones after it.
</div>` : ''}
<button class="go">RIG IT</button>
${job.client ? '<div class="terms">Quoted on the forecast at time of callout. Weather is not a variation.</div>' : ''}
</div>`;
card.classList.add('on');
hud.setVisible(false);
@ -557,18 +736,30 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
? (r.collateral ?? []).map((c) => `
<div class="row bad"><span>${c.what}</span><b>$${c.cost}</b></div>`).join('')
: '';
// SPRINT12 — E's .void: the forfeited bonus is STRUCK THROUGH, not zeroed.
// The quoted $${cleanMax} stays on the paper with a line through it — the
// player must see the money they didn't get sitting in the same column as
// the money they did. A bonus you never see fail is a bonus you never
// learn to protect. (E's words; the single highest-value line in the kit.)
const cleanRow = w ? (w.clean
? `<div class="row"><span>clean bonus — nothing of theirs broken</span><b>+$${w.clean}</b></div>`
: `<div class="row bad"><span>clean bonus — forfeited</span><b>$0</b></div>`) : '';
? `<div class="row"><span>clean site</span><b>+$${w.clean}</b></div>`
: `<div class="row void"><span>clean site</span><b>$${w.cleanMax ?? 0}</b></div>`) : '';
// AMOUNT DUE is what tonight's paper actually says: everything above it is
// argument, this is the conclusion. pay spent, so it goes negative the
// night you take the carport with you — and the bank line under it stays,
// because "what this night was worth" and "where that leaves you" are two
// different facts.
const due = w ? w.pay - w.spent : 0;
const money = w ? `
<div class="ledger">
<div class="row"><span>${w.won ? 'base — the job' : `base — night lost (${Math.round(100 * w.fee / Math.max(1, w.fullFee))}%)`}</span><b>+$${w.fee}</b></div>
<div class="row"><span>${w.won ? 'callout fee' : `callout fee — night lost (${Math.round(100 * w.fee / Math.max(1, w.fullFee))}%)`}</span><b>+$${w.fee}</b></div>
<div class="row"><span>garden bonus ${r.hp.toFixed(0)}% of the bed</span><b>+$${w.bonus}</b></div>
${cleanRow}
<div class="row"><span>gear recovered</span><b>+$${w.refund}</b></div>
${collateralRows}
<div class="row"><span>spent on the rig</span><b>$${w.spent}</b></div>
<div class="row bad"><span>spent on the rig</span><b>$${w.spent}</b></div>
<div class="row due ${due < 0 ? 'neg' : ''}"><span>AMOUNT DUE</span><b>${due < 0 ? '' : '+'}$${Math.abs(due)}</b></div>
<div class="row total"><span>in the bank</span><b>$${w.bankBefore} $${w.bankAfter}</b></div>
</div>` : '';
@ -577,14 +768,35 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
: w.outcome === 'win' ? 'SEE THE WEEK'
: 'SEE THE DAMAGE';
// The same letterhead as the job sheet, same docket number, and the kind
// flips to TAX INVOICE — one outfit, two papers, one night apart. The
// terms line: E's flavour when your failure broke something of theirs,
// the world's most boring sentence otherwise.
const letterhead = w?.client ? `
<div class="letterhead">
<div>
<div class="mark">${BUSINESS.mark}</div>
<div class="trade">${BUSINESS.trade}</div>
</div>
<div class="docket">
<div class="kind">TAX INVOICE</div>
<div class="no">INV ${docketNo(w.night)} · ${ABN}</div>
</div>
</div>
<div class="billto">
<div class="who">${w.client}</div>
${w.addr ? `<div class="addr">${w.addr}</div>` : ''}
</div>` : '';
card.innerHTML = `<div class="card jobcard">
${w?.client ? `<div class="letterhead">${w.client}<span class="inv">invoice</span></div>` : ''}
${letterhead}
<h1>MORNING${w ? ` · NIGHT ${w.night} OF 5` : ''}</h1>
<h2>${r.subtitle}</h2>
${rows}
${money}
<div class="verdict ${r.win ? 'win' : 'lose'}">${r.verdict}</div>
<button class="go">${next}</button>
${w?.client ? `<div class="terms">Payable 14 days. ${w.collateral ? 'Theyll want that made right by Friday.' : 'Thank you for your business.'}</div>` : ''}
</div>`;
card.classList.add('on');
hud.setVisible(false);
@ -600,7 +812,7 @@ showForecast({ key, def, site, tomorrowDef }, wk, onGo) {
get cardOpen() { return card.classList.contains('on'); },
dispose() {
root.remove(); card.remove(); style.remove();
root.remove(); card.remove(); style.remove(); dawn.remove();
d.scene.remove(barGroup);
quad.dispose();
for (const b of bars) {

View File

@ -162,8 +162,15 @@ function createGarden(world) {
* @returns {{verdict: string, mode: string}}
*/
export function verdictFor({ hp, lost, win, dmg, pondPeak, pondDumped }) {
// SPRINT12 — B's flag, actioned: "weakest link that went first" reduces on
// the EFFECTIVE rating (rating × ratingHint), matching sail.js's failure
// line and B's summary.weakest tie-break fix. On the bare rating a rated
// shackle on the carport beam (6.5 × 0.22 = 1.43 kN effective) out-ranks a
// carabiner on honest steel and the verdict names the wrong culprit — this
// sentence exists to teach which steel lied.
const eff = (c) => c.hw.rating * (c.anchor?.ratingHint ?? 1);
const worst = lost.length
? lost.reduce((a, c) => (a && a.hw.rating <= c.hw.rating ? a : c))
? lost.reduce((a, c) => (a && eff(a) <= eff(c) ? a : c))
: null;
const named = worst ? `${worst.hw.name} at ${worst.anchorId.toUpperCase()}` : '';
const hailKilled = dmg.hail > dmg.rain;

View File

@ -222,6 +222,16 @@ export class RiggingSession {
return rig.attach(this.picks.map((p) => p.anchorId), this.picks.map((p) => p.hw), this.tension);
}
/**
* What a pick's corner actually fails at, in newtons: hardware rating × the
* anchor's ratingHint (`?? 1` mirrors sail.js world.js guarantees the field,
* but a session can be handed bare test anchors that never met world.js).
*/
_effRating(p) {
const a = this.anchors.find((x) => x.id === p.anchorId);
return p.hw.rating * (a?.ratingHint ?? 1);
}
/** Everything the HUD needs to draw the prep panel, in one read. */
get summary() {
return {
@ -232,8 +242,16 @@ export class RiggingSession {
fabric: { id: this.fabric.id, name: this.fabric.name, porosity: this.fabric.porosity, cost: this.fabric.cost, blurb: this.fabric.blurb },
canStart: this.canStart,
corners: this.picks.map((p) => ({ anchorId: p.anchorId, hw: p.hw.name, rating: p.hw.rating, cost: p.hw.cost })),
// The weak link is the lowest EFFECTIVE rating — hw.rating × the anchor's
// ratingHint, the same product sail.js fails a corner on (SPRINT12, A's
// ruling). D's #7: this used to reduce on hw.rating alone with strict <,
// so four identical carabiners flagged whichever was clicked FIRST — the
// label pointed at click order, not steel, and on the corner block it
// named the genuinely worst anchor only by luck. Ratings ties still keep
// the first pick, honestly: if the products are equal the steel really is
// interchangeable and there is no "genuinely worst" to point at.
weakest: this.picks.length
? this.picks.reduce((w, p) => (p.hw.rating < w.hw.rating ? p : w)).anchorId
? this.picks.reduce((w, p) => (this._effRating(p) < this._effRating(w) ? p : w)).anchorId
: null,
};
}

View File

@ -211,6 +211,32 @@ test('summary names the weak link for the HUD', () => {
return `weak link flagged: ${sum.weakest}, $${sum.budget} left`;
});
test("weak link is rating × ratingHint, not click order (D's #7)", () => {
// Corner-block shape: uniform hardware, one anchor made of lies. The old
// reduce compared bare hw.rating with strict <, so four identical carabiners
// flagged whichever was clicked FIRST — on site_02 it pointed at cb1 only
// because D happened to click cb1 first. The label must follow the product
// sail.js actually fails on: hw.rating × anchor.ratingHint.
const anchors = [
{ id: 'q1', type: 'post', pos: { x: -3, y: 4, z: -3 }, ratingHint: 1 },
{ id: 'q2', type: 'post', pos: { x: 3, y: 4, z: -3 }, ratingHint: 1 },
{ id: 'q3', type: 'post', pos: { x: 3, y: 4, z: 3 }, ratingHint: 1 },
{ id: 'cb1', type: 'carport', pos: { x: -3, y: 2.3, z: 3 }, ratingHint: 0.22 },
].map((a) => ({ ...a, sway: () => a.pos }));
const s = new RiggingSession({ anchors });
// click the honest steel FIRST — the pre-fix code flags q1 here, forever
for (const id of ['q1', 'q2', 'q3', 'cb1']) assert(s.rig(id).ok, `rig ${id} failed`);
assert(s.summary.weakest === 'cb1',
`four identical carabiners: the weak link is the 0.22 carport beam, got ${s.summary.weakest}`);
// And better hardware on the lying anchor can make it genuinely NOT the weak
// link: rated 6500 × 0.22 = 1430 N still beats carabiner 1200 × 1.0 — the
// label follows the product, not the price tag and not the hint alone.
s.setHardware('cb1', RATED);
assert(s.summary.weakest === 'q1',
`rated@0.22 (1430 N) out-rates carabiner@1.0 (1200 N) — expected q1, got ${s.summary.weakest}`);
return 'weak link tracks rating × hint through hardware changes';
});
test('reset() returns a used session to a fresh prep phase', () => {
const s = session();
for (const id of ['h1', 'h3', 'p1', 'p2']) s.rig(id);

View File

@ -863,12 +863,27 @@ export class SailRig {
return n ? Math.sqrt(sum / n) / SIM_DT : 0;
}
/** Ported from the prototype: 0.4 s sustained over the rating and it lets go. */
/**
* Ported from the prototype: 0.4 s sustained over the rating and it lets go.
*
* SPRINT12 the threshold is the ANCHOR's, not just the hardware's:
* `hw.rating * anchor.ratingHint`. A's ruling (THREADS sprint 11, "THE
* RATINGS ARE REAL. WIRE THEM."): DESIGN's fascia/carport lie is an ANCHOR
* failing, and before this line every anchor was exactly as strong as the
* carabiner you hung off it E's baked 0.22/0.30/0.35 were read by nothing,
* and the lever that decided whether the trap fired was tension, not steel.
* Read LIVE from c.anchor each check (not captured at attach): dress() adopts
* GLB hints by MUTATING the anchor objects in place, and a prep-time rig must
* see the dressed number, not whatever was there when attach() ran.
* The `?? 1` is belt-and-braces world.js guarantees a finite hint on every
* anchor (DEFAULT_RATING_HINT, a.test pins it), because `load > rating *
* undefined` is `load > NaN`: always false, i.e. an UNBREAKABLE anchor.
*/
_checkFailure(dt) {
for (let k = 0; k < 4; k++) {
const c = this.corners[k];
if (c.broken) continue;
if (c.load > c.hw.rating) c.overload += dt;
if (c.load > c.hw.rating * (c.anchor.ratingHint ?? 1)) c.overload += dt;
else c.overload = Math.max(0, c.overload - dt * OVERLOAD_RECOVER);
if (c.overload > OVERLOAD_SECS) {
c.broken = true;

View File

@ -901,6 +901,119 @@ test('ponding: rain that the router swallows cannot silently pass', () => {
return 'no rain API -> no pond (and Lane A asserts the router keeps it)';
});
// --- SPRINT12: THE RATINGS ARE REAL (A's ruling, THREADS sprint 11) ---------
// sail.js fails a corner on load > hw.rating * anchor.ratingHint. This test
// asserts the CONSEQUENCE, not the formula: on the corner block, at max
// tension, through the funnel, the carport blows before an honest post — the
// yard's whole thesis, which D measured to be UNENFORCED before the wiring
// (at any tension the sim had no reason to prefer cb over q; the lever that
// decided the trap was tension, not steel).
const STORM_03B = await loadStormDef('storm_03b_earlybuster');
/**
* site_02_corner_block, DRESSED dumped live from world.anchors after dress()
* (browser, SPRINT12), same provenance as tools/site_audit's backyard dump.
* Node cannot dress (GLTFLoader + fetch), and the graybox positions are a
* different yard see audit.mjs's header for the whole sermon. ratingHint is
* E's baked number, adopted by adoptAnchor; q1..q4 are site-JSON posts at
* world.js's DEFAULT_RATING_HINT = 1.
*/
const SITE2_DRESSED = [
['tr1', 'tree', 6.833, 2.992, 0.154, 1.0], ['tr1b', 'tree', 7.142, 3.764, 0.043, 0.88],
['q1', 'post', -3.953, 3.937, -2.824, 1.0], ['q2', 'post', 3.983, 4.001, -2.276, 1.0],
['q3', 'post', 2.249, 3.991, 4.498, 1.0], ['q4', 'post', -3.334, 4.022, 4.445, 1.0],
['cb1', 'carport', -8.41, 2.289, -3, 0.22], ['cb2', 'carport', -5.59, 2.289, -3, 0.22],
['cp1', 'carport_post', -8.41, 1.679, -0.39, 0.3], ['cp2', 'carport_post', -8.41, 1.679, -5.61, 0.3],
].map(([id, type, x, y, z, ratingHint]) => {
const pos = { x, y, z };
return { id, type, ratingHint, pos, sway: () => pos };
});
/** site_02's funnel, verbatim from the site JSON — the yard's personality. */
const SITE2_VENTURI = [{ x: -6, z: 0, axis: 2.1, gain: 1.5, radius: 5, sharp: 3 }];
/** realWind() with the SITE's venturi on it, the way main.js sets it at load. */
function site2Wind(def) {
const field = createWindField(def);
field.setVenturi(SITE2_VENTURI);
const out = { x: 0, y: 0, z: 0 };
return {
sample(pos, t) { return field.vecAt(pos.x, pos.z, t, out); },
speedAt(t) { field.vecAt(-6, 0, t, out); return Math.hypot(out.x, out.z); },
gustTelegraph: () => null,
rainAt: (t) => field.rainAt(t),
rainMmPerHour: (t) => field.rainMmPerHour(t),
};
}
/**
* D's exact carport line (cb1 cb2 q2 q3) on UNIFORM rated shackles, settled 12 s
* on the calm day (funnel on the gap doesn't switch off for prep, same as the
* audit), then flown through the whole early buster. Uniform hardware ON
* PURPOSE: the only asymmetry left is the anchors themselves, so if a cb corner
* goes first it can only be ratingHint. Returns breaks with the rig's OWN clock
* on them settle is t 0..12, the storm is t 12..102.
*/
const flyCarportLine = (anchors, tension) => {
const r = new SailRig({ anchors, gridN: 10, porosity: 0.30 });
r.watchDivergence = true;
r.attach(['cb1', 'cb2', 'q2', 'q3'], Array(4).fill(HARDWARE[2]), tension);
const breaks = [];
r.events.on('break', (e) => breaks.push({ id: e.anchorId, t: e.t }));
const calm = site2Wind(STORM_01), storm = site2Wind(STORM_03B);
for (let i = 0, n = Math.round(12 / SIM_DT); i < n; i++) r.step(SIM_DT, calm, (i * SIM_DT) % 3);
const SETTLE_END = r.t;
for (let i = 0; i < Math.round(STORM_03B.duration / SIM_DT); i++) r.step(SIM_DT, storm, i * SIM_DT);
return { breaks, SETTLE_END };
};
test('ruling: on site_02 the CARPORT blows before an honest post — at DEFAULT tension', () => {
// The half D's cold pass proved missing: pre-wiring, at tension 1.0 the
// honest post blew first and the carport cost nothing, so the lever that
// decided the trap was tension. Now the same rig, default tension, survives
// prep and loses the CARPORT mid-storm while both honest posts hold — the
// anchor decides, not the dial. (Measured: cb1 lets go around t≈41 with
// q2/q3 peaking ~1.8/2.5 kN, well under a bare 6.5 kN rated shackle.)
const { breaks, SETTLE_END } = flyCarportLine(SITE2_DRESSED, 1.0);
assert(breaks.length > 0,
'nothing blew at default tension: ratingHint is not reaching _checkFailure — the trap is still tension-gated');
const firstCb = breaks.findIndex((b) => b.id.startsWith('cb'));
const firstQ = breaks.findIndex((b) => b.id.startsWith('q'));
assert(firstCb >= 0, `the carport never blew (breaks: ${breaks.map((b) => b.id).join(',')})`);
assert(firstQ === -1 || firstCb < firstQ,
`an honest post (${breaks[firstQ]?.id}) blew before the carport — the trap is pointing the wrong way`);
assert(breaks[firstCb].t > SETTLE_END,
`the beam let go at t=${breaks[firstCb].t.toFixed(1)}s, INSIDE the ${SETTLE_END.toFixed(0)}s prep settle — ` +
'at default tension the trap should fire in the storm, not on the shop floor');
return `default tension: ${breaks[firstCb].id} blew at t=${(breaks[firstCb].t - SETTLE_END).toFixed(1)}s into the storm, honest posts held`;
});
test('ruling: at MAX tension the carport still goes first — and the hint is doing it', () => {
// The sprint's literal shape (max tension through the funnel), plus the
// control that makes both tests mean "the HINT", not "the load".
const { breaks } = flyCarportLine(SITE2_DRESSED, 1.4); // TENSION_MAX
const firstCb = breaks.findIndex((b) => b.id.startsWith('cb'));
const firstQ = breaks.findIndex((b) => b.id.startsWith('q'));
assert(firstCb >= 0, `max tension and the carport still never blew (breaks: ${breaks.map((b) => b.id).join(',')})`);
assert(firstQ === -1 || firstCb < firstQ,
`an honest post (${breaks[firstQ]?.id}) blew before the carport at max tension`);
// Identical yard, every hint forced to 1 — bare hardware ratings, the
// pre-wiring game — must survive the same night intact: rated shackles at
// 6.5 kN hold these loads (worst peak ~3.4 kN); only 6.5 × 0.22 = 1.43 kN
// lets go. This is the mutation control IN the suite: unwire sail.js and
// both tests above go red because the wired and unhinted runs collapse into
// this one. If THIS half ever breaks, the loads moved and the cb-first
// asserts stop isolating the wiring — re-measure before touching thresholds.
const unhinted = flyCarportLine(
SITE2_DRESSED.map((a) => ({ ...a, ratingHint: 1, sway: a.sway })), 1.4).breaks;
assert(unhinted.length === 0,
`hint-free control lost ${unhinted.map((b) => b.id).join(',')} — bare rated shackles no longer hold this line; ` +
'the cb-first asserts are no longer attributing the break to ratingHint');
return `max tension: ${breaks[firstCb].id} first at t=${breaks[firstCb].t.toFixed(1)}s; hint-free control held 4/4`;
});
export const SAIL_TESTS = TESTS;
export function runSailSelftest() {

View File

@ -986,7 +986,11 @@ export function createSkyFx(o = {}) {
let worst = 0, broken = false;
for (const c of sail.corners) {
if (c.broken) { broken = true; continue; }
const rating = c.hw && c.hw.rating ? c.hw.rating : 1;
// Effective rating is hardware × anchor hint (SPRINT12, B's wiring):
// a carport corner fails at 0.22× its shackle, and a creak keyed on
// the shackle alone would go quiet exactly where the steel is worst.
const hint = c.anchor && c.anchor.ratingHint != null ? c.anchor.ratingHint : 1;
const rating = (c.hw && c.hw.rating ? c.hw.rating : 1) * hint;
worst = Math.max(worst, c.load / rating);
}
audio.creak(dt, worst);

View File

@ -12,6 +12,7 @@ import { CALM_STORM, createGame, createWindRouter, stormsToPreload, verdictFor }
import { orderRing } from '../sail.js';
import { loadStorm, createWind } from '../weather.js';
import { createWeek, NIGHTS, nightAt, gradeFor, BROKE_BELOW, PAY } from '../week.js';
import { createHud } from '../hud.js';
import { assert, assertEq, assertLess, fixedLoop } from '../testkit.js';
/** @param {import('../testkit.js').Suite} t */
@ -124,6 +125,7 @@ export default async function run(t) {
for (let i = 0; i < NIGHTS.length; i++) {
const j = nightAt(i);
assert(j.client, `night ${i + 1} has a client`);
assert(j.addr, `night ${i + 1} has an address — a letterhead bills somebody somewhere`);
assert(j.brief && j.brief.length > 20, `night ${i + 1} has a brief worth reading`);
assert(j.site, `night ${i + 1} has a yard`);
}
@ -143,6 +145,7 @@ export default async function run(t) {
// or printing "undefined" at a client.
const j = nightAt(99); // off the end entirely
assertEq(j.client, null, 'no client is null, not undefined');
assertEq(j.addr, null, 'no address is null');
assertEq(j.brief, null, 'no brief is null');
assertEq(j.site, 'backyard_01', 'and it still names a yard');
});
@ -264,6 +267,113 @@ export default async function run(t) {
assertEq(cb.work, 'bracket', 'the carport beam is a bracket job — needs the ladder');
});
// --- SPRINT12 gate 3: E's letterhead/invoice kit, rendered ----------------
// Both of Sprint 11's card bugs were invisible to the suite because nothing
// ever RENDERED a card and looked. These do the minimum of that in DOM: the
// kit's contract classes must exist on a real render AND their load-bearing
// CSS must actually draw. Eyes on the browser are still required — a DOM
// assert can't see a letterhead with buttons through it.
t.test('SPRINT12: the invoice wears the letterhead, and the dead bonus is struck through', () => {
if (typeof document === 'undefined') return 'SKIPPED — no DOM';
const def = { baseCurve: [[0, 10]], gusts: { powBase: 5, powRamp: 5 } };
// Night 3, the carport night: collateral forfeits the clean bonus, so this
// one render exercises the void, the neg AMOUNT DUE, and the docket number.
const wk = createWeek();
wk.advance(); wk.advance();
const w = wk.settle({ hp: 86, win: true,
collateral: [{ what: 'the carport', cost: 180 }], intactHardwareValue: 12 }, def, 71);
const hud = createHud({ scene: new THREE.Scene() });
try {
hud.showAftermath({ hp: 86, cornersLost: 1, cornersTotal: 4, hailBlocked: 'some hail',
bill: 34, collateral: [{ what: 'the carport', cost: 180 }],
subtitle: 'test', verdict: 'test', win: true, week: w }, () => {});
const q = (sel) => document.querySelector(`#hud-card ${sel}`);
assertEq(q('.letterhead .mark')?.textContent, 'HARD YARDS', "the outfit's mark (ruling: adopted)");
const no = q('.letterhead .docket .no')?.textContent ?? '';
assert(no.includes('INV 1043'), `docket says INV 1043, got "${no}"`);
// The ruling is that the ABN STAYS sequential — it reads as "example" the
// way 555 numbers do, and a realistic one is a stranger's tax identity.
assert(no.includes('ABN 12 345 678 901'), `the sequential ABN survives, got "${no}"`);
assertEq(q('.billto .who')?.textContent, 'the Vasilaros place', 'the bill-to block names the client');
// E's .void — quoted, not paid, and still on the paper.
const voidB = q('.ledger .row.void b');
assert(voidB, 'the forfeited clean bonus renders as .void, not as $0 or missing');
assertEq(voidB.textContent, `$${w.cleanMax}`, 'struck at the QUOTED amount');
assert(getComputedStyle(voidB).textDecorationLine.includes('line-through'),
'and the strike actually draws — the class without its CSS is decoration');
// AMOUNT DUE is the conclusion: pay spent, negative the night you take
// the carport with you, and it must SAY so.
const due = w.pay - 71;
const dueB = q('.ledger .row.due b');
assert(dueB, 'the invoice concludes with AMOUNT DUE');
assertEq(dueB.textContent, `${due < 0 ? '' : '+'}$${Math.abs(due)}`, 'due = pay spent');
assertEq(q('.ledger .row.due')?.classList.contains('neg'), due < 0, 'a negative due reads as one');
} finally { hud.dispose(); }
});
t.test('SPRINT12: the job sheet carries the same letterhead, a quote, and the terms line', () => {
if (typeof document === 'undefined') return 'SKIPPED — no DOM';
// The same outfit, the same night, the other document: JOB 1043 in the
// morning becomes INV 1043 — the pair answering each other is the design.
const wk = createWeek();
wk.advance(); wk.advance();
const hud = createHud({ scene: new THREE.Scene() });
try {
hud.showForecast(
{ key: 'storm_03b_earlybuster', def: earlyBusterDef, site: null, tomorrowDef: null },
{ night: wk.night, nights: wk.nights, log: [], job: wk.job,
quote: wk.quote(earlyBusterDef), bank: wk.bank }, () => {});
const q = (sel) => document.querySelector(`#hud-card ${sel}`);
assertEq(q('.letterhead .mark')?.textContent, 'HARD YARDS', 'same mark as the invoice');
assertEq(q('.letterhead .docket .kind')?.textContent, 'JOB SHEET', 'but this paper is the quote');
assert((q('.letterhead .docket .no')?.textContent ?? '').includes('JOB 1043'),
'and it shares the docket number with its invoice');
assert(q('.billto .addr'), 'the bill-to block says where the job is');
assertEq(document.querySelectorAll('#hud-card .sched .cond').length, 3,
'three pay lines, each carrying its condition');
assert((q('.terms')?.textContent ?? '').includes('not a variation'),
"the terms line: quoted on the forecast, weather is not a variation");
} finally { hud.dispose(); }
});
t.test("SPRINT12: the kid's bike leans INTO the south fence, not into open air", () => {
// E's axis trap, pinned from the PLACEMENT side. e.test proves the GLB
// leans toward local Z; nothing until now proved the site points that lean
// at anything. Un-rotate the bike or drag it mid-yard and this reddens —
// the failure mode is a bike leaning on air, which reads as a physics bug
// and would get chased in the wrong lane (E's words, their lean note).
const b = site.bike;
assert(b, 'backyard_01 places the bike');
assertEq(b.model, 'bike_kid_01_v1', "E's model, the v1 with the baked lean");
// Local Z rotated by rotY must land on +Z — the south fence side.
const ry = (b.rotYDeg * Math.PI) / 180;
const leanTowardFence = -Math.cos(ry); // z of (0,0,1) rotated about Y
assert(leanTowardFence > 0.95,
`rotYDeg ${b.rotYDeg} points the baked lean at z=${leanTowardFence.toFixed(2)} — not the fence`);
// The standoff, measured: bars reach 0.286 m past the tyre line toward the
// lean; the fence rails sit at z = depth/2 ± 0.02. The band accepts
// bars-on-rail ± a hand's width, and rejects mid-yard or tyres-in-fence.
const gap = site.yard.depth / 2 - b.z;
assert(gap > 0.15 && gap < 0.45,
`bike stands ${gap.toFixed(2)} m off the fence line — bars touch at ~0.31`);
// RULING (SPRINT12 gate 3.2): E's $60 is DECLINED until the sim can knock a
// bike over. Billing collateral for an event the player never sees is the
// lie the invoice exists to kill; leaning on the windward fence is the one
// pose a southerly can't falsify. This assert is the ruling's tripwire: if
// someone prices the bike, they must also build the fall, and this message
// is where they find that out.
assert(b.collateralValue == null, 'the bike is unpriced BY RULING — build the fall first');
});
// --- SPRINT11 gate 1: the three rulings, each pinned ----------------------
t.test('ruling: the carport is typed as a carport, not smuggled in as a post', () => {
@ -376,6 +486,27 @@ export default async function run(t) {
assertEq(site2World.collateralFor(undefined), null, 'and no key is not a bill');
});
t.test('SPRINT12 ruling: the gutter BILLS — 90, and the free failure is dead', () => {
// E priced it ($90, reasoning baked in the asset and adopted in the site
// JSON's _collateral) and named the seam: the house is not a structure, so
// collateralFor/wreckStructure had to be taught the house entry. This is
// the assert E left me to flip: backyard_01's house was the last free
// failure in the game.
const priced = world.collateralFor('gutter');
assert(priced, 'the gutter has a price at all — the null era ends here');
assertEq(priced.cost, 90, "A's ruling: 90 — wipes the trap's night (kit + fee), not the week");
assertEq(priced.label, 'the gutter', 'and reads as English on the invoice');
// The band that makes the number legible: ornament < gutter < structure.
assert(site.gnome.collateralValue < priced.cost && priced.cost < 180,
'gnome 25 < gutter 90 < carport 180');
// The key prices THIS site's house, not a global constant: the corner
// block has no house, so its 'gutter' stays null (pinned above).
// And nothing is wrecked before anyone breaks anything. (The wreck GLB
// arrives from lane/e at integration; absent, the swap no-ops false and
// the bill still lands — same offline contract as the carport.)
assertEq(world.isWrecked('gutter'), false, 'the gutter starts on the house');
});
// --- 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

View File

@ -58,6 +58,9 @@ const ASSETS = [
{ name: 'house_yardside', h: [2.5, 3.5],
nodes: ['wall', 'door', 'window', 'roof', 'fascia', 'gutter',
'fascia_anchor_01', 'fascia_anchor_02', 'fascia_anchor_03'] },
{ name: 'house_yardside_wrecked', h: [2.5, 3.5],
nodes: ['wall', 'door', 'window', 'roof', 'fascia_torn',
'gutter_torn', 'gutter_down', 'downpipe_loose', 'debris_fascia'] },
{ name: 'shed_01', h: [1.9, 2.4], nodes: ['shell', 'roof', 'doors', 'door_anchor'] },
{ name: 'shed_table', h: [0.8, 1.0], nodes: ['table_top', 'table_frame', 'pickup_anchor'] },
{ name: 'garden_bed', h: [0.5, 1.1],
@ -178,6 +181,93 @@ export default async function run(t) {
'wrecked carport must name its intact twin so A can pair the swap');
});
// The gutter, priced — the carport ruling's second application (SPRINT12
// §gate 3.3). backyard_01's fascia anchors have said collateral:"gutter"
// since Sprint 6 and nobody ever priced one, so collateralFor('gutter')
// returns null and the house is a FREE failure. The proposal is 90 and the
// reasoning lives beside GUTTER_COLLATERAL in build_yard_assets.py; what THIS
// pins is the calibration, not the digit: the gutter must cost more than the
// ornament and less than the structure, because the fascia (0.35) is honestly
// better steel than the carport beam (0.22) and the tutorial yard's trap must
// cost you a night, not the week. A rules the number; if it moves, move it in
// the factory and re-export — do not let site JSON and the GLB tell two prices.
t.test('the gutter is priced, inside the band, and keyed to what the anchors say', () => {
const h = loaded.get('house_yardside')?.scene.getObjectByName('house_yardside');
assert(h, 'house_yardside root missing');
const cost = h.userData?.collateral_value;
assert(typeof cost === 'number', `house carries no collateral_value (${JSON.stringify(h.userData)})`);
// collateral_key exists because, unlike the carport, the structure and the
// thing you take have different names: the key says WHICH collateral string
// this value prices, and it must be the one the fascia anchors carry or
// Lane A's wiring prices nothing.
assert(h.userData?.collateral_key === 'gutter',
`collateral_key is ${JSON.stringify(h.userData?.collateral_key)} — must name the anchors' collateral string`);
const a1 = loaded.get('house_yardside')?.scene.getObjectByName('fascia_anchor_01');
assert(a1?.userData?.collateral === h.userData.collateral_key,
`fascia anchor says collateral=${JSON.stringify(a1?.userData?.collateral)} but the price is keyed ${JSON.stringify(h.userData.collateral_key)} — the chain is broken`);
const gnome = loaded.get('garden_gnome_01')?.scene
.getObjectByName('garden_gnome_01')?.userData?.collateral_value;
const carport = loaded.get('carport_01')?.scene
.getObjectByName('carport_01')?.userData?.collateral_value;
assert(cost > gnome, `gutter (${cost}) must cost more than the gnome (${gnome}) — structural collateral beats ornament`);
assert(cost < carport, `gutter (${cost}) must cost less than the carport (${carport}) — the backyard's trap is the gentler one`);
// Wreckage carries the same price, so scoring can read either state.
const w = loaded.get('house_yardside_wrecked')?.scene.getObjectByName('house_yardside_wrecked');
assert(w?.userData?.collateral_value === cost,
'the wrecked house must price its gutter the same as the one it used to be');
assert(w?.userData?.broken_variant_of === 'house_yardside',
'wrecked house must name its intact twin so A can pair the swap');
});
// The wreck's whole message is vertical: the gutter that was UP at the eave is
// DOWN. Both halves are measured, and the intact half is the negative control
// that proves the measurement measures — if someone rebuilds the wreck with
// the run back at the eave (or flips the export axis), gutter_down's box
// lands ~2.6 m up and this goes red. Verified red once already: built with
// the ground run at eave height as a negative control, this failed at
// "tops out at y=2.68" (1 failed / 319 passed) while the Blender verify said
// [PASS] 9.46 x 2.10 x 2.92 on the same bad file — the run's PLAN position
// didn't move, so no box span changed. A bounding box cannot answer "did it
// fall" unless something pins which height it fell FROM.
t.test('the torn gutter is DOWN in the wreck, UP in the intact house', () => {
const up = loaded.get('house_yardside')?.scene.getObjectByName('gutter');
assert(up, 'intact house lost its gutter node');
const upBox = new THREE.Box3().setFromObject(up);
assert(upBox.max.y > 2.5,
`intact gutter tops out at y=${upBox.max.y.toFixed(2)} — the control is broken, nothing below can mean anything`);
const wreck = loaded.get('house_yardside_wrecked');
assert(wreck, 'house_yardside_wrecked did not load');
const down = new THREE.Box3().setFromObject(wreck.scene.getObjectByName('gutter_down'));
assert(down.max.y < 0.5,
`gutter_down tops out at y=${down.max.y.toFixed(2)} — the run is not on the grass`);
const hang = new THREE.Box3().setFromObject(wreck.scene.getObjectByName('gutter_torn'));
assert(hang.max.y > 2.3,
`gutter_torn tops out at y=${hang.max.y.toFixed(2)} — it should still reach the eave it tore from`);
assert(hang.min.y < 1.6,
`gutter_torn bottoms out at y=${hang.min.y.toFixed(2)} — the torn end should sag well below the fascia line`);
// And the house itself did NOT fall: unlike the carport, this wreck keeps
// its full height, because only the eave line failed. A shorter (or taller)
// wreck here means someone wrecked the building instead of the gutter.
const hi = new THREE.Box3().setFromObject(loaded.get('house_yardside').scene);
const hw = new THREE.Box3().setFromObject(wreck.scene);
const dh = Math.abs((hi.max.y - hi.min.y) - (hw.max.y - hw.min.y));
assert(dh < 0.05, `wreck height differs from the house by ${dh.toFixed(3)} m — a house does not fall when its gutter does`);
});
// You cannot re-tie to a ripped eave. An anchor that outlives its fascia
// would be the free-failure bug back again, wearing a wreck for a costume —
// world.anchors would keep offering the tie-off after the aftermath swap.
t.test('no fascia anchor survives into the wreck', () => {
const w = loaded.get('house_yardside_wrecked');
assert(w, 'house_yardside_wrecked did not load');
for (const n of ['fascia_anchor_01', 'fascia_anchor_02', 'fascia_anchor_03']) {
assert(!w.scene.getObjectByName(n),
`${n} survives in the wreck — the eave it anchored is gone, so it must be too`);
}
});
// A wreck that stands taller than the thing it was is a bug, not a wreck.
t.test('the wrecked carport is shorter than the carport', () => {
const a = new THREE.Box3().setFromObject(loaded.get('carport_01').scene);
@ -400,7 +490,8 @@ export default async function run(t) {
// swap needs a fudge offset per prop and will grow one.
t.test('broken variants sit on the same ground plane as their intact twin', () => {
for (const [intact, broken] of [['garden_gnome_01', 'garden_gnome_01_broken'],
['fence_panel', 'fence_panel_snapped']]) {
['fence_panel', 'fence_panel_snapped'],
['house_yardside', 'house_yardside_wrecked']]) {
for (const n of [intact, broken]) {
const box = new THREE.Box3().setFromObject(loaded.get(n).scene);
assert(Math.abs(box.min.y) < 0.03,

View File

@ -48,34 +48,38 @@ import { START_BUDGET, HARDWARE } from './contracts.js';
* Copy lives here as data, per SPRINT11's rule: client flavour is data, not code.
*/
export const NIGHTS = [
// SPRINT12: `addr` is the second line of E's bill-to block — a letterhead
// bills somebody somewhere. Street names are the site's fiction (E's kit
// drafted both), and the addr carries the yard so the invoice, which has no
// site line of its own, still says where the night happened.
{
storm: 'storm_01_gentle', site: 'backyard_01',
client: 'the Hendersons',
client: 'the Hendersons', addr: '14 Kurrajong St — the backyard',
brief: 'They fly out Friday and the seedlings are the whole point — six weeks in, first season that '
+ 'took. Get the sail up while it\'s calm. Nothing tonight will test it.',
},
{
storm: 'storm_03_southerly', site: 'backyard_01',
client: 'the Hendersons',
client: 'the Hendersons', addr: '14 Kurrajong St — the backyard',
brief: 'A southerly, and hail with it. This is the one the seedlings can\'t take — cloth over the bed '
+ 'or there\'s no bed on Monday.',
},
{
storm: 'storm_03b_earlybuster', site: 'site_02_corner_block',
client: 'the Vasilaros place',
client: 'the Vasilaros place', addr: '2 Bight Rd — the corner block',
brief: 'Short notice — corner block two streets over, never rigged it. Same southerly as Tuesday, '
+ 'except the change is through before you\'ve finished your coffee. They said there\'s plenty '
+ 'to tie off to.',
},
{
storm: 'storm_02_wildnight', site: 'backyard_01',
client: 'the Hendersons',
client: 'the Hendersons', addr: '14 Kurrajong St — the backyard',
brief: 'Back at the Hendersons\', and this is the night the whole week was pointing at. Rig it like '
+ 'they\'re watching, because Friday they will be.',
},
{
storm: 'storm_02b_icenight', site: 'backyard_01',
client: 'the Hendersons',
client: 'the Hendersons', addr: '14 Kurrajong St — the backyard',
brief: 'Less wind than last night and more ice, which is worse for the bed and easier on the rig. '
+ 'Last night before they land.',
},
@ -99,6 +103,7 @@ export function nightAt(i) {
storm: base.storm,
site: base.site ?? 'backyard_01',
client: base.client ?? null,
addr: base.addr ?? null,
brief: base.brief ?? null,
pay: base.pay ?? {},
};
@ -347,7 +352,7 @@ export function createWeek(opts = {}) {
const s = { fee, fullFee, bonus, refund, clean, cleanMax, collateral, pay, spent,
bankBefore, bankAfter: bank, outcome, night: week.night, held,
grade: gradeFor(held), stormKey: week.stormKey, won: !!run.win,
client: job.client, site: job.site };
client: job.client, addr: job.addr, site: job.site };
log.push(s);
return s;
},

View File

@ -200,6 +200,9 @@ export function createWorld(scene, opts = {}) {
const SHED = site.shed;
const SHED_TABLE = site.shedTable ? { ...site.shedTable, rotY: rad(site.shedTable.rotYDeg) } : null;
const GNOME = site.gnome ? { ...site.gnome, rotY: rad(site.gnome.rotYDeg) } : null;
// SPRINT12: the per-client prop, the gnome pattern — a named top-level key,
// not a generic props[]. See the site JSON's _why for the lean/fence math.
const BIKE = site.bike ? { ...site.bike, rotY: rad(site.bike.rotYDeg) } : null;
const treeSpecs = site.trees ?? [];
const postSpecs = site.posts ?? [];
@ -440,6 +443,23 @@ export function createWorld(scene, opts = {}) {
// rating_hint / collateral that make it a trap. The site's own asserts (E's
// e.test) pin those ratings below the fascia's — do not "fix" them upward.
const structures = new Map();
/**
* SPRINT12 the house's collateral seam, taught rather than restructured.
* E named the trap precisely: collateralFor()/wreckStructure() iterate
* `structures`, and the house is NOT a structure so the gutter stayed
* unpriced and unswappable. The alternative was moving the house into
* structures[] (it fits the shape), but the house is the one building with
* extra jobs graybox stand-in, north boundary, the thing validateSite and
* two other lanes' code read at `site.house` and re-homing it mid-sprint
* to avoid two small branches is churn, not design. If a third house-like
* thing ever appears, THEN generalise. `collateralKey` (E's field, baked in
* the GLB, canonical in site JSON) names which collateral string this
* price answers the carport never needed it because there structure id
* and collateral string are the same word.
*/
const houseEntry = { spec: HOUSE, glb: null, wreck: null };
const houseKey = () =>
HOUSE ? (HOUSE.collateralKey ?? houseEntry.glb?.userData?.collateral_key ?? null) : null;
for (const st of site.structures ?? []) {
const marker = new THREE.Group();
marker.name = st.id;
@ -614,9 +634,10 @@ export function createWorld(scene, opts = {}) {
// Model names come off the site now. `load(null)` resolves null, so a site
// that simply has no shed (site_02 has a carport) skips it without a branch.
const [shed, table, houseGlb, bedGlb, gnome] = await Promise.all([
const [shed, table, houseGlb, bedGlb, gnome, bike] = await Promise.all([
load(SHED?.model), load(SHED_TABLE?.model), load(HOUSE?.model),
load(site.gardenBedModel ?? 'garden_bed_v1'), load(GNOME?.model),
load(BIKE?.model),
]);
const treeGlbs = await Promise.all(treeSpecs.map((s) => load(s.model)));
@ -642,6 +663,20 @@ export function createWorld(scene, opts = {}) {
root.add(gnome);
}
// --- the kid's bike (per-client juice, SPRINT12) ----------------------
// The lean is baked into the GLB toward local Z (E's export note — in
// Blender it leans +Y; the exporter maps (x,y,z)→(x,z,y)), so placement's
// ONE job is to point that lean at the fence. rotY comes from site data;
// the site's _why records the measured bars-to-rail arithmetic. Not in
// solids — you can walk past a kid's bike — and not billed: unpriced by
// ruling until wind can knock it over.
if (bike) {
bike.name = 'bike_kid_01';
bike.position.set(BIKE.x, heightAt(BIKE.x, BIKE.z), BIKE.z);
bike.rotation.y = BIKE.rotY;
root.add(bike);
}
// --- house (decision 6: no re-cut, the GLB's data wins) ---------------
// E's fascia sits at 2.80 m and their anchors span x=-3..3, where my
// graybox guessed 2.6 m and -5..5. Reading them narrows the house span by
@ -657,6 +692,22 @@ export function createWorld(scene, opts = {}) {
solids.push(houseGlb);
houseGlb.updateWorldMatrix(true, true);
for (const a of HOUSE.anchors ?? []) adoptAnchor(houseGlb, a.node, a.id);
houseEntry.glb = houseGlb;
// SPRINT12 — the torn-gutter wreck, the carport pattern on the one
// building that is not a structure. Loaded now and parked invisible for
// the same reason the carport's is: the swap happens as the storm ends,
// and an async load there drops the payoff frames after the card.
if (HOUSE.wreckedModel) {
const wreck = await load(HOUSE.wreckedModel);
if (wreck) {
wreck.name = 'house_yardside_wrecked';
wreck.position.copy(houseGlb.position);
wreck.visible = false;
root.add(wreck);
houseEntry.wreck = wreck;
}
}
}
// --- trees -----------------------------------------------------------
@ -810,6 +861,16 @@ export function createWorld(scene, opts = {}) {
if (!Number.isFinite(cost)) return null;
return { cost, label: spec.collateralLabel ?? glb?.userData?.collateral_label ?? spec.id };
}
// SPRINT12 — the gutter (A's ruling: $90, E's proposal adopted; the
// reasoning is in backyard_01.json beside the number). Same contract as
// structures: site JSON canonical, GLB extras fallback, null when
// unpriced — a site whose house declares no collateralKey still reads
// "not scored", never "free".
if (HOUSE && key === houseKey()) {
const cost = HOUSE.collateralValue ?? houseEntry.glb?.userData?.collateral_value ?? null;
if (!Number.isFinite(cost)) return null;
return { cost, label: HOUSE.collateralLabel ?? houseEntry.glb?.userData?.collateral_label ?? key };
}
return null;
},
@ -823,14 +884,30 @@ export function createWorld(scene, opts = {}) {
*/
wreckStructure(id) {
const entry = structures.get(id);
if (!entry?.wreck || !entry.glb) return false;
entry.glb.visible = false;
entry.wreck.visible = true;
return true;
if (entry?.wreck && entry.glb) {
entry.glb.visible = false;
entry.wreck.visible = true;
return true;
}
// The house, keyed by its collateral string ('gutter'): the gutter
// unzips, the house stands. E's window_glow warning honoured — the wreck
// ships its glow hidden_by_default under the same name, so the swap
// copies the intact house's current glow state or the client's lights
// would go out with the gutter if this ever lands mid-night.
if (HOUSE && id === houseKey() && houseEntry.wreck && houseEntry.glb) {
const glowWas = houseEntry.glb.getObjectByName('window_glow')?.visible ?? false;
const glow = houseEntry.wreck.getObjectByName('window_glow');
if (glow) glow.visible = glowWas;
houseEntry.glb.visible = false;
houseEntry.wreck.visible = true;
return true;
}
return false;
},
/** Is this structure standing? Lane D asked for a poke-able truth. */
isWrecked(id) {
if (HOUSE && id === houseKey()) return houseEntry.wreck?.visible === true;
return structures.get(id)?.wreck?.visible === true;
},

Binary file not shown.