# Bot King's Coding Forge — vendored Blockly Games (licence + provenance)

## Source
- Upstream: **Blockly Games** by Google — `https://github.com/blockly-games/blockly-games`
  (formerly `google/blockly-games`; the project transferred orgs but the code is
  the same Google-authored project referenced in the Chairman's decision doc).
- Artifact used: the maintained **`offline` branch** pre-compiled release bundle
  `generated/blockly-games-en.zip` (English-only single-language build, produced
  by the project's own `build.py` for offline/self-hosted use — this is the
  intended "deployable static build" path called out in the brief, since
  building from source requires the full Closure/Python toolchain).
- Fetched: 2026-07-16, from `raw.githubusercontent.com/blockly-games/blockly-games/offline/...`.
- Games shipped: Puzzle, Maze, Bird, Turtle, Movie, Music, Pond (full English
  bundle — locale-stripped per the Chairman's brief; the wing surfaces
  Maze -> Turtle -> Bird as the primary GST progression, the other titles
  remain reachable through Blockly's own in-game "more games" links for later).

## Licence
**Apache License 2.0.** Full text retained at `games/coding-forge/LICENSE`
(fetched from the upstream `master` branch `LICENSE` file, identical licence
governs the `offline` branch build). No NOTICE file ships upstream beyond the
LICENSE text itself. Apache-2.0 permits self-hosted redistribution, including
after modification, provided the licence is retained and changes are noted —
both are done here.

## Modifications made to the vendored bundle (documented per Apache-2.0 §4)
1. **Removed `<script src="/common/storage.js"></script>`** from
   `maze.html`, `turtle.html`, `bird.html`, `music.html`, `movie.html`,
   `pond-tutor.html`. This tag is a leftover reference to Blockly Games'
   optional server-side "save/share my program" backend (App Engine XML
   storage), which is intentionally **not included** in the `offline` branch
   build (there is no `storage.js` file anywhere in the offline bundle). Left
   in place it 404s on every page load. The game code already checks
   `"BlocklyStorage" in window` before using it and hides the affected
   "link to my program" button when absent — removing the dead tag is a
   no-op for gameplay and clears the console-error requirement. No game
   logic, puzzle levels, or Blockly block definitions were touched.
2. **`about.html`**: changed `href="/"` to `href="index.html"` (relative) so
   the About page's title link resolves correctly when hosted under a
   subpath (`games/coding-forge/en/`) instead of a domain root.
3. **GAP 5 (2026-07-17) — added `en/estate-theme.css` (new file, not part of
   the vendored release) and one `<link rel="stylesheet" href="estate-theme.css">`
   line to `maze.html`, `turtle.html`, `bird.html`** (the three halls the GST
   shell actually frames). This re-skins the surrounding chrome — page
   background, the toolbox/flyout panel, scrollbars, stock Google buttons,
   the level-complete dialog, the code-preview panel — from Blockly Games'
   default white/grey/red/blue to the estate's navy/gold palette, targeting
   only Blockly's standard, stable CSS class names (`.blocklyMainBackground`,
   `.blocklyToolboxDiv`, `.blocklyFlyoutBackground`, `.blocklyScrollbarBg`,
   `.blocklyScrollbarHandle`, etc.) that Blockly's own runtime `Blockly.Css.inject()`
   attaches. A proper `Blockly.Theme` object (the "correct" Blockly theming
   API) was considered first but isn't reachable from outside the compiled
   `generated/en/compressed.js` bundle without editing that upstream
   Closure-compiled logic, which is exactly what this project does not do —
   CSS override is the documented, non-invasive fallback. **Block colours
   and shapes inside the workspace are untouched** — that colour-coding is
   Blockly's own pedagogical language (move/logic/loop categories etc.),
   not decoration, and re-theming it would work against the puzzle rather
   than the chrome around it. No `.js` file, block definition, level, or
   puzzle rule was touched by this change.
4. No other files were altered. Puzzle/maze/level logic, block sets, and all
   game code are byte-identical to the upstream offline release.

## Framing / iframe compatibility
Verified: the offline bundle ships with no `X-Frame-Options` or CSP headers
of its own (it is static files with no server logic), and since it is
self-hosted same-origin under `gabe-gameworks/site/games/coding-forge/en/`,
there is no cross-origin frame restriction. `games/forge-coding.html` frames
`en/maze.html`, `en/turtle.html`, `en/bird.html` directly.

## What GST added on top (not part of the vendored bundle)
The GST shell (`games/forge-coding.html`) is original Bot King narrative
wrapper + chrome built for this site; it does not modify the framed Blockly
Games pages, it only frames them and tracks local per-hall progress
(`gw_forge_progress` in `localStorage`) for the Academy hub's stat tiles.
