Skip to content

fix(worldview): exact BlueMap gzip routing and CSP-safe asset readiness - #610

Merged
athNdev merged 4 commits into
mainfrom
codex/bluemap-asset-csp
Nov 19, 2026
Merged

athNdev merged 4 commits into
mainfrom
codex/bluemap-asset-csp

Conversation

@athNdev

@athNdev athNdev commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

Fix the black-map false pass from preview 44530053075 on the backend product
path only
. No showcase, capture, scripts/review, showcase.yml or README
file was edited by this lane; the screenshot owner remains the sole showcase
editor. No publication/release.

Root causes addressed

  1. maps/world/textures.json returned 404 because the disposable stack used a
    plain static web root with no BlueMap compressed-resource routing.
  2. BlueMap's vue-i18n runtime template compile (new Function) was blocked by
    the unchanged panel CSP.

Changes

  • internal/worldview/proxy.go: forwards Accept-Encoding and relays
    Content-Encoding for every renderer (native BlueMap webserver unchanged).
    Only for the BlueMap adapter and only for map textures.json /
    PRBM/PNG tile payloads, a plain-path 404 retries exactly the +".gz"
    sibling, labelled with the uncompressed media type plus
    Content-Encoding: gzip. Literal .gz client-decompression paths get no
    Content-Encoding. Range never switches representation; other renderers,
    other paths and auth/session/scope/private-cache gates are unchanged.
  • internal/worldview/adapters.go: READY requires a bounded JSON textures
    document for every configured map (capped at 32 probes), via the plain
    encoded route or the exact .gz sibling. Missing/empty/SPA-fallback data
    reports ABSENT and no map session is issued.
  • CSP is byte-for-byte unchanged and pinned by a new test; no unsafe-eval,
    no per-route CSP and no screenshot-only bypass.
  • ADR 0047, docs/world-viewing.md and the governing knowledge concept updated
    in the same commits.

Pinned CSP-safe webapp build

Upstream BlueMap v5.29 source commit
a61e143fe1e069c536159e0bc79410d5b6da3885 rebuilt with
__INTLIFY_JIT_COMPILATION__: true in vite.config.js. Verified JIT bundle
index-BA9KJ4pi.js SHA-256
ba940f930de0642acfd2ca8b0eda6aa0914ce02fcf673cee18262b3dd5217da3 has 0
new Function / 0 compileToFunction; pristine v5.29 has 1 / 2. The built
artifact, manifest and exact fixture recipe are in the audit handoff folder
bluemap-asset-csp-handoff/ so the next preview can actually serve it.

Verification

  • GOTOOLCHAIN=go1.26.11 go test ./... -count=1: PASS.
  • GOTOOLCHAIN=go1.26.11 go vet ./...: PASS.
  • go run ./cmd/knowledge-lint -root . -fix then without -fix: 40/40 queries,
    85 concepts, indexes current.
  • New fail-closed fixtures: real gzip texture/tile bytes through the proxy,
    missing texture stays 404, literal .gz encoding rules, native encoding
    relay, BlueMap-only/path-only scoping, Range preservation, q=0 refusal,
    gzip-only readiness, non-textures body rejection, every-map probing.
  • Independent exact-head review at 5ad1f35e by a separate OpenCode agent on a
    free model: no blockers, recommendation to merge. First review found 5
    issues (including a HIGH: readiness lacked the .gz fallback); all were
    fixed and re-reviewed. Full verdict in the handoff folder.

Evidence limits

Backend tests are local httptest fixtures with real gzip bytes; no live
container, browser or WebGL render is claimed here. Two-host product
integration and the actual screenshot are separate and owned by the sole
screenshot owner: do not report the map capture as qualified until a new
capture with the pinned bundle and fail-closed assertions has been produced.

@athNdev athNdev closed this Nov 19, 2026
@athNdev athNdev reopened this Nov 19, 2026
@athNdev

athNdev commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Showcase capture owner is ready and blocked only on this fix. Once #610 is green/merged, please allow a short single main showcase run with worlds=true; parallel main merges previously broke provenance monotonicity. I will visually inspect the real rendered PNG before any README link.

Forward Accept-Encoding/Content-Encoding for all renderers; scope the .gz fallback to BlueMap textures/tile paths with Range and non-BlueMap behavior unchanged. Require real textures.json bytes before READY. Pin the unchanged CSP and add fail-closed regressions. ADR 0047 and knowledge updated.
Probe the exact .gz sibling in readiness so gzip-only roots can become READY; validate a JSON textures document for every configured map with a bounded probe count; make explicit gzip refusal override Accept-Encoding wildcard. Update ADR/docs/knowledge.
ST1023: omit redundant io.Reader type; QF1002: use a tagged switch on r.URL.Path.
@athNdev
athNdev force-pushed the codex/bluemap-asset-csp branch from bf4b664 to 6817d0f Compare November 19, 2026 14:52
@athNdev
athNdev merged commit 48fe7c7 into main Nov 19, 2026
29 of 30 checks passed
@athNdev
athNdev deleted the codex/bluemap-asset-csp branch November 19, 2026 15:18
@athNdev

athNdev commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Final evidence for exact head 6817d0f (rebased onto main 9e2f0e0; ADR renumbered 0047 -> 0048 because main claimed 0047): all 15 CI checks pass on run 44548520569. Backend Lint & Vet issues ST1023/QF1002 were fixed, not waived. The first Backend Test Suite failure was the unrelated playerskin wall-clock flake; rerun of that exact job on the unchanged head passed (job 135632680080). Go Race Detector first hit a 10-minute timeout in unrelated internal/rpc/services.TestLifecycleRPCPersistsPartialRecreationAfterCancellation (job package set excludes internal/worldview); rerun of that exact job on the unchanged head passed in 8m57s (job 135654533805). Independent exact-head review at this head: APPROVED, no blockers (proxy.go and proxy_asset_test.go byte-identical to the previously approved 5ad1f35). Pinned Go 1.26.11 test/vet, golangci-lint (0 issues) and knowledge-lint all green. Pinned JIT webapp artifact, manifest, fixture recipe, ADR 0048 and evidence limits are in the audit handoff folder. No showcase edits, no publication.

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