The city points at its own buildings, and the sky stops depending on an API
**Clouds were invisible to everyone who had not wired up NWS.** The layer
took `currentWeather()?.cloudCover ?? 0`, and `currentWeather()` is null on
any deployment without a weather source — which is the default, and the
exact configuration this repo is held to: a stranger clones it, runs one
command, and gets a city with no account and no key. Their sky was
permanently, silently empty. `atmosphere.ts` already models a sky when
nobody has observed one; it now models cover too, an observed reading
still wins outright, and the clouds are there on a bare clone.
**Both offices are pins on the city, and clicking one walks you in.** Each
pack has carried a real `site` since the sun needed one, and that
coordinate was known to the lighting and to nothing else — a visitor
looking at the board had no way to tell that two of those buildings are
ones they can go inside. The coordinates move to a tiny eagerly-imported
`offices/sites.ts` that the packs import *from*, because a pack is a 25 kB
lazy chunk and the board wants its pins long before anybody opens a door.
A test asserts the pack and the table hold the **same object**, not merely
equal values: a drifted coordinate would put the marker on one building
and the sun on another and both would look entirely plausible.
**Aircraft bank into their turns.** The roll channel existed and was never
written, so every turn was flat. Bank comes from the coordinated-turn
relation against the measured turn rate, damped by a first-order lag so it
settles rather than oscillates, and clamped at 30° like a real limiter.
Six regression tests, because roll is the one channel that feeds itself —
position and heading are recomputed from the last two observations and
wash out a bad value, while a NaN in the roll would persist for the life
of the track.
That fed straight into a real defect: `AdsbFlights` substituted
`heading: 0` for records with no `track` field, which is harmless for a
symmetrical dart and is a **sustained full-scale artefact** once aircraft
bank — a target whose real heading is 200° reported as 0° reads as a 160°
turn and pins the roll at its limiter for as long as it is in the feed.
Those records are dropped now. An aeroplane the feed will not give a
heading for is one this layer cannot draw honestly.
**The office empties out overnight.** A full complement of seated people
at one in the morning, under house lights that came on because the sun is
down, was the least believable thing left in the room once the clock
became real. A live roster always wins — an API that says the building is
empty is telling the truth about the building.
**Robots go somewhere.** They pick real addresses — a seat, a room — and
turn to face the seat when they arrive, rather than stopping at a random
angle. Godmode gets an office section: house lights forced on or off or
following the sun, robots and ceilings toggled, with a readout.
**The bundle is split.** Entry chunk 758 kB to 208 kB, with three.js and
satellite.js in a vendor chunk that survives an app deploy instead of
being re-downloaded on every one. Rollup's 500 kB warning still fires and
should — it now points at three.js, where it is true, instead of at our
code, where it was pointing at three.js all along.
Reviewers caught two false geography claims in the new prose ("both
shipped buildings stand in San Francisco" — one is across the estuary at
Alameda Point) and several miscounted figures. Fixed. In a codebase where
the comments are the design record, those are defects.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,7 @@ import type {
|
||||
Yaw,
|
||||
Zone,
|
||||
} from "../interiors/types.ts";
|
||||
import { FRONTIER_VALLEY_SITE } from "./sites.ts";
|
||||
|
||||
// ---- The shed -------------------------------------------------------------
|
||||
|
||||
@@ -672,13 +673,7 @@ export const FRONTIER_VALLEY: Office = {
|
||||
* So the high glazing really does take north light and the lagoon really is
|
||||
* to the south.
|
||||
*/
|
||||
site: {
|
||||
lat: 37.7756,
|
||||
lng: -122.3186,
|
||||
elevation: 4,
|
||||
heading: 0,
|
||||
label: "Alameda Point",
|
||||
},
|
||||
site: FRONTIER_VALLEY_SITE,
|
||||
meta: {
|
||||
description:
|
||||
"A startup in a hangar at Alameda Point: one room, fifty-four by thirty, nine metres to the trusses. The second pack, and the one that shows the format describes a shed as well as it describes a corridor.",
|
||||
|
||||
@@ -86,6 +86,7 @@ import type {
|
||||
Yaw,
|
||||
Zone,
|
||||
} from "../interiors/types.ts";
|
||||
import { LUMBRIDGE_HQ_SITE } from "./sites.ts";
|
||||
|
||||
// ---- The floor plate ------------------------------------------------------
|
||||
|
||||
@@ -2172,13 +2173,7 @@ export const LUMBRIDGE_HQ: Office = {
|
||||
* number that decides whether the sun ever actually enters the building, and
|
||||
* pointing the glass at the afternoon is the whole reason the field exists.
|
||||
*/
|
||||
site: {
|
||||
lat: 37.7897,
|
||||
lng: -122.3972,
|
||||
elevation: 188,
|
||||
heading: 205,
|
||||
label: "Transbay, San Francisco",
|
||||
},
|
||||
site: LUMBRIDGE_HQ_SITE,
|
||||
meta: {
|
||||
description:
|
||||
"The reference office: two levels around a double-height commons, twenty-six rooms, a hundred and twenty-six seats. Copy this file, change the numbers, keep the seat ids.",
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Where the shipped buildings stand, separately from the buildings themselves.
|
||||
*
|
||||
* An `Office` pack carries its own `site`, and that is still the authority — a
|
||||
* pack handed over HTTP by a self-hoster brings its site with it and never
|
||||
* touches this file. What this file exists for is the one question the *city*
|
||||
* asks, which a pack cannot answer without being loaded: **where are the
|
||||
* buildings I could walk into?**
|
||||
*
|
||||
* The office packs are deliberately lazy chunks. `lumbridge-hq` alone is 25 kB
|
||||
* of furniture and floor plan, and the whole point of `loadOffice`'s dynamic
|
||||
* import is that a visitor who only ever looks at the city never pays for it.
|
||||
* But the city wants to draw a marker on the two buildings the moment the board
|
||||
* appears, which is long before anybody has opened a door — so importing a pack
|
||||
* to read four numbers off it would put the entire catalogue back in the entry
|
||||
* chunk and undo the split.
|
||||
*
|
||||
* Hence a tiny eagerly-imported module holding just the coordinates, and each
|
||||
* pack importing its own site **from here** rather than declaring it inline. One
|
||||
* source of truth, and the direction of the dependency is the safe one: the
|
||||
* small thing does not know about the large one.
|
||||
*/
|
||||
|
||||
import type { OfficeSite } from "../interiors/types.ts";
|
||||
|
||||
/**
|
||||
* High in a Transbay tower. See `lumbridge-hq.ts` for what the four numbers mean
|
||||
* and why `heading` is the one that decides whether the sun ever gets in.
|
||||
*/
|
||||
export const LUMBRIDGE_HQ_SITE: OfficeSite = {
|
||||
lat: 37.7897,
|
||||
lng: -122.3972,
|
||||
elevation: 188,
|
||||
heading: 205,
|
||||
label: "Transbay, San Francisco",
|
||||
};
|
||||
|
||||
/** A hangar on the old naval air station. See `frontier-valley.ts`. */
|
||||
export const FRONTIER_VALLEY_SITE: OfficeSite = {
|
||||
lat: 37.7756,
|
||||
lng: -122.3186,
|
||||
elevation: 4,
|
||||
heading: 0,
|
||||
label: "Alameda Point",
|
||||
};
|
||||
|
||||
/**
|
||||
* Every building this build can walk into, for the city to point at.
|
||||
*
|
||||
* `id` matches the pack's own `Office.id` and the `OFFICES` table in `main.ts`,
|
||||
* which is what lets a click on a marker resolve to a door. Keeping the three in
|
||||
* step is not enforced by the type system; it is enforced by there being exactly
|
||||
* two of them and by `office.test.ts` asserting that each pack's site is the one
|
||||
* named here.
|
||||
*/
|
||||
export const OFFICE_SITES: { id: string; name: string; site: OfficeSite }[] = [
|
||||
{ id: "lumbridge-hq", name: "Lumbridge HQ", site: LUMBRIDGE_HQ_SITE },
|
||||
{ id: "frontier-valley", name: "Frontier Valley", site: FRONTIER_VALLEY_SITE },
|
||||
];
|
||||
Reference in New Issue
Block a user