Skip to content

viewer: cover solar rotation exports and mounted site reactivity - #43

Draft
kvnloo wants to merge 4 commits into
mainfrom
nc/pe26-solar-exported-regression
Draft

kvnloo wants to merge 4 commits into
mainfrom
nc/pe26-solar-exported-regression

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Problem

Draft #43 already adds exported solar-direction coverage and mounted site reactivity. PE32 found host-local calendar getters; PE33 removed that drift. PE35's exact-head review found the remaining contract ambiguity: callers may mistake an ISO date-only value for a selected site day, although a Date always carries an instant. Mean-solar day west of Greenwich can differ from UTC date, and legal UTC+14 civil dates can differ even more near the date line. The subprocess regression also compared outputs without proving the children observed distinct host time zones.

Design

  • E-001: Pure daylight math remains viewer-owned, with no editor dependency or new core runtime Three.js.
  • E-002/E-003/E-010: Preserve existing solar and viewer exports, site schema, registry and agent/host mechanisms; no migration or solver change.
  • T-001: Exercise observable results through published @pascal-app/viewer exports in the existing colocated Bun test; no source-grep, cross-package source imports, mocks or sleeps in the new cases.
  • Calendar contract: day: Date is an instant that selects the mean-solar calendar day at the supplied longitude. It is not a date-only/civil-day argument. Longitude gives mean-solar time (4 minutes per degree), not the legally observed time zone or an IANA civil calendar. new Date('2026-06-21') parses as UTC midnight, not an instruction to select June 21 at a western site. A civil-date scheduling API would need a separately chosen legal time zone and an explicit product requirement; this patch does not invent that conversion.

Change (file:line at exact head c59dc97765f43123c7175137dce483855df7f5ff)

PE36 — one commit on existing fork-only Draft branch, parent 334cb37, new head c59dc97:

Retained earlier commits: PE26 exported solarLight/persisted site north rotation; PE27 mounted root-site key/CPU-sky reactivity; PE33 mean-solar day-from-instant calculation and initial host-timezone subprocess regression. These are not new PE36 changes.

Tests

3 new Bun cases; 1 earlier subprocess case strengthened. ALL UNRUN. No executed Bun, Biome, types, build, Chromium/GPU, or PMREM evidence is claimed. No Actions run was returned for this exact head when inspected.

Hand-derived expected values (not execution):

  • At −74°, mean clock is UTC−4h56. UTC midnight 2026-06-21 is mean June 20 19:04; noon on that selected day is 2026-06-20T16:56:00Z. An instant at June 21 12:00Z instead selects June 21 mean-solar noon 2026-06-21T16:56:00Z.
  • At ±180°, offsets ±12h select different mean-date labels for UTC midnight June 21, but both refer to one physical noon 2026-06-21T00:00:00Z.
  • At −157.5°, mean offset is UTC−10h30. Civil UTC+14 June 21 00:10 is UTC June 20 10:10, or mean June 19 23:40; selected noon is 2026-06-19T22:30:00Z. Civil June 21 12:00 is UTC June 20 22:00, mean June 20 11:30; selected noon is 2026-06-20T22:30:00Z.
  • The UTC child must observe getTimezoneOffset()===0, whereas Etc/GMT+5 must observe ===300 and the prior local calendar day. Both must return identical public solar outputs.

Exact verification commands — ALL UNRUN:

bun install --frozen-lockfile
bun run build
bun --cwd packages/viewer run test
TZ=UTC bun test packages/viewer/src/lib/daylight/daylight.test.ts
TZ=Etc/GMT+5 bun test packages/viewer/src/lib/daylight/daylight.test.ts
bun run check
bun run check-types
bun run ci

The two bare bun test commands are focused-file invocations only, not the documented package/full-suite script. bun run build must precede them because public viewer imports resolve to dist. The whole package test uses bun --cwd packages/viewer run test, and the full suite uses bun run ci.

Upstream readiness

HOLD — fork-only Draft; do not promote. The chosen contract matches the existing instant-based implementation but has no independent civil-date product requirement or timezone selection API. Earlier mounted private-import T-001 exposure is not resolved in PE36. The CPU-sky probe is not visible GPU sky/PMREM/shadow proof. Exact-head native checks and PE34 browser/GPU evidence remain prerequisites. No upstream write, new branch/PR, default-branch push, or merge.

Follow-ups

  1. PE34-PR43-SOLAR-BROWSER-RECEIPT: obtain exact-head green CI and real published-viewer GPU key/shadow/sky/PMREM evidence at a saved nonzero north rotation.
  2. PE37-PR43-SOLAR-CIVIL-REQUIREMENT: if civil-day scheduling is required, validate its intended date/zone contract before designing an explicit zone-aware API; do not infer legal time zones from longitude.
  3. PE37-PR43-SOLAR-PUBLIC-BOUNDARY: move existing mounted reactivity coverage to an observable public viewer boundary without claiming CPU-sky samples validate GPU output.

Implemented by ChatGPT (mobile app, GitHub connector) for Kevin's OSS factory.

@kvnloo
kvnloo force-pushed the nc/pe26-solar-exported-regression branch from 12d6020 to 31b4257 Compare November 6, 2026 19:54
@kvnloo
kvnloo force-pushed the nc/pe26-solar-exported-regression branch from 31b4257 to 1e4474b Compare November 6, 2026 19:56
@kvnloo kvnloo changed the title viewer: export solarLight and test persisted north rotation viewer: cover solar rotation exports and mounted site reactivity Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant