Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e8b7bdfebf | |||
| 84dc67076a | |||
| abc5a5c3a8 | |||
| 08bc8b58fa | |||
| 793bcd7701 | |||
| 2962b13696 | |||
| 118ad5a2d4 | |||
| 1f60ddd17a |
@@ -8,4 +8,5 @@ One row per feature, with its analysis document (CLAUDE.md §5.1). Gaps live in
|
||||
| Workspace, contracts, gates, PWA shell | 0 | Merged to `main` 2026-11-01 (`d11d242`); built, not deployed. Phase 0 gate still open | [phase0-workspace.md](features/phase0-workspace.md) | [feature-phase0-workspace.md](reviews/feature-phase0-workspace.md) |
|
||||
| Roadmap and gameplay docs, read against the code | 0 | Merged 2026-11-01; Q1–Q7 answered by the author | — | [docs-roadmap-gameplay.md](reviews/docs-roadmap-gameplay.md) |
|
||||
| The Letter slot: page at `#letter`, empty `docs/LETTER.md` | 0 | Merged to `main`; built, not deployed. Invisible until the author writes | [letter-slot.md](features/letter-slot.md) | [feature-letter-slot.md](reviews/feature-letter-slot.md) |
|
||||
| The art pipeline and the art board: STYLE.md (S1–S5 approved; fox F1–F4 draft), the manifest (Phase 1–3, 53 pictures), stand-ins, `tools/art-prep`, the published board | 0 | Merged to `main`; board published (private). The app is unchanged. Gate waits on the first real picture | [art-pipeline.md](features/art-pipeline.md) | [feature-art-board.md](reviews/feature-art-board.md), [art-phase2-3-pictures.md](reviews/art-phase2-3-pictures.md) |
|
||||
| The sun: real sunrise, sunset and solar noon on the device; polar day and night | 1 | Merged to `main`; engine only, the app does not show it yet | [sun.md](features/sun.md) | [feature-sun.md](reviews/feature-sun.md) |
|
||||
| The art pipeline and the art board: STYLE.md (S1–S5 and the fox's F1–F4 approved), the manifest (Phase 1–3, 53 pictures), stand-ins, `tools/art-prep`, the published board | 0 | Merged to `main`; board published (private). The app is unchanged. Gate waits on the first real picture | [art-pipeline.md](features/art-pipeline.md) | [feature-art-board.md](reviews/feature-art-board.md), [art-phase2-3-pictures.md](reviews/art-phase2-3-pictures.md) |
|
||||
|
||||
@@ -40,11 +40,21 @@ board exist, and the first real picture is the author's to make.
|
||||
| G0.21 | No PNG icons | Open (predicted trap). iOS ignores SVG for `apple-touch-icon`. Comes through the art pipeline. |
|
||||
| G0.22 | No CI | Open. Every gate ran on this machine only. With G0.13. |
|
||||
| G0.23 | Source maps are built and would be published | Open. `sourcemap: true`; maps are not precached. Decide with G0.13 whether the repository is public. If not, use `'hidden'`. |
|
||||
| G0.24 | No art pipeline: `docs/ART.md`, `art/STYLE.md` (drafted with the author), `art/manifest.json` for Phase 1 assets, SVG placeholders, `tools/art-prep` | **Pipeline built 2026-11-01** (`feature/art-board`): docs/ART.md, the Phase 1 manifest (25 pictures), 29 generated stand-ins, `tools/art-prep` (50 tests; 5 of 5 put-back bugs caught), the art board published. STYLE.md approved by the author 2026-11-01 (S1–S5 kept as drafted; `docs/style-approved`). The board grew to 53 pictures with Phases 2–3 (`art/phase2-3-pictures`; the fox's look F1–F4 is a draft). **Still open:** the **Phase 0 gate**, one real picture through every step into `art/final/`. |
|
||||
| G0.24 | No art pipeline: `docs/ART.md`, `art/STYLE.md` (drafted with the author), `art/manifest.json` for Phase 1 assets, SVG placeholders, `tools/art-prep` | **Pipeline built 2026-11-01** (`feature/art-board`): docs/ART.md, the Phase 1 manifest (25 pictures), 29 generated stand-ins, `tools/art-prep` (50 tests; 5 of 5 put-back bugs caught), the art board published. STYLE.md approved by the author 2026-11-01 (S1–S5 kept as drafted; `docs/style-approved`). The board grew to 53 pictures with Phases 2–3 (`art/phase2-3-pictures`); the fox's look F1–F4 approved with a deep red-orange coat (`art/fox-coat`). **Still open:** the **Phase 0 gate**, one real picture through every step into `art/final/`. |
|
||||
| ~~G0.25~~ | ~~No slot for *A Letter from the Gardener*~~ | Closed 2026-11-01, merged to `main`. `docs/LETTER.md` holds slots as comments only; the page opens at `#letter` once it has words. 16 ui tests, and e2e on both the empty and a temporary written letter. Mutations caught: the link while empty, any link scheme, focus not moving, *heal* in the letter. |
|
||||
| G0.27 | The quiet door to real help has no numbers (§5.6 rule 5) | Open. The slot is in `docs/LETTER.md`. Support lines are real-world facts the author must verify, per country, so the door exists only once the letter does. |
|
||||
| ~~G0.26~~ | ~~Not decided: how the sunset invitation reaches the player on the web~~ | Closed 2026-11-01 by the author (Q6): in-app only on the web, no push server; local notifications through the Tauri shell in Phase 6. Recorded in ROADMAP Phase 0 and CLAUDE.md §8. |
|
||||
|
||||
## Phase 1 — The rose alone
|
||||
|
||||
**Started 2026-11-01** with the sun, while the Phase 0 gate waits on the author (pictures,
|
||||
sentences). Nothing in Phase 1 is visible to the player yet.
|
||||
|
||||
| Id | Gap | Status / evidence |
|
||||
|:--|:--|:--|
|
||||
| ~~G1.1~~ | ~~No module computes the sun (CLAUDE.md §7); polar and DST traps only predicted~~ | Closed 2026-11-01 on `feature/sun`. `engine/src/sun/sun.ts`: 26 published days in 6 cities within 2 min, polar day and night at Tromsø, 50 tests, 5 of 5 put-back bugs caught. Both traps measured (CLAUDE.md §8). |
|
||||
| G1.2 | The player cannot choose a city; no time-zone guess; no sunset time on screen | Open. A city list on the device (never GPS, never an IP lookup), the device zone as the fallback, the time shown in the garden. |
|
||||
|
||||
## Design questions — answered
|
||||
|
||||
Raised by GAMEPLAY.md and ROADMAP.md, answered by the author 2026-11-01. Details in
|
||||
@@ -60,4 +70,5 @@ Raised by GAMEPLAY.md and ROADMAP.md, answered by the author 2026-11-01. Details
|
||||
| ~~Q6~~ | When the notification decision is due | Phase 0, in-app only (G0.26) |
|
||||
| ~~Q7~~ | Which phase holds the Amicitia bridge | Phase 3 |
|
||||
| Q8 | "Nearby days give a little more" | Open as a rule for the Phase 1 Soul review: a gap's cost is never shown |
|
||||
| ~~Q10~~ | In polar night, when should the invitation come? | At solar noon, when the twilight is brightest: answered by the author 2026-11-01 (`features/sun.md` D4). In polar day it is the lowest light, as CLAUDE.md §8 suggests. |
|
||||
| Q9 | May the Letter name the book and its author for the one sentence of inspiration (GAMEPLAY §7)? | Open. `lint:copy` refuses those names in the letter as everywhere in the product. A yes needs a written, letter-only exemption. |
|
||||
|
||||
@@ -61,7 +61,7 @@ typecheck and lint. Nothing imports it: not the app, not the packages.
|
||||
| A10 | Claude writes its review and the `final` paths into the board's rows. The card shows them. | Mark sees on the card what Claude checked and whether the picture is in the game, with no separate report to read. |
|
||||
| A11 | *Added 2026-11-01 (`art/phase2-3-pictures`).* The manifest also holds Phase 2 (the fox, berries, the bush, the brush) and the Phase 3 pictures whose mechanics are already decided (paths, lanterns). Every card carries a `phase`, the manifest lists phases in order, and the board shows *Phase N* on each card. | Mark asked for more pictures on the board. Making them now lets the fox's look settle before Phase 2 code depends on it. The phase on the card keeps a Phase 3 picture from being taken for something Phase 1 needs. |
|
||||
| A12 | **The planets are not on the board.** | Each planet is designed in its own feature doc (ROADMAP Phase 2), and their grown-ups are the book's most recognisable drawings. Asking for pictures before the design exists would fix a look with the highest likeness risk and no design behind it. |
|
||||
| A13 | The fox is a second character with his own sheet (`fox-sheet`) and two review points (STYLE.md §7, 8–9). His look (F1–F4 in STYLE.md §0) is a **draft for Mark**. Mark's approval covered S1–S5 only. | The same mechanism that keeps the rose consistent, reused. The draft is marked as one, so the approval is not stretched over choices he never saw. |
|
||||
| A13 | The fox is a second character with his own sheet (`fox-sheet`) and two review points (STYLE.md §7, 8–9). His look (F1–F4 in STYLE.md §0) was a draft, and Mark approved it on 2026-11-01 with one change: a deep red-orange coat (`#BC4A22`) instead of muted russet (`art/fox-coat`). | The same mechanism that keeps the rose consistent, reused. The draft was marked as one, so the rose's approval was not stretched over choices he had not seen. |
|
||||
| A14 | A stand-in with no drawing **stops the build**. Before this, an unknown cell got an empty box. | 28 new pictures made a silent blank likely. A blank stand-in looks like a layout bug, not a missing drawing. |
|
||||
|
||||
## 3. Risk analysis
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
# The sun — real sunrise and sunset, on the device
|
||||
|
||||
Status: built on `feature/sun`. ROADMAP Phase 1, *the sun*. Review:
|
||||
[`feature-sun.md`](../reviews/feature-sun.md). The first piece of Phase 1, and the one the
|
||||
spike leaves behind even if the answer is no (ROADMAP §0: *a reusable sentence library and a sun
|
||||
module*).
|
||||
|
||||
---
|
||||
|
||||
## 1. Why and what, in the player's terms
|
||||
|
||||
Every day, at the player's **real** local sunset, the game invites them to put the phone down and
|
||||
look at the real one (CLAUDE.md §1). The rose's sentence is best opened then. The in-game sunset
|
||||
says when tonight's real one is. All of that needs one honest answer: *when does the sun set
|
||||
here, today?*
|
||||
|
||||
What the player gets from this piece alone: nothing on screen yet. What it guarantees:
|
||||
|
||||
- **The time is real.** It is computed from the sun's position and checked against a published
|
||||
almanac for six cities on four continents, both hemispheres, the equator and the Arctic.
|
||||
- **It never needs the network.** It is maths on the device. No lookup, no service.
|
||||
- **It never needs GPS.** The place is a city the player chose, or a guess from the device's time
|
||||
zone (CLAUDE.md §5.6 rule 6). Choosing that city is the app's job, later in Phase 1.
|
||||
- **The far north is not forgotten.** Where the sun does not set in summer or rise in winter, the
|
||||
engine still gives a gentle moment for the invitation (D4), never an error and never silence.
|
||||
- **A clock change is the clock's doing.** The sun moves a minute or two a day. When the clocks
|
||||
change, the sunset on the clock jumps an hour while the sun itself does nothing. The engine
|
||||
works in instants, so the jump only appears where the clock is read.
|
||||
|
||||
## 2. Technical architecture
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
app["apps/rosea (later in Phase 1)<br/>the chosen city or the device zone"] -->|"place, day"| sun
|
||||
subgraph engine["packages/engine (pure)"]
|
||||
sun["sun/sun.ts<br/>sunDay(day, place)<br/>invitation(sunDay)"]
|
||||
time["time/localDay.ts<br/>the only place a day is computed"]
|
||||
sun --> time
|
||||
end
|
||||
golden["engine/test/fixtures/sun-usno.json<br/>28 published days"] -.->|golden tests| sun
|
||||
script["scripts/fetch-sun-golden.ts<br/>run by hand, never by a test"] -.->|records| golden
|
||||
```
|
||||
|
||||
- **`sunDay(day, place)`** takes a `LocalDay` and `{ lat, lon, timeZone }` and returns one of
|
||||
three shapes: `sun-sets` (sunrise, solar noon, sunset), `polar-day` (solar noon, lowest light) or
|
||||
`polar-night` (solar noon). Every time is an epoch-milliseconds instant.
|
||||
- **`invitation(sunDay)`** is the instant the game invites the player outside: the sunset, or the
|
||||
polar alternative (D4). The app renders it and decides nothing.
|
||||
- **The algorithm** is NOAA's solar calculator (after Meeus, *Astronomical Algorithms*): the sun's
|
||||
declination and the equation of time at a given instant, then the hour angle at which its
|
||||
centre is 0.833° below the horizon (refraction and the sun's radius). Each event is refined by
|
||||
recomputing at its own instant.
|
||||
|
||||
### Decisions
|
||||
|
||||
| # | Decision | Why |
|
||||
|:--|:--|:--|
|
||||
| D1 | NOAA's algorithm, in TypeScript, in the engine. No library, no WASM. | About 80 lines of public-domain maths, accurate to about a minute below 72° latitude. CLAUDE.md §2: WASM only with a measurement that says it must. |
|
||||
| D2 | **"Today's sunset" is the one after today's solar noon**, even when it falls after midnight. "Today" is the local day whose solar noon it is. | Reykjavík on 21 June sets at 00:04 on the 22nd. The published table for the 21st lists the *previous* evening's 00:04. A player in Reykjavík means tonight's sunset, not last night's. |
|
||||
| D3 | The engine returns instants. Clock times are read in the app, with the city's zone. | One instant has one meaning. The DST jump is then only the clock's (§1), and the engine cannot be wrong about it. |
|
||||
| D4 | **Polar day**: the invitation is the *lowest light*, solar midnight. **Polar night**: the invitation is solar noon, when the twilight is brightest. | CLAUDE.md §8 asks for a gentle alternative, *e.g. the hour the light is lowest*. In polar night that hour is all day, so the brightest one is the moment worth going out for. **Decided by the author 2026-11-01** (Q10). |
|
||||
| D5 | Near the edge of polar day or night, an event whose hour angle leaves the possible range is clamped to solar midnight or noon. | On those few days the sun only grazes the horizon. A defined answer beats a NaN. Accuracy there is worse, and the tests say so. |
|
||||
| D6 | Golden values come from the U.S. Naval Observatory's published tables, recorded once into a fixture by `scripts/fetch-sun-golden.ts`. | CLAUDE.md §5.5 asks for published tables. Recording them keeps tests offline and deterministic, and the script shows exactly where each number came from. |
|
||||
| D7 | Tolerance: **2 minutes**, stated in the test. | The almanac rounds to the minute; NOAA's method is good to about a minute at these latitudes. |
|
||||
| D8 | Where a clock is about twelve hours off the sun, one calendar day a year can hold no solar noon. The engine then gives the nearest noon and never throws. | Found by fast-check at 179.9° W on UTC: noon crosses midnight in late December, so 26 December has none. No real zone is that far off the sun (the worst are about three hours), so the property tests give each place a zone that follows its longitude, and a unit test pins the impossible case. |
|
||||
|
||||
## 3. Risk analysis
|
||||
|
||||
Risk here means a person feeling worse, a person's location, or a person becoming reachable.
|
||||
|
||||
| Risk | Where | Answer |
|
||||
|:--|:--|:--|
|
||||
| **A wrong sunset sends someone out to a dark sky**, or too late. A broken promise from the one feature that points beyond the screen. | Correctness | Golden tests in six cities, including DST days; property tests across latitudes and days. |
|
||||
| **The far north gets nothing** — no sunset, so no invitation, every day for months. A person left out by geography. | Soul | D4: a defined, gentle moment on every day, tested at Tromsø and at ±80°. |
|
||||
| **The time is used to find someone.** A sunset time narrows down where a person lives. | Privacy | It is computed and kept on the device. This module has no I/O at all, and the engine's lint rule forbids it. Phase 4's shared sky uses a coarse cell and a day bucket only (CLAUDE.md §4), never this. |
|
||||
| **The test fixture holds coordinates.** | Privacy | City centres from public sources, never a player. No test uses a real person's location (§5.5). |
|
||||
| **A DST day records the wrong local day** for a sunset, and the rose's sentence moves to the wrong day. | Correctness | The day is only ever computed by `localDay`. Tested on all six DST transition days in the fixture. |
|
||||
|
||||
Reachability: none. The module talks to no one.
|
||||
|
||||
## 4. Gap analysis and the designed solution
|
||||
|
||||
| Gap | Solution | State |
|
||||
|:--|:--|:--|
|
||||
| No `engine/src/sun/` (CLAUDE.md §2, §7: *one module computes the sun*) | `sun/sun.ts`: `sunDay`, `invitation` | Built |
|
||||
| Polar day and night: a predicted trap (CLAUDE.md §8) | Two defined kinds and D4. **Measured**: Tromsø has no rise or set on 21 June and no events on 21 December | Built; the trap is confirmed |
|
||||
| DST and the local day: a predicted trap | D3 and `localDay`. **Measured**: the Prague sunset is 18:28 on 28 March and 19:29 on the 29th; the sun moved one minute | Built; the trap is confirmed |
|
||||
| Golden tests against published tables (§5.5) | 28 days in 6 cities, recorded from USNO | Built |
|
||||
| Choosing a city, the time-zone guess, showing the time | The app, with a city list; later in Phase 1 | **Open** (G1.2) |
|
||||
| The invitation in polar night (D4) | Noon twilight | Decided by the author (Q10) |
|
||||
|
||||
## 5. Verification matrix
|
||||
|
||||
| Case | Kind | Where |
|
||||
|:--|:--|:--|
|
||||
| Sunrise, solar noon and sunset match the USNO table within 2 min, in the city's own clock, on 26 days in 6 cities | unit, golden | `engine/test/sun.test.ts` |
|
||||
| The fixture's offset agrees with the IANA zone on every day, so the table and the zone database tell the same story | unit, golden | same |
|
||||
| Tromsø 21 June is polar day; 21 December is polar night | unit, golden | same |
|
||||
| Reykjavík midsummer: tonight's sunset falls after midnight, on the next local day (D2) | unit, golden | same |
|
||||
| A DST change moves the clock's sunset by an hour while the instant moves by about a day | unit | same |
|
||||
| For any latitude within ±60°, any longitude and any day of 2026: sunrise < noon < sunset, noon is midway, noon is on the asked day | property | same |
|
||||
| Sunsets on consecutive days are never more than 5 minutes apart within ±60° | property | same |
|
||||
| ±80° on the solstices: polar day and night, the right way round in each hemisphere | unit | same |
|
||||
| The invitation is the sunset, the lowest light, or noon, by kind | unit, property | same |
|
||||
| A day that does not exist, a latitude above 90°, an unknown zone: refused | unit | same |
|
||||
| Nothing leaves the device | lint | the engine purity rule already covers `src/sun/` |
|
||||
| Choosing a city, and seeing the time in the app | e2e, offline | **later in Phase 1** |
|
||||
@@ -48,7 +48,7 @@ cards with *Phase N* on each, and no broken image.
|
||||
| 5 | Test honesty | Two tests used *fox* as their example of a thing not in the manifest (`unknown character "fox"`, `"fox-sheet" is not a picture`). Adding the fox made them fail for the wrong reason. | **Fixed**: the example is now *owl*. Lesson: `testing.md`. |
|
||||
| 6 | Soul | A lantern unlit could read as *nobody answered*. | **Covered by the game, not the picture**: a lantern only one player lit is never shown to the other (CLAUDE.md §8). The unlit cell is described as "quiet, not sad". |
|
||||
| 7 | Scope | Paths and lanterns are Phase 3. The screen that shows two roses and the path between them is not designed. | **Deferred, said on the card**: F4 and the card's *usedBy* say the Phase 3 feature doc may ask for them again. |
|
||||
| 8 | Process | STYLE.md was approved an hour earlier. Adding the fox under that heading would stretch the approval over choices Mark never saw. | **Fixed**: F1–F4 are listed as a draft in §0. HANDOVER asks Mark to approve them before `fox-sheet`. |
|
||||
| 8 | Process | STYLE.md was approved an hour earlier. Adding the fox under that heading would stretch the approval over choices Mark never saw. | **Fixed**: F1–F4 were listed as a draft in §0. Mark then approved them with a deeper red-orange coat (`art/fox-coat`). |
|
||||
| 9 | Process | The full run started with the machine at 85 % CPU. §5.7 says not above ~80 %. The load was not checked first. | **Noted.** The run passed and nothing else was disturbed, but the check comes first next time. |
|
||||
| 10 | Process | A cleanup step in the drill command would have removed `F:\manifest.bak`, a path at the drive's root. The safety check refused it, and nothing ran. | **Fixed**: the drill was rerun with backups only in the scratchpad and no removal. |
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# Review — `feature/sun`
|
||||
|
||||
Adversarial self-review (CLAUDE.md §5.3). Analysis: [`features/sun.md`](../features/sun.md).
|
||||
Reviewed 2026-11-01 on Node 22.11.0, Windows 10. There is no PR: the only remote is Gitea.
|
||||
|
||||
## Gates — counts, not exit codes
|
||||
|
||||
| Gate | Result |
|
||||
|:--|:--|
|
||||
| `pnpm lint` | exit 0, the engine purity rule included: `src/sun/` reads no clock, no network, no device |
|
||||
| `pnpm typecheck` | exit 0, `scripts/fetch-sun-golden.ts` included |
|
||||
| `pnpm test` | **236 passed**: schema 15, content 47, art-prep 56, **engine 102 (+50 sun)**, ui 16 |
|
||||
| `pnpm test:e2e` / `test:offline` | 7 passed / 1 passed. **The app is unchanged**: nothing imports the sun yet |
|
||||
|
||||
**Golden.** 26 published days in 6 cities match the U.S. Naval Observatory's tables within
|
||||
2 minutes on the city's own clock, for sunrise, solar noon and sunset. Two more days, Tromsø's polar
|
||||
day and night, match the table's *no event*. The table's clock offset agrees with the IANA zone
|
||||
database on all 28 days.
|
||||
|
||||
**Stable.** The property tests ran three times with fresh seeds, 50 of 50 each time.
|
||||
|
||||
## Bug drills — each put back once, in `src/sun/sun.ts`
|
||||
|
||||
| Put back | Result |
|
||||
|:--|:--|
|
||||
| No refraction: the horizon at 90° instead of 90.833° | CAUGHT: 27 failures, every golden day |
|
||||
| No equation of time | CAUGHT: 25 failures |
|
||||
| Polar day and polar night swapped | CAUGHT: 8 failures |
|
||||
| No local-day correction of solar noon | CAUGHT: 2 failures (Kiritimati, D8) |
|
||||
| The UTC date derived back from the noon instant (finding 2's bug) | CAUGHT: 3 failures (properties near 180°) |
|
||||
|
||||
## Findings
|
||||
|
||||
| # | Area | Finding | Resolution |
|
||||
|:--|:--|:--|:--|
|
||||
| 1 | Correctness | The published table for Reykjavík on 21 June lists a sunset at 00:04. That is the **previous evening's** sunset. A naive "events within the calendar day" design would tell a player in Reykjavík that tonight's sunset was 00:04 this morning. | **By design (D2)**: today's sunset is the one after today's solar noon. Tested: it falls on 22 June, local. |
|
||||
| 2 | Correctness | The first draft derived the UTC date back from the noon instant. Near 180° the noon falls on the next UTC date, which would move sunrise and sunset by a whole day. Spotted on re-reading, before any test ran. | **Fixed**: the date is passed in. Drill 5 shows the property tests now catch it. |
|
||||
| 3 | Correctness | fast-check found a day with no solar noon: at 179.9° W on UTC, noon crosses midnight in late December. | **Defined (D8)** and pinned by a unit test. No real zone is twelve hours off the sun, so the properties use zones that follow longitude. |
|
||||
| 4 | Correctness | Near the edge of polar day or night the hour angle can leave its range during refinement. | **Clamped (D5).** Accuracy on those few days is not measured: no golden day sits at the edge. Said here and in *not verified*. |
|
||||
| 5 | Soul | Where the sun never sets or never rises, "every day at sunset" would leave a person with no invitation for months. | **Fixed (D4)**: the lowest light in polar day, noon twilight in polar night. The author confirmed the second on 2026-11-01 (Q10). |
|
||||
| 6 | Soul | A DST change could make the game look as if the sunset "moved" because of the player, or move the rose's sentence to another day. | The engine works in instants (D3); the day comes only from `localDay`. Tested on all six DST days in the fixture. |
|
||||
| 7 | Privacy | The golden script calls a US government API with coordinates. | Only by hand, only for six public city centres, never in a test or the app. The tests read the recorded file. |
|
||||
| 8 | Privacy | A sunset time narrows down where someone is. | It never leaves the device: the module has no I/O and the purity rule forbids any. Phase 4 must never send it (CLAUDE.md §4). |
|
||||
| 9 | Test honesty | The DST tests read the clock with `Intl` in the test, which is also what `localDay` uses. A bug in the platform's zone data would hide in both. | Cross-checked: the USNO table states each day's offset independently, and a test asserts the zone database agrees on all 28 days. |
|
||||
|
||||
## What was not verified
|
||||
|
||||
- Accuracy on the days right at the edge of polar day or night (finding 4).
|
||||
- Latitudes above 72° on ordinary days, other than Tromsø's 69.6°.
|
||||
- Years far from 2026. The method holds for centuries, but only 2026 is tested.
|
||||
- The app: choosing a city, the time-zone guess, and showing the time are later in Phase 1 (G1.2).
|
||||
@@ -214,7 +214,8 @@ pnpm build # turbo: schema -> engine/content/ui ->
|
||||
pnpm lint # ESLint, incl. the engine-purity rule (§7)
|
||||
pnpm typecheck # tsc + svelte-check, every package plus e2e/ and scripts/
|
||||
pnpm test # vitest, all packages — quote counts per package
|
||||
pnpm --filter @rosea/engine test # incl. fast-check property tests (sun golden tests: later)
|
||||
pnpm --filter @rosea/engine test # incl. fast-check property tests and the sun golden tests
|
||||
tsx scripts/fetch-sun-golden.ts # re-records the sun's published tables (network; by hand, never in a test)
|
||||
pnpm test:e2e # builds, then Playwright against the BUILT app under /Rosea/
|
||||
pnpm test:offline # builds, loads once, CLOSES the server, reloads
|
||||
pnpm validate:library # every hope sentence; fixtures must FAIL
|
||||
@@ -488,8 +489,8 @@ No timestamp finer than a day, no precise location, no free text, no link to the
|
||||
| Trap | Why it bites |
|
||||
|:--|:--|
|
||||
| **A PWA cannot schedule a local notification** *(predicted — verify first)* | The sunset invitation is time-based. A web app generally cannot fire a notification at a set time while closed without a **push server** sending it, and a push server that knows when someone's sunset is knows roughly where they are. On iOS, web push works only for a site added to the home screen. **Decided in Phase 0 (2026-11-01):** in-app sunset only for the web build — no push server — and local notifications through the Tauri shell later (Phase 6). |
|
||||
| **Polar day and polar night** *(predicted)* | Above the Arctic Circle the sun does not set in summer or rise in winter. "Every day at sunset" has no answer there. The engine must return a defined state and the game must have a gentle alternative (e.g. the hour the light is lowest). |
|
||||
| **DST and the local day** *(predicted)* | Sunset jumps an hour twice a year under a player who did nothing; a day boundary computed in UTC records Monday-evening care as Tuesday's. One module computes the day. |
|
||||
| **Polar day and polar night** *(measured 2026-11-01)* | Above the Arctic Circle the sun does not set in summer or rise in winter. "Every day at sunset" has no answer there. Measured: the almanac has no rise or set in Tromsø on 21 June and no events at all on 21 December. `engine/sun` returns `polar-day` or `polar-night` and a gentle moment for each (the lowest light; noon twilight) — `.agents/features/sun.md` D4. |
|
||||
| **DST and the local day** *(measured 2026-11-01)* | Sunset jumps an hour twice a year under a player who did nothing: Prague's is 18:28 on 28 March and 19:29 on the 29th, while the sun moved one minute. A day boundary computed in UTC records Monday-evening care as Tuesday's. One module computes the day; the sun works in instants. |
|
||||
| **Comfort becomes wallpaper** | The same words every day stop meaning anything. Comfort words are occasional; the real trace of a real person is constant. Track repetition in tests. |
|
||||
| **Guilt sneaks in through "gentle" reminders** | "Your rose misses you" is guilt wearing a ribbon. No notification ever refers to neglect — the player's or anyone else's. |
|
||||
| **Streak creep** | Someone will propose "just a small streak". Growth is from total care; a missed day never resets anything. |
|
||||
|
||||
@@ -12,8 +12,8 @@ Rewritten at the end of each session (CLAUDE.md §5.1).
|
||||
Gitea hashes match. Analysis: [`.agents/features/phase0-workspace.md`](.agents/features/phase0-workspace.md).
|
||||
Review, with counts and the mutation results:
|
||||
[`.agents/reviews/feature-phase0-workspace.md`](.agents/reviews/feature-phase0-workspace.md).
|
||||
- **Gates:** all pass on this machine. Unit tests: 186 (schema 15, content 47,
|
||||
art-prep 56, engine 52, ui 16). E2E: 7. Offline: 1. `lint:copy`: 12 files, 0 problems.
|
||||
- **Gates:** all pass on this machine. Unit tests: 236 (schema 15, content 47,
|
||||
art-prep 56, engine 102, ui 16). E2E: 7. Offline: 1. `lint:copy`: 12 files, 0 problems.
|
||||
`validate:library`: 13 of 13 fixtures rejected.
|
||||
- **Built, not deployed:** there is no host yet.
|
||||
- **Roadmap and gameplay docs:** `docs/ROADMAP.md` and `docs/GAMEPLAY.md` are on
|
||||
@@ -35,6 +35,13 @@ Rewritten at the end of each session (CLAUDE.md §5.1).
|
||||
republish `tools/art-prep/dist/board/` to that URL. Review:
|
||||
[`.agents/reviews/feature-art-board.md`](.agents/reviews/feature-art-board.md).
|
||||
|
||||
- **The sun (Phase 1 begins):** merged to `main`. `packages/engine/src/sun/sun.ts` gives
|
||||
sunrise, solar noon and sunset for a local day and a place, or polar day or night, and the
|
||||
moment the game invites the player out. It matches the U.S. Naval Observatory's tables within
|
||||
2 minutes in Prague, Reykjavík, Tromsø, Quito, Sydney and Anchorage, DST days included.
|
||||
The app does not use it yet. Analysis: [`.agents/features/sun.md`](.agents/features/sun.md).
|
||||
Review: [`.agents/reviews/feature-sun.md`](.agents/reviews/feature-sun.md).
|
||||
|
||||
**Phase 0 is not finished.** The roadmap's Phase 0 is more than the workspace. Its
|
||||
gate needs 60 verified sentences (G0.18) and one illustration through the art
|
||||
pipeline (G0.24). The pipeline and the board are built; the first real picture is not made yet. Also open: a GitHub remote (G0.13). The Letter slot is built (G0.25).
|
||||
@@ -46,8 +53,8 @@ The notification decision is made: in-app only on the web (G0.26).
|
||||
door to real help (G0.27), and Q9 (may the letter name the book).
|
||||
2. **Sentences:** an agent may propose public-domain candidates with their sources.
|
||||
Only the author can mark one verified.
|
||||
3. **Art:** the style is approved (S1–S5). The fox's look, F1–F4 in `art/STYLE.md` §0, is a draft:
|
||||
approve it or change it before making `fox-sheet`. Make `rose-sheet` on the board and accept it. That is the first step of the Phase 0 art gate.
|
||||
3. **Art:** the style is approved (S1–S5), and so is the fox (F1–F4, with a deep red-orange coat).
|
||||
Make `rose-sheet` on the board and accept it; `fox-sheet` comes first for Phase 2. That is the first step of the Phase 0 art gate.
|
||||
After an accept, Claude reads the row (`ArtifactData get art/<id>`), downloads the picture
|
||||
(`Artifact read` with the asset id as `path`), runs `pnpm art:accept`, commits on `art/<set>`,
|
||||
and writes `final` back into the row.
|
||||
|
||||
@@ -10,8 +10,9 @@ A picture that is off-style goes back for another try. It is never shipped.
|
||||
> the rose's character sheet, is still the test. If it looks wrong, this file changes before
|
||||
> anything else is made, and `pnpm art:board` rebuilds every prompt.
|
||||
>
|
||||
> **Added later the same day, a draft again:** the fox and the Phase 2–3 pictures (F1–F4 in §0,
|
||||
> §3a, the new rows in §2 and §4, review points 8–9). Mark's approval above covers S1–S5 only.
|
||||
> **The fox and the Phase 2–3 pictures** (F1–F4 in §0, §3a, the new rows in §2 and §4, review
|
||||
> points 8–9) were added later the same day and **approved by Mark** with one change: the fox's
|
||||
> coat is a deep red-orange, not the drafted muted russet.
|
||||
|
||||
---
|
||||
|
||||
@@ -25,11 +26,11 @@ A picture that is off-style goes back for another try. It is never shipped.
|
||||
| S4 | The palette | §2 | It starts from the app's tokens (`--rose #b4485e`, `--paper #fbf6f1`). |
|
||||
| S5 | The sky | Drawn in code, never painted | The sun moves at the player's real time, and the stars are the real constellations. A painted sky could do neither. |
|
||||
|
||||
**Draft, waiting for Mark: the fox and the Phase 2–3 pictures.**
|
||||
**The fox and the Phase 2–3 pictures, decided 2026-11-01.**
|
||||
|
||||
| # | Choice | The draft says | Why |
|
||||
| # | Choice | Decided | Why |
|
||||
|:--|:--|:--|:--|
|
||||
| F1 | The fox's look | A small russet fox with a cream mask round his eyes and muzzle, dark legs, and a bushy tail with faint darker rings | The mask and the rings are the quiet nod to Ulfík the red panda (CLAUDE.md §1). They also keep him far from the book's fox, which is pale and sandy with very long ears. |
|
||||
| F1 | The fox's look | A small, young, shy fox with a **deep red-orange** coat, a cream mask round his eyes and muzzle, dark legs, and a bushy tail with faint darker rings. *Mark changed the coat from the drafted muted russet; the rest is as drafted.* | The mask and the rings are the quiet nod to Ulfík the red panda (CLAUDE.md §1), and the deeper coat is closer to his. All of it keeps him far from the book's fox, which is pale and sandy with very long ears. |
|
||||
| F2 | His size | Sitting, he is about as tall as the rose | They share the garden bed and must read together on a phone. |
|
||||
| F3 | Bush and berries | One wild bush in three states. The berries are their own small pictures, placed on the bush in code | Five berry kinds (GAMEPLAY.md §3) then need one bush, not five. |
|
||||
| F4 | Paths and lanterns (Phase 3) | Small vignettes for now | The screen that shows two roses and the path between them is not designed yet. Its feature doc may ask for them again. |
|
||||
@@ -72,7 +73,7 @@ The main tones. Small shades in between are fine.
|
||||
| Sunset glow | coral | `#E9846A` |
|
||||
| Night | dusk indigo | `#2E3561` |
|
||||
| Lamps and stars | lamp gold | `#F4D58D` |
|
||||
| Fox coat | russet | `#B65A35` |
|
||||
| Fox coat | deep red-orange | `#BC4A22` |
|
||||
| Fox mask, chest, tail tip | cream | `#F3E3C8` |
|
||||
| Fox legs, ear tips | deep brown | `#5A3A33` |
|
||||
| Wild strawberries | strawberry | `#D2554E` |
|
||||
@@ -109,11 +110,11 @@ The rose is the only character in Phase 1. Every rose picture follows the charac
|
||||
|
||||
---
|
||||
|
||||
## 3a. The fox (Phase 2, draft: F1–F2)
|
||||
## 3a. The fox (Phase 2: F1–F2)
|
||||
|
||||
The fox is the second character. Every fox picture follows the character sheet `fox-sheet`.
|
||||
|
||||
- **A small, young fox** with a warm russet coat (`#B65A35`). His face has a cream mask
|
||||
- **A small, young fox** with a deep red-orange coat (`#BC4A22`), warm and glowing, never neon. His face has a cream mask
|
||||
(`#F3E3C8`): cream cheeks and muzzle, and a small cream spot above each eye. His legs and
|
||||
paws are deep brown (`#5A3A33`). His ears are rounded and of middle size, cream inside with
|
||||
dark tips. His tail is big and bushy, with three faint darker rings and a cream tip.
|
||||
@@ -212,7 +213,7 @@ tick them: *Accept* is one tap.
|
||||
5. The size and background are right for its kind in §5.
|
||||
6. It reads clearly at the smallest size it is shown.
|
||||
7. It is gentle: nothing blames, frightens or looks hurt, and drift looks like waiting.
|
||||
8. It reads as one young russet fox with a cream mask and a ringed tail, shy and gentle, and
|
||||
8. It reads as one young red-orange fox with a cream mask and a ringed tail, shy and gentle, and
|
||||
nothing like the book's sandy, long-eared fox.
|
||||
9. He matches `fox-sheet`: the same mask, ears, leg colour, tail rings and size.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"fox": {
|
||||
"sheet": "fox-sheet",
|
||||
"description": "The fox: a small, young fox; sitting, he is about as tall as the rose. A warm russet coat (#B65A35). A cream mask (#F3E3C8) on his face: cream cheeks and muzzle and a small cream spot above each eye. Deep brown legs and paws (#5A3A33). Rounded ears of middle size, cream inside with dark tips. A big bushy tail with three faint darker rings and a cream tip. Small dark eyes, often half-closed, a tiny dark nose and mouth. A fox's pointed muzzle and a fox's body: the mask and the tail rings are only a nod to a red panda. Shy, curious and gentle, never sly."
|
||||
"description": "The fox: a small, young fox; sitting, he is about as tall as the rose. A deep red-orange coat (#BC4A22), warm and glowing, never neon. A cream mask (#F3E3C8) on his face: cream cheeks and muzzle and a small cream spot above each eye. Deep brown legs and paws (#5A3A33). Rounded ears of middle size, cream inside with dark tips. A big bushy tail with three faint darker rings and a cream tip. Small dark eyes, often half-closed, a tiny dark nose and mouth. A fox's pointed muzzle and a fox's body: the mask and the tail rings are only a nod to a red panda. Shy, curious and gentle, never sly."
|
||||
}
|
||||
},
|
||||
"avoid": [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-asleep (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><circle cx="150" cy="160" r="66" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M205 200 Q 170 235 110 205" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M205 200 Q 170 235 110 205" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M205 200 Q 170 235 110 205" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M96.5 150 l12 -27 l12 27z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M123.5 150 l12 -27 l12 27z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 125 168)"><circle cx="125" cy="168" r="30" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="108.5" cy="178.5" rx="16.5" ry="11.4" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="113" cy="154.5" r="5" fill="#f3e3c8"/><circle cx="135" cy="154.5" r="5" fill="#f3e3c8"/> <path d="M106 164 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M128 164 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="96.5" cy="177" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><circle cx="150" cy="160" r="66" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M205 200 Q 170 235 110 205" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M205 200 Q 170 235 110 205" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M205 200 Q 170 235 110 205" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M96.5 150 l12 -27 l12 27z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M123.5 150 l12 -27 l12 27z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 125 168)"><circle cx="125" cy="168" r="30" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="108.5" cy="178.5" rx="16.5" ry="11.4" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="113" cy="154.5" r="5" fill="#f3e3c8"/><circle cx="135" cy="154.5" r="5" fill="#f3e3c8"/> <path d="M106 164 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M128 164 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="96.5" cy="177" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-brushed (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="46" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#b65a35" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="40" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(8 145 72)"><circle cx="145" cy="72" r="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="46" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#bc4a22" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="40" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(8 145 72)"><circle cx="145" cy="72" r="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-carrying-petal (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 80 98)"><circle cx="80" cy="98" r="34" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <path d="M61 94 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M83 94 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> <ellipse cx="44.5" cy="123.5" rx="16" ry="9" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/></g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 80 98)"><circle cx="80" cy="98" r="34" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <path d="M61 94 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M83 94 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> <ellipse cx="44.5" cy="123.5" rx="16" ry="9" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/></g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-curious (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(-14 80 98)"><circle cx="80" cy="98" r="34" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <circle cx="67" cy="94" r="4" fill="#3a2730"/><circle cx="89" cy="94" r="4" fill="#3a2730"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(-14 80 98)"><circle cx="80" cy="98" r="34" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <circle cx="67" cy="94" r="4" fill="#3a2730"/><circle cx="89" cy="94" r="4" fill="#3a2730"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-eating (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(-30 80 98)"><circle cx="80" cy="98" r="34" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <path d="M61 94 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M83 94 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(-30 80 98)"><circle cx="80" cy="98" r="34" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <path d="M61 94 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M83 94 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-leading (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><g transform="translate(300 0) scale(-1 1)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M221.7 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M191.1 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 215 98)"><circle cx="215" cy="98" r="34" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="234.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="227" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="205" cy="82.7" r="5" fill="#f3e3c8"/> <circle cx="228" cy="94" r="4" fill="#3a2730"/><circle cx="206" cy="94" r="4" fill="#3a2730"/><circle cx="246.5" cy="108.2" r="5" fill="#3a2730"/> </g></g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><g transform="translate(300 0) scale(-1 1)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M221.7 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M191.1 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 215 98)"><circle cx="215" cy="98" r="34" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="234.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="227" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="205" cy="82.7" r="5" fill="#f3e3c8"/> <circle cx="228" cy="94" r="4" fill="#3a2730"/><circle cx="206" cy="94" r="4" fill="#3a2730"/><circle cx="246.5" cy="108.2" r="5" fill="#3a2730"/> </g></g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-petted (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(-18 145 72)"><circle cx="145" cy="72" r="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(-18 145 72)"><circle cx="145" cy="72" r="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 6 12 0" fill="none" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-resting (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M250 205 Q 285 215 290 180" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M250 205 Q 285 215 290 180" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M250 205 Q 285 215 290 180" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="170" cy="192" rx="92" ry="30" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M70 215 V 222" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M42.4 158.8 l12 -28.8 l12 28.8z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M71.2 158.8 l12 -28.8 l12 28.8z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 72 178)"><circle cx="72" cy="178" r="32" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="54" cy="189.2" rx="17.6" ry="12.16" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="60" cy="163.6" r="5" fill="#f3e3c8"/><circle cx="82" cy="163.6" r="5" fill="#f3e3c8"/> <path d="M53 174 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M75 174 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="42" cy="187.6" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M250 205 Q 285 215 290 180" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M250 205 Q 285 215 290 180" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M250 205 Q 285 215 290 180" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="170" cy="192" rx="92" ry="30" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M70 215 V 222" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M42.4 158.8 l12 -28.8 l12 28.8z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M71.2 158.8 l12 -28.8 l12 28.8z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 72 178)"><circle cx="72" cy="178" r="32" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="54" cy="189.2" rx="17.6" ry="12.16" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="60" cy="163.6" r="5" fill="#f3e3c8"/><circle cx="82" cy="163.6" r="5" fill="#f3e3c8"/> <path d="M53 174 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M75 174 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="42" cy="187.6" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-sitting (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 145 72)"><circle cx="145" cy="72" r="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 145 72)"><circle cx="145" cy="72" r="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-trotting (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 80 98)"><circle cx="80" cy="98" r="34" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <circle cx="67" cy="94" r="4" fill="#3a2730"/><circle cx="89" cy="94" r="4" fill="#3a2730"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M235 120 Q 280 110 290 60" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><path d="M110 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M130 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M200 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M220 140 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><ellipse cx="165" cy="128" rx="80" ry="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M49.3 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M79.9 77.6 l12 -30.6 l12 30.6z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 80 98)"><circle cx="80" cy="98" r="34" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="60.5" cy="109.9" rx="18.700000000000003" ry="12.92" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="68" cy="82.7" r="5" fill="#f3e3c8"/><circle cx="90" cy="82.7" r="5" fill="#f3e3c8"/> <circle cx="67" cy="94" r="4" fill="#3a2730"/><circle cx="89" cy="94" r="4" fill="#3a2730"/><circle cx="48.5" cy="108.2" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-visiting (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(16 145 72)"><circle cx="145" cy="72" r="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M112.1 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M146.3 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(16 145 72)"><circle cx="145" cy="72" r="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="122.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="133" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="155" cy="54.9" r="5" fill="#f3e3c8"/> <path d="M126 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><path d="M148 68 q6 4 12 0" fill="#3a2730" stroke="#3a2730" stroke-width="3" stroke-linecap="round"/><circle cx="110.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<!-- Stand-in for fox-watching (art/placeholders, CLAUDE.md §2): form and layout only, not art. Built by tools/art-prep. -->
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#b65a35" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M183.9 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><path d="M149.7 49.2 l12 -34.2 l12 34.2z" fill="#b65a35" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 175 72)"><circle cx="175" cy="72" r="38" fill="#b65a35" stroke="#3a2730" stroke-width="4"/> <ellipse cx="197.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="187" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="165" cy="54.9" r="5" fill="#f3e3c8"/> <circle cx="188" cy="68" r="4" fill="#3a2730"/><circle cx="166" cy="68" r="4" fill="#3a2730"/><circle cx="209.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
<g transform="translate(61.4 100.4) scale(1.2971)"><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#3a2730" stroke-width="38" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#bc4a22" stroke-width="30" stroke-linecap="round"/><path d="M185 215 Q 250 205 240 150" fill="none" stroke="#5a3a33" stroke-width="32" stroke-dasharray="6 26" opacity=".45"/><ellipse cx="160" cy="150" rx="50" ry="64" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><ellipse cx="148" cy="160" rx="24" ry="38" fill="#f3e3c8"/><path d="M140 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M168 175 V 225" stroke="#5a3a33" stroke-width="14" stroke-linecap="round"/><path d="M183.9 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><path d="M149.7 49.2 l12 -34.2 l12 34.2z" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/><g transform="rotate(0 175 72)"><circle cx="175" cy="72" r="38" fill="#bc4a22" stroke="#3a2730" stroke-width="4"/> <ellipse cx="197.5" cy="85.3" rx="20.900000000000002" ry="14.44" fill="#f3e3c8" stroke="#3a2730" stroke-width="4"/> <circle cx="187" cy="54.9" r="5" fill="#f3e3c8"/><circle cx="165" cy="54.9" r="5" fill="#f3e3c8"/> <circle cx="188" cy="68" r="4" fill="#3a2730"/><circle cx="166" cy="68" r="4" fill="#3a2730"/><circle cx="209.5" cy="83.4" r="5" fill="#3a2730"/> </g></g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -4,7 +4,7 @@ Every illustration in Rosea Domi goes through this pipeline. A picture that skip
|
||||
not shipped, however good it looks (CLAUDE.md §7).
|
||||
|
||||
- **What the pictures look like:** [`art/STYLE.md`](../art/STYLE.md). Mark approved it on
|
||||
2026-11-01 (S1–S5 in its §0). The fox and the Phase 2–3 pictures (F1–F4) are a draft.
|
||||
2026-11-01 (S1–S5 in its §0). The fox and the Phase 2–3 pictures (F1–F4) were approved the same day, with a deep red-orange coat.
|
||||
- **Which pictures exist:** [`art/manifest.json`](../art/manifest.json), in phase order: Phase 1 (the rose and her garden), Phase 2 (the fox, berries, the bush), and the decided Phase 3 pictures (paths, lanterns). The planets wait for their own feature docs.
|
||||
- **The tools:** [`tools/art-prep/`](../tools/art-prep/). It turns those two files into prompts,
|
||||
stand-ins and the board, and moves accepted pictures into `art/final/`.
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { isLocalDay, localDay, type LocalDay } from './time/localDay.js';
|
||||
export { invitation, sunDay, type Place, type SunDay } from './sun/sun.js';
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* The ONLY place in the repository where the sun is computed (CLAUDE.md §7).
|
||||
*
|
||||
* NOAA's solar calculator, after Meeus, Astronomical Algorithms: the sun's
|
||||
* declination and the equation of time at an instant, then the hour angle at
|
||||
* which the sun's centre is 0.833° below the horizon (refraction plus its
|
||||
* radius). Good to about a minute below 72° latitude.
|
||||
*
|
||||
* Every time returned is an instant (epoch milliseconds). Reading it on a clock
|
||||
* is the app's job, with the city's zone, so a DST change moves only the clock
|
||||
* (.agents/features/sun.md D3). The place is a city the player chose, or a guess
|
||||
* from the device's zone: never GPS (CLAUDE.md §5.6 rule 6).
|
||||
*/
|
||||
import { isLocalDay, localDay, type LocalDay } from '../time/localDay.js';
|
||||
|
||||
export interface Place {
|
||||
/** Degrees, north positive. */
|
||||
readonly lat: number;
|
||||
/** Degrees, east positive. */
|
||||
readonly lon: number;
|
||||
/** IANA zone whose local day is asked about. */
|
||||
readonly timeZone: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* One local day of sun. Sunrise and sunset are the ones around this day's solar
|
||||
* noon, so tonight's sunset may fall after midnight, on the next local day (D2).
|
||||
*/
|
||||
export type SunDay =
|
||||
| { readonly kind: 'sun-sets'; readonly day: LocalDay; readonly sunrise: number; readonly solarNoon: number; readonly sunset: number }
|
||||
/** The sun never sets. `lowestLight` is solar midnight, after this day's noon. */
|
||||
| { readonly kind: 'polar-day'; readonly day: LocalDay; readonly solarNoon: number; readonly lowestLight: number }
|
||||
/** The sun never rises. Solar noon is when the twilight is brightest. */
|
||||
| { readonly kind: 'polar-night'; readonly day: LocalDay; readonly solarNoon: number };
|
||||
|
||||
const MINUTE = 60_000;
|
||||
const DAY = 24 * 60 * MINUTE;
|
||||
const RAD = Math.PI / 180;
|
||||
/** The sun's centre at sunrise and sunset: 0.833° below the horizon. */
|
||||
const ZENITH = 90.833 * RAD;
|
||||
|
||||
interface Sun {
|
||||
/** Radians. */
|
||||
readonly declination: number;
|
||||
/** Minutes the true sun is ahead of the mean sun. */
|
||||
readonly equationOfTime: number;
|
||||
}
|
||||
|
||||
/** The sun's declination and the equation of time at an instant (NOAA). */
|
||||
function sunAt(epochMs: number): Sun {
|
||||
const T = (epochMs / DAY + 2440587.5 - 2451545) / 36525; // Julian centuries since J2000.0
|
||||
const L0 = (((280.46646 + T * (36000.76983 + T * 0.0003032)) % 360) + 360) % 360;
|
||||
const M = 357.52911 + T * (35999.05029 - 0.0001537 * T);
|
||||
const e = 0.016708634 - T * (0.000042037 + 0.0000001267 * T);
|
||||
const C = Math.sin(M * RAD) * (1.914602 - T * (0.004817 + 0.000014 * T))
|
||||
+ Math.sin(2 * M * RAD) * (0.019993 - 0.000101 * T)
|
||||
+ Math.sin(3 * M * RAD) * 0.000289;
|
||||
const omega = 125.04 - 1934.136 * T;
|
||||
const lambda = L0 + C - 0.00569 - 0.00478 * Math.sin(omega * RAD);
|
||||
const eps0 = 23 + (26 + (21.448 - T * (46.815 + T * (0.00059 - T * 0.001813))) / 60) / 60;
|
||||
const eps = (eps0 + 0.00256 * Math.cos(omega * RAD)) * RAD;
|
||||
const y = Math.tan(eps / 2) ** 2;
|
||||
const eq = y * Math.sin(2 * L0 * RAD) - 2 * e * Math.sin(M * RAD)
|
||||
+ 4 * e * y * Math.sin(M * RAD) * Math.cos(2 * L0 * RAD)
|
||||
- 0.5 * y * y * Math.sin(4 * L0 * RAD) - 1.25 * e * e * Math.sin(2 * M * RAD);
|
||||
return { declination: Math.asin(Math.sin(eps) * Math.sin(lambda * RAD)), equationOfTime: (4 * eq) / RAD };
|
||||
}
|
||||
|
||||
/** cos of the hour angle at sunrise and sunset. Above 1: never rises. Below -1: never sets. */
|
||||
function cosHourAngle(lat: number, declination: number): number {
|
||||
return Math.cos(ZENITH) / (Math.cos(lat * RAD) * Math.cos(declination)) - Math.tan(lat * RAD) * Math.tan(declination);
|
||||
}
|
||||
|
||||
/** Solar noon nearest 12:00 mean solar time on the UTC date starting at `utcMidnight`. */
|
||||
function solarNoonOn(utcMidnight: number, lon: number): number {
|
||||
let noon = utcMidnight + (720 - 4 * lon) * MINUTE;
|
||||
for (let i = 0; i < 2; i++) noon = utcMidnight + (720 - 4 * lon - sunAt(noon).equationOfTime) * MINUTE;
|
||||
return noon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sunrise (`side` -1) or sunset (`side` +1) around the solar noon of the UTC date
|
||||
* starting at `utcMidnight`, refined at its own instant. The date is passed in,
|
||||
* never derived from noon: near 180° the noon itself can fall on the next UTC date.
|
||||
* An hour angle out of range, only near the edge of polar day or night, is clamped (D5).
|
||||
*/
|
||||
function horizonCrossing(utcMidnight: number, noon: number, lat: number, lon: number, side: -1 | 1): number {
|
||||
let at = noon;
|
||||
for (let i = 0; i < 4; i++) {
|
||||
const sun = sunAt(at);
|
||||
const H = Math.acos(Math.min(1, Math.max(-1, cosHourAngle(lat, sun.declination)))) / RAD; // degrees
|
||||
// Minutes from this UTC midnight; below 0 or above 1440 is the day before or after.
|
||||
const fromMidnight = 720 - 4 * lon - sun.equationOfTime + side * 4 * H;
|
||||
at = utcMidnight + fromMidnight * MINUTE;
|
||||
}
|
||||
return at;
|
||||
}
|
||||
|
||||
function check(day: LocalDay, place: Place): number {
|
||||
if (!isLocalDay(day)) throw new RangeError(`sunDay: '${day}' is not a LocalDay (YYYY-MM-DD)`);
|
||||
const [y, m, d] = day.split('-').map(Number) as [number, number, number];
|
||||
const utcMidnight = Date.UTC(y, m - 1, d);
|
||||
if (new Date(utcMidnight).getUTCDate() !== d) throw new RangeError(`sunDay: ${day} does not exist`);
|
||||
if (!(Math.abs(place.lat) <= 90)) throw new RangeError(`sunDay: latitude ${place.lat} is outside -90..90`);
|
||||
if (!(Math.abs(place.lon) <= 180)) throw new RangeError(`sunDay: longitude ${place.lon} is outside -180..180`);
|
||||
return utcMidnight;
|
||||
}
|
||||
|
||||
/** The sun on one local day at one place. */
|
||||
export function sunDay(day: LocalDay, place: Place): SunDay {
|
||||
const { lat, lon, timeZone } = place;
|
||||
let utcMidnight = check(day, place);
|
||||
|
||||
// The solar noon that falls on this local day. Zones far from their longitude
|
||||
// (UTC+14 at 157° W) put it on the UTC date before or after. A clock twelve
|
||||
// hours off the sun can leave a day with no noon at all; then the nearest is
|
||||
// used (D8). No real zone is that far off.
|
||||
let solarNoon = solarNoonOn(utcMidnight, lon);
|
||||
for (let i = 0; i < 2; i++) {
|
||||
const on = localDay(solarNoon, timeZone);
|
||||
if (on === day) break;
|
||||
utcMidnight += on < day ? DAY : -DAY;
|
||||
solarNoon = solarNoonOn(utcMidnight, lon);
|
||||
}
|
||||
|
||||
const c = cosHourAngle(lat, sunAt(solarNoon).declination);
|
||||
if (c > 1) return { kind: 'polar-night', day, solarNoon };
|
||||
// Solar midnight: halfway to the next solar noon.
|
||||
if (c < -1) return { kind: 'polar-day', day, solarNoon, lowestLight: (solarNoon + solarNoonOn(utcMidnight + DAY, lon)) / 2 };
|
||||
return {
|
||||
kind: 'sun-sets', day, solarNoon,
|
||||
sunrise: horizonCrossing(utcMidnight, solarNoon, lat, lon, -1),
|
||||
sunset: horizonCrossing(utcMidnight, solarNoon, lat, lon, 1)
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* When the game invites the player outside: the sunset; in polar day the lowest
|
||||
* light; in polar night noon, when the twilight is brightest (D4; decided by the
|
||||
* author, Q10).
|
||||
*/
|
||||
export function invitation(sun: SunDay): number {
|
||||
switch (sun.kind) {
|
||||
case 'sun-sets': return sun.sunset;
|
||||
case 'polar-day': return sun.lowestLight;
|
||||
case 'polar-night': return sun.solarNoon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
{
|
||||
"source": "https://aa.usno.navy.mil/api/rstt/oneday (U.S. Naval Observatory, Astronomical Applications). Times are HH:MM on the local clock at utcOffset; null means the event does not happen that day.",
|
||||
"recorded": "2026-11-01",
|
||||
"rows": [
|
||||
{
|
||||
"city": "Prague",
|
||||
"lat": 50.0755,
|
||||
"lon": 14.4378,
|
||||
"timeZone": "Europe/Prague",
|
||||
"day": "2026-03-28",
|
||||
"utcOffset": 1,
|
||||
"why": "the day before DST starts",
|
||||
"rise": "05:48",
|
||||
"transit": "12:07",
|
||||
"set": "18:28"
|
||||
},
|
||||
{
|
||||
"city": "Prague",
|
||||
"lat": 50.0755,
|
||||
"lon": 14.4378,
|
||||
"timeZone": "Europe/Prague",
|
||||
"day": "2026-03-29",
|
||||
"utcOffset": 2,
|
||||
"why": "DST starts",
|
||||
"rise": "06:46",
|
||||
"transit": "13:07",
|
||||
"set": "19:29"
|
||||
},
|
||||
{
|
||||
"city": "Prague",
|
||||
"lat": 50.0755,
|
||||
"lon": 14.4378,
|
||||
"timeZone": "Europe/Prague",
|
||||
"day": "2026-06-21",
|
||||
"utcOffset": 2,
|
||||
"why": "midsummer",
|
||||
"rise": "04:53",
|
||||
"transit": "13:04",
|
||||
"set": "21:16"
|
||||
},
|
||||
{
|
||||
"city": "Prague",
|
||||
"lat": 50.0755,
|
||||
"lon": 14.4378,
|
||||
"timeZone": "Europe/Prague",
|
||||
"day": "2026-10-24",
|
||||
"utcOffset": 2,
|
||||
"why": "the day before DST ends",
|
||||
"rise": "07:39",
|
||||
"transit": "12:46",
|
||||
"set": "17:54"
|
||||
},
|
||||
{
|
||||
"city": "Prague",
|
||||
"lat": 50.0755,
|
||||
"lon": 14.4378,
|
||||
"timeZone": "Europe/Prague",
|
||||
"day": "2026-10-25",
|
||||
"utcOffset": 1,
|
||||
"why": "DST ends",
|
||||
"rise": "06:40",
|
||||
"transit": "11:46",
|
||||
"set": "16:52"
|
||||
},
|
||||
{
|
||||
"city": "Prague",
|
||||
"lat": 50.0755,
|
||||
"lon": 14.4378,
|
||||
"timeZone": "Europe/Prague",
|
||||
"day": "2026-12-21",
|
||||
"utcOffset": 1,
|
||||
"why": "midwinter",
|
||||
"rise": "07:58",
|
||||
"transit": "12:00",
|
||||
"set": "16:02"
|
||||
},
|
||||
{
|
||||
"city": "Reykjavík",
|
||||
"lat": 64.1466,
|
||||
"lon": -21.9426,
|
||||
"timeZone": "Atlantic/Reykjavik",
|
||||
"day": "2026-03-20",
|
||||
"utcOffset": 0,
|
||||
"why": "equinox",
|
||||
"rise": "07:29",
|
||||
"transit": "13:35",
|
||||
"set": "19:43"
|
||||
},
|
||||
{
|
||||
"city": "Reykjavík",
|
||||
"lat": 64.1466,
|
||||
"lon": -21.9426,
|
||||
"timeZone": "Atlantic/Reykjavik",
|
||||
"day": "2026-06-21",
|
||||
"utcOffset": 0,
|
||||
"why": "midsummer: a sunset near midnight",
|
||||
"rise": "02:55",
|
||||
"transit": "13:30",
|
||||
"set": "00:04"
|
||||
},
|
||||
{
|
||||
"city": "Reykjavík",
|
||||
"lat": 64.1466,
|
||||
"lon": -21.9426,
|
||||
"timeZone": "Atlantic/Reykjavik",
|
||||
"day": "2026-12-21",
|
||||
"utcOffset": 0,
|
||||
"why": "midwinter: four hours of day",
|
||||
"rise": "11:22",
|
||||
"transit": "13:26",
|
||||
"set": "15:29"
|
||||
},
|
||||
{
|
||||
"city": "Tromsø",
|
||||
"lat": 69.6492,
|
||||
"lon": 18.9553,
|
||||
"timeZone": "Europe/Oslo",
|
||||
"day": "2026-03-29",
|
||||
"utcOffset": 2,
|
||||
"why": "DST starts",
|
||||
"rise": "06:03",
|
||||
"transit": "12:49",
|
||||
"set": "19:37"
|
||||
},
|
||||
{
|
||||
"city": "Tromsø",
|
||||
"lat": 69.6492,
|
||||
"lon": 18.9553,
|
||||
"timeZone": "Europe/Oslo",
|
||||
"day": "2026-06-21",
|
||||
"utcOffset": 2,
|
||||
"why": "polar day",
|
||||
"rise": null,
|
||||
"transit": "12:46",
|
||||
"set": null
|
||||
},
|
||||
{
|
||||
"city": "Tromsø",
|
||||
"lat": 69.6492,
|
||||
"lon": 18.9553,
|
||||
"timeZone": "Europe/Oslo",
|
||||
"day": "2026-10-25",
|
||||
"utcOffset": 1,
|
||||
"why": "DST ends",
|
||||
"rise": "07:38",
|
||||
"transit": "11:28",
|
||||
"set": "15:17"
|
||||
},
|
||||
{
|
||||
"city": "Tromsø",
|
||||
"lat": 69.6492,
|
||||
"lon": 18.9553,
|
||||
"timeZone": "Europe/Oslo",
|
||||
"day": "2026-12-21",
|
||||
"utcOffset": 1,
|
||||
"why": "polar night",
|
||||
"rise": null,
|
||||
"transit": null,
|
||||
"set": null
|
||||
},
|
||||
{
|
||||
"city": "Quito",
|
||||
"lat": -0.1807,
|
||||
"lon": -78.4678,
|
||||
"timeZone": "America/Guayaquil",
|
||||
"day": "2026-03-20",
|
||||
"utcOffset": -5,
|
||||
"why": "equinox on the equator",
|
||||
"rise": "06:18",
|
||||
"transit": "12:21",
|
||||
"set": "18:24"
|
||||
},
|
||||
{
|
||||
"city": "Quito",
|
||||
"lat": -0.1807,
|
||||
"lon": -78.4678,
|
||||
"timeZone": "America/Guayaquil",
|
||||
"day": "2026-06-21",
|
||||
"utcOffset": -5,
|
||||
"why": "June solstice",
|
||||
"rise": "06:12",
|
||||
"transit": "12:16",
|
||||
"set": "18:19"
|
||||
},
|
||||
{
|
||||
"city": "Quito",
|
||||
"lat": -0.1807,
|
||||
"lon": -78.4678,
|
||||
"timeZone": "America/Guayaquil",
|
||||
"day": "2026-12-21",
|
||||
"utcOffset": -5,
|
||||
"why": "December solstice",
|
||||
"rise": "06:08",
|
||||
"transit": "12:12",
|
||||
"set": "18:16"
|
||||
},
|
||||
{
|
||||
"city": "Sydney",
|
||||
"lat": -33.8688,
|
||||
"lon": 151.2093,
|
||||
"timeZone": "Australia/Sydney",
|
||||
"day": "2026-04-04",
|
||||
"utcOffset": 11,
|
||||
"why": "the day before DST ends",
|
||||
"rise": "07:09",
|
||||
"transit": "12:58",
|
||||
"set": "18:47"
|
||||
},
|
||||
{
|
||||
"city": "Sydney",
|
||||
"lat": -33.8688,
|
||||
"lon": 151.2093,
|
||||
"timeZone": "Australia/Sydney",
|
||||
"day": "2026-04-05",
|
||||
"utcOffset": 10,
|
||||
"why": "DST ends",
|
||||
"rise": "06:10",
|
||||
"transit": "11:58",
|
||||
"set": "17:45"
|
||||
},
|
||||
{
|
||||
"city": "Sydney",
|
||||
"lat": -33.8688,
|
||||
"lon": 151.2093,
|
||||
"timeZone": "Australia/Sydney",
|
||||
"day": "2026-06-21",
|
||||
"utcOffset": 10,
|
||||
"why": "midwinter",
|
||||
"rise": "07:00",
|
||||
"transit": "11:57",
|
||||
"set": "16:54"
|
||||
},
|
||||
{
|
||||
"city": "Sydney",
|
||||
"lat": -33.8688,
|
||||
"lon": 151.2093,
|
||||
"timeZone": "Australia/Sydney",
|
||||
"day": "2026-10-03",
|
||||
"utcOffset": 10,
|
||||
"why": "the day before DST starts",
|
||||
"rise": "05:30",
|
||||
"transit": "11:44",
|
||||
"set": "17:59"
|
||||
},
|
||||
{
|
||||
"city": "Sydney",
|
||||
"lat": -33.8688,
|
||||
"lon": 151.2093,
|
||||
"timeZone": "Australia/Sydney",
|
||||
"day": "2026-10-04",
|
||||
"utcOffset": 11,
|
||||
"why": "DST starts",
|
||||
"rise": "06:29",
|
||||
"transit": "12:44",
|
||||
"set": "19:00"
|
||||
},
|
||||
{
|
||||
"city": "Sydney",
|
||||
"lat": -33.8688,
|
||||
"lon": 151.2093,
|
||||
"timeZone": "Australia/Sydney",
|
||||
"day": "2026-12-21",
|
||||
"utcOffset": 11,
|
||||
"why": "midsummer",
|
||||
"rise": "05:41",
|
||||
"transit": "12:53",
|
||||
"set": "20:05"
|
||||
},
|
||||
{
|
||||
"city": "Anchorage",
|
||||
"lat": 61.2181,
|
||||
"lon": -149.9003,
|
||||
"timeZone": "America/Anchorage",
|
||||
"day": "2026-03-07",
|
||||
"utcOffset": -9,
|
||||
"why": "the day before DST starts",
|
||||
"rise": "07:41",
|
||||
"transit": "13:10",
|
||||
"set": "18:41"
|
||||
},
|
||||
{
|
||||
"city": "Anchorage",
|
||||
"lat": 61.2181,
|
||||
"lon": -149.9003,
|
||||
"timeZone": "America/Anchorage",
|
||||
"day": "2026-03-08",
|
||||
"utcOffset": -8,
|
||||
"why": "DST starts",
|
||||
"rise": "08:38",
|
||||
"transit": "14:10",
|
||||
"set": "19:44"
|
||||
},
|
||||
{
|
||||
"city": "Anchorage",
|
||||
"lat": 61.2181,
|
||||
"lon": -149.9003,
|
||||
"timeZone": "America/Anchorage",
|
||||
"day": "2026-06-21",
|
||||
"utcOffset": -8,
|
||||
"why": "midsummer",
|
||||
"rise": "04:20",
|
||||
"transit": "14:02",
|
||||
"set": "23:43"
|
||||
},
|
||||
{
|
||||
"city": "Anchorage",
|
||||
"lat": 61.2181,
|
||||
"lon": -149.9003,
|
||||
"timeZone": "America/Anchorage",
|
||||
"day": "2026-10-31",
|
||||
"utcOffset": -8,
|
||||
"why": "the day before DST ends",
|
||||
"rise": "09:26",
|
||||
"transit": "13:43",
|
||||
"set": "18:00"
|
||||
},
|
||||
{
|
||||
"city": "Anchorage",
|
||||
"lat": 61.2181,
|
||||
"lon": -149.9003,
|
||||
"timeZone": "America/Anchorage",
|
||||
"day": "2026-11-01",
|
||||
"utcOffset": -9,
|
||||
"why": "DST ends",
|
||||
"rise": "08:28",
|
||||
"transit": "12:43",
|
||||
"set": "16:57"
|
||||
},
|
||||
{
|
||||
"city": "Anchorage",
|
||||
"lat": 61.2181,
|
||||
"lon": -149.9003,
|
||||
"timeZone": "America/Anchorage",
|
||||
"day": "2026-12-21",
|
||||
"utcOffset": -9,
|
||||
"why": "midwinter",
|
||||
"rise": "10:14",
|
||||
"transit": "12:58",
|
||||
"set": "15:41"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
import fc from 'fast-check';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { invitation, sunDay, type Place, type SunDay } from '../src/sun/sun.js';
|
||||
import { localDay } from '../src/time/localDay.js';
|
||||
|
||||
/** Recorded by scripts/fetch-sun-golden.ts from the U.S. Naval Observatory. */
|
||||
interface Row {
|
||||
readonly city: string;
|
||||
readonly lat: number;
|
||||
readonly lon: number;
|
||||
readonly timeZone: string;
|
||||
readonly day: string;
|
||||
readonly utcOffset: number;
|
||||
readonly why: string;
|
||||
readonly rise: string | null;
|
||||
readonly transit: string | null;
|
||||
readonly set: string | null;
|
||||
}
|
||||
const golden = JSON.parse(readFileSync(new URL('./fixtures/sun-usno.json', import.meta.url), 'utf8')) as { rows: Row[] };
|
||||
|
||||
/** The almanac rounds to the minute, and NOAA's method is good to about a minute below 72°. */
|
||||
const TOLERANCE_MINUTES = 2;
|
||||
const MINUTE = 60_000;
|
||||
const HOUR = 60 * MINUTE;
|
||||
|
||||
const clocks = new Map<string, Intl.DateTimeFormat>();
|
||||
/** Minutes after midnight on the local clock of `timeZone`: what a person there reads. */
|
||||
function clock(epochMs: number, timeZone: string): number {
|
||||
let f = clocks.get(timeZone);
|
||||
if (!f) {
|
||||
f = new Intl.DateTimeFormat('en-GB', { timeZone, hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h23' });
|
||||
clocks.set(timeZone, f);
|
||||
}
|
||||
const p = Object.fromEntries(f.formatToParts(epochMs).map((x) => [x.type, x.value]));
|
||||
return Number(p.hour) * 60 + Number(p.minute) + Number(p.second) / 60;
|
||||
}
|
||||
const minutes = (hhmm: string): number => Number(hhmm.slice(0, 2)) * 60 + Number(hhmm.slice(3));
|
||||
/** The shortest way round the clock face, so 23:59 and 00:01 are 2 minutes apart. */
|
||||
const apart = (a: number, b: number): number => Math.min(Math.abs(a - b), 1440 - Math.abs(a - b));
|
||||
|
||||
function offsetHours(epochMs: number, timeZone: string): number {
|
||||
const name = new Intl.DateTimeFormat('en-US', { timeZone, timeZoneName: 'longOffset' }).formatToParts(epochMs).find((p) => p.type === 'timeZoneName')?.value ?? '';
|
||||
const m = /GMT([+-])(\d\d):(\d\d)/.exec(name);
|
||||
return m ? (m[1] === '-' ? -1 : 1) * (Number(m[2]) + Number(m[3]) / 60) : 0;
|
||||
}
|
||||
|
||||
const placeOf = (r: Row): Place => ({ lat: r.lat, lon: r.lon, timeZone: r.timeZone });
|
||||
const UTC = (lat: number, lon: number): Place => ({ lat, lon, timeZone: 'UTC' });
|
||||
/**
|
||||
* A place whose clock follows its longitude, as real zones roughly do. Etc/GMT
|
||||
* signs are inverted: Etc/GMT-5 is UTC+5.
|
||||
*/
|
||||
const zoned = (lat: number, lon: number): Place => {
|
||||
const offset = Math.round(lon / 15);
|
||||
return { lat, lon, timeZone: offset === 0 ? 'Etc/GMT' : `Etc/GMT${offset > 0 ? '-' : '+'}${Math.abs(offset)}` };
|
||||
};
|
||||
|
||||
describe('sunDay — golden, against the U.S. Naval Observatory tables', () => {
|
||||
it('the fixture covers six cities, both hemispheres, the equator, the Arctic and every DST change it names', () => {
|
||||
expect(new Set(golden.rows.map((r) => r.city))).toEqual(new Set(['Prague', 'Reykjavík', 'Tromsø', 'Quito', 'Sydney', 'Anchorage']));
|
||||
expect(golden.rows.filter((r) => /DST (starts|ends)/.test(r.why) && !r.why.startsWith('the day before'))).toHaveLength(8);
|
||||
});
|
||||
|
||||
const sunny = golden.rows.filter((r) => r.rise !== null && r.set !== null);
|
||||
it.each(sunny.map((r) => [r.city, r.day, r.why, r] as const))('%s %s (%s): rise, noon and set within 2 min, on the local clock', (_c, _d, _w, r) => {
|
||||
const s = sunDay(r.day, placeOf(r));
|
||||
if (s.kind !== 'sun-sets') throw new Error(`expected a sunset, got ${s.kind}`);
|
||||
// The table and the zone database agree about the clock that day.
|
||||
expect(offsetHours(s.solarNoon, r.timeZone)).toBe(r.utcOffset);
|
||||
expect(apart(clock(s.sunrise, r.timeZone), minutes(r.rise ?? ''))).toBeLessThanOrEqual(TOLERANCE_MINUTES);
|
||||
expect(apart(clock(s.solarNoon, r.timeZone), minutes(r.transit ?? ''))).toBeLessThanOrEqual(TOLERANCE_MINUTES);
|
||||
expect(apart(clock(s.sunset, r.timeZone), minutes(r.set ?? ''))).toBeLessThanOrEqual(TOLERANCE_MINUTES);
|
||||
expect(localDay(s.solarNoon, r.timeZone)).toBe(r.day);
|
||||
});
|
||||
|
||||
it('Reykjavík at midsummer: tonight\'s sunset falls after midnight, so it is on the next local day (D2)', () => {
|
||||
const r = golden.rows.find((x) => x.city === 'Reykjavík' && x.day === '2026-06-21');
|
||||
const s = sunDay('2026-06-21', placeOf(r!));
|
||||
if (s.kind !== 'sun-sets') throw new Error(s.kind);
|
||||
// The table lists 00:04 on the 21st: that is the evening of the 20th. Ours is the evening of the 21st.
|
||||
expect(localDay(s.sunset, 'Atlantic/Reykjavik')).toBe('2026-06-22');
|
||||
expect(s.sunset - s.solarNoon).toBeGreaterThan(10 * HOUR);
|
||||
});
|
||||
|
||||
it('Tromsø: polar day on 21 June, polar night on 21 December, as the table says', () => {
|
||||
const tromso = golden.rows.filter((r) => r.city === 'Tromsø');
|
||||
const june = tromso.find((r) => r.day === '2026-06-21')!;
|
||||
const december = tromso.find((r) => r.day === '2026-12-21')!;
|
||||
expect([june.rise, june.set, december.rise, december.set]).toEqual([null, null, null, null]);
|
||||
|
||||
const summer = sunDay(june.day, placeOf(june));
|
||||
expect(summer.kind).toBe('polar-day');
|
||||
expect(apart(clock(summer.solarNoon, june.timeZone), minutes(june.transit ?? ''))).toBeLessThanOrEqual(TOLERANCE_MINUTES);
|
||||
expect(sunDay(december.day, placeOf(december)).kind).toBe('polar-night');
|
||||
});
|
||||
});
|
||||
|
||||
describe('sunDay — the clock changes, the sun does not', () => {
|
||||
it('Prague, 29 March: the sunset on the clock jumps an hour, the instant moves about a day', () => {
|
||||
const prague: Place = { lat: 50.0755, lon: 14.4378, timeZone: 'Europe/Prague' };
|
||||
const before = sunDay('2026-03-28', prague);
|
||||
const after = sunDay('2026-03-29', prague);
|
||||
if (before.kind !== 'sun-sets' || after.kind !== 'sun-sets') throw new Error('expected sunsets');
|
||||
const moved = after.sunset - before.sunset;
|
||||
expect(Math.abs(moved - 24 * HOUR)).toBeLessThan(3 * MINUTE); // the sun: a minute or two
|
||||
const onTheClock = clock(after.sunset, prague.timeZone) - clock(before.sunset, prague.timeZone);
|
||||
expect(onTheClock).toBeGreaterThan(58);
|
||||
expect(onTheClock).toBeLessThan(63); // the clock: an hour
|
||||
});
|
||||
|
||||
it('Sydney, 5 April: the clocks go back, and the sunset on the clock comes an hour earlier', () => {
|
||||
const sydney: Place = { lat: -33.8688, lon: 151.2093, timeZone: 'Australia/Sydney' };
|
||||
const before = sunDay('2026-04-04', sydney);
|
||||
const after = sunDay('2026-04-05', sydney);
|
||||
if (before.kind !== 'sun-sets' || after.kind !== 'sun-sets') throw new Error('expected sunsets');
|
||||
const onTheClock = clock(after.sunset, sydney.timeZone) - clock(before.sunset, sydney.timeZone);
|
||||
expect(onTheClock).toBeLessThan(-58);
|
||||
expect(onTheClock).toBeGreaterThan(-63);
|
||||
});
|
||||
});
|
||||
|
||||
describe('sunDay — properties', () => {
|
||||
const days2026 = fc.integer({ min: 0, max: 364 }).map((n) => localDay(Date.UTC(2026, 0, 1) + n * 24 * HOUR, 'UTC'));
|
||||
const midLatitudes = fc.double({ min: -60, max: 60, noNaN: true });
|
||||
const longitudes = fc.double({ min: -180, max: 180, noNaN: true });
|
||||
|
||||
it('within ±60°, at any longitude with its own clock: sunrise before noon before sunset, noon midway, noon on the asked day', () => {
|
||||
fc.assert(fc.property(midLatitudes, longitudes, days2026, (lat, lon, day) => {
|
||||
const place = zoned(lat, lon);
|
||||
const s = sunDay(day, place);
|
||||
if (s.kind !== 'sun-sets') return false;
|
||||
const morning = s.solarNoon - s.sunrise;
|
||||
const afternoon = s.sunset - s.solarNoon;
|
||||
return s.sunrise < s.solarNoon && s.solarNoon < s.sunset
|
||||
&& Math.abs(morning - afternoon) < 2 * MINUTE
|
||||
&& s.sunset - s.sunrise < 24 * HOUR
|
||||
&& localDay(s.solarNoon, place.timeZone) === day;
|
||||
}), { numRuns: 500 });
|
||||
});
|
||||
|
||||
it('within ±60°, sunsets on consecutive days are never more than 5 minutes apart on the sun\'s own clock', () => {
|
||||
fc.assert(fc.property(midLatitudes, longitudes, fc.integer({ min: 0, max: 363 }), (lat, lon, n) => {
|
||||
const day = (k: number): string => localDay(Date.UTC(2026, 0, 1) + k * 24 * HOUR, 'UTC');
|
||||
const a = sunDay(day(n), zoned(lat, lon));
|
||||
const b = sunDay(day(n + 1), zoned(lat, lon));
|
||||
if (a.kind !== 'sun-sets' || b.kind !== 'sun-sets') return false;
|
||||
return Math.abs(b.sunset - a.sunset - 24 * HOUR) < 5 * MINUTE;
|
||||
}), { numRuns: 300 });
|
||||
});
|
||||
|
||||
it('the invitation is always a defined instant near the asked day, for every latitude', () => {
|
||||
fc.assert(fc.property(fc.double({ min: -90, max: 90, noNaN: true }), longitudes, days2026, (lat, lon, day) => {
|
||||
const s = sunDay(day, UTC(lat, lon));
|
||||
const at = invitation(s);
|
||||
return Number.isFinite(at) && at >= s.solarNoon - 12 * HOUR && at <= s.solarNoon + 24 * HOUR;
|
||||
}), { numRuns: 500 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('sunDay — the far north and south (D4)', () => {
|
||||
it.each([
|
||||
[80, '2026-06-21', 'polar-day'], [80, '2026-12-21', 'polar-night'],
|
||||
[-80, '2026-06-21', 'polar-night'], [-80, '2026-12-21', 'polar-day'],
|
||||
[90, '2026-06-21', 'polar-day'], [-90, '2026-06-21', 'polar-night']
|
||||
] as const)('latitude %s on %s is %s', (lat, day, kind) => {
|
||||
expect(sunDay(day, UTC(lat, 0)).kind).toBe(kind);
|
||||
});
|
||||
|
||||
it('polar day invites at the lowest light, about twelve hours after noon; polar night at noon, when the twilight is brightest', () => {
|
||||
const summer = sunDay('2026-06-21', UTC(80, 15));
|
||||
if (summer.kind !== 'polar-day') throw new Error(summer.kind);
|
||||
expect(invitation(summer)).toBe(summer.lowestLight);
|
||||
expect(Math.abs(summer.lowestLight - summer.solarNoon - 12 * HOUR)).toBeLessThan(MINUTE);
|
||||
const winter = sunDay('2026-12-21', UTC(80, 15));
|
||||
expect(invitation(winter)).toBe(winter.solarNoon);
|
||||
});
|
||||
|
||||
it('where the sun sets, the invitation is the sunset', () => {
|
||||
const s: SunDay = sunDay('2026-06-21', { lat: 50.0755, lon: 14.4378, timeZone: 'Europe/Prague' });
|
||||
if (s.kind !== 'sun-sets') throw new Error(s.kind);
|
||||
expect(invitation(s)).toBe(s.sunset);
|
||||
});
|
||||
});
|
||||
|
||||
describe('sunDay — the edges of the clock face', () => {
|
||||
it('Kiritimati, UTC+14 at 157° W: noon falls on the next UTC date, and is still on the asked local day', () => {
|
||||
const kiritimati: Place = { lat: 1.87, lon: -157.4, timeZone: 'Pacific/Kiritimati' };
|
||||
for (const day of ['2026-01-01', '2026-06-21', '2026-12-31']) {
|
||||
const s = sunDay(day, kiritimati);
|
||||
expect(localDay(s.solarNoon, kiritimati.timeZone)).toBe(day);
|
||||
expect(localDay(s.solarNoon, 'UTC') < day).toBe(true); // UTC is still on the day before
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('sunDay — a clock twelve hours off the sun (D8)', () => {
|
||||
it('at 179.9° W on UTC, 26 December has no solar noon of its own; the engine gives the nearest one, never throws', () => {
|
||||
// Found by fast-check. Solar noon sits at midnight there and crosses it in late
|
||||
// December, so one calendar day holds none. No real zone is this far off the sun.
|
||||
const place = UTC(0, -179.92);
|
||||
const noons = ['2026-12-25', '2026-12-26', '2026-12-27'].map((d) => sunDay(d, place).solarNoon);
|
||||
expect(noons.map((n) => localDay(n, 'UTC'))).toEqual(['2026-12-25', '2026-12-27', '2026-12-27']);
|
||||
for (const n of noons) expect(Math.abs(n - Date.UTC(2026, 11, 26, 24))).toBeLessThan(25 * HOUR);
|
||||
});
|
||||
});
|
||||
|
||||
describe('sunDay — refusals', () => {
|
||||
it.each([
|
||||
['2026-02-30', UTC(50, 14), /does not exist/],
|
||||
['2026-6-1', UTC(50, 14), /not a LocalDay/],
|
||||
['2026-06-21', UTC(91, 14), /latitude/],
|
||||
['2026-06-21', UTC(50, 181), /longitude/],
|
||||
['2026-06-21', UTC(Number.NaN, 14), /latitude/],
|
||||
['2026-06-21', { lat: 50, lon: 14, timeZone: 'Europe/Pargue' }, /time zone/i]
|
||||
] as const)('%s at %o', (day, place, message) => {
|
||||
expect(() => sunDay(day, place)).toThrow(message);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Records the sun's published times for the golden tests (CLAUDE.md §5.5) into
|
||||
* packages/engine/test/fixtures/sun-usno.json. Run by hand, never by a test: the
|
||||
* tests read the recorded file and make no network call.
|
||||
*
|
||||
* tsx scripts/fetch-sun-golden.ts
|
||||
*
|
||||
* Source: the U.S. Naval Observatory's Astronomical Applications API (one day of
|
||||
* rise, upper transit and set for a point). Each row asks for the clock offset the
|
||||
* place keeps on that date after any DST change, so the table is the local clock a
|
||||
* person there reads. The cities and coordinates are public places, never a player.
|
||||
*/
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
interface City {
|
||||
readonly name: string;
|
||||
readonly lat: number;
|
||||
readonly lon: number;
|
||||
readonly timeZone: string;
|
||||
/** [local day, the UTC offset in hours the clocks show that day after any change, why this day]. */
|
||||
readonly days: readonly (readonly [string, number, string])[];
|
||||
}
|
||||
|
||||
const CITIES: readonly City[] = [
|
||||
{ name: 'Prague', lat: 50.0755, lon: 14.4378, timeZone: 'Europe/Prague', days: [
|
||||
['2026-03-28', 1, 'the day before DST starts'], ['2026-03-29', 2, 'DST starts'],
|
||||
['2026-06-21', 2, 'midsummer'], ['2026-10-24', 2, 'the day before DST ends'],
|
||||
['2026-10-25', 1, 'DST ends'], ['2026-12-21', 1, 'midwinter']] },
|
||||
{ name: 'Reykjavík', lat: 64.1466, lon: -21.9426, timeZone: 'Atlantic/Reykjavik', days: [
|
||||
['2026-03-20', 0, 'equinox'], ['2026-06-21', 0, 'midsummer: a sunset near midnight'], ['2026-12-21', 0, 'midwinter: four hours of day']] },
|
||||
{ name: 'Tromsø', lat: 69.6492, lon: 18.9553, timeZone: 'Europe/Oslo', days: [
|
||||
['2026-03-29', 2, 'DST starts'], ['2026-06-21', 2, 'polar day'],
|
||||
['2026-10-25', 1, 'DST ends'], ['2026-12-21', 1, 'polar night']] },
|
||||
{ name: 'Quito', lat: -0.1807, lon: -78.4678, timeZone: 'America/Guayaquil', days: [
|
||||
['2026-03-20', -5, 'equinox on the equator'], ['2026-06-21', -5, 'June solstice'], ['2026-12-21', -5, 'December solstice']] },
|
||||
{ name: 'Sydney', lat: -33.8688, lon: 151.2093, timeZone: 'Australia/Sydney', days: [
|
||||
['2026-04-04', 11, 'the day before DST ends'], ['2026-04-05', 10, 'DST ends'],
|
||||
['2026-06-21', 10, 'midwinter'], ['2026-10-03', 10, 'the day before DST starts'],
|
||||
['2026-10-04', 11, 'DST starts'], ['2026-12-21', 11, 'midsummer']] },
|
||||
{ name: 'Anchorage', lat: 61.2181, lon: -149.9003, timeZone: 'America/Anchorage', days: [
|
||||
['2026-03-07', -9, 'the day before DST starts'], ['2026-03-08', -8, 'DST starts'],
|
||||
['2026-06-21', -8, 'midsummer'], ['2026-10-31', -8, 'the day before DST ends'],
|
||||
['2026-11-01', -9, 'DST ends'], ['2026-12-21', -9, 'midwinter']] }
|
||||
];
|
||||
|
||||
const API = 'https://aa.usno.navy.mil/api/rstt/oneday';
|
||||
|
||||
interface Phenomenon { readonly phen: string; readonly time: string }
|
||||
|
||||
async function oneDay(c: City, day: string, tz: number): Promise<Record<string, string | null>> {
|
||||
const url = `${API}?date=${day}&coords=${c.lat},${c.lon}&tz=${tz}&dst=false`;
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) throw new Error(`${url}: HTTP ${res.status}`);
|
||||
const body = (await res.json()) as { properties: { data: { sundata: Phenomenon[] } } };
|
||||
const at = (phen: string): string | null => body.properties.data.sundata.find((p) => p.phen === phen)?.time ?? null;
|
||||
return { rise: at('Rise'), transit: at('Upper Transit'), set: at('Set') };
|
||||
}
|
||||
|
||||
const rows = [];
|
||||
for (const c of CITIES) {
|
||||
for (const [day, tz, why] of c.days) {
|
||||
rows.push({ city: c.name, lat: c.lat, lon: c.lon, timeZone: c.timeZone, day, utcOffset: tz, why, ...(await oneDay(c, day, tz)) });
|
||||
}
|
||||
}
|
||||
|
||||
const out = fileURLToPath(new URL('../packages/engine/test/fixtures/sun-usno.json', import.meta.url));
|
||||
writeFileSync(out, JSON.stringify({
|
||||
source: `${API} (U.S. Naval Observatory, Astronomical Applications). Times are HH:MM on the local clock at utcOffset; null means the event does not happen that day.`,
|
||||
recorded: new Date().toISOString().slice(0, 10),
|
||||
rows
|
||||
}, null, 2) + '\n');
|
||||
console.log(`fetch-sun-golden: ${rows.length} days -> ${out}`);
|
||||
@@ -21,7 +21,7 @@ const C = {
|
||||
coral: '#e9846a',
|
||||
night: '#2e3561',
|
||||
lamp: '#f4d58d',
|
||||
fox: '#b65a35',
|
||||
fox: '#bc4a22',
|
||||
cream: '#f3e3c8',
|
||||
foxLeg: '#5a3a33',
|
||||
strawberry: '#d2554e',
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('STYLE.md', () => {
|
||||
it('§7 has the ten review points, a point split over two lines read as one', () => {
|
||||
const points = reviewPoints(readStyle());
|
||||
expect(points).toHaveLength(10);
|
||||
expect(points[8]).toBe("It reads as one young russet fox with a cream mask and a ringed tail, shy and gentle, and nothing like the book's sandy, long-eared fox.");
|
||||
expect(points[8]).toBe("It reads as one young red-orange fox with a cream mask and a ringed tail, shy and gentle, and nothing like the book's sandy, long-eared fox.");
|
||||
expect(points[3]).toBe('Nothing from the book: no glass dome, screen, tiny planet, desert, child or scarf, and no look of its drawings.');
|
||||
});
|
||||
|
||||
|
||||