b25f217e3e
The world stops being a simulation of California and starts being California. **THE PROMOTION GATE WAS THE FIRST COMMIT, BEFORE ANY ORANGE PIXEL EXISTED.** On today's live store the SoCal board contains 22 incidents. Every one has NULL acreage and fifteen are nameless LA County dispatch numbers. Drawn naively that is 22 orange marks over Los Angeles on a day nothing is burning — in a frame that contains no other warm colour, so one glyph would be the most salient object on the board and twenty-two would spend its credibility permanently. `acres >= 10 AND contained < 80 AND type != 'RX' AND last_seen = max(last_seen)` returns 0 on SoCal, exactly 5 on California, 0 on the Bay — same body, same day, three correct answers. The empty board is a deliverable, not a fallback: it says "No active fire on this board — CAL FIRE and WFIGS, just now", states that 21 records were gated and why, lists the largest fires burning OUTSIDE the frame with distances, and counts the hot pixels it is deliberately not drawing. **The privacy leak is structurally impossible rather than carefully avoided.** cloud-1 serves a projection; the four home-relative columns never leave that box. `observations.threat` was the one that nearly got through — it is `(16/distance)^2 x log10(acres) x momentum x containment x wind-alignment`, so with acreage and containment public it inverts to a distance circle around a house and three fires give an intersection. A grep of the built bundle for distance_km, bearing_deg, threat, 7762 and the street name returns nothing. **Deliberately not used, and both would have produced a confident wrong answer:** the store's `air` table retains only the last parameter of each poll, so all 78 rows read "Good" while the live feed reports ozone 101 "Unhealthy for Sensitive Groups" — haze driven off it would clear the sky during a smoke event. And `weather` is written only inside the NWS alerts loop, so a quiet day stores no wind at all. Tera's own per-region NWS wind is already correct and already what the clouds drift on. Satellite detections are drawn as evidence and never as incidents. The permanent industrial heat source 4.7 km from the owner's house is flagged persistent and dropped, asserted by a test that first proves it is present in the fixture. MODIS integer confidence and VIIRS string confidence are branched on `sat`. **The LA office is a twin.** Its entire authored second storey — Model Loft, Model Bay, The Materials Room, 430 lines nobody had ever stood in — is reachable on foot: a walker crosses level-1 to level-2 in 73 fixed steps, floorY 0 to 5, verified against the real pack rather than a synthetic plan. Its two studio devices read real hardware through a field-allowlisted bridge: mute, volume and reachability only. Never level, because there is no passive level upstream and obtaining one would record a room with people in it. Never dB, because upstream is gainPct across four different native scales. The bridge refuses all writes. Fixed at its root: an anonymous visitor was getting permanently at-rest instruments backing off against a 401. The tier moves into `createDeviceSource`, so anon gets the living simulator three file headers already promised. **Item 8 is closed, not fixed, and the correction is the point.** The Bay Area "stutter" was GPU power management — the card sat at 500 MHz of 2725 through every run that reproduced it, 4096/2048/1024/256 shadow maps all render in 1.21-1.31 ms, and two consecutive runs over a byte-identical dist gave 33.4 then 16.7. The allowance is removed and the cell is back to 16.7. Geometry is the gate; frame time is advisory. Item 7 was re-scoped after measuring: 1,069,006 of the Bay Area's 2,265,056 triangles were the second submission of the same buildings into the shadow pass. Mobile now has its own triangle caps and bay-area mobile draws 1,266,096. Also: bridges and the freeway corridor light up at night as emission, not lights — 1,614 deck lamps and 18 tower heads on the Bay in two draw calls. The single change that made US-101 legible was moving its edge lines from the lit material to the unlit one: retroreflective paint, the argument the SFO night frame already makes. California went 21,991 lamps to 4,051, clustered at the 17 town districts, because a rural interurban corridor genuinely is unlit. Tests 1137 -> 1340, server 280. All ten budget cells pass on first attempt with no cap raised. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
101 lines
4.2 KiB
TypeScript
101 lines
4.2 KiB
TypeScript
/**
|
|
* The opening move, held to the two things it must never do.
|
|
*
|
|
* Neither of these is a look-at-the-picture question — those were answered with
|
|
* `scripts/look.mjs` and cannot be asserted — but both are the kind of thing
|
|
* that would break silently and be noticed months later in a screenshot.
|
|
*
|
|
* 1. **The hero seat only ever brings a camera down.** A board's whole-board
|
|
* shot is authored between 32 and 41 degrees above the ground and is much
|
|
* better seen from lower; a *room's* viewpoint is often eye height, and
|
|
* lifting a camera that is standing inside a building to twenty-nine
|
|
* degrees is a ceiling shot of somebody's desk. `Math.min` is the whole
|
|
* guard and it is one character from being wrong.
|
|
* 2. **Neither pose is allowed past the orbit's ceiling.** `setPose` hands the
|
|
* camera to `OrbitControls`, which clamps to `maxDistance` on its next
|
|
* update, so a pose beyond it is not a wider shot — it is a move that
|
|
* starts wherever the clamp happened to land.
|
|
*
|
|
* Plus the invariant that makes the move a move: the start stands further off
|
|
* and higher than the rest, and looks at the same point.
|
|
*/
|
|
|
|
import assert from "node:assert/strict";
|
|
import { describe, it } from "node:test";
|
|
import { Vector3 } from "three";
|
|
import { arrivalStart, heroPose } from "../engine/scene.ts";
|
|
|
|
/** Elevation above the horizontal, in degrees, of a pose about its target. */
|
|
function elevationDeg(pose: { position: Vector3; target: Vector3 }): number {
|
|
const d = pose.position.clone().sub(pose.target);
|
|
return (Math.asin(d.y / d.length()) * 180) / Math.PI;
|
|
}
|
|
|
|
function reach(pose: { position: Vector3; target: Vector3 }): number {
|
|
return pose.position.distanceTo(pose.target);
|
|
}
|
|
|
|
/** A pose at `elevation` degrees and `distance` units from the origin. */
|
|
function pose(elevationDegrees: number, distance: number) {
|
|
const e = (elevationDegrees * Math.PI) / 180;
|
|
return {
|
|
target: new Vector3(10, 4, -6),
|
|
position: new Vector3(
|
|
10 + Math.cos(e) * distance * 0.6,
|
|
4 + Math.sin(e) * distance,
|
|
-6 + Math.cos(e) * distance * 0.8,
|
|
),
|
|
};
|
|
}
|
|
|
|
describe("the opening move", () => {
|
|
it("brings a high board pose down and leaves its target alone", () => {
|
|
// California's chapter 01: 408 out, 352 up, so 40.8 degrees.
|
|
const authored = pose(40.8, 538);
|
|
const hero = heroPose(authored, 1_000);
|
|
assert.ok(elevationDeg(hero) < elevationDeg(authored) - 8, elevationDeg(hero).toFixed(1));
|
|
assert.ok(elevationDeg(hero) > 20, elevationDeg(hero).toFixed(1));
|
|
assert.deepEqual(hero.target.toArray(), authored.target.toArray());
|
|
});
|
|
|
|
it("gives the three boards one answer, not three", () => {
|
|
// 40.8 California, 34.7 San Francisco, 32.1 Southern California.
|
|
const elevations = [40.8, 34.7, 32.1].map((deg) =>
|
|
elevationDeg(heroPose(pose(deg, 400), 1_000)),
|
|
);
|
|
for (const e of elevations) assert.ok(Math.abs(e - elevations[0]!) < 0.001, String(e));
|
|
});
|
|
|
|
it("never raises a camera that is already low — an office keeps its seat", () => {
|
|
const eyeLevel = pose(7, 12);
|
|
const hero = heroPose(eyeLevel, 40);
|
|
assert.ok(
|
|
elevationDeg(hero) <= elevationDeg(eyeLevel) + 0.001,
|
|
`${elevationDeg(hero)} vs ${elevationDeg(eyeLevel)}`,
|
|
);
|
|
});
|
|
|
|
it("stands further off and higher than the pose it will land on", () => {
|
|
const rest = heroPose(pose(40.8, 538), 5_000);
|
|
const start = arrivalStart(rest, 5_000);
|
|
assert.ok(reach(start) > reach(rest));
|
|
assert.ok(elevationDeg(start) > elevationDeg(rest));
|
|
assert.deepEqual(start.target.toArray(), rest.target.toArray());
|
|
});
|
|
|
|
it("keeps both poses inside the orbit's own ceiling", () => {
|
|
const ceiling = 300;
|
|
const authored = pose(40.8, 538);
|
|
const rest = heroPose(authored, ceiling);
|
|
assert.ok(reach(rest) <= ceiling, String(reach(rest)));
|
|
assert.ok(reach(arrivalStart(rest, ceiling)) <= ceiling, String(reach(arrivalStart(rest, ceiling))));
|
|
});
|
|
|
|
it("is a no-op on a degenerate pose rather than a NaN", () => {
|
|
const degenerate = { target: new Vector3(1, 2, 3), position: new Vector3(1, 2, 3) };
|
|
const hero = heroPose(degenerate, 100);
|
|
assert.deepEqual(hero.position.toArray(), [1, 2, 3]);
|
|
assert.deepEqual(hero.target.toArray(), [1, 2, 3]);
|
|
});
|
|
});
|