Skip to content

Sky Clock: load Chronicle's shared GPU painter before the sky - #303

Merged
keyxmakerx merged 2 commits into
mainfrom
claude/project-thread-1o66d0
Nov 13, 2026
Merged

keyxmakerx merged 2 commits into
mainfrom
claude/project-thread-1o66d0

Conversation

@keyxmakerx

Copy link
Copy Markdown
Owner

Requested by Key Maker · project thread

Fixes #300
Security implication: none. Client-side drawing code copied unchanged from Chronicle; no new requests, settings or saved data.
Consumer-verified: Chronicle loads gl_shared.js right before sky_gl.js (internal/templates/layouts/base.templ:318-319 on Chronicle main 00fe30a), and sky_gl.js:20 stops with a console line when window.SharedGL is missing. The Sky Clock now loads them in that same order.
Foundry compatibility: n/a for new Foundry APIs (no Foundry calls change). Not yet run in a live Foundry world; the live check is below and belongs with #210.
Mockup: n/a

What this changes

Chronicle's sky now paints through one shared graphics-card painter, gl_shared.js (SharedGL), which the painted crafting benches also use (keyxmakerx/Chronicle#2069, ADR-072 there). Without it, the newer sky_gl.js draws nothing on the graphics card and the Sky Clock falls back to the flat basic sky. This copies gl_shared.js and the current sky files into vendor/chronicle/, unchanged, and loads gl_shared.js just before sky_gl.js.

Why

#300, filed when the shared painter went into Chronicle. Copying the files byte-for-byte keeps the module's sky exactly Chronicle's, which the CHRONICLE_DIR sync test checks.

What the refreshed sky files bring along, besides the shared painter:

  • sky_world.js / sky_pane.js: daylight tinted by the calendar's kind of sun, and the pane's bodyAt / bodiesUp / overlay hooks used by Chronicle's hand controls. The Sky Clock doesn't pass the calendar's sun yet, so the tint and the coloured disc stay off in Foundry (filed as Sky Clock: show the calendar's kind of sun #302); the hooks are unused here.
  • sky_2d.js, sky_shaders.js: the sun's disc drawn in that colour, on the basic and the painted sky. With no sun passed it is the old disc.

Test plan

  • CHRONICLE_DIR=../Chronicle node --test tools/test-sky-clock.mjs: 18 of 18, including the byte-for-byte match of every vendored sky file against Chronicle main.
  • CHRONICLE_DIR=../Chronicle node --test tools/test-*.mjs: 1671 of 1673. The 2 failures are byte checks for files this PR doesn't touch and that drifted from earlier Chronicle merges: crafting_lib.js in test-craft-relay.mjs (Refresh the vendored crafting and sky copies from Chronicle main #299) and shop_room.js in test-shop-room.mjs (Copy Chronicle's shop room again: one comment has drifted #284). Both fail the same way on main (checked: 30 of 32 there, the same two).
  • tools/check-comment-clutter.sh: OK.
  • node tools/check-package-descriptor.mjs: descriptor unchanged, not needed.
  • Manual verification in Foundry (operator, Foundry v14 world, GM): Game Settings, Configure Settings, Chronicle Sync; turn on "Show Chronicle's calendar" and set "Calendar look" to Sky Clock. The glass globe appears in a corner. Working: the painted sky, with soft clouds, a glowing sun or moons and stars at night, same as Chronicle's calendar page. Broken: a flat banded sky with no glow, or a browser console line "[sky] gl_shared.js is not loaded before sky_gl.js".
  • CI passes.

Tenet self-check

  • T-B1 security: n/a (no auth, tokens or requests touched).
  • T-B2 plugin isolation: the files are Chronicle's, copied unchanged; nothing outside the Sky Clock's loader changes.
  • T-B3 production UI: no UI change; a missing painter degrades to the basic sky, never a blank clock.
  • T-B4 dual-audience docs: .ai.md's vendored sky row now names gl_shared.js and why it loads first.

Stop-and-flag

If during review you find a tenet violation the author missed, flag explicitly citing the tenet by number.


Generated by Claude Code

Chronicle's sky now paints through gl_shared.js (SharedGL), the page's
one WebGL2 context and slow-device verdict, which the painted crafting
benches share. Copy it into vendor/chronicle/ with the current sky files,
all unchanged, and load it right before sky_gl.js in the Sky Clock and
its test.

Fixes #300

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZefPi2DYXfRvFz1WymVFu
@keyxmakerx keyxmakerx self-assigned this Nov 3, 2026
@keyxmakerx
keyxmakerx merged commit 4bcd9dd into main Nov 13, 2026
4 checks passed
@keyxmakerx
keyxmakerx deleted the claude/project-thread-1o66d0 branch November 13, 2026 00:34
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.

Sky Clock: vendor Chronicle's gl_shared.js with the sky scripts

2 participants