Skip to content

console: vendor the TypeScript console from upstream's dist/ - #38

Merged
blakebauman merged 1 commit into
mainfrom
console-dist-rename
Aug 11, 2026
Merged

blakebauman merged 1 commit into
mainfrom
console-dist-rename

Conversation

@blakebauman

@blakebauman blakebauman commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

fold-run/fold-console is a built TypeScript SPA now — Preact, TanStack Router
and TanStack Query, compiled by Vite — where it was hand-written HTML/CSS/JS.
Its build output moved to dist/, so the path scripts/sync-console.sh reads
moves with it. That one-line change is the whole functional diff; the rest is
the re-vendored bundle and the pin.

Pinned at ea4c545, the current head of fold-console main
(fold-run/fold-console#1 and #2, both merged).

console-sync.yml is failing until this lands, because fold-console main
already carries the rename and this repo still looks for console/. That is
the designed failure mode — a pin from before the rename has no dist/, one
from after has no console/, and either mismatch fails loudly in the sync
rather than vendoring stale bytes — but it means the weekly job is red until
merge, not broken.

Reviewing this

gateway/console/app.js is minified bundle output. Reading this diff is not
a review
— read the upstream diff on src/. Upstream CI rebuilds and fails on
any drift between source and dist/, so the bytes here are entailed by it.
That note is now in the script itself, since it applies to every future bump.

What did not change, and so needs no edit:

  • The embedded file set. index.html, app.js, style.css and the four
    font subsets plus OFL.txt come out of the new build under exactly the names
    MANIFEST already lists — gateway/introspection_test.go is untouched.
  • The CSP, and every security property the page is held to. The token still
    lives in page memory only; upstream-controlled strings are still never markup
    (JSX escapes text children, and upstream CI rejects the escape hatches);
    fetches are still relative so a path-prefixed deployment works. Upstream now
    also fails its build on inline <script> and style attributes, which
    default-src 'self' was already dropping silently.
  • The font bytes. Unchanged, hence absent from the diff.

The MANIFEST comment is retargeted at what an allowlist protects against now:
not upstream's README and CI config, but a source map, a second chunk, or a
stats file that a build happened to emit. That is a weaker threat than a
hand-maintained tree posed, but a likelier one.

Verification

Run locally against this branch:

  • ./scripts/sync-console.sh — vendors 8 files, writes the pin
  • make console-check — gateway/console matches its pin
  • go build ./...
  • go test ./gateway — full package, ok in 8.8s

TestConsoleAssetsTargetCurrentAPI earned its keep

Worth recording, since this repo owns that test. Upstream's first cut composed
its fetch paths from a shared base constant. That minifies to
${e}/federation, so the literals this test greps for vanished from the bundle
— while the console kept working. The guard had silently stopped guarding,
which would have left genuine v1.9 skew to be discovered by an operator
watching a dashboard never load.

This suite caught it, on the vendored bundle, before any of it reached main
here. Upstream now spells the paths out, says in the source why they must not
be refactored back into a base, and mirrors the assertion in its own CI — so
the next occurrence fails in the PR that causes it rather than during a
supply-chain review here.

🤖 Generated with Claude Code

fold-run/fold-console is a built TypeScript SPA now — Preact, TanStack Router
and TanStack Query, compiled by Vite — where it was hand-written HTML/CSS/JS.
Its build output moved to dist/, so the path this script reads moves with it.

That is the whole functional change here; the rest of the diff is the
re-vendored bundle and the pin.

Two notes for whoever reviews the next bump, now recorded in the script:

  - gateway/console/app.js is minified bundle output. Reading this diff is not
    a review — read upstream's diff on src/. Upstream CI rebuilds and fails on
    any drift between source and dist/, so the bytes here are entailed by it.
  - The pin and the source path move together. A pin from before the rename has
    no dist/, one from after has no console/; either mismatch fails loudly here
    rather than vendoring stale bytes. The error names the case explicitly,
    because the generic message sends the reader upstream to look for a
    directory that is sitting right there under its old name.

The embedded file set is unchanged — index.html, app.js, style.css and the four
font subsets plus OFL.txt come out of the new build under exactly the names
MANIFEST already lists — so neither the manifest nor
gateway/introspection_test.go needs an edit, and the CSP the page runs under is
untouched.

The MANIFEST comment is retargeted at what an allowlist now protects against:
not upstream's README and CI config, but a source map, a second chunk, or a
stats file that a build happened to emit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman marked this pull request as ready for review August 11, 2026 15:13
@blakebauman
blakebauman merged commit 4efbc90 into main Aug 11, 2026
7 checks passed
@blakebauman

Copy link
Copy Markdown
Member Author

Retrospective verification record

This is not an independent review. It was written with Claude Code in the
same session that authored the change, and is filed because
.github/workflows/console-sync.yml calls for a human plus a security-auditor
pass on console bumps and neither is recorded on this PR. It records what was
mechanically verified, so a later reader can tell that apart from what was
actually reviewed by a person.

Verified

  • git apply --check and then git apply against a pristine main
    checkout: applies cleanly, and bash -n scripts/sync-console.sh passes on the
    result.
  • ./scripts/sync-console.sh at the pinned commit: vendors 8 files, writes
    gateway/console_source.go.
  • make console-check: gateway/console matches its pin.
  • go build ./... and go test ./gateway (full package) locally.
  • CI green on all seven jobs.
  • Embedded file set unchanged, so MANIFEST and
    gateway/introspection_test.go legitimately need no edit.

Reasoning worth recording

The script and the pin have to move together. A pre-rename pin has no dist/
and a post-rename one has no console/, so a split lands as a loud sync
failure rather than silently vendored stale bytes. That was the intended
failure mode and it held: console-sync failed to open its weekly PR during
the window, by design.

Not reviewed

The vendored gateway/console/app.js bytes were not read. They are minified
build output; the meaningful diff is upstream on src/, and the guarantee
relied on is that upstream CI rebuilds and fails on drift between source and
dist/. That guarantee is itself unaudited here.

@blakebauman
blakebauman deleted the console-dist-rename branch August 13, 2026 16:13
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